This guide explains how to implement Digital Signal Processing (DSP) in your HiFi processing chain using a headless Linux server, CamillaDSP, and JellyCLI.
- System Overview
- Prerequisites
- Linux Audio Architecture
- Installation
- Configuration
- Deployment
- Testing
- Troubleshooting
- System Architecture
The setup consists of three main components:
- ALSA Loopback Device - Virtual sound card for internal routing
- CamillaDSP - Real-time audio processing engine
- JellyCLI - Headless music player client for Jellyfin
The audio flow is:
JellyCLI → Loopback Device → CamillaDSP → Physical Sound Card → Speakers/DAC
- Linux system with Docker installed
- ALSA utils (
alsa-utils
package) - Working sound card and DAC setup
- Docker and Docker Compose
- Jellyfin server
- JellyCLI configured and tested
ALSA (Advanced Linux Sound Architecture) provides:
- Hardware abstraction
- Device enumeration
- PCM (audio) routing
- Mixer controls
- Load the module:
sudo modprobe snd-aloop
- Verify the loopback device:
aplay -l | grep Loopback
- Make it persistent by adding to
/etc/modules
:
echo "snd-aloop" | sudo tee -a /etc/modules
- Clone this repository:
git clone https://github.com/bkutasi/headless-camilladsp
cd headless-camilladsp
- Build CamillaDSP Docker image:
docker build -t camilladsp .
Adjust the device settings in config.yml
:
- Set capture device to
hw:Loopback,1,0
for ALSA loopback input - Configure playback device to match your DAC hardware
- Ensure sample rates are compatible with your audio hardware
- Configure filters and EQ settings as desired
- Optional: Follow audio tuning guides to optimize sound quality
NOTE: Make sure that the Loopback,1 device is used for capture since that is the "input" of the loopback device. You then can use the Loopback,0 device for playback which is the "output" of the loopback device.
- List all audio devices:
aplay -l
arecord -l
- Test loopback device:
speaker-test -D hw:Loopback,1,0 -c 2
docker run -it --rm \
--name camilladsp \
--device /dev/snd:/dev/snd \
--group-add $(getent group audio | cut -d: -f3) \
-v /path/to/config.yml:/root/camilladsp/config.yml \
-v /path/to/filters:/root/camilladsp/filters \
camilladsp
-
Ensure you have a Jellyfin server running. You can download and install Jellyfin from here.
-
Install JellyCLI by following the instructions in the JellyCLI repository.
-
Configure JellyCLI by creating a configuration file. You can find a sample configuration file in the JellyCLI repository.
-
Verify your soundcard is recognized by the system:
docker run -it --rm \
--name jellycli \
--device /dev/snd \
--env ALSA_CARD=Loopback \
-v ~/jellycli-config/jellycli-conf:/root/.config \
tryffel/jellycli --no-gui
- Test audio routing:
# Play test tone to loopback device
speaker-test -D hw:Loopback,1,0 -c 2 -t sine
# Record from loopback device
arecord -D hw:Loopback,0,0 -f cd test.wav
- Verify DSP processing:
# Monitor CPU usage
docker stats camilladsp
# Check CamillaDSP logs
docker logs -f camilladsp
- Test end-to-end:
# Play audio file through the chain
ffplay -nodisp -autoexit -f alsa hw:Loopback,1,0 test.mp3
- No Sound
- Check ALSA mixer levels:
alsamixer
- Verify device permissions:
ls -l /dev/snd/*
- Check Docker audio group:
groups
- Audio Glitches
- Increase buffer size in
config.yml
- Check CPU usage and system load
- Verify sample rates match
- Device Busy
# List processes using sound devices
fuser -v /dev/snd/*
# Reset ALSA
sudo alsa force-reload
- ALSA configuration:
cat /proc/asound/cards
cat /proc/asound/modules
- Monitor CamillaDSP:
# View detailed logs
docker logs camilladsp -f --tail 100
# Check CPU usage
top -p $(pgrep camilladsp)
- Audio routing test:
# Record processed output
arecord -D hw:YourDAC,0 -f cd output.wav
flowchart TB
JF[Jellyfin Server]
JC[JellyCLI]
LP[ALSA Loopback]
CD[CamillaDSP]
DAC[Sound Card/DAC]
SP[Speakers]
JF -->|"Stream music"| JC
JC -->|"Audio"| LP
LP -->|"Capture"| CD
CD -->|"Processed audio"| DAC
DAC -->|"Analog"| SP
style JF fill:#3b82f6,stroke:#1e40af,color:#ffffff
style JC fill:#f97316,stroke:#c2410c,color:#ffffff
style LP fill:#8b5cf6,stroke:#5b21b6,color:#ffffff
style CD fill:#f97316,stroke:#c2410c,color:#ffffff
style DAC fill:#22c55e,stroke:#15803d,color:#ffffff
style SP fill:#22c55e,stroke:#15803d,color:#ffffff
- Jellyfin Server → Streams your music library
- JellyCLI → Receives and plays the stream
- ALSA Loopback → Virtual sound card for routing
- CamillaDSP → Processes audio (EQ, filters)
- Sound Card/DAC → Converts to analog
- Speakers → Final audio output
For issues, improvements, or discussions, please open a ticket in the repository.
- CamillaDSP: HEnquist/camilladsp
- JellyCLI: tryffel/jellycli