Skip to content

Standalone crashes on macOS (Apple Silicon) — CoreAudio delivers more samples than configured buffer #266

Description

@Hornfisk

Description

The standalone CPAL backend panics on macOS Apple Silicon when CoreAudio delivers more samples than the configured buffer/period size.

Reproduction

$ ./autokit-standalone --period-size 1024
thread 'cpal_alsa_out' panicked at 'Received 1115 samples, while the configured buffer size is 1024', src/wrapper/standalone/backend/cpal.rs:832

Same behavior at --period-size 512 (receives 558 samples). CoreAudio appears to deliver variable-sized buffers that consistently exceed the requested size.

Workaround: --period-size 4096 avoids the panic but adds ~85ms of latency, which is noticeable for percussive instruments.

Environment

  • macOS 15, Apple M1
  • nih-plug standalone (CPAL backend)
  • VST3 and CLAP builds work fine in DAWs — the host manages buffer sizes correctly there

Expected behavior

The standalone backend should handle CoreAudio's variable buffer sizes without panicking — either by processing incoming audio in chunks of buffer_size, or by dynamically sizing the output storage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions