PeteSahat
Member
- Joined
- Dec 28, 2023
- Messages
- 30
- Likes
- 10
Hey everyone!
This is a guide on how to properly set-up the Audio Injector interface with CamillaDSP on an RPi 4 using the JACK Audio API for an ultra low-latency audio system.
Multi-channel audio interfaces for the Raspberry Pi are quite rare, so this guide might be useful for some.
It took me a while to figure out the correct procedure, as the Octo project appears abandoned, and many users reported routing issues and random channel swapping—with no clear solution available.
Raspberry Pi 4 with Audio Injector Octo – Installation Guide
NOTE: This guide shows how to install the Octo audio interface along with CamillaDSP and the JACK Audio API on an RPi 4 without random channel swapping issues. All other audio interfaces of the Pi are disabled in this example. The result is a very low latency audio system.
1. Basic Installation
1.1 Install the Operating System:
Use Raspberry Pi Imager
OS: Raspberry Pi OS Lite (64-bit)
Set up network, SSH, and user account (this guide assumes the username is pi; if using a different username, adjust commands accordingly).
1.2 Update the System:
sudo apt update && sudo apt full-upgrade -y
2. Audio Configuration
2.1 Edit config.txt:
sudo nano /boot/firmware/config.txt
#Edit these entries or add if non-existent:
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on
#dtparam=audio=on
dtoverlay=vc4-kms-v3d,noaudio
#at the very bottom of the file add:
dtoverlay=audioinjector-addons
#save and reboot
3. Install JACK Audio Server
3.1 Install JACK with real time permission:
sudo apt install jackd2
3.2 Configure Real-Time Priority:
sudo adduser $USER audio #most likely already added
sudo nano /etc/security/limits.d/audio.conf
#Content looks like:
@audio - rtprio 95
@audio - memlock unlimited
#@audio - nice -19
3.3 Install Development Packages:
sudo apt install -y build-essential git cmake pkg-config libasound2-dev libjack-jackd2-dev libsamplerate0-dev
3.4 Set Up JACK Autostart Service:
sudo nano /etc/systemd/system/jackd.service
#Content:
[Unit]
Description=JACK Audio Daemon
After=alsa-restore.service
Requires=alsa-restore.service
[Service]
User=pi
Environment=JACK_NO_AUDIO_RESERVATION=1
LimitRTPRIO=95
LimitMEMLOCK=infinity
ExecStart=/usr/bin/jackd -P95 -d alsa -d hw:0 -r 48000 -p 128 -n 3
Restart=on-failure
[Install]
WantedBy=multi-user.target
#Enable and start the service:
sudo systemctl enable jackd.service
sudo systemctl start jackd.service
sudo reboot
#Check if Jack is running properly:
sudo systemctl status jackd.service
4. Install CamillaDSP
4.1 Install Rust and Cargo:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
#reboot
4.2 Install Dependencies:
sudo apt update
sudo apt install git
4.3 Clone CamillaDSP:
git clone https://github.com/HEnquist/camilladsp.git
cd camilladsp
4.4 Compile with JACK Support:
RUSTFLAGS='-C target-feature=+neon -C target-cpu=native' cargo build --release --features jack-backend,websocket
4.5 Create Service Files:
mkdir -p ~/camilladsp/coeffs ~/camilladsp/configs
sudo wget https://raw.githubusercontent.com/mdsimon2/RPi-CamillaDSP/main/camilladsp.service -O /lib/systemd/system/camilladsp.service
4.6 Adjust ExecStart in Service File and change username:
sudo nano /lib/systemd/system/camilladsp.service
#add your username username
#Change this line to:
ExecStart=/home/pi/camilladsp/target/release/camilladsp -s /home/pi/camilladsp/statefile.yml -w -g-0 -o /home/pi/camilladsp/camilladsp.log -p 1234
4.7 Enable and Start Service:
sudo systemctl enable camilladsp
sudo service camilladsp start
5. Install CamillaDSP GUI
5.1 Install Web Interface:
wget https://github.com/HEnquist/camillagui-backend/releases/download/v3.0.2/bundle_linux_aarch64.tar.gz -O ~/camilladsp/bundle_linux_aarch64.tar.gz
sudo tar -xvf ~/camilladsp/bundle_linux_aarch64.tar.gz -C /opt/
5.2 Set Up GUI Service:
sudo wget https://raw.githubusercontent.com/mdsimon2/RPi-CamillaDSP/main/camillagui.service -O /lib/systemd/system/camillagui.service
sudo nano /lib/systemd/system/camillagui.service # Adjust username if needed
5.3 Enable and Start GUI Service:
sudo systemctl enable camillagui
sudo service camillagui start
5.4 Reboot:
sudo reboot
6. Verification
#Check status:
sudo systemctl status jackd.service
sudo systemctl status camilladsp
sudo systemctl status camillagui
#Web Interface:
http://<yourPI-IP>:5005/gui/index.html
7. Kernel Downgrade (Required, otherwise Octo will not work!)
sudo rpi-update f5c4fc199c8d8423cb427e509563737d1ac21f3c
sudo reboot
8. Camilla setup
In the Camilla webgui under "Devices" > Capture & Playback Devices choose JACK
Chunksize can be reduced for very low latency values - 32 is absolutely safe. Check ExecStart=/usr/bin/jackd -P95 -d alsa -d hw:0 -r 48000 -p 128 -n 3 in ExecStart=/usr/bin/jackd -P95 -d alsa -d hw:0 -r 48000 -p 128 -n 3 for further latency adjustmens. From here it is experimentation.
Create a new config under "Files" and mark it as active (the star button)
On the left hand side click "Apply and save".
You might need to adjust recording levels in alsamixer.
DONE!