Repository navigation
fix(macos): resolve microphones Chromium labels with a transport suffix - #1147
Conversation
Chromium appends (Built-in), (Virtual), (Aggregate) or (Bluetooth) to a macOS input's name, besides the USB vendor:product pair already handled. The ScreenCaptureKit helper only stripped the USB pair, so a chosen BlackHole 2ch (Virtual) fell back to the default input. Strip one known suffix after the exact match fails, keeping ambiguous names unresolved. Fixes #1143
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No actionable issue is established; the change is mergeable after normal checks. Pre-merge checks |
|
Summary
The macOS ScreenCaptureKit helper maps the renderer's microphone choice (a hashed Chromium id plus its label) to an AVFoundation input by name. Chromium builds that label from the CoreAudio name plus one suffix per transport type:
(Built-in),(Virtual),(Aggregate),(Bluetooth), or the USB(vvvv:pppp)pair. #648 taught the resolver the USB pair only, so a chosenBlackHole 2ch (Virtual)(AVFoundation:BlackHole 2ch,BlackHole2ch_UID) fell back to the default input with the "could not be identified" toast.resolveMicrophoneDeviceIDnow:AirPods Pro (Bluetooth)still wins),Unknown or lowercase suffixes, doubled suffixes and Chromium's
Default - ...entry still resolve to nothing, and a name two inputs share stays ambiguous, so the helper keeps falling back to the default and saying so.Related issue
Fixes #1143
Candidate for cherry-pick to release/v2.1.0 (the candidate at 9c55596 has the same resolver).
Type of change
Release impact
Desktop impact
Screenshots / video
None, no UI change.
Testing
swift test --package-path electron/native/screencapturekit: 65 tests, 0 failures. New cases use real macOS labels beside the AVFoundation uniqueID/localizedName pairs for the same inputs (BlackHole, built-in mic, AirPods, Shure MV7 over USB, an aggregate device), plus ambiguity, theDefault - ...entry and unknown suffixes.device(nil)), pass with the fix.BlackHole2ch_UID | BlackHole 2ch, the name the stripped label now matches.Manual check remaining: a real HUD take on macOS with two inputs, choosing the non-default one (e.g.
BlackHole 2ch (Virtual)while the built-in mic is the default), to confirm no fallback toast and the right input in the audio.Summary by CodeRabbit