Skip to content

Opt wiremix's capture streams out of wireplumber state persistence - #64

Open
HoneyHazard wants to merge 1 commit into
tsowell:mainfrom
HoneyHazard:metering-skip-state-persistence
Open

Opt wiremix's capture streams out of wireplumber state persistence#64
HoneyHazard wants to merge 1 commit into
tsowell:mainfrom
HoneyHazard:metering-skip-state-persistence

Conversation

@HoneyHazard

@HoneyHazard HoneyHazard commented Aug 5, 2026

Copy link
Copy Markdown

⚠️ Full Disclosure: Drafted with AI assistance (Claude); reviewed by me briefly. I am neither a RUST developer nor pipewire expert. If I should stop making these PRs into your wonderful project, please let me know. ⚠️

That being said, I hope these can be helpful and useful additions that users could appreciate.


wireplumber's state-stream.lua persists volume/mute/target to disk (~/.local/state/wireplumber/stream-properties, write+fsync+rename, debounced) for any node whose media.class matches Stream/* - which is what a pw_stream gets by default when no media.class is set, exactly wiremix's capture streams (wirehose/stream.rs::capture_node). These streams are purely internal metering taps with no volume/mute/target of their own worth remembering across launches, so every Props update on one is wasted disk I/O and wireplumber policy work.

state-stream.lua already supports a per-node opt-out, checked before any of that work happens: stream_props["state.restore-props"] and ["state.restore-target"]. Setting both to "false" on the capture stream skips it entirely.

A note on scope, in the interest of not overselling this: I confirmed via strace that wireplumber's state-file write path is real and not free, but on investigation the dominant cost on a real system with many concurrent streams turned out to be an unrelated background process (something else entirely was recreating its own stream repeatedly) rather than wiremix's captures specifically. So this is a legitimate, low-risk correctness fix - an internal tap shouldn't be treated like a real user stream - more than a load-bearing performance fix on its own. Still worth doing: it costs nothing for any wiremix build, and removes real per-event disk I/O that has no reason to happen for these streams.

Tested:

  • cargo test: 144/144 passing
  • cargo fmt --check / cargo clippy -- -D warnings / cargo doc (matching this repo's CI): all clean

Drafted with AI assistance (Claude); reviewed by me before opening. Left as a draft while I finish going through it - not requesting review yet.

wireplumber's state-stream.lua persists volume/mute/target to disk
(~/.local/state/wireplumber/stream-properties, write+fsync+rename,
debounced) for any node whose media.class matches "Stream/*" - which is
what a pw_stream gets by default when no media.class is set, exactly
wiremix's capture streams (wirehose/stream.rs::capture_node). These
streams are purely internal metering taps with no volume/mute/target of
their own worth remembering across launches, so every Props update on
one is wasted disk I/O and wireplumber policy work.

state-stream.lua already supports a per-node opt-out, checked before any
of that work happens: stream_props["state.restore-props"] and
["state.restore-target"]. Setting both to "false" on the capture stream
skips it entirely.

Confirmed via strace that wireplumber's state-file write path is real
and not free, but on investigation the dominant cost on a real system
turned out to be an unrelated background process (a stabilizer tone
generator repeatedly recreating its own stream) rather than wiremix's
captures specifically - so this is a legitimate, low-risk correctness
fix (an internal tap shouldn't be treated like a real user stream) more
than a load-bearing performance fix on its own. Still worth doing: it
costs nothing for any wiremix build, and removes real per-event
disk I/O that has no reason to happen for these streams.

Tested: cargo test (144/144), cargo fmt --check / cargo clippy -- -D
warnings / cargo doc (matching wiremix's CI) all clean.
@HoneyHazard
HoneyHazard marked this pull request as ready for review August 9, 2026 05:48
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.

1 participant