Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 257e4063778cc7454cdc15f69aeb1c32467d3b71 Mon Sep 17 00:00:00 2001
- From: Georg Chini <georg@chini.tk>
- Date: Mon, 20 Jul 2020 18:50:21 +0200
- Subject: [PATCH] loopback: Fix sink latency calculation if source is alsa
- source with fixed latency
- When an alsa source with fixed latency is used, the actual latency of the source
- will only be one fragment size. This is not taken into account when the required
- sink latency is calculated.
- This patch fixes the issue.
- ---
- src/modules/module-loopback.c | 2 ++
- 1 file changed, 2 insertions(+)
- diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
- index ed559e4c7..b07e02383 100644
- --- a/src/modules/module-loopback.c
- +++ b/src/modules/module-loopback.c
- @@ -1016,6 +1016,8 @@ static void set_sink_input_latency(struct userdata *u, pa_sink *sink) {
- if (u->min_source_latency > requested_latency) {
- latency = PA_MAX(u->latency, u->minimum_latency);
- requested_latency = (latency - u->min_source_latency) / 2;
- + if (u->fixed_alsa_source)
- + requested_latency = PA_MIN(requested_latency, (latency - u->core->default_fragment_size_msec * PA_USEC_PER_MSEC) / 2);
- }
- latency = PA_CLAMP(requested_latency , u->min_sink_latency, u->max_sink_latency);
- --
- 2.25.0.rc2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement