Advertisement
Guest User

Untitled

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