Repository navigation
Conversation
Core Audio reports an empty bundle ID ("") for processes without an
app bundle. FineTune used it as-is, so every such process got a blank
row and shared the "" persistence key, colliding volume/mute settings.
Treat "" as missing and name the app after its executable.
The tap health monitor also skipped muted taps, assuming they get no
callbacks. They do, and .mutedWhenTapped only silences the process
while the tap is read, so a dead muted tap leaked audio forever.
Health-check muted taps too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DisplayableApp.id was the persistence identifier, which every running instance of the same executable (or app) shares. SwiftUI rows with duplicate IDs swap state, so mute/volume clicks landed on the wrong process and the one actually playing stayed unmuted. Active rows now use persistenceIdentifier#pid; saved settings stay keyed by persistenceIdentifier. Keyboard navigation resolves rows by the new ID and ignores rows whose process exited instead of writing a junk key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setMute only flipped the flag on an existing tap. If tap creation had failed earlier, the row showed "muted" while the app kept playing. Ensure the tap exists first, as setVolume already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
@ronitsingh10 Muted bare executables (no |
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.
Problem
Apps launched as bare executables (no
.appbundle — e.g. a game or tool built from source and run from a terminal) could not be reliably muted:Reproduced with several instances of the same SDL game binary running at once (plus a second binary), all muted in FineTune, still audible.
Root causes
Empty bundle ID treated as a real value. Core Audio's
kAudioProcessPropertyBundleIDreturns""(notnil) for bare executables.AudioProcessMonitorused it as-is, so the row name became"".components(separatedBy: ".").last == "", andpersistenceIdentifier(bundleID ?? "name:…") became""for every bare executable — they all shared one settings key.Duplicate SwiftUI row IDs.
DisplayableApp.idwaspersistenceIdentifier. Multiple running instances of the same executable (or the same app launched twice) share that identifier, soForEachgot duplicate IDs. SwiftUI then mixes rows up: a click on one row can mute/unmute a different process, and the process actually playing stays unmuted while its row looks muted.Muted taps were excluded from the health monitor.
startHealthMonitorskipped muted taps on the assumption that muted taps get no IO callbacks. They do (_lastRenderHostTimeis updated before the mute early-return), and.mutedWhenTappedonly silences the process while the tap is being read — so a muted tap that died was never recreated and the app's original audio leaked through indefinitely.setMutecould be a silent no-op. UnlikesetVolume,setMutedidn't ensure a tap exists. If tap creation had failed earlier, the row showed muted while nothing was silencing the app.Changes
AudioProcessMonitor: treat an empty bundle ID as missing. Name fallback order: resolved app name → last bundle-ID component →NSRunningApplication.localizedName→ executable name (proc_pidpath) →"Unknown". Bare executables now get a real name, icon, and aname:<executable>persistence key.AudioApp.rowID(persistenceIdentifier#pid) is used asDisplayableApp.idfor active rows, so rows are unique per process. Saved settings remain keyed bypersistenceIdentifier. Keyboard navigation resolves rows by the new ID and ignores a row whose process exited (instead of writing a junk settings key).setMuteensures the tap exists before applying mute.Per-row mute/volume behavior is unchanged: each instance is still controlled from its own row.
Tests
AudioProcessMonitorIdentityTests: empty-bundle-ID handling, name fallback order, distinct persistence key for bare executables, and distinct row IDs for multiple instances sharing one persistence key.PopupKeyboardNavModelTestsupdated for the renamed row-ID label.Manually verified: bare executables show named rows, each row controls its own process, and pausing each game process in turn while listening confirmed no audio leaks after a fresh launch.
🤖 Generated with Claude Code