From db9699b7e9fb1e1cfc684c709069ff34b66f26f2 Mon Sep 17 00:00:00 2001 From: Kishi85 Date: Thu, 4 Jun 2026 16:10:30 +0200 Subject: [PATCH 1/2] fix(linux/pipewire): avoid video stream freeze (on display switch) This is a trial-and-error workaround to avoid video stream freezing when display switching that somehow happens when not using the added thread sleeps due to a racecondition that needs to be further diagnosed. Pipewire state change logging is also move to information log level to improve initial issue analysis without enabling debug logging --- src/platform/linux/pipewire.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/platform/linux/pipewire.cpp b/src/platform/linux/pipewire.cpp index d7a20940409..93e11600e1e 100644 --- a/src/platform/linux/pipewire.cpp +++ b/src/platform/linux/pipewire.cpp @@ -420,8 +420,13 @@ namespace pipewire { }; static void on_stream_state_changed(void *user_data, enum pw_stream_state old, enum pw_stream_state state, const char *err_msg) { - BOOST_LOG(debug) << "[pipewire] PipeWire stream state: " << pw_stream_state_as_string(old) - << " -> " << pw_stream_state_as_string(state); + if (err_msg != nullptr) { + BOOST_LOG(info) << "[pipewire] PipeWire stream error '" << err_msg << "' on state: " << pw_stream_state_as_string(old) + << " -> " << pw_stream_state_as_string(state); + } else { + BOOST_LOG(info) << "[pipewire] PipeWire stream state: " << pw_stream_state_as_string(old) + << " -> " << pw_stream_state_as_string(state); + } auto *d = static_cast(user_data); @@ -853,18 +858,20 @@ namespace pipewire { case platf::capture_e::timeout: if (!pull_free_image_cb(img_out)) { // Detect if shutdown is pending - BOOST_LOG(debug) << "[pipewire] PipeWire: timeout -> interrupt nudge"; + BOOST_LOG(debug) << "[pipewire] PipeWire: timeout -> shutdown pending -> interrupt nudge"; pipewire.frame_cv().notify_all(); return platf::capture_e::interrupted; } if (!push_captured_image_cb(std::move(img_out), false)) { - BOOST_LOG(debug) << "[pipewire] PipeWire: !push_captured_image_cb -> ok"; + BOOST_LOG(debug) << "[pipewire] PipeWire: timeout -> !push_captured_image_cb -> ok"; + std::this_thread::sleep_for(100us); // Workaround: delay OK by 100us to avoid video stream freezing return platf::capture_e::ok; } break; case platf::capture_e::ok: if (!push_captured_image_cb(std::move(img_out), true)) { - BOOST_LOG(debug) << "[pipewire] PipeWire: !push_captured_image_cb -> ok"; + BOOST_LOG(debug) << "[pipewire] PipeWire: ok -> !push_captured_image_cb -> ok"; + std::this_thread::sleep_for(100us); // Workaround: delay OK by 100us to avoid video stream freezing return platf::capture_e::ok; } break; From ec7393d781993b8495fe28d14979ee0a2c4355ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 06:36:42 +0000 Subject: [PATCH 2/2] build(deps): bump third-party/wayland-protocols Bumps [third-party/wayland-protocols](https://github.com/LizardByte-infrastructure/wayland-protocols) from `02e63e7` to `ee78491`. - [Commits](https://github.com/LizardByte-infrastructure/wayland-protocols/compare/02e63e74a807afed95bc25a386173110afef24e3...ee78491a237eaff9389a0ccf8680521d074407d3) --- updated-dependencies: - dependency-name: third-party/wayland-protocols dependency-version: ee78491a237eaff9389a0ccf8680521d074407d3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- third-party/wayland-protocols | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/wayland-protocols b/third-party/wayland-protocols index 02e63e74a80..ee78491a237 160000 --- a/third-party/wayland-protocols +++ b/third-party/wayland-protocols @@ -1 +1 @@ -Subproject commit 02e63e74a807afed95bc25a386173110afef24e3 +Subproject commit ee78491a237eaff9389a0ccf8680521d074407d3