From 04c24be2db48348fa0c863238184f3997519a48a Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Tue, 1 Nov 2022 17:25:11 +0100 Subject: [PATCH] PulseAudio: don't drain the stream right after initial uncorking The draining was introduced in ae3c8b19c65, apparently as an experiment doing several changes. But the drain is outside the loop where freewheeling changes, so the fix must have worked for other reasons. There doesn't seem to be any benefit from draining at that point. The stream is already empty. If not, we could have flushed it. Draining right after uncorking will conceptualy create an intentional underflow, even though it isn't reported as such. PipeWire seems to (something like 6-12 months ago) have regressed in handling of that grey area, causing that *underflow* to cause a request for too much data, and thus causing constant *overflows* and unusable playback. This change makes PulseAudio playback work for me again. --- libs/backends/pulseaudio/pulseaudio_backend.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/libs/backends/pulseaudio/pulseaudio_backend.cc b/libs/backends/pulseaudio/pulseaudio_backend.cc index 92781e623e..0d97f3caeb 100644 --- a/libs/backends/pulseaudio/pulseaudio_backend.cc +++ b/libs/backends/pulseaudio/pulseaudio_backend.cc @@ -1008,9 +1008,6 @@ PulseAudioBackend::main_process_thread () } } - pa_threaded_mainloop_lock (p_mainloop); - sync_pulse (pa_stream_drain (p_stream, stream_operation_cb, this)); - _dsp_load_calc.reset (); stream_latency_update_cb (p_stream, this);