Skip to content

audio: call pw_loop_enter/leave on the SPA event loop - #1261

Open
zhouwg wants to merge 1 commit into
quickshell-mirror:masterfrom
kan-linux:kan
Open

zhouwg wants to merge 1 commit into
quickshell-mirror:masterfrom
kan-linux:kan

Conversation

@zhouwg

@zhouwg zhouwg commented Oct 5, 2026

Copy link
Copy Markdown

Overview

PwCore::start() creates a pw_loop but never calls pw_loop_enter() before iterating it via QSocketNotifier. This triggers SPA's internal assertion impl->enter_count > 0 at loop.c:817 on every pw_loop_iterate() call, causing the PipeWire connection to fail silently.

Add pw_loop_enter() after pw_loop_new() and pw_loop_leave() before pw_loop_destroy() to properly manage the loop lifecycle.

Additional information

Before the fix: clicking the audio icon had no response, and audio volume adjustment did not work.
After the fix: audio volume adjustment works correctly.

Screenshot From 2026-10-05 19-35-51

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: Yes, Paired with MiMoCode + MiMo-V2.5-Pro, use MiMo-V2.5-Pro to generate the fix, then reviewed/tested manually.

PwCore::start() creates a pw_loop but never calls pw_loop_enter() before
iterating it via QSocketNotifier. This triggers SPA's internal assertion
impl->enter_count > 0 at loop.c:817 on every pw_loop_iterate() call,
causing the PipeWire connection to fail silently.

Add pw_loop_enter() after pw_loop_new() and pw_loop_leave() before
pw_loop_destroy() to properly manage the loop lifecycle.

Assisted-by: MiMoCode + MiMo-V2.5-Pro
@outfoxxed

Copy link
Copy Markdown
Member

Its unclear if we should enter this when processing pipewire events (from socket notify) or just for the full duration of the connection and there is zero documentation (as usual). I also don't get this so I guess they changed an assertion in a newer package version than I'm on.

Did you try both positions or know why it should go around the app event loop vs event stream handling?

@outfoxxed

outfoxxed commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Did some research, looks correct.

Can you enable maintainer edits on the branch?

@outfoxxed
outfoxxed force-pushed the master branch 2 times, most recently from 72a1ce2 to 11ca60b Compare October 6, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants