From c3ded6d56ca1723ae54bc02e43c255cea19d1f5c Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Sun, 6 Aug 2023 01:39:40 -0500 Subject: [PATCH] LibAudio: Improve PulseAudio stream connection error messages We were missing a formatted error message printout when the connection failed after the initial `pa_stream_connect_playback()` API call. --- Userland/Libraries/LibAudio/PulseAudioWrappers.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibAudio/PulseAudioWrappers.cpp b/Userland/Libraries/LibAudio/PulseAudioWrappers.cpp index f99d338ea9..96d1d3833e 100644 --- a/Userland/Libraries/LibAudio/PulseAudioWrappers.cpp +++ b/Userland/Libraries/LibAudio/PulseAudioWrappers.cpp @@ -230,7 +230,7 @@ ErrorOr> PulseAudioContext::create_stream(Output stream_wrapper.ptr()); if (auto error = pa_stream_connect_playback(stream, nullptr, &buffer_attributes, flags, nullptr, nullptr); error != 0) { - warnln("PulseAudio stream connection failed with error: {}", pulse_audio_error_to_string(static_cast(error))); + warnln("Failed to start PulseAudio stream connection with error: {}", pulse_audio_error_to_string(static_cast(error))); return Error::from_string_literal("Error while connecting the PulseAudio stream"); } @@ -244,6 +244,7 @@ ErrorOr> PulseAudioContext::create_stream(Output is_ready = true; break; case PulseAudioStreamState::Failed: + warnln("PulseAudio stream connection failed with error: {}", pulse_audio_error_to_string(get_last_error())); return Error::from_string_literal("Failed to connect to PulseAudio daemon"); case PulseAudioStreamState::Unconnected: case PulseAudioStreamState::Terminated: