Exiting from snd_pcm_wait or snd_pcm_write.
Hi all,
If I have an application running 2 or more threads.
Thread 1 is currently calling snd_pcm_wait() waiting for enough availiable space to appear in the sound buffer. Thread 2 wants to stop thread 1 doing that( abort the snd_pcm_wait() call), and then wants thread 1 to restart with new data.
Can Thread 2 just call snd_pcm_drop() while thread 1 is calling snd_pcm_wait() ? What about Thread 2 calling snd_pcm_reset() while thread 1 is calling snd_pcm_wait()?
We basically want the user seeking through an audio stream.
So, as the user seeks across the stream, a few audio frames/clippets of sound are played as one goes.
So, basically, the user is continually changing the source of samples being sent to the audio card.
In order for this changing to happen quickly, we need the some way to safely abort the snd_pcm_wait() and snd_pcm_write() calls.
Can we do this?
Cheers
James
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
At Sun, 06 Apr 2003 21:25:06 +0100,
Quoted 11 lines · James Courtier-Dutton
Hi all,
If I have an application running 2 or more threads. Thread 1 is currently calling
snd_pcm_wait()waiting for enough availiable space to appear in the sound buffer.
Thread 2 wants to stop thread 1 doingthat( abort the snd_pcm_wait() call), and then wants thread 1 to restart with new data.Can Thread 2 just call
snd_pcm_drop()while thread 1 is callingsnd_pcm_wait()?
it should be ok. the thread 1 will be woken up after the pcm is stopped, but POLLOUT won't be set in this case.
Quoted 2 lines
What about Thread 2 calling
snd_pcm_reset()while thread 1 is callingsnd_pcm_wait()?
this may not work (although i'm not 100% sure).
the thread 1 might lose sync.
ciao,
Takashi
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/