Repository navigation
Fall back to most recently used mic when no default is marked - #1604
Closed
vinicioslc wants to merge 7 commits into
Closed
vinicioslc wants to merge 7 commits into
vinicioslc wants to merge 7 commits into
Conversation
Closes thewh1teagle#1596 - Create indicator window hidden; show only after page_ready - Call set_ignore_cursor_events after show to avoid panic on hidden window - Show overlay on hotkey key-down before start_record - Fallback mic selection when no ALSA isDefault device matches - Denylist dictation-indicator in window-state (stale 280x200 restore) - Listen for indicator events before ready signal
Keep only universal dictation-indicator changes (hidden first paint, page_ready gate, window-state denylist, hotkey overlay on key-down). Revert ALSA/PipeWire default selection and recording-shortcut fallbacks. Refs thewh1teagle#1596
On hosts where default_input_device() never matches the enumerated list (common with ALSA via PipeWire), callers only checked isDefault and threw "No default microphone" even though inputs existed. findInputDevice now prefers: saved id → marked default → most recent activity → first input. Successful starts stamp activity so the next fallback prefers the mic that last worked. Applied to dictation hotkey, recording shortcut, and the recording tab.
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
On Linux (ALSA via PipeWire),
cpal'sdefault_input_device()often returns a synthetic name that never appears in the enumerated device list. No device is markedisDefault, so callers that only checkisDefaultthrow "No default microphone is available" even when mics are present:hotkey.tsx(dictation indicator)recording-shortcut.tsx(global recording shortcut)use-recording.ts(recording tab — saved id only, no fallback)Solution
Shared
findInputDevice()with a universal fallback chain:recording.recentInputDeviceActivity, stamped on every successfulstart_record)Applied to all three call sites. Explicit None (
savedInputDeviceId === '') in the recording tab is preserved.Tests
findInputDeviceinaudio.test.tstsc --noEmit: clean