Skip to content

Fix crash on launch when no audio input device is present - #950

Open
gabbe-swe wants to merge 2 commits into
Louis-CFM:mainfrom
gabbe-swe:fix/no-microphone-crash
Open

gabbe-swe wants to merge 2 commits into
Louis-CFM:mainfrom
gabbe-swe:fix/no-microphone-crash

Conversation

@gabbe-swe

@gabbe-swe gabbe-swe commented Oct 27, 2026 •

Copy link
Copy Markdown

Fixes #949

With no microphone connected (Mac mini, Mac Studio), the input node's hardware format reports 0 ch / 0 Hz and installTap raises an uncatchable NSException during app launch. The node's outputFormat still reports a synthetic 2 ch / 44.1 kHz format, so it cannot be used to detect the missing device.

Check inputFormat(forBus:) before installing the tap and bail out with a catchable error so the caller can show the unavailable state.

Patch by gabbe with Devin

Verified

 
On a Mac mini M4 (macOS 26.6.2) with no input device and voiceEnabled = 1:
 

  • Before: SIGABRT on every launch, VoiceAudio.start() → installTapOnBus
    in the crash trace.
  • After: app launches normally; log shows
    [Voice] no audio input device — pipeline skipped; voice features show the
    unavailable state and recover when a mic is connected
    (AVAudioEngineConfigurationChange handling is already in place).
     

Follow-ups (not in this patch)

 

  • The same guard may be worth adding in the other tap installers
    (MacDictation.swift, NoteAudio.swift, ParakeetEngine.swift) if they can
    run with no input device.
  • The voice pipeline could start lazily rather than from SettingsView.init(),
    so an audio failure can never block launch.

With no microphone connected (Mac mini, Mac Studio), the input node's
hardware format reports 0 ch / 0 Hz and installTap raises an
uncatchable NSException during app launch. The node's outputFormat
still reports a synthetic 2 ch / 44.1 kHz format, so it cannot be
used to detect the missing device.

Check inputFormat(forBus:) before installing the tap and bail out
with a catchable error so the caller can show the unavailable state.

Patch by [gabbe](https://github.com/gabbe-swe) with [Devin](https://devin.ai)

This branch has not been deployed

No deployments
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.

Coucou 0.5.3 crashes on launch when no microphone is present

1 participant