fix: follow changed default microphone - #1875
Open
kaynansc wants to merge 1 commit into
Open
Conversation
kaynansc
marked this pull request as ready for review
August 7, 2026 21:48
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.
Before Submitting This PR
If this is a feature or change that was previously closed/rejected:
Not applicable. This is a bug fix for a separately reproduced default-device transition; it does not reopen a closed feature proposal.
Human Written Description
When Handy is set to Default, changing the macOS input can leave it listening to the previous microphone. This update detects the change and reopens the audio stream before the next recording, so the new default microphone works without restarting Handy.
Related Issues/Discussions
No public issue has been filed for this exact default-device transition.
Related: #1715 and #1716 cover the main-thread audio freeze that made the old reset workaround beachball. #1874 covers physical microphone disconnects; this PR instead handles a live system-default change while the existing stream remains healthy.
Community Feedback
The bug was reported from a real macOS workflow using
Default, Always-On mode, Bluetooth AirPods, and other microphones. It was reproduced locally against v0.9.4 before implementing the fix. No public discussion exists yet for this exact case.Testing
Root cause: with Always-On enabled and
selected_microphone = None, Handy kept the stream opened on the device that was default at startup. Changing the macOS default left that healthy stream attached to the old microphone. Opening the dropdown only refreshed its options, and resetting toDefaultwas the only path that restarted capture.What changed:
Defaultis selected.spawn_blockingcommand path.Automated checks:
rustc --test src/managers/audio_device_refresh.rs— 5 passedcargo test --lib --locked— 182 passedcargo clippy --all-targets --locked— passed with existing warnings outside this changebun run lint— passedbun run build— passedbun run format:check— passedManual macOS validation:
Default: changed the input default from Stealth 700P Gen 3 to AirPods and started recording without reset. The log had no newUsing device, confirming capture remained on the old stream.System default microphone changed; reopening stream before recording, thenUsing device: Ok("Microfone (MacBook Pro)"), followed by a successful recording start. The app remained responsive.AirPods became unavailable to CoreAudio during the corrected-build run, so the green hardware transition used the two input devices still present. It exercises the same default-device comparison and CoreAudio reopen path.
The debug
Handy.appbundle built successfully with an ad-hoc signature. DMG packaging was stopped after the application bundle was complete because it was not needed for hardware validation.Screenshots/Videos (if applicable)
No UI screenshot is needed; the regression is an audio-routing state mismatch. The before/after device names and reopen event were verified in
handy.log.AI Assistance
If AI was used: