There is use case in Gstreamer ALSA sink, in case of changed caps Gsreatmer reconfigs and it calls snd_pcm_hw_free() before snd_pcm_prepre(). See gstreamer1.0-plugins-base/ gst-libs/gst/audio/gstaudiobasesink.c: gst_audio_base_sink_setcaps(): - gst_audio_ring_buffer_release() - gst_audio_sink_ring_buffer_release() - gst_alsasink_unprepare() - snd_pcm_hw_free() is called before - gst_audio_ring_buffer_acquire() - gst_audio_sink_ring_buffer_acquire() - gst_alsasink_prepare() - set_hwparams() - snd_pcm_hw_params() - snd_pcm_prepare()
But with current implementation after clock rate is started in .prepare reconfiguration of clock rate is not allowed, unless the stream is stopped.
This patch set by move stop of clock to .hw_free callback, to allow reconfiguration of clock rate.
Jiada Wang (1): ASoC: rsnd: call .hw_{params,free} in pair for same stream
Timo Wischer (2): ASoC: rsnd: Support hw_free() callback at DAI level ASoC: rsnd: Allow reconfiguration of clock rate
sound/soc/sh/rcar/core.c | 22 +++++++++++++-- sound/soc/sh/rcar/rsnd.h | 36 ++++++++++++++++++++---- sound/soc/sh/rcar/ssi.c | 61 +++++++++++++++++++++++++++++----------- sound/soc/sh/rcar/ssiu.c | 3 +- 4 files changed, 96 insertions(+), 26 deletions(-)