Repository navigation
Conversation
Starting a recording from a hotkey with "confirm before recording without a microphone" on (the default) first called MicrophoneFeed::list(), which reads every input device's configuration. The Tauri confirm only matches the device name on macOS (microphone_available_for_confirmation); do the same here so the start isn't held up by a CoreAudio config scan.
This branch has not been deployed
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.
Starting a recording from a hotkey with "Confirm before recording without a microphone" turned on (it's on by default) first checks that the selected microphone is still there. In the GPUI app that check was
MicrophoneFeed::list().contains_key(name), which runsget_usable_deviceon every input device, and on the default device twice. The hotkey start waits on all of that before it does anything else.On macOS, the Tauri confirm only matches the name (
microphone_available_for_confirmationwithMicrophoneFeed::list_names()). This PR does the same in GPUI. Other platforms keeplist(), also as Tauri does.Results
From the existing
native_picker_latencybenchmark (cargo test --bin cap-gpui native_picker_latency -- --ignored --nocapture), with 10 samples on an M5 Max running macOS 27 with 2 input devices:microphone_metadata_all_devices(oneMicrophoneFeed::list()per device, 2 calls)tauri_device_inventory(list_cameras()plusMicrophoneFeed::list_names())So each
list()call that this removes from the hotkey path was about 140 ms at the median, with a worst case around a second.Tests
cargo test --bin cap-gpui hotkeys: 5 passed.cargo clippy --bin cap-gpuireports the same 7 existing warnings asmain, none inhotkeys.rs.Not yet tested
The hotkey start with a microphone selected, and the "No microphone detected" sheet for a missing one, still need hand-testing.