How alexanderpach/low-latency-audio-pipeline works
LLAP generates a 440 Hz sine wave on a producer thread, publishes samples to a lock-free single-producer/single-consumer ring buffer, and uses miniaudio’s playback callback to consume them for the audio device. The user starts and stops this runtime through the console. The graph preserves the audio backend and the queue’s cache-line support; miniaudio’s implementation was not sampled, so its internal behavior is not expanded here.
Main entry points: LLAP.cpp Pipeline runtime · audio_engine.h Audio engine · SPSCDisruptor.cpp SPSC ring buffer · miniaudio.h Miniaudio backend
Components 8
Runtime control
- Pipeline runtime
LLAP.cpp - Tone producer
LLAP.cpp
Audio playback
- Audio engine
audio_engine.h - Miniaudio backend
miniaudio.h
Lock-free buffer
- SPSC ring buffer
SPSCDisruptor.cpp - Cache-line support
disruptor.h
Other components
- Console user
- Audio device
Connections 9
- Console user → Pipeline runtime: starts and stops
LLAP.cpp - Pipeline runtime → Tone producer: launches thread
LLAP.cpp - Pipeline runtime → Audio engine: creates and controls
LLAP.cpp - Pipeline runtime → Audio engine: gets queue
LLAP.cpp - Tone producer → SPSC ring buffer: publishes samples
LLAP.cpp - Audio engine → SPSC ring buffer: consumes samples
audio_engine.h - Audio engine → Miniaudio backend: configures playback
audio_engine.h - Miniaudio backend → Audio device: outputs audio
README.md - SPSC ring buffer → Cache-line support: uses cache-line size
SPSCDisruptor.cpp