Skip to content

Crash: MicLevelMonitor.start() crashes on headless Mac (no audio input device) #4163

@RR-610

Description

@RR-610

Description

Moltbot.app crashes with SIGABRT when navigating to the Voice Wake settings panel on a headless Mac mini (no audio input device connected).

Environment

  • Device: Mac mini M4 (Mac16,10), 16GB RAM
  • OS: macOS 26.2 (25C56)
  • App version: 2026.1.27-beta.1 (debug build, ad-hoc signed)
  • Bundle ID: bot.molt.mac.debug
  • Mode: Local, headless (no display/mic/speaker connected)

Steps to Reproduce

  1. Run Moltbot.app on a headless Mac mini with no audio input device
  2. Open Settings (right-click menu bar icon)
  3. Navigate to the Voice Wake / voice control settings panel
  4. App crashes immediately

Crash Analysis

The crash is a SIGABRT caused by an uncaught NSException from AVAudioEngine:

Exception Type: EXC_CRASH (SIGABRT)
Termination: abort() called

Last Exception Backtrace:
  __exceptionPreprocess
  objc_exception_throw
  +[NSException raise:format:]
  AVAudioEngineImpl::InstallTapOnNode(...)  ← exception thrown here
  -[AVAudioNode installTapOnBus:bufferSize:format:block:]
  MicLevelMonitor.start(onLevel:)           ← app code entry
  VoiceWakeSettings.restartMeter()
  closure #4 in VoiceWakeSettings.body.getter

Additionally, system log shows on startup:

HALDefaultDevice.cpp:746 Could not find default device

Root Cause

MicLevelMonitor.start() calls AVAudioNode.installTapOnBus() without verifying that a valid audio input device exists. On headless Macs with no microphone, AVAudioEngine's input node has no associated device, causing installTap to throw an NSException.

Suggested Fix

In MicLevelMonitor.start(onLevel:), check for a valid input device before installing the tap:

// Before installing tap, verify input device exists
let inputNode = engine.inputNode
guard inputNode.inputFormat(forBus: 0).channelCount > 0 else {
    // No input device available — skip mic monitoring
    return
}

Or wrap in a do/catch with ObjC exception handling since installTap throws an ObjC exception (not a Swift error).

Crash Report

Full .ips crash report available: Moltbot-2026-01-29-113240.ips

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions