diff mbox

[1/3] ASoC: rsnd: tidyup src->convert_rate reset timing

Message ID 87vaqi3stx.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State Accepted
Commit fc99d23f6d3ec6b17772915114018444393e0ad1
Headers show

Commit Message

Kuninori Morimoto April 6, 2017, 7:24 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Current src->convert_rate will be set on .hw_param, and
be reset on .quit timing.
But, .hw_param will not be called again if user did Ctrl-Z + fg.
It should be reset on initial of .hw_param to keep its value.
Here, ctu.c already do this.
This patch solves this issue, other wise, MIXed sound will be
strange if user did like below.

	> aplay -D plughw:0,0 sound_44100.wav &
	> aplay -D plughw:0,1 sound_96000.wav
	> Ctrl-Z
	> fg # 96kHz will be played as 44.1kHz

Reported-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
---
 sound/soc/sh/rcar/src.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox

Patch

diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index 42db48d..20b5b2e 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -167,6 +167,7 @@  static int rsnd_src_hw_params(struct rsnd_mod *mod,
 	 *	dpcm_fe_dai_hw_params()
 	 *	dpcm_be_dai_hw_params()
 	 */
+	src->convert_rate = 0;
 	if (fe->dai_link->dynamic) {
 		int stream = substream->stream;
 		struct snd_soc_dpcm *dpcm;
@@ -414,8 +415,6 @@  static int rsnd_src_quit(struct rsnd_mod *mod,
 
 	rsnd_mod_power_off(mod);
 
-	src->convert_rate = 0;
-
 	/* reset sync convert_rate */
 	src->sync.val = 0;