[alsa-devel] Playback PCM drain and card fifos

Eliot Blennerhassett linux at audioscience.com
Wed Aug 17 06:21:34 CEST 2011


I am seeing playback audio get truncated at the end of playback. The
amount lost is about what is in the on-card fifo. (asihpi driver)
For example in a specific test this is about 100ms of audio, though in
theory could go much higher if I let the card fifo fill completely.

The current driver calls snd_pcm_period_elapsed when the card has read
from the alsa ringbuffer. I.e. it is notifying that the buffer is
available for more data to be written.

As soon as the driver notifies that the final data has been read by the
card, the trigger stop is called, which in turn stops the card playback

However, the data just read has not been played back yet so the audio is

During playback the driver sets runtime->delay = on_card_bytes

I'm trying to work out what I can do in the driver (or in alsa mid layer
if necessary), to make this work better?


Eliot Blennerhassett
AudioScience Inc.

More information about the Alsa-devel mailing list