Re: timestamps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, 21 Apr 2010, Jonas Holmberg wrote:

> How can I get the CLOCK_MONOTONIC timestamp for the first sample in the
> data I get from snd_pcm_readi()?

before reading the data, take the current timestamp (with clock_gettime) 
and subtract snd_pcm_delay() for the stream (see the API docs for 
snd_pcm_delay() for more details).

The accuracy of the returned value depends on the driver/hw's ability to 
report accurate delay values.

PS Alternate strategy is to use SND_PCM_TSTAMP_MMAP mode, in which
    you can query (with snd_pcm_htimestamp()) the timestamp of
    last period elapsed event. See the alsa-lib PCM API docs for
    details. With certain drivers/hw, this is the only way to get
    accurate estimates for delay.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux