Skip to content

Commit

Permalink
ASoC: Fix check for symmetric rate enforcement
Browse files Browse the repository at this point in the history
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: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Sascha Hauer authored and Mark Brown committed Aug 17, 2011
1 parent 0cc62e9 commit 25b7679
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/soc/soc-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
codec_dai->active--;
codec->active--;

if (!cpu_dai->active && !codec_dai->active)
rtd->rate = 0;

/* Muting the DAC suppresses artifacts caused during digital
* shutdown, for example from stopping clocks.
*/
Expand Down

0 comments on commit 25b7679

Please sign in to comment.