Commit 25b76791 authored by Sascha Hauer's avatar Sascha Hauer Committed by Mark Brown

ASoC: Fix check for symmetric rate enforcement

The ASoC core tries to not enforce symmetric rates when
two streams open simultaneously. It does so by checking
rtd->rate being zero. This works exactly once after booting
because it is not set to zero again when the streams close.
Fix this by setting rtd->rate when no active stream is left.

[This leads to lots of warnings about not enforcing the symmetry in some
situations as there's a race in the userspace API where we know we've
got two applications but don't know what rates they want to set.
-- broonie ]
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 0cc62e92
...@@ -290,6 +290,9 @@ static int soc_pcm_close(struct snd_pcm_substream *substream) ...@@ -290,6 +290,9 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
codec_dai->active--; codec_dai->active--;
codec->active--; codec->active--;
if (!cpu_dai->active && !codec_dai->active)
rtd->rate = 0;
/* Muting the DAC suppresses artifacts caused during digital /* Muting the DAC suppresses artifacts caused during digital
* shutdown, for example from stopping clocks. * shutdown, for example from stopping clocks.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment