The audio engine queues sound-control commands (PATCH, PAN, PLAY,
STOP, etc.) into an sfifo for the audio thread to consume from inside
_run_commands(). The FIFO was sized at 128 commands, which was fine
under SDL 1.2's push-callback model: the driver fired callbacks at a
predictable cadence that drained the FIFO promptly.
SDL 3's pull-stream model on macOS calls our audio callback ~25-30 ms
apart with 4096-byte (1024-sample) chunks. Under sustained
multi-channel activity (e.g. holding fire in Classic mode, where
xkobo_shot generates several commands per shot at ~33 Hz), the FIFO
fills faster than the audio thread drains it and overflows. Each
overflowed command is a silently dropped sound event — audibly
manifest as unevenly-spaced shot sounds.
Bumping to 1024 gives the FIFO plenty of headroom (the drain rate at
~250 Hz handles thousands of commands/sec; the FIFO only needs to
absorb burst arrivals between drain ticks).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>