[alsa-devel] [RFC][PATCH] ASoC: Move symmetric rate check for substreams to hw_params

Mark Brown broonie at opensource.wolfsonmicro.com
Mon Mar 7 13:09:24 CET 2011

On Mon, Mar 07, 2011 at 05:26:03PM +0530, Vaibhav Bedia wrote:
> Currently the symmetric rate check is present in the snd_pcm_open() call.
> However this causes snd_pcm_open() to fail for the 2nd substream is the
> 2nd call to snd_pcm_open() is made before the 1st substream has set a non-zero
> rate by calling snd_pcm_hw_params().
> Fix this by moving the call to snd_pcm_apply_symmetry() to soc_pcm_hw_params().

This means that applications won't be constrained by the current
settings so can't automatically choose the required rate.  ALSA is just
fundamentally racy here, if you want to reliably open bidirectional
streams you need to serialise the startup of the two directions.

More information about the Alsa-devel mailing list