Overview
Acoustic monitoring is fundamental to biodiversity assessment — species classifiers, event detectors, sound level meters, spectrogram generators, and archival systems each need access to the same audio data, potentially at different times and in different formats.
ws-audiod solves this by acting as shared audio infrastructure. The daemon maintains exclusive ALSA device ownership and distributes samples to any number of concurrent consumers via shared memory (zero-copy) or Unix domain sockets. Consumer crashes are isolated — no single failed classifier or recorder can bring down the audio capture.
Why It Matters
On Linux-based embedded systems, an ALSA PCM device can typically only be opened by a single process at any given time. Software mixing plugins like dsnoop introduce latency and restrict format negotiation. PulseAudio and PipeWire add unnecessary complexity to headless embedded deployments. ws-audiod provides reliable, shared audio infrastructure without reimplementing low-level ALSA capture and distribution logic.
Key Features
- Continuous capture with zero sample loss
- Concurrent multi-consumer access via C++ and Python client libraries
- On-demand audio clip extraction from rolling buffer
- Pre-event and post-event clip extraction
- Zero-copy sample distribution via POSIX shared memory
- Gapless block recording (consecutive fixed-duration files with zero inter-file sample gap)
- Configurable sample rate, bit depth, and channel count
- WAV and FLAC output formats
- Gain control and DC offset removal
- Multi-device support (multiple daemon instances)
- Live terminal level meter with gain control (audiod-mon)
Quick Start
sudo apt update
sudo apt install -y cmake build-essential libasound2-dev libsndfile1-dev pkg-config
git clone https://github.com/Wildlife-Systems/ws-audiod.git
cd ws-audiod
mkdir build && cd build
cmake ..
make -j4
sudo make installSource Code
ws-audiod is open source and available on GitHub.