Alan Cox wrote:
V4L2 puts sequence numbers and timestamps on all frames captured.
Don't know about audio APIs.
The audio API's let you query the transfer counters, so you have a cycling
32bit view. Unfortunately not all sound hardware will even tell you about
missed stuff, and the clocks can be somewhat inaccurate
The best I have managed is to read the audio data, then use the
SNDCTL_DSP_GETISPACE ioctl to figure out how the time of the read data
compares to the current time. I have found no better method (yet). An
example is in NVrec (http://www.ee.up.ac.za/~justin/v4l2), in oss_core.c
-justin