Reconnect the spectrum capture when pipewire-pulse restarts #4

Merged
charles merged 1 commit from spectrum-reconnect into main 2026-10-07 15:07:21 +00:00
Owner

The strip visualizer went flat after any pipewire-pulse restart (a package update or a manual restart) and stayed flat until miraboxd was restarted, because nothing rebuilt the dead libpulse connection.

  • The spectrum worker now watches the context and capture-stream state and rebuilds the connection itself, with backoff (2s doubling to 30s).
  • The analysis buffers live across reconnects, so the strip/viz readers never see a freed Impl.
  • Bars fall to zero while disconnected instead of freezing.
  • This also covers the headset sink vanishing and returning, and the daemon starting before pipewire-pulse.

Tested: restarted pipewire-pulse under the new build. The capture dropped and came back within a second (spectrum capture lost — reconnecting → spectrum capture reconnected) with no miraboxd restart.

Not covered here: EndpointPulse (Game/Chat/Mic knobs) and AudioPulse (per-app volumes) still don't reconnect.

🤖 Generated with Claude Code

The strip visualizer went flat after any pipewire-pulse restart (a package update or a manual restart) and stayed flat until miraboxd was restarted, because nothing rebuilt the dead libpulse connection. - The spectrum worker now watches the context and capture-stream state and rebuilds the connection itself, with backoff (2s doubling to 30s). - The analysis buffers live across reconnects, so the strip/viz readers never see a freed `Impl`. - Bars fall to zero while disconnected instead of freezing. - This also covers the headset sink vanishing and returning, and the daemon starting before pipewire-pulse. **Tested:** restarted pipewire-pulse under the new build. The capture dropped and came back within a second (`spectrum capture lost — reconnecting` → `spectrum capture reconnected`) with no miraboxd restart. **Not covered here:** `EndpointPulse` (Game/Chat/Mic knobs) and `AudioPulse` (per-app volumes) still don't reconnect. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The strip visualizer went flat after any pipewire-pulse restart (package
update, manual restart) until miraboxd was restarted: the libpulse context
died and nothing rebuilt it.

The worker now watches the context and capture-stream state and rebuilds
the connection itself, with backoff (2s doubling to 30s). The analysis
buffers live across reconnects, so the strip/viz readers never see a freed
Impl. Bars fall to zero while disconnected instead of freezing. This also
covers the headset sink vanishing and returning, and the daemon starting
before pipewire-pulse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
charles deleted branch spectrum-reconnect 2026-10-07 15:07:21 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/mirabox-application!4
No description provided.