How to to keep track of the amount of queued samples with ALSA?

62 Views Asked by At

There is a text file in the Linux kernel documentation about ALSA timestamping. I copied the following quote from the file.

The ALSA API provides two basic pieces of information, avail and delay, which combined with the trigger and current system timestamps allow for applications to keep track of the 'fullness' of the ring buffer and the amount of queued samples.

This is very interesting for me but I have trouble to understand how to do it properly just by reading the file. I am able to get avail, delay, and timestamps but do not understand how to use them to get the amount of queued samples.

I want to get an approximation of the playback delay.

Is there an implementation of this available? Could someone explain how to this a bit more explicit?

0

There are 0 best solutions below