[alsa-devel] [Uclinux-dist-devel] [PATCH 2/5] ASoC codec: SSM2602: assign last substream to the master when shutting down

Takashi Iwai tiwai at suse.de
Sun Jun 14 10:15:41 CEST 2009


At Sat, 13 Jun 2009 12:06:07 +0100,
Mark Brown wrote:
> 
> On Sat, Jun 13, 2009 at 07:03:12AM -0400, Mike Frysinger wrote:
> 
> > the first part conditionalized the constraints.  ignoring whitespace
> > changes, this is the diff:
> > +if (master_runtime->rate != 0)
> >     snd_pcm_hw_constraint_minmax(substream->runtime,
> >     ......
> > +if (master_runtime->sample_bits != 0)
> >     snd_pcm_hw_constraint_minmax(substream->runtime,
> >     ......
> 
> > or maybe that is what you're saying and i dont know alsa
> 
> That's not a bad change - there's a thin race condition if you
> simultaneously start up two applications where the primary substream
> could be there but not yet configured since stream startup is separate
> to the configuration of the stream.  It's hard but not impossible to
> reproduce.

An absolute race-free hw-constraint for multiple substreams is
actually difficult to implement.  The best practice would be to give
an error and refuse the change when any inconsistency occurs, IMO.


Takashi


More information about the Alsa-devel mailing list