10 Nov
2012
10 Nov
'12
6:28 p.m.
Daniel Sanz wrote:
I noticed that the snd_pcm_drain call blocks until the buffer is completely drained. Is there any way to drain the buffer without a block?
Try calling snd_pcm_nonblock(handle, 1).
I've tried calling snd_pcm_nonblock(handle, 1) before the call to snd_pcm_drain but it does not work.
How so?
The context is that this is an application that plays a particular WAV sound repeatedly, so I don't want to wait until the sound is played completely before it is played again.
Then why do you drain at all? Just write the new data into the buffer.
Regards, Clemens