alsa-sink: increase watermark when there is nothing to rewind
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 26 Apr 2020 17:55:08 +0000 (19:55 +0200)
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>
Mon, 14 Dec 2020 19:18:25 +0000 (19:18 +0000)
If we do not manage to rewind at all because there is nothing to rewind
any more, it means the latency is too small, and we let audio escape our
control. We should thus increase the watermark to fix this.

Fixes #871

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/287>

src/modules/alsa/alsa-sink.c

index f7fef8a7e144cb0964361243d5b96fa683556b5f..bd8377ced86722d96809d114f62c55b6df09f2bb 100644 (file)
@@ -1877,8 +1877,11 @@ static int process_rewind(struct userdata *u) {
             u->after_rewind = true;
             return 0;
         }
-    } else
+    } else {
         pa_log_debug("Mhmm, actually there is nothing to rewind.");
+        if (u->use_tsched)
+            increase_watermark(u);
+    }
 
 rewind_done:
     pa_sink_process_rewind(u->sink, 0);