Repository navigation
feat(audio): keep host default sink with keep_default_sink - #5935
Open
mikefaille wants to merge 8 commits into
Open
mikefaille wants to merge 8 commits into
mikefaille wants to merge 8 commits into
Conversation
… host default Adds the keep_default_sink config key controlling whether audio capture swaps the host default sink. - Config: new keep_default_sink key (default disabled) with validation. - Policy: when enabled, capture keeps the host default sink untouched; teardown restores only state this session changed. - UI: AudioVideo tab toggle plus locale strings. - Docs: configuration.md documents the new key. - Tests: config, audio, and linux audio unit coverage.
2 tasks done
Rename shadowed module field (S1669), extract adopt_sink/ensure_sink helpers from the duplicated sink setup blocks (S3776), shrink the oversized enumeration lambda (S1188), and guard destructor teardown against throwing unloads (S1048). Behavior unchanged.
Give the destructor's catch-all a log statement so the intentionally suppressed unload path is not an empty handler (S2486). Teardown stays non-throwing.
ReenigneArcher
requested changes
Oct 16, 2026
ReenigneArcher
left a comment
Member
There was a problem hiding this comment.
Why doesn't your agent follow the AGENTS.md file?
Contributor
Author
|
@ReenigneArcher I will review. |
Contributor
Author
I reviewed myself and I don't see the issue. |
Member
|
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
Adds a
keep_default_sinkaudio option (Linux) that lets Sunshine capture aconfigured
audio_sinkwithout making the Sunshine sink the host default.Mechanism: a sink-routing policy object is resolved from the audio settings
and handed to
capture_sink. When the option is enabled, capture only setsthe requested sink and logs that the host default is being left alone — no
swap at startup, no restore at teardown. Adopted (pre-existing) sinks are
kept alive on peer teardown rather than unloaded (adopt-don't-unload), so
host routing is undisturbed. The option defaults to off, preserving current
behavior unless explicitly opted in. Wired through config, the web UI audio
tab, and unit tests.
Note: this addresses the reported default-sink takeover only when the new
option is enabled; existing
audio_sink-only configs still swap by default.Screenshot
The change adds a "Keep Default Sink" checkbox to the Audio/Video settings
tab. Screenshot to be attached by the author.
Issues Fixed or Closed
Roadmap Issues
None.
Testing
cmake --build build -j2(Release, Ninja, CUDA enabled): exit 0--gtest_filter='*Audio*:*Sink*:*KeepDefault*:*Config*':299 tests from 35 suites, all passed — including
KeepDefaultSinkAudioTest.CaptureSinkKeepsHostDefaultSink,NullSinkOwnershipTest.AdoptedSinksSurvivePeerTeardown,SinkRoutingPolicyTest(x2),AudioControlAdapterTest, andKeepDefaultSinkConfigTest(x2)(pre-existing platform skips: UtfUtils non-Windows, SystemTrayDisabled,
MouseHID x4), 0 failed
uv run --locked lb-update-clang-format: no changes (format clean)Type of Change
Checklist
AI Usage
See our AI usage policy.
AI-assisted implementation and tests; reviewed and tested by the author.