Fix aggregate device volume slider permanently broken after install#849
Open
pranahonk wants to merge 1 commit intokyleneideck:masterfrom
Open
Fix aggregate device volume slider permanently broken after install#849pranahonk wants to merge 1 commit intokyleneideck:masterfrom
pranahonk wants to merge 1 commit intokyleneideck:masterfrom
Conversation
…yleneideck#848) Skip volume/mute sync for aggregate devices to prevent deprecated AudioHardwareService APIs from corrupting their volume control state. Always report aggregate devices as having volume/mute controls so BGMDevice controls stay enabled and PropagateControlListChange (null device toggle) is not triggered. Also fix implicit int-to-float conversion warnings for newer Xcode.
GloryWord
added a commit
to GloryWord/BackgroundMusic
that referenced
this pull request
Apr 12, 2026
Recent post-v0.4.3 Tahoe reports pointed to two failure modes that made Background Music feel unsafe to use: aggregate output devices could lose usable volume controls, and quitting or uninstalling could leave the system stuck at the wrong volume. This change pulls the minimal proven fixes onto a single branch so Tahoe users can build from source without reopening the broader helper/ducking design. The aggregate-device lane now treats aggregate outputs as special cases for control detection and skips deprecated volume/mute sync paths that can corrupt System Settings state. The termination lane deactivates control-sync and playthrough before restoring the default device, and the uninstall path removes stale BGM device preference entries that can keep incorrect volume state alive across restarts. Constraint: Must stay close to upstream master to preserve CoreAudio behavior and ease future rebases Constraint: Cannot fully verify privileged install/runtime helper behavior in this environment because sudo is unavailable Rejected: Large Tahoe-specific refactor of the helper/ducking pipeline | too broad without a reproducible runtime failure locally Rejected: Leaving the open Tahoe stability fixes unmerged locally | keeps known aggregate/shutdown regressions in the user build Confidence: medium Scope-risk: moderate Reversibility: clean Directive: Treat this as a Tahoe stability lane, not a complete fix for FaceTime/browser ducking; validate runtime capture separately on the target machine Tested: xcodebuild build (Background Music Device, Background Music, BGMXPCHelper) Tested: xcodebuild test -only-testing:BGMDriverTests Tested: xcodebuild test -only-testing:BGMAppUnitTests Not-tested: Privileged install of BGMXPCHelper/driver via launchd Not-tested: Real FaceTime + browser YouTube runtime on macOS Tahoe 26.3.1 Related: upstream PR kyleneideck#849 Related: upstream PR kyleneideck#850
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.
Summary
Fixes #848 — Installing Background Music with an Aggregate Device as output permanently disables the aggregate device's volume slider in System Settings, even after uninstalling.
Root cause:
BGMDeviceControlsList::MatchControlsListOf()uses deprecatedAudioHardwareService*APIs to detect volume support, which return incorrect results for aggregate devices on newer macOS. This causes BGMDevice's volume control to be disabled, triggeringPropagateControlListChange(a null-device toggle) that corrupts macOS's internal state for the aggregate device. Additionally,CopyVolumeFrom()uses these same deprecated APIs to write to the aggregate device's virtual master volume, which can permanently corrupt its volume control state.Fix:
BGMAudioDevice::IsAggregate()to detect aggregate devices viakAudioDeviceTransportTypeAggregateMatchControlsListOf(): always report aggregate devices as having volume/mute controls (macOS provides virtual controls for them regardless)CopyVolumeFrom()/CopyMuteFrom(): skip volume/mute sync for aggregate devices to avoid corrupting their state via deprecated APIsTest plan