Skip to content

fix(macos): avoid Bluetooth headset mics in automatic selection - #113

Merged
kitlangton merged 1 commit into
mainfrom
fix/automatic-mic-avoids-bluetooth
Oct 2, 2026
Merged

kitlangton merged 1 commit into
mainfrom
fix/automatic-mic-avoids-bluetooth

Conversation

@kitlangton

Copy link
Copy Markdown
Collaborator

Why

Opening a Bluetooth headset's microphone switches AirPods and similar headsets into a low-quality call profile for everything they play. With the microphone set to Automatic, HEX opened the macOS default input, which becomes the headset as soon as it connects. With Keep ready, music sounded bad the whole time HEX was running (#106). With Release when idle, every shortcut chord that briefly matched the dictation key opened the mic and made the audio blip (#88).

What Changes

Automatic selection keeps its existing order (compiled device preferences, then the macOS default) with one change: when that default is a Bluetooth input and the Mac has a built-in microphone, HEX opens the built-in microphone instead.

Inputs present macOS default Automatic opens
MacBook Pro Microphone, AirPods Pro AirPods Pro MacBook Pro Microphone
MacBook Pro Microphone, USB mic USB mic USB mic
AirPods Pro only (for example a Mac mini) AirPods Pro AirPods Pro

A headset chosen explicitly in Settings, and the CLI --device override, are still opened as before. Each skip is logged with both device names.

The transport comes from CoreAudio (kAudioDevicePropertyTransportType, Bluetooth or Bluetooth LE versus built-in), resolved from cpal's device UID, because cpal does not report it on macOS.

Scope

Fixes #106 and #88 for Automatic selection. It does not change an explicitly saved device or follow default-device changes while a warm stream is already open.

Verification

cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test
git diff --check
  • 492 tests passed, 13 ignored, including the new automatic_input_prefers_built_in_over_a_bluetooth_default selection table.
  • A temporary live probe on this Mac (not committed) enumerated real inputs through the new CoreAudio lookup: MacBook Pro Microphone: BuiltIn, BlackHole 2ch: Other, iPhone Continuity mic Other. AirPods were not connected, so the Bluetooth branch has not been exercised against a real headset yet.

@kitlangton
kitlangton merged commit 428ed47 into main Oct 2, 2026
2 checks passed
@kitlangton
kitlangton deleted the fix/automatic-mic-avoids-bluetooth branch October 2, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Worse Music quality when Hex is active

1 participant