* sound: ALSA PCM Timestamps
@ 2018-05-23 13:00 Muni Sekhar
2018-05-23 13:54 ` Pierre-Louis Bossart
0 siblings, 1 reply; 2+ messages in thread
From: Muni Sekhar @ 2018-05-23 13:00 UTC (permalink / raw)
To: kernelnewbies, linux-sound, alsa-devel
[ 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
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.
--
Thanks,
Sekhar
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: sound: ALSA PCM Timestamps
2018-05-23 13:00 sound: ALSA PCM Timestamps Muni Sekhar
@ 2018-05-23 13:54 ` Pierre-Louis Bossart
0 siblings, 0 replies; 2+ messages in thread
From: Pierre-Louis Bossart @ 2018-05-23 13:54 UTC (permalink / raw)
To: Muni Sekhar, kernelnewbies, linux-sound, alsa-devel
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.
>
>
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-05-23 13:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-23 13:00 sound: ALSA PCM Timestamps Muni Sekhar
2018-05-23 13:54 ` Pierre-Louis Bossart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).