* Exiting from snd_pcm_wait or snd_pcm_write.
@ 2003-04-06 20:25 James Courtier-Dutton
2003-04-08 16:04 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: James Courtier-Dutton @ 2003-04-06 20:25 UTC (permalink / raw)
To: alsa-devel
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Exiting from snd_pcm_wait or snd_pcm_write.
2003-04-06 20:25 Exiting from snd_pcm_wait or snd_pcm_write James Courtier-Dutton
@ 2003-04-08 16:04 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2003-04-08 16:04 UTC (permalink / raw)
To: James Courtier-Dutton; +Cc: alsa-devel
At Sun, 06 Apr 2003 21:25:06 +0100,
James Courtier-Dutton wrote:
>
> 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() ?
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.
> What about Thread 2 calling snd_pcm_reset() while thread 1 is calling
> snd_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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-04-08 16:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-06 20:25 Exiting from snd_pcm_wait or snd_pcm_write James Courtier-Dutton
2003-04-08 16:04 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox