提交 c4ef8786 编写于 作者: M Mark Brown

ASoC: Warn rather than set a silly constraint when we can't do symmetry

Symmetric rate configuration can fail if the second stream starting tries
to apply the symmetric constraint before the first stream has got far
enough to pick a rate. Rather than try to enforce a nonsensical rate of
0Hz log a warning and allow the application to carry on. Things might go
wrong later on but the user will know about it and there's unlikely to be
lasting damage.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: NLiam Girdwood <lrg@ti.com>
上级 4f333b20
......@@ -505,6 +505,16 @@ static int soc_pcm_apply_symmetry(struct snd_pcm_substream *substream)
!rtd->dai_link->symmetric_rates)
return 0;
/* This can happen if multiple streams are starting simultaneously -
* the second can need to get its constraints before the first has
* picked a rate. Complain and allow the application to carry on.
*/
if (!rtd->rate) {
dev_warn(&rtd->dev,
"Not enforcing symmetric_rates due to race\n");
return 0;
}
dev_dbg(&rtd->dev, "Symmetry forces %dHz rate\n", rtd->rate);
ret = snd_pcm_hw_constraint_minmax(substream->runtime,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册