PeteSahat
Member
- Joined
- Dec 28, 2023
- Messages
- 34
- Likes
- 25
Hi!
Volumio OS is probably one of the most convenient pieces of software for playing music, and even the free version offers quite a few features through its plugins.
However, for my preamp/streamer project, I naturally need the ability to play other audio sources.
So I've "downgraded" Volumio OS to being one of several sources. An analog source can now be selected in addition to the usual sources via the I2S ADC. In the same way, it should also be possible to implement an S/PDIF or Bluetooth input. In theory, Bluetooth output should also be possible this way.
The prerequisite for this is CamillaDSP as the "control center," where source selection and routing are handled via presets.
An important point: I'm not using Volumio's built-in Fusion DSP plugin, but rather a "real" CamillaDSP installation running in parallel on the Pi.
Volumio no longer sends the audio stream directly to the physical playback hardware. Instead, it writes the stream to the ALSA loopback device.
CamillaDSP reads this stream from the loopback capture device and then takes care of the further signal processing and output to the playback hardware.
For the D/A converter, I'm using the new WONDOM 8-channel USB DAC (https://store.sure-electronics.com/product/854).
There's nothing comparable available at this price. Multichannel DACs are pretty rare to begin with, and they're usually expensive.
For the ADC, I'm also using the PCM1822 from WONDOM (https://store.sure-electronics.com/product/813).
The ADC even offers balanced inputs, and since it operates as a slave, it doesn't require a master clock either, which simplifies the wiring.
With a selector switch, you can connect as many analog sources to the Pi as you like.
And with an I2S selector, the whole setup can also be cascaded, for example to accommodate additional digital sources. The possibilities are endless!
This makes it very easy to build a fully-fledged preamp/streamer/receiver with DSP for crossover management, room correction, and EQ.
Here is the installation guide:
Volumio + CamillaDSP Installation
This guide describes how to install CamillaDSP and CamillaGUI on Volumio and route the Volumio audio signal through ALSA Loopback.
Audio output is handled by the aforementioned USB DAC.
Prerequisite: The Linux username is volumio. If you use a different username, every occurrence of
/home/volumio
must be adjusted accordingly.
### 1. Flash Volumio
Flash Volumio onto the SD card.
### 2. Resize the Volumio partition
Use GParted or another partitioning tool to enlarge the volumio_data partition:
1. Select the partition:volumio_data
2. Expand the partition to use all available storage space.
### 3. Set up Volumio
1. Start Volumio and connect to the Volumio hotspot via Wi-Fi. The setup page should then open automatically in your browser.
2. Enter your network details and complete the setup. The Pi will then reboot.
3. Wait for the Pi to reconnect to the network.
4. Open: http://your-pi-ip/dev and enable SSH.
5. Connect to the Pi via SSH, either using PowerShell or, more conveniently, an SSH client. I use MUON on Linux.
### 4. Install CamillaDSP and its services, and create the Loopback device
1. Copy the following script and save it as setup.sh
2. Then copy the file to the Pi's home directory:
3. Make the file executable:
4. Then run it:
5. In the Volumio GUI, under Playback Options, select "Loopback" as the output device. Further down, set Mixer Type to "None". Volume control will be handled by CamillaDSP.
6. The CamillaGUI can now also be accessed in your browser at:
7. In CamillaGUI, open the Devices section and enter the following settings exactly as shown. CamillaDSP will only work correctly with these settings:
8. In the Mixer tab, create a mixer and configure it for 2 input channels and 8 output channels.
9. In the Pipeline tab, add the newly created mixer to the processing chain.
10. In the Files tab, give the configuration a name and save it. Then click the star (
) to mark the configuration as active. This ensures that this configuration will be used as the default configuration when the system starts.
NOTE: You can choose whatever sample rate you want in CamillaDSP. However, the DAC manual states: "The USB sound card only supports 48-kHz/16-bit or 48-kHz/24-bit." It's best to leave the sample rate at 48 kHz to minimize sample-rate conversion.
From this point onward, you can adapt CamillaDSP to your own requirements. But the basic setup is now complete.
Next, we'll install the PCM1822 as the capture device:
### 1. Copy the following script and save it as install_pcm1822.sh
### 2. Then copy the file to the Pi's home directory:
### 3. Make it executable
### 4. Run the script and reboot
Then reboot the Pi.
### 5. Set the ADC switches
Make sure all switches on the ADC are set to LOW (switches in the up position).
### 7. Connect the ADC to the Pi
Connect the ADC to the Raspberry Pi according to the pinout shown at pinout.xyz:
### 8. Configure CamillaGUI
In CamillaGUI, create a new configuration and give it a unique name.
The only change you need to make is to change the Capture Device to:
Voilà — you now have analog input via I2S!
Congratulations! You have now installed Volumio and an analog source on a Pi and can output 8 channels simultaneously. Camilla can be used as a crossover, EQ, and mixer, and—to a certain extent—for room correction.
This allows you to build an ultra-compact streamer/preamp/DSP—all for just under €100!
Volumio OS is probably one of the most convenient pieces of software for playing music, and even the free version offers quite a few features through its plugins.
However, for my preamp/streamer project, I naturally need the ability to play other audio sources.
So I've "downgraded" Volumio OS to being one of several sources. An analog source can now be selected in addition to the usual sources via the I2S ADC. In the same way, it should also be possible to implement an S/PDIF or Bluetooth input. In theory, Bluetooth output should also be possible this way.
The prerequisite for this is CamillaDSP as the "control center," where source selection and routing are handled via presets.
An important point: I'm not using Volumio's built-in Fusion DSP plugin, but rather a "real" CamillaDSP installation running in parallel on the Pi.
Volumio no longer sends the audio stream directly to the physical playback hardware. Instead, it writes the stream to the ALSA loopback device.
CamillaDSP reads this stream from the loopback capture device and then takes care of the further signal processing and output to the playback hardware.
For the D/A converter, I'm using the new WONDOM 8-channel USB DAC (https://store.sure-electronics.com/product/854).
There's nothing comparable available at this price. Multichannel DACs are pretty rare to begin with, and they're usually expensive.
For the ADC, I'm also using the PCM1822 from WONDOM (https://store.sure-electronics.com/product/813).
The ADC even offers balanced inputs, and since it operates as a slave, it doesn't require a master clock either, which simplifies the wiring.
With a selector switch, you can connect as many analog sources to the Pi as you like.
And with an I2S selector, the whole setup can also be cascaded, for example to accommodate additional digital sources. The possibilities are endless!
This makes it very easy to build a fully-fledged preamp/streamer/receiver with DSP for crossover management, room correction, and EQ.
Here is the installation guide:
Volumio + CamillaDSP Installation
This guide describes how to install CamillaDSP and CamillaGUI on Volumio and route the Volumio audio signal through ALSA Loopback.
Audio output is handled by the aforementioned USB DAC.
Prerequisite: The Linux username is volumio. If you use a different username, every occurrence of
/home/volumio
must be adjusted accordingly.
### 1. Flash Volumio
Flash Volumio onto the SD card.
### 2. Resize the Volumio partition
Use GParted or another partitioning tool to enlarge the volumio_data partition:
1. Select the partition:volumio_data
2. Expand the partition to use all available storage space.
### 3. Set up Volumio
1. Start Volumio and connect to the Volumio hotspot via Wi-Fi. The setup page should then open automatically in your browser.
2. Enter your network details and complete the setup. The Pi will then reboot.
3. Wait for the Pi to reconnect to the network.
4. Open: http://your-pi-ip/dev and enable SSH.
5. Connect to the Pi via SSH, either using PowerShell or, more conveniently, an SSH client. I use MUON on Linux.
ssh volumio@YOUR-PI-IP The password is volumio
### 4. Install CamillaDSP and its services, and create the Loopback device
1. Copy the following script and save it as setup.sh
Code:
#!/bin/bash
set -e
EFFECTIVE_USER="volumio"
INSTALL_ROOT="/home/$EFFECTIVE_USER"
CAMILLADSP_DIR="$INSTALL_ROOT/camilladsp"
CAMILLADSP_BINARY="$CAMILLADSP_DIR/camilladsp"
CAMILLAGUI_DIR="$INSTALL_ROOT/camillagui_backend"
CAMILLADSP_API="https://api.github.com/repos/HEnquist/camilladsp/releases/latest"
CAMILLAGUI_API="https://api.github.com/repos/HEnquist/camillagui-backend/releases/latest"
CAMILLADSP_ASSET="camilladsp-linux-armv7.tar.gz"
CAMILLAGUI_ASSET="bundle_linux_armv7.tar.gz"
log() {
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1"
}
mark_done() {
echo "$1 completed"
}
install_dependencies() {
log "Installing dependencies..."
sudo apt update
sudo apt install -y \
alsa-utils \
libasound2 \
curl \
wget \
ca-certificates
}
prepare_directories() {
log "Preparing installation directories..."
sudo mkdir -p \
"$CAMILLADSP_DIR" \
"$CAMILLADSP_DIR/coeffs" \
"$CAMILLADSP_DIR/configs"
sudo chown -R \
"$EFFECTIVE_USER:$EFFECTIVE_USER" \
"$CAMILLADSP_DIR"
}
install_loopback() {
log "Preparing ALSA loopback..."
echo "snd-aloop" | sudo tee \
/etc/modules-load.d/snd-aloop.conf >/dev/null
sudo modprobe snd-aloop || true
}
get_latest_asset_url() {
local api_url="$1"
local asset_name="$2"
curl -fsSL \
-H "Accept: application/vnd.github+json" \
"$api_url" |
grep '"browser_download_url":' |
grep "$asset_name" |
head -n 1 |
cut -d '"' -f 4
}
get_latest_version() {
local api_url="$1"
curl -fsSL \
-H "Accept: application/vnd.github+json" \
"$api_url" |
grep '"tag_name":' |
head -n 1 |
cut -d '"' -f 4
}
install_camilladsp() {
log "Installing latest CamillaDSP ARMv7 binary..."
local version
local download_url
local tmp_dir
version=$(get_latest_version "$CAMILLADSP_API")
download_url=$(get_latest_asset_url \
"$CAMILLADSP_API" \
"$CAMILLADSP_ASSET"
)
if [ -z "$download_url" ]; then
echo "ERROR: Could not find CamillaDSP ARMv7 release."
exit 1
fi
log "Latest CamillaDSP version: $version"
tmp_dir=$(mktemp -d)
log "Downloading CamillaDSP..."
sudo wget \
-q \
--show-progress \
"$download_url" \
-O "$tmp_dir/$CAMILLADSP_ASSET"
log "Installing CamillaDSP binary..."
sudo tar \
-xzf "$tmp_dir/$CAMILLADSP_ASSET" \
-C "$tmp_dir"
if [ ! -f "$tmp_dir/camilladsp" ]; then
echo "ERROR: CamillaDSP binary not found after extraction."
rm -rf "$tmp_dir"
exit 1
fi
sudo install \
-m 0755 \
"$tmp_dir/camilladsp" \
"$CAMILLADSP_BINARY"
sudo chown \
"$EFFECTIVE_USER:$EFFECTIVE_USER" \
"$CAMILLADSP_BINARY"
rm -rf "$tmp_dir"
log "CamillaDSP installed at:"
log "$CAMILLADSP_BINARY"
}
install_camilladsp_service() {
log "Installing CamillaDSP systemd service..."
cat <<EOF | sudo tee /etc/systemd/system/camilladsp.service >/dev/null
[Unit]
Description=CamillaDSP
After=network.target sound.target
[Service]
Type=simple
User=$EFFECTIVE_USER
WorkingDirectory=$CAMILLADSP_DIR
ExecStart=$CAMILLADSP_BINARY \
-s $CAMILLADSP_DIR/statefile.yml \
-w \
-g-40 \
-o $CAMILLADSP_DIR/camilladsp.log \
-p 1234
Restart=always
RestartSec=1
StandardOutput=journal
StandardError=journal
SyslogIdentifier=camilladsp
[Install]
WantedBy=multi-user.target
EOF
}
install_camillagui() {
log "Installing latest CamillaGUI backend..."
local version
local download_url
local tmp_dir
version=$(get_latest_version "$CAMILLAGUI_API")
download_url=$(get_latest_asset_url \
"$CAMILLAGUI_API" \
"$CAMILLAGUI_ASSET"
)
if [ -z "$download_url" ]; then
echo "ERROR: Could not find CamillaGUI ARMv7 release."
exit 1
fi
log "Latest CamillaGUI version: $version"
tmp_dir=$(mktemp -d)
log "Downloading CamillaGUI..."
sudo wget \
-q \
--show-progress \
"$download_url" \
-O "$tmp_dir/$CAMILLAGUI_ASSET"
log "Removing previous CamillaGUI installation..."
sudo rm -rf "$CAMILLAGUI_DIR"
log "Extracting CamillaGUI..."
sudo tar \
-xzf "$tmp_dir/$CAMILLAGUI_ASSET" \
-C "$INSTALL_ROOT"
rm -rf "$tmp_dir"
if [ ! -x "$CAMILLAGUI_DIR/camillagui_backend" ]; then
echo "ERROR: CamillaGUI backend not found after extraction."
exit 1
fi
sudo chown -R \
"$EFFECTIVE_USER:$EFFECTIVE_USER" \
"$CAMILLAGUI_DIR"
log "CamillaGUI installed at:"
log "$CAMILLAGUI_DIR"
log "Using CamillaGUI default configuration paths."
}
install_camillagui_service() {
log "Installing CamillaGUI systemd service..."
cat <<EOF | sudo tee /etc/systemd/system/camillagui.service >/dev/null
[Unit]
Description=CamillaDSP Backend and GUI
After=network.target camilladsp.service
Requires=camilladsp.service
[Service]
Type=simple
User=$EFFECTIVE_USER
WorkingDirectory=$CAMILLAGUI_DIR
ExecStart=$CAMILLAGUI_DIR/camillagui_backend
Restart=always
RestartSec=2
StandardOutput=journal
StandardError=journal
SyslogIdentifier=camillagui
[Install]
WantedBy=multi-user.target
EOF
}
enable_services() {
log "Enabling and starting services..."
sudo systemctl daemon-reload
sudo systemctl enable camilladsp.service
sudo systemctl enable camillagui.service
sudo systemctl restart camilladsp.service
sudo systemctl restart camillagui.service
}
show_status() {
log "Installation status:"
echo
sudo systemctl --no-pager --full status camilladsp.service || true
echo
sudo systemctl --no-pager --full status camillagui.service || true
echo
log "Listening ports:"
sudo ss -ltnp | grep -E ':1234|:5005' || true
echo
log "ALSA devices:"
aplay -l || true
}
###################################
# MAIN
###################################
log "Starting CamillaDSP installation on Volumio..."
install_dependencies
prepare_directories
install_loopback
install_camilladsp
install_camilladsp_service
install_camillagui
install_camillagui_service
enable_services
show_status
log "Installation complete."
2. Then copy the file to the Pi's home directory:
Code:
/home/volumio/
3. Make the file executable:
Code:
chmod +x setup.sh
Code:
sudo ./setup.sh
5. In the Volumio GUI, under Playback Options, select "Loopback" as the output device. Further down, set Mixer Type to "None". Volume control will be handled by CamillaDSP.
6. The CamillaGUI can now also be accessed in your browser at:
Code:
http://YOUR-PI-IP:5005/gui/index.html
7. In CamillaGUI, open the Devices section and enter the following settings exactly as shown. CamillaDSP will only work correctly with these settings:
Code:
Capture device: hw:CARD=Loopback,DEV=1
Playback device: hw:CARD=UCM,DEV=0
Sample rate: 48000
Capture channels: 2
Playback channels: 8
8. In the Mixer tab, create a mixer and configure it for 2 input channels and 8 output channels.
9. In the Pipeline tab, add the newly created mixer to the processing chain.
10. In the Files tab, give the configuration a name and save it. Then click the star (
NOTE: You can choose whatever sample rate you want in CamillaDSP. However, the DAC manual states: "The USB sound card only supports 48-kHz/16-bit or 48-kHz/24-bit." It's best to leave the sample rate at 48 kHz to minimize sample-rate conversion.
From this point onward, you can adapt CamillaDSP to your own requirements. But the basic setup is now complete.
Next, we'll install the PCM1822 as the capture device:
### 1. Copy the following script and save it as install_pcm1822.sh
Code:
#!/bin/bash
# PCM1822 ADC Installation Script for Volumio/Raspberry Pi
# This script installs the PCM1822 device tree overlay and systemd service
# to enable the PCM1822 ADC alongside the Wondom USB DAC
set -e
echo "=========================================="
echo "PCM1822 ADC Installation Script"
echo "=========================================="
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root (sudo)"
exit 1
fi
# 1. Create device tree overlay source file
echo "Creating device tree overlay source..."
cat > /tmp/pcm1822-i2s.dts << 'EOF'
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
fragment@0 {
target = <&i2s>;
__overlay__ {
status = "okay";
};
};
fragment@1 {
target = <&sound>;
sound_overlay: __overlay__ {
compatible = "simple-audio-card";
simple-audio-card,name = "pcm1822";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink0_cpu>;
simple-audio-card,frame-master = <&dailink0_cpu>;
status = "okay";
dailink0_cpu: simple-audio-card,cpu {
sound-dai = <&i2s>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <32>;
};
simple-audio-card,codec {
sound-dai = <&i2s>;
system-clock-frequency = <12288000>;
};
};
};
__overrides__ {
card-name = <&sound_overlay>,"simple-audio-card,name";
};
};
EOF
# 2. Compile device tree overlay
echo "Compiling device tree overlay..."
dtc -@ -I dts -O dtb -o /boot/overlays/pcm1822-i2s.dtbo /tmp/pcm1822-i2s.dts
# 3. Remove overlay from config.txt if present
echo "Checking config.txt..."
if grep -q "dtoverlay=pcm1822-i2s" /boot/config.txt; then
echo "Removing existing overlay from config.txt..."
sed -i '/dtoverlay=pcm1822-i2s/d' /boot/config.txt
fi
# Ensure I2S is enabled
if ! grep -q "dtparam=i2s=on" /boot/config.txt; then
echo "Enabling I2S in config.txt..."
echo "dtparam=i2s=on" >> /boot/config.txt
fi
# 4. Create systemd service
echo "Creating systemd service..."
cat > /etc/systemd/system/load-pcm1822-overlay.service << 'EOF'
[Unit]
Description=Load PCM1822 overlay after USB initialization
After=multi-user.target
Wants=multi-user.target
[Service]
Type=oneshot
ExecStart=/usr/bin/dtoverlay pcm1822-i2s
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
EOF
# 5. Enable and start systemd service
echo "Enabling systemd service..."
systemctl daemon-reload
systemctl enable load-pcm1822-overlay.service
systemctl start load-pcm1822-overlay.service
# 6. Verify installation
echo "Verifying installation..."
sleep 2
if systemctl is-active --quiet load-pcm1822-overlay.service; then
echo "✓ Systemd service is running"
else
echo "✗ Systemd service failed to start"
systemctl status load-pcm1822-overlay.service
fi
# 7. Check audio devices
echo ""
echo "Checking audio devices..."
echo "Playback devices:"
aplay -l
echo ""
echo "Capture devices:"
arecord -l
echo ""
echo "=========================================="
echo "Installation Complete!"
echo "=========================================="
echo ""
echo "Expected devices:"
echo " - Card 5: UCM [WONDOM UCM] (USB DAC - Playback)"
echo " - Card 6: pcm1822 [pcm1822] (ADC - Capture)"
echo ""
echo "CamillaDSP configuration:"
echo " capture:"
echo " device: \"hw:CARD=pcm1822,DEV=0\""
echo " playback:"
echo " device: \"hw:CARD=UCM,DEV=0\""
echo ""
echo "PCM1822 Hardware Configuration:"
echo " - All switches set to LOW (UP position)"
echo ""
echo "Reboot recommended to ensure all services start correctly."
echo "Run: sudo reboot"
### 2. Then copy the file to the Pi's home directory:
Code:
/home/volumio/
Code:
chmod +x install_pcm1822.sh
### 4. Run the script and reboot
Code:
sudo ./install_pcm1822.sh
Then reboot the Pi.
### 5. Set the ADC switches
Make sure all switches on the ADC are set to LOW (switches in the up position).
### 7. Connect the ADC to the Pi
Connect the ADC to the Raspberry Pi according to the pinout shown at pinout.xyz:
Code:
GND → physical pin 9
DATA → physical pin 38
BCLK → physical pin 12
LRCLK → physical pin 35
### 8. Configure CamillaGUI
In CamillaGUI, create a new configuration and give it a unique name.
The only change you need to make is to change the Capture Device to:
Code:
hw:CARD=pcm1822,DEV=0
Voilà — you now have analog input via I2S!
Congratulations! You have now installed Volumio and an analog source on a Pi and can output 8 channels simultaneously. Camilla can be used as a crossover, EQ, and mixer, and—to a certain extent—for room correction.
This allows you to build an ultra-compact streamer/preamp/DSP—all for just under €100!
Last edited: