Re: [PATCH] fix snd_pcm_drain() excluding SETUP state from valid states

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

 



On Thu, May 14, 2020 at 03:52:25PM +0200, Jaroslav Kysela wrote:
> NAK: You should not call drain when the PCM handle is in the SETUP field.
> It's an obvious caller problem. The streaming should be active somehow.

The pb here is the non-blocking calls of the drain function: in my test case,
the first call to the drain function switches the pcm in draining state, but
the pcm will be switched to the setup state somewhen in between 2 drain function
calls! Naively, I was calling the drain function on a regular time basis to see
if the draining was finished, namely expecting 0 to be returned.

Then if I understood you well, the right way(tm) to use the drain function in
non-block mode, is to call only once the drain function, then inspect the state
of the pcm till it not anymore in the draining state. 

Am I right? Or did I miss something again?

regards,

-- 
Sylvain



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

  Powered by Linux