• Welcome to ASR. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

RPi + CamillaDSP Tutorial

Thanks!

It looks like camilladsp is running, but there is an issue with the GUI.

My guess is that you did not update camillagui.service to reflect your username:

Process: 24195 ExecStart=/home/username/camilladsp/camillagui_backend/camillagui_backend (code=exited, status=203/E

You need to update both the User and ExecStart lines. You can see from the camillagui.service screenshot below that my username is michael1 and both fields are updated.

1740669853318.png


Update camillagui.service to reflect your username, run "sudo systemctl daemon-reload" and "sudo service camillagui restart".

Michael
 
Thanks!

It looks like camilladsp is running, but there is an issue with the GUI.

My guess is that you did not update camillagui.service to reflect your username:

Process: 24195 ExecStart=/home/username/camilladsp/camillagui_backend/camillagui_backend (code=exited, status=203/E

You need to update both the User and ExecStart lines. You can see from the camillagui.service screenshot below that my username is michael1 and both fields are updated.

View attachment 431939

Update camillagui.service to reflect your username, run "sudo systemctl daemon-reload" and "sudo service camillagui restart".

Michael
Thanks a lot for your very quick reply, Michael! I missed the change in ExecStart but I have updated it and it's working now!
 
Glad to hear it worked! I am surprised you are the first person to raise this issue TBH. The new self-contained GUI environment is great, but you need to specify the absolute path to run it.

Now I am wondering if there is a more appropriate place to install it. Seems like /opt/ works and is an appropriate directory. Any input from folks with Linux knowledge?

Michael
 
I guess noone has overlooked this before... Anyway, I'm glad it's up and running!

Just one more thing, though. I use a Hifiberry DAC+DSP hat. Should I specify that anywhere specific? I tried the method for the DAC8x yiu mention in the tutorial but when I open the file with Nano nothing has changed and the Hifiberry is not there.
 
Are you talking about the dtoverlay in config.txt? DAC+DSP uses dtoverlay=hifiberry-dac (https://www.hifiberry.com/docs/data-sheets/datasheet-dac-dsp/) which is different from the dac8x.

If you run "echo 'dtoverlay=hifiberry-dac' | sudo tee -a /boot/firmware/config.txt > /dev/null" it should add dtoverlay=hifiberry-dac to end the end of config.txt (you might have to scroll down to see it). You can also just edit config.txt in nano and add it that way.

Michael
 
Now I am wondering if there is a more appropriate place to install it. Seems like /opt/ works and is an appropriate directory. Any input from folks with Linux knowledge?
The reference would be Filesystem Hierarchy Standard.
/opt is the right place for non-packaged things that have one directory per application, with all its files in a tree under that directory.
/usr/local is also for non-packaged things, but puts files in a directories similar to the usual /usr layout (bin, lib, include etc.)

From the paths you're giving it looks like /opt would be the correct place.
 
A few small updates to the tutorial in the name of simplicity.

GUI is now installed in /opt/camillagui_backend/. As a result, only the "User" field needs to be updated in camillagui.service. For existing users this requires an update to camillagui.service.

Python virtual environment is now installed in /opt/venv/. As above this means only the "User" field needs to be updated in flirc.service and oled.service. Again, for existing users this requires updates to flirc.service and oled.service.

All example configurations now use the sample chunk size / target levels and added some guidance of how to achieve lower latency.

Michael
 
A few small updates to the tutorial in the name of simplicity.

GUI is now installed in /opt/camillagui_backend/. As a result, only the "User" field needs to be updated in camillagui.service. For existing users this requires an update to camillagui.service.

Python virtual environment is now installed in /opt/venv/. As above this means only the "User" field needs to be updated in flirc.service and oled.service. Again, for existing users this requires updates to flirc.service and oled.service.

All example configurations now use the sample chunk size / target levels and added some guidance of how to achieve lower latency.

Michael
Missing "pip3 install lgpio" from the "OLED Display" section.
 
Not needed on raspberry pi os as it is installed by default. That has been removed from the tutorial for some time.
That's odd I needed it to get the display working for me. Maybe because I haven't started from scratch in a while?
 
That's odd I needed it to get the display working for me. Maybe because I haven't started from scratch in a while?

Hmm, its possible. Unfortunately, my two setups with displays get reloaded pretty frequently as I am testing new version of the tutorial. I try to keep in mind existing setups but sometimes things fall through the cracks. TBH I am usually worried of the opposite where I've installed some dependency in the past but that doesn't happen by default with a fresh setup.

If you have the virtual environment installed with the "--system-site-packages" option, you can run "sudo apt install python3-lgpio". The advantage to that over pip3 in the virtual environment is that it is installed as a system package that will stay installed. If you install in the virtual environment and then delete / move / re-install the virtual environment, you will need to re-install in the new virtual environment.

When I say raspberry pi os installs lgpio by default it is python3-lgpio.

Michael
 
When I say raspberry pi os installs lgpio by default it is python3-lgpio.
Yea I don't have that installed.

dsp@bedroom-dsp:~ $ apt list -a python3-lgpio
Listing... Done
python3-lgpio/stable 0.2.2-1~rpt1 arm64

python3-lgpio/stable 0.2.2-1~rpt1 armhf

dsp@bedroom-dsp:~ $

That must be why I needed pip3 lgpio.
 
I haven't checked in on the forum for a while, so I apologize if the question has been asked before:

Is there a benefit to updating to v.3 if I already have everything set up the way I want on v.2.0.3?
 
Is there a benefit to updating to v.3 if I already have everything set up the way I want on v.2.0.3?
I can only share my experience:

Version 2 was working perfectly fine with camilladsp-setrate. At some point camilladsp-setrate stopped working properly. Neither it nor CamillaDSP had been updated, so it probably was due to some other package update or an update to my streamer, but I really don't know and never solved the issue.

I did a completely fresh install of Raspberry Pi OS Lite, CamillaDSP v. 3, CamillaGUI v. 3, and camilladsp-setrate, and everything has been working well since.

Side note: Timeshift does not work well when using a microSD card for the primary storage, as I found out when I tried to use it to set my system back to a previous state.
 
If everything is working fine in v2 I personally wouldn't worry about upgrading to v3. To me advantages of v3 are:

-Bundled GUI with stand alone python environment is easier to install
-Labels on capture and playback channels
-Target level maximum increased from 2 x chunksize - 1 to 4 x chunksize, biggest benefit is for setups using rate adjust
-GUI channel assignment in pipeline is easier, no need to repeat the same filter step if applying to multiple channels

I am sure there are other things in v3 that are useful but I don't personally use / notice them.

Michael
 
I just updated to v3 to try the new link_volume_control feature so I could control camilladsp volume using the volume slider in any LMS controller app (e.g. the Material Skin web app). Documentation for link_volume_control at


To find the name of the device to use for volume in the squeezelite settings, I used

Bash:
squeezelite -o hw:Loopback,1 -L

The output is

Code:
Volume controls for hw:Loopback,1
   PCM

I added "-V PCM" to my squeezelite settings in /etc/defaults/squeezelite so that squeezelite uses this as a volume control instead of software volume control.

Bash:
SB_EXTRA_ARGS="-V PCM -W -C 5 -r 48000-48000 -R hLE:::28"

We need the card number for the Loopback device. We can use

Code:
aplay -l

to list the card numbers. Loopback is card number 2 on my system. Then use this number to get the name of the volume control used by camilladsp and the current volume:

Code:
amixer -c 2 controls |  grep MIXER

The output is

Code:
numid=97,iface=MIXER,name='PCM Playback Volume'

So I set link_volume_control in the camilla GUI to "PCM Playback Volume" and click "Apply and save" button. The LMS volume should then control the camilladsp volume. The downside is that LMS volume of 15% and below maps to -51 dBFS, so the full volume range is not useable.

EDIT: it looks like there's an alsa "min_db" setting that could be set to extend the range of the slider, but the syntax eludes me.

EDIT: AI tells me that

To configure the min_db value for a particular volume control, you would need to adjust the TLV metadata for that control. This typically involves modifying the ALSA driver code or using tools like amixer to set the volume to specific hardware values and modify the audio channels
Hmmm...
 
Last edited:
Hi,
I want to use camilladsp with picoreplayer in a multiform setup. When I use the default settings for the sync time (20ms) it get periodic pops in the playback. When I increase the sync time to 100ms I do not hear the pops (probably less frequent)

command string:
/usr/local/bin/squeezelite -n "wz" -o camilladsp -a 4096:1:32:0: -d all=debug -f /var/log/pcp_squeezelite.log

This is the log from squeezelite:
[23:59:59.024374] process_strm:281 strm command a
[23:59:59.024378] process_strm:329 skip ahead interval: 20
[23:59:59.031544] _output_frames:73 skip 882 of 882 frames
[00:00:00.025408] sendSTAT:195 STAT: STMt
[00:00:01.026553] sendSTAT:195 STAT: STMt
[00:00:02.009138] process:533 strm
[00:00:02.009161] process_strm:281 strm command t
[00:00:02.009164] sendSTAT:195 STAT: STMt
[00:00:03.010209] sendSTAT:195 STAT: STMt
[00:00:04.011280] sendSTAT:195 STAT: STMt
[00:00:05.012342] sendSTAT:195 STAT: STMt
[00:00:06.013404] sendSTAT:195 STAT: STMt
[00:00:07.011960] process:533 strm
[00:00:07.011983] process_strm:281 strm command t
[00:00:07.011987] sendSTAT:195 STAT: STMt
[00:00:08.013034] sendSTAT:195 STAT: STMt
[00:00:09.017314] sendSTAT:195 STAT: STMt
[00:00:09.023162] process:533 strm
[00:00:09.023174] process_strm:281 strm command a
[00:00:09.023178] process_strm:329 skip ahead interval: 24
[00:00:09.058560] _output_frames:73 skip 1058 of 1058 frames
[00:00:10.024206] sendSTAT:195 STAT: STMt
[00:00:11.025294] sendSTAT:195 STAT: STMt
[00:00:12.011743] process:533 strm
[00:00:12.011765] process_strm:281 strm command t
[00:00:12.011768] sendSTAT:195 STAT: STMt
[00:00:13.012816] sendSTAT:195 STAT: STMt
[00:00:14.013901] sendSTAT:195 STAT: STMt
[00:00:15.014979] sendSTAT:195 STAT: STMt
[00:00:16.016045] sendSTAT:195 STAT: STMt
[00:00:17.008891] process:533 strm
[00:00:17.008915] process_strm:281 strm command t
[00:00:17.008919] sendSTAT:195 STAT: STMt
[00:00:18.009973] sendSTAT:195 STAT: STMt


This is my cdsp config:

description: null
devices:
adjust_period: 10
capture:
channels: 2
extra_samples: null
format: S24LE3
labels: null
read_bytes: null
skip_bytes: null
type: Stdin
capture_samplerate: 96000
chunksize: 4096
enable_rate_adjust: true
multithreaded: null
playback:
channels: 2
device: plughw:CARD=Balanced,DEV=0
format: S24LE3
type: Alsa
queuelimit: 4
rate_measure_interval: 1
resampler:
profile: Balanced
type: AsyncSinc
samplerate: 96000
silence_threshold: null
silence_timeout: null
stop_on_rate_change: false
target_level: 16000
volume_limit: null
volume_ramp_time: null
worker_threads: null
filters: {}
mixers: {}
pipeline: []
processors: {}
title: null


I have played around with target levels not really improving the situation.

The hardware is a rpi5 and a motu mk5 ultralite.

I am looking for your help to fix this.
 
Back
Top Bottom