$ show HEnquist/camilladsp
CamillaDSP is a real-time audio stream processing engine written in Rust. It captures audio from a configurable backend (ALSA, PulseAudio, PipeWire, CoreAudio, WASAPI, ASIO, or file), processes it through a user-defined pipeline of filters, mixers, compressors, and other DSP components, and outputs it to a playback device. The pipeline is defined via YAML configuration, supporting biquad filters, FIR convolution (with hand-optimized NEON and AVX+FMA SIMD kernels), loudness, limiting, noise gates, and dithering. A websocket-based control interface allows runtime adjustments of volume, mute, faders, and config reloads. The architecture is modular with separate threads for capture, processing, and playback, using a PI rate controller for buffer level regulation. Benchmarks demonstrate attention to performance. While primarily an application, the DSP filter implementations and utility components (ring buffer, conversion routines, rate controller) are reusable building blocks for audio software.
The LLM identified 4 files worth highlighting for reuse:
Implements real-time FFT-based convolution for FIR filtering using the realfft crate. Includes platform-specific SIMD kernels for complex multiplication and multiply-add (AVX+FMA on x86_64, NEON on aarch64). Demonstrates advanced DSP pattern with segmented overlap-save convolution in a reusable Filter trait implementation.
Generates biquad filter coefficients for over 20 filter types (lowpass, highpass, peaking, shelving, notch, allpass, Linkwitz-Riley, etc.) with parameter validation. Encapsulates coefficient calculation and filter state management in a clean, stateless function interface, making it a reusable building block for audio processing.
Provides a full-duplex WebSocket control interface using a command/reply pattern. Commands are parsed into an enum, dispatched to handlers, and replied with structured JSON. Supports ~80 operations including volume, mute, faders, config management, signal level queries, and device enumeration. The pattern is extensible and could be reused for other real-time control applications.
A simple yet safe ring buffer implementation using the ringbuf crate, used for lock-free transfer of audio data between audio callback threads and processing threads. Demonstrates a common producer-consumer pattern suitable for real-time systems.