From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [Uclinux-dist-devel] [PATCH 2/5] ASoC codec: SSM2602: assign last substream to the master when shutting down Date: Sun, 14 Jun 2009 10:15:41 +0200 Message-ID: References: <20090603105223.GE11507@sirena.org.uk> <8bd0f97a0906030537y1e65aa7atec4b0c5cdf4ae2f@mail.gmail.com> <20090603145316.GA7315@rakim.wolfsonmicro.main> <8bd0f97a0906031826j647efa0bs1ffb6492cfd0ccd8@mail.gmail.com> <20090604085921.GD6983@rakim.wolfsonmicro.main> <20090613104435.GA4795@sirena.org.uk> <8bd0f97a0906130347x74973be2nf5c26641a09c5e24@mail.gmail.com> <20090613105911.GB4795@sirena.org.uk> <8bd0f97a0906130403k29956684j6caeae40e16b1e6@mail.gmail.com> <20090613110607.GA8052@opensource.wolfsonmicro.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id B9A792466A for ; Sun, 14 Jun 2009 10:15:41 +0200 (CEST) In-Reply-To: <20090613110607.GA8052@opensource.wolfsonmicro.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: Karl Beldan , uclinux-dist-devel@blackfin.uclinux.org, alsa-devel@alsa-project.org, Cliff Cai , Mike Frysinger List-Id: alsa-devel@alsa-project.org 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