[pulseaudio-discuss] Why audio latency in loopback is divided by 3?

Tanu Kaskinen tanuk at iki.fi
Wed Jun 29 08:42:14 PDT 2011


On Mon, 2011-06-20 at 18:14 +0200, marcin at saepia.net wrote:
> Hi,
> 
> I found interesting piece of code in module-loopback:
> 
> int pa__init(pa_module *m) {
> (...)
>     pa_sink_input_set_requested_latency(u->sink_input, u->latency/3);
> (...)
> }
> 
> I understand it sets the desired latency, but what is the reason for
> this division by three? Why 3 not 2, 5, 88 or 3213?

Without looking at the code, I'd guess the reason is that there are
three equal-sized buffers: the capture buffer (of the source), the
playback buffer (of the sink) and then the module also maintains an
intermediate buffer. The total latency is the sum of these buffers, and
the sink input requested latency only concerns the playback buffer.

-- 
Tanu



More information about the pulseaudio-discuss mailing list