Repository navigation
fix(audio): restore ducked media when the player re-creates its stream - #1128
Open
KitsuneKode wants to merge 1 commit into
Open
KitsuneKode wants to merge 1 commit into
KitsuneKode wants to merge 1 commit into
Conversation
With pause_media and duck_media both on, a playing player was ducked and then paused. Players that tear their stream down on pause (Chromium, Spotify) re-create it on resume, and PipeWire's stream-restore hands the new stream the volume voxtype had set, under an index the restore never touched: the music stayed at the ducked level after the take. - The streams of the players voxtype pauses are no longer ducked; they go quiet by themselves. - After the restore, a background watch (4 s, cancelled by the next take) puts any stream an app re-created at its ducked level back at that app's original volume. A stream matches on both the app and the expected ducked volume, and only a successful pactl write counts.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With
duck_mediaon, media sometimes stayed at the ducked level after a dictation. Two causes:pause_mediaandduck_mediaboth on, a player that was just paused still has a sink input for a moment, so it was ducked. On resume, the player (Spotify, Firefox, mpv) re-creates its stream; PipeWire's stream-restore gives the new stream the volume we set, under an index restore never saw. Streams of apps whose MPRIS player we paused are now left alone (matched by process name, executable, and the player'sIdentity/DesktopEntry).Restore still never waits on the watch.
Related Issue
None filed; found while daily-driving
pause_media+duck_mediawith Spotify and Firefox on PipeWire. #1126 touches the same function (it skips filter-chain streams); the two changes are independent, and I'm happy to rebase on whichever lands first.Type of Change
Testing
pause_media+duck_mediaon)cargo testand all tests pass (see below)cargo clippy --all-targets --no-deps -- -D warningswith no warningscargo fmtNew tests cover the sink-input parsing of inactive streams, app matching, and the ducked-level match.
Ran CI's jobs locally:
cargo fmt --check,cargo clippy --all-targets --no-deps -- -D warnings(default, ONNX engines andosd-nativefeatures), andcargo test(default features, and theparakeetfeatures). Everything passes except two tests that fail the same way on a cleandevcheckout here:meeting::tests::the_chunk_a_crash_left_untranscribed_is_transcribed_on_finish, and, only when the whole suite runs at once,daemon::tests::streaming_stop_watchdog_recovers_when_backend_never_ends.Documentation
Pre-merge checklist
devbranch (notmain)Additional Notes
Written with Claude Code (Claude Opus 5.5); I reviewed and tested it. Commits are signed.