Skip to content

Explain stuck coreaudiod instead of a generic "Recording failed to start" - #1020

Merged
Beingpax merged 2 commits into
Beingpax:mainfrom
justadityaraj:fix/coreaudiod-not-running
Oct 18, 2026
Merged

Beingpax merged 2 commits into
Beingpax:mainfrom
justadityaraj:fix/coreaudiod-not-running

Conversation

@justadityaraj

@justadityaraj justadityaraj commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

#1018

When coreaudiod gets wedged, AudioOutputUnitStart (or an earlier AUHAL call on the retry) returns kAudioHardwareNotRunningError ('stop'). Recorder folded that into couldNotStartRecording, so the user only saw "Recording failed to start", and restarting VoiceInk did nothing.

Made three changes:

  • CoreAudioRecorderError gets a status property so the OSStatus can be read from any case.
  • Recorder throws a new RecorderError.audioSystemNotRunning when that status is 'stop'.
  • recordingAudioFailure maps it the same way as noUsableMicrophone: a specific message plus a "Restart Audio" button that runs killall coreaudiod through the admin password prompt.

Added de/fr/zh-Hans strings to match the catalog.

Before:
before

After:
after

Built locally with Xcode 27. Checked in a debug build that the real toast shows and that the status match fires for 'stop' and not for other codes. I couldn't wedge coreaudiod on demand, so the full fail, restart, record loop wasn't run end to end. The restart command is the one that fixed it on my machine.

The admin prompt says up front that sound in all apps will cut out for a moment.

Not covered: the mid-recording device switch path can hit the same status. Left it out to keep this small.

When coreaudiod gets wedged (usually after long uptime with many
sleep/wake cycles), AudioOutputUnitStart fails with
kAudioHardwareNotRunningError ('stop'). Recorder folded that into
couldNotStartRecording, so the user only saw "Recording failed to
start". Restarting VoiceInk doesn't help because the broken state lives
in coreaudiod, which only an admin can restart.

Detect that status and show a specific message with a "Restart Audio"
action that runs `killall coreaudiod` through the standard admin
password prompt.

Closes Beingpax#1018

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

…failures

The Restart Audio action now passes a localized prompt to the admin
dialog, so the user sees that sound in all apps will cut out before
confirming, instead of a generic osascript prompt. A failed launch or a
non-zero osascript exit (including a cancelled prompt) is logged.
@Beingpax
Beingpax merged commit d791c15 into Beingpax:main Oct 18, 2026
2 checks passed
@justadityaraj
justadityaraj deleted the fix/coreaudiod-not-running branch October 18, 2026 14:34
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.

2 participants