Why audio latency in loopback is divided by 3?

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

 



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



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux