Re: snd_pcsp locking mess

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Tue, 21 Oct 2008 01:51:57 +0400,
Stas Sergeev wrote:
> 
> Hi.
> 
> Takashi Iwai wrote:
> > Indeed, the async trigger is nice to have in the common place.
> > However, the change wouldn't be as trivial as it sounds, as you
> > mentioned.  By async nature, there can be a transition phase between
> > the XRUN and STOP, which can cause races.
> Could you please elaborate on how my
> proposed patch could possibly affect
> that? It basically doesn't do anything
> at all except providing one more callback
> for what would otherwise had to be done
> in a trigger() callback anyway.
> If there is a race with that patch, then
> I pretty much suspect it was with an old
> code too. I can't imagine any possible
> change. What have changed?

The PCM status is changed immediately after calling trigger(_async)
callback XRUN or SETUP.  That is, you can start the stream again soon
after snd_pcm_stop().  In the case of async operation, the hardware
may be likely still running, but the PCM core doesn't know about it
and allows you to restart the stream.  So it's racy, at least from the
PCM core viewpoint.

Usually async operation has a way to indicate the pending status,
either setting the state to WORKING/PENDING, or having an additional
flag.  In either way, we need the change in the PCM core side.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux