r/raspberry_pi • u/Vegetable_Local_6168 • 22h ago
Show-and-Tell I built Sonora, a lightweight Raspberry Pi Hi-Fi audio OS with a custom Rust engine and CamillaDSP
Hi everyone,
I wanted to share Sonora, an audio OS I've been building over the past few months for Raspberry Pi (2, 3, 4 and 5, both 32-bit and 64-bit, headless or as a local touch kiosk).
Why I built it & the hardest parts
I started this project because I wanted a dedicated audio player that stays genuinely responsive even on older hardware like a Pi 2 or 3B (1 GB), without heavy background services or constant SD card wear. Instead of wrapping MPD, I wrote my own audio daemon in Rust (MPRS, speaking the MPD protocol on port 6600), paired with a Go backend and a WebUI served directly from RAM.
The hardest parts were:
- getting real-time DSD-to-PCM FIR decimation cheap enough for older Pis without causing ALSA xruns
- dealing with broken/non-standard ADTS AAC web radio streams
- handling NAS network dropouts over Wi-Fi without stalling the USB audio bus
- keeping the Chromium kiosk's CPU/RAM usage in check on 1 GB boards
On a headless Pi 3B, the whole OS now uses ~288 MB of RAM during playback, with mprs at ~3.5% CPU and camilladsp at ~3.1% CPU.
Main features
- Custom Rust audio engine (MPRS): gapless playback, bit-perfect ALSA output, DSD over PCM (DoP) passthrough for compatible DACs, plus DSD-to-PCM conversion (32:1 Kaiser FIR decimation) for PCM-only DACs or when DSP is active
- Built-in CamillaDSP & CamillaGUI: real-time room correction and parametric EQ, with software volume using a cubic volume curve
- USB Audio CD transport: bit-perfect CD playback and ripping from external USB optical drives
- Sources & integrations: USB/NVMe drives, multiple SMB/NFS NAS shares, web radio, Spotify Connect (spotifyd), AirPlay (shairport-sync), UPnP/DLNA (upmpdcli) and Bluetooth sink
- Privacy: no Sonora cloud account required, zero telemetry
Status, licensing & tested hardware
- Status: active public beta with OTA updates (v1.0.199)
- License: Sonora's own components (MPRS, Go backend, WebUI) are closed source and free for personal use (no plans to open-source them at this time). All bundled open-source components (Linux, CamillaDSP, CamillaGUI, spotifyd, shairport-sync, upmpdcli, etc.) remain under their respective licenses, listed in the WebUI credits.
- Tested hardware: Raspberry Pi 2B, 3B, 3B+, 4B, 5 and Allo USBridge Signature, with UAC2 USB DACs (RME ADI-2, Topping, SMSL) and I2S/S/PDIF HATs (Allo Boss, DigiOne, HiFiBerry, InnoMaker, ES9038Q2M/AK4493 boards)
More details and SD card images: https://sonora-os.pages.dev/en.html
I'd really appreciate any technical feedback or questions about the audio pipeline.