[pulseaudio-discuss] Question regarding latencies reported by alsa-source and alsa-sink

Tanu Kaskinen tanuk at iki.fi
Sun Jan 17 05:40:45 PST 2016


On Sat, 2016-01-16 at 23:22 +0100, Georg Chini wrote:
> Hello,
> 
> I have been working on a new version of module-loopback for quite a 
> while now.
> I am also replacing the smoother in alsa-source and alsa-sink to achieve 
> more
> precise latency reports.
> Now I hit a problem, were I am not sure how to solve it. The get_latency 
> calls
> of alsa-sink and alsa-source truncate the latency to 0 when it becomes 
> negative.
> Would it be possible to let the calls return negative values?
> Due to the error in the initial conditions those values still make sense 
> and clipping
> them causes massive problems for the rate controller of module-loopback.
> 
> If it is not possible to let the calls return negative values, do you 
> have any other
> idea how to work around the problem?

Reporting negative latency doesn't make sense, since it implies time
travel. Where do those negative latency values come from?

Filtering out obviously incorrect values seems appropriate for most use
cases. If you really need access to "unfiltered" values, maybe
pa_sink_get_latency() could have an "allow_negative" parameter or
something similar.

-- 
Tanu


More information about the pulseaudio-discuss mailing list