Re: [alsa-devel] sound: ALSA PCM Timestamps

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



On 5/23/18 8:00 AM, Muni Sekhar wrote:
[ Please keep me in CC as I'm not subscribed to the list]

Hi All,

There are several time stamping functions in ALSA:


snd_pcm_status_get_trigger_tstamp

snd_pcm_status_get_trigger_htstamp

snd_pcm_status_get_tstamp

snd_pcm_status_get_htstamp

snd_pcm_status_get_audio_htstamp

snd_pcm_status_get_driver_htstamp

the *_tstamp functions work with a 'struct timeval' which provides microsecond resolution. The *_stamp functions work with a 'struct timespec' which provides nanosecond resolution.

The trigger_*tstamp returns the time when the stream started (typically when the DMA starts). The get_tstamp returns the current timestamp measured with the regular timekeeping functions, which by subtracting the trigger timestamp provides the elapsed time since the start. You can specify if you want the REALTIME/MONOTONIC/MONOTONIC_RAW timestamp type, depending on your application. The audio timestamp returns the current timestamp but measured using audio-specific counters. If the audio clocks are not aligned with the system time (e.g. if they use different oscillators or the audio clock source is external), there will be a drift between audio timestamps and system timestamp.





I would like to understand what points in time the resulting functions
represent and what is the corresponding kernel mode callback for those
API’s.


I'd be really grateful if someone took the time to help me clearing my doubt.




--
To unsubscribe from this list: send the line "unsubscribe linux-sound" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux