Bug 64643

Summary: [alsa] Need to ensure same clock is used for smoother put and get
Product: PulseAudio Reporter: Javier Jardón <jjardon>
Component: modulesAssignee: pulseaudio-bugs
Status: RESOLVED MOVED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Javier Jardón 2013-05-15 17:24:22 UTC

    
Comment 1 Javier Jardón 2013-05-15 17:28:46 UTC
When setting the smoother in the alsa modules we use the htimestamp, but when interpolating (using get) we use pa_rtclock. pa_rtclock is not guaranteed to be the same as htimestamp.

Specifically in the case where CLOCK_MONOTONIC is not defined, alsa will use getnstimeofday.
Also in the case where HAVE_CLOCK_GETTIME is not defined in alsa-lib (can happen in Android) then alsa-lib will not use CLOCK_MONOTONIC.

The fix is to use snd_pcm_status to get the time from alsa when calculating latency.

A less accurate alternative would be to simply use pa_rtclock_get during the smoother_put.
Comment 2 GitLab Migration User 2018-07-30 10:03:17 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/186.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.