[alsa-devel] When command SNDRV_PCM_TRIGGER_STOP is asked in snd_pcm_ops trigger(), which buffer in the buffer list should be the last one to output by the DMA?
cladisch at fastmail.net
Fri Nov 9 09:58:34 CET 2007
Sonic Zhang wrote:
> After ALSA starts playing, several buffers ahead of current one
> running by the DMA controller are usually filled in advance by the
> ALSA layer. When command SNDRV_PCM_TRIGGER_STOP is asked in
> snd_pcm_ops trigger(), which buffer should be the last one to output
> by the DMA?
When the stop trigger is called, the stream should be stopped
immediately, that is, you should, if possible, not even wait for the end
of the current buffer.
When an application calls snd_pcm_drain(), ALSA stops filling the buffer
and waits until the data has played before calling the stop trigger.
More information about the Alsa-devel