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

Cai, Cliff Cliff.Cai at analog.com
Mon Jun 15 04:40:47 CEST 2009


 

>-----Original Message-----
>From: Takashi Iwai [mailto:tiwai at suse.de] 
>Sent: Sunday, June 14, 2009 4:16 PM
>To: Mark Brown
>Cc: Mike Frysinger; Karl Beldan; 
>uclinux-dist-devel at blackfin.uclinux.org; 
>alsa-devel at alsa-project.org; Cai, Cliff
>Subject: Re: [alsa-devel] [Uclinux-dist-devel] [PATCH 2/5] 
>ASoC codec: SSM2602: assign last substream to the master when 
>shutting down
>
>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.
>


Without this patch, Oss-based applications (such as "tone","vplay" etc.)
won't work properly.  

Cliff


More information about the Alsa-devel mailing list