[alsa-devel] [PATCH 3/5] ASoC: Blackfin: tweak how weinitialize the SPORT

Cai, Cliff Cliff.Cai at analog.com
Thu Jun 4 04:36:48 CEST 2009


>-----Original Message-----
>From: Mark Brown [mailto:broonie at opensource.wolfsonmicro.com] 
>Sent: Wednesday, June 03, 2009 6:29 PM
>To: Mike Frysinger
>Cc: alsa-devel at alsa-project.org; 
>uclinux-dist-devel at blackfin.uclinux.org; Cai, Cliff
>Subject: Re: [alsa-devel] [PATCH 3/5] ASoC: Blackfin: tweak 
>how weinitialize the SPORT
>On Tue, Jun 02, 2009 at 12:18:55AM -0400, Mike Frysinger wrote:
>> @@ -199,7 +190,7 @@ static void bf5xx_i2s_shutdown(struct 
>snd_pcm_substream *substream,
>>  			       struct snd_soc_dai *dai)
>>  {
>>  	pr_debug("%s enter\n", __func__);
>> -	bf5xx_i2s.counter--;
>> +	bf5xx_i2s.configured = 0;
>>  }
>Are you sure this works properly with simultaneous record and playback?
>If one stops while the other is running then the configured 
>flag will be cleared, meaning that the stopped stream can be 
>restarted and used to reconfigure the DAI which appears to be 
>what the code is trying to prevent.
>This should be using constraints to stop applications trying 
>to reconfigure active streams - for the sample rate you just 
>need to set symmetric_rates in the DAI.

This is not a problem of rate but format,I think combine the two flags
will solve all the problems.
The reason I write this patch is that I found when some oss-based
applications open soundcard ,the startup callbacks will be called
several times.
So using the counter to record opened pcm streams is not reliable.



More information about the Alsa-devel mailing list