Repository navigation
Skip the engine warmup when the pinned recorder will record - #1874
Merged
Merged
Conversation
#1857 moved built-in and wired mics onto the pinned recorder, but the warmup check still only skipped the engine for a Bluetooth macOS input. So after a wake or route change, a key press warmed AVAudioEngine on the default mic, waited for it, then recorded through the recorder anyway (233 and 327 ms starts in local logs, against about 110 ms normally). - PinnedDictationInputPolicy.skipsEngineWarmup decides warmup from the same selection and recorderIsNeeded rule the start uses, so the two can't drift apart again. A Bluetooth macOS input still never warms. - After a fallback to the engine, warmup runs again until the recorder next starts, so a repeat fallback isn't also a cold start. - Fast tests pin the agreement, the Bluetooth guard and the fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps #1880's speed-path fallback and this branch's warmup rule. Warmup now asks the same question the recorder does, including whether empty takes moved the mic back to the engine, so that mic's engine stays warm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
r3dbars
added a commit
that referenced
this pull request
Sep 28, 2026
Speech CLAUDE.md: keeps main's warmup sentence (#1874) and this branch's 0.5 s rule for empty takes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 28, 2026
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.
Why
#1857 moved built-in and wired mics onto the pinned recorder. But
pinnedDictationSkipsEngineWarmup()still only skipped the engine when the macOS input was a Bluetooth headset.So after a wake or route change (readiness stale), a key press warmed
AVAudioEngineon the default mic, waited for it, then recorded through the pinned recorder anyway. That start never uses the engine.From local
events.jsonlon 1.1.65+:debug.logshowsstarted after 289ms waitwhile the engine warmed the MacBook mic, thenrecording started on the pinned microphone.What changed
PinnedDictationInputPolicy.skipsEngineWarmup(for:afterEngineFallback:)decides warmup from the samepinnedDictationInputSelection()andrecorderIsNeededrule the start uses, so the two can't drift apart again.pinnedDictationFellBackToEngineturns warmup back on until the recorder next starts. That way a repeat fallback isn't also a cold start.Sources/Speech/CLAUDE.md.Tradeoff: built-in and wired mic users no longer get the engine prewarmed at launch or wake. So the first fallback after launch starts cold. Field data: 4 fallbacks in 117 pinned starts over 30 days, all from one install. Local: 0.
Verification
bash build.sh --no-open: passbash run-tests.sh: 18514 / 18514 passpython3 scripts/dev/check-source-pins.py --changed-only: passNot verified on hardware. A live A/B (switch the macOS input to the MacBook mic, then dictate) was started but not finished. Plan: after merge, compare pinned starts that follow a route change, plus
dictation_started_after_waitcounts, inevents.jsonlbefore and after.🤖 Generated with Claude Code