• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. 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!

RPi4 + CamillaDSP Tutorial

wineds

Active Member
Joined
Sep 1, 2019
Messages
117
Likes
82
Location
Melbourne, Australia
I have been having a play with this today. There's a lot to like. Nice write up @mdsimon2 ! Anybody else get clipping with volume filters at 0db?

I wanted to try this as my Okto has always used plughw (I guess to handle the 2 to 8 channel conversion) and I wanted to bypass that and go direct to hw;DAC8PRO. Ultimately I do want to get auto sample rate working as per Scripples Alsa hook.

I also had an issue with the " after ,1 in this code block :

Untitled.png
 
Last edited:
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
Thanks for the feedback guys, just PM'd @AdamG247 to see if I can be given access to edit the original posts or have a mod update the squeezelite line to correct.

With the clipping at 0 dB, what do you have programmed in to the DSP? I assume something more than straight pass through? Do you have any boosts? This is certainly an issue when doing volume control in a downstream device like the Okto, you can see from the screenshots in Part 4 but in my setup all output channels have at least 6 dB attenuation to avoid digital clipping.

I do think I want to pursue sample rate switching further if only to better understand how it works, maybe something for this weekend.

Michael
 

AdamG

Helping stretch the audiophile budget…
Moderator
Forum Donor
Joined
Jan 3, 2021
Messages
4,742
Likes
15,692
Location
Reality
Thanks for the feedback guys, just PM'd @AdamG247 to see if I can be given access to edit the original posts or have a mod update the squeezelite line to correct.

With the clipping at 0 dB, what do you have programmed in to the DSP? I assume something more than straight pass through? Do you have any boosts? This is certainly an issue when doing volume control in a downstream device like the Okto, you can see from the screenshots in Part 4 but in my setup all output channels have at least 6 dB attenuation to avoid digital clipping.

I do think I want to pursue sample rate switching further if only to better understand how it works, maybe something for this weekend.

Michael
Edit complete but see pm please.
 

wineds

Active Member
Joined
Sep 1, 2019
Messages
117
Likes
82
Location
Melbourne, Australia
Thanks for the feedback guys, just PM'd @AdamG247 to see if I can be given access to edit the original posts or have a mod update the squeezelite line to correct.

With the clipping at 0 dB, what do you have programmed in to the DSP? I assume something more than straight pass through? Do you have any boosts? This is certainly an issue when doing volume control in a downstream device like the Okto, you can see from the screenshots in Part 4 but in my setup all output channels have at least 6 dB attenuation to avoid digital clipping.

I do think I want to pursue sample rate switching further if only to better understand how it works, maybe something for this weekend.

Michael

Hi Michael,
I notice there also a similar " error with the Shairport Sync line. I get clipping just testing using your default camilladsp.yml containing 2x8 mixer and volume control. If I drop the Camilla GUI volume slider to -1db clipping vanishes.

Untitled1.png
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
Hi Michael,
I notice there also a similar " error with the Shairport Sync line. I get clipping just testing using your default camilladsp.yml containing 2x8 mixer and volume control. If I drop the Camilla GUI volume slider to -1db clipping vanishes.

View attachment 180027

Thanks for the info! 44.1 kHz to 96 kHz resampling is resulting in clipping. Like I mentioned I have attenuation built in to my Okto setup so I have not noticed it there but when testing shairplay-sync on my MOTU Ultralite Mk5 with CamillaDSP I noticed the same issue. I'll update the Okto configuration files to have 1 dB of attenuation on all channels and make a note about potential for clipping from resampling as well as DSP boosts when using downstream volume control.

Michael
 

DWPress

Major Contributor
Forum Donor
Joined
May 30, 2018
Messages
1,016
Likes
1,464
Location
MI
@mdsimon2 Great work! I may just buy a Pi4 just to play with all of this and see if I like it any more than my current way of doing things.

Any idea if it will run on an old PC running Ubuntu Server 21.10 64 bit? I know there'd be plenty of changes in your above instructions regarding things specifically for the Pi but I've an old C2D digital signage box laying around that could be used.
 

beneix

Member
Joined
Dec 25, 2021
Messages
14
Likes
5
Any idea if it will run on an old PC running Ubuntu Server 21.10 64 bit? I know there'd be plenty of changes in your above instructions regarding things specifically for the Pi but I've an old C2D digital signage box laying around that could be used.
It will depend on your requirements. From the Github site:
CamillaDSP runs on Linux, macOS and Windows. The exact system requirements are determined by the amount of processing the application requires, but even relatively weak CPUs like Intel Atom have much more processing power than most will need.

In general, a 64-bit CPU and OS will perform better.

A few examples, done with CamillaDSP v0.5.0:
  • A Raspberry Pi 4 doing FIR filtering of 8 channels, with 262k taps per channel, at 192 kHz. CPU usage about 55%.
  • An AMD Ryzen 7 2700u (laptop) doing FIR filtering of 96 channels, with 262k taps per channel, at 192 kHz. CPU usage just under 100%.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
@mdsimon2 Great work! I may just buy a Pi4 just to play with all of this and see if I like it any more than my current way of doing things.

Any idea if it will run on an old PC running Ubuntu Server 21.10 64 bit? I know there'd be plenty of changes in your above instructions regarding things specifically for the Pi but I've an old C2D digital signage box laying around that could be used.

Most of it should be pretty similar, obviously none of the GPIO stuff will be applicable. The biggest definite change is that the pre-built binary will be different.

Instead of:

Code:
wget https://github.com/HEnquist/camilladsp/releases/download/v1.0.0-alpha5/camilladsp-linux-aarch64.tar.gz
tar -xvf camilladsp-linux-aarch64.tar.gz

You will want to use:

Code:
https://github.com/HEnquist/camilladsp/releases/download/v1.0.0-alpha5/camilladsp-linux-amd64.tar.gz
tar -xvf camilladsp-linux-amd64.tar.gz

Some of the dependencies may also be different.

Michael
 

dthed

New Member
Joined
Oct 22, 2021
Messages
4
Likes
2
Hi Michael, thanks also from me for the wonderful guide! I'm wondering... do you sometimes find, once every 5 or 10 or so boots, that the loopback fails to set itself up and that you have to do the sudo apt install linux-modules-extra-$(uname -r) command and reboot again to get it working?
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
Hi Michael, thanks also from me for the wonderful guide! I'm wondering... do you sometimes find, once every 5 or 10 or so boots, that the loopback fails to set itself up and that you have to do the sudo apt install linux-modules-extra-$(uname -r) command and reboot again to get it working?

The only thing I have experienced is that if the kernel is updated then I need to re-run sudo apt install linux-modules-extra-$(uname -r). I feel like there have been a few kernel updates in the last week or so. This is pretty annoying and I need to do some research on a better solution that works through kernel updates. I kind of hint at this in the tutorial but on Ubuntu 21.04 I did not need to install linux-modules-extra, it just worked and I am not sure what changed with Ubuntu 21.10.

If any folks know of a better solution I am all ears!

Michael
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
The only thing I have experienced is that if the kernel is updated then I need to re-run sudo apt install linux-modules-extra-$(uname -r). I feel like there have been a few kernel updates in the last week or so. This is pretty annoying and I need to do some research on a better solution that works through kernel updates. I kind of hint at this in the tutorial but on Ubuntu 21.04 I did not need to install linux-modules-extra, it just worked and I am not sure what changed with Ubuntu 21.10.

If any folks know of a better solution I am all ears!

Michael

Have a quick follow-up on this, appears that if you use sudo apt install linux-modules-extra-raspi it works through kernel updates. Just tried it on a clean install which started with kernel 5.13.0-1008, ran the above mentioned command after a restart the loopback was there. Then updated Ubuntu and ended up with kernel 5.13.0-1015 and loopback was still there without running any new commands.

I've updated the instructions to reflect.

Michael
 

Wirrunna

Member
Joined
May 27, 2021
Messages
93
Likes
45
Location
South Coast, NSW, Australia
Michael, I have just done a quick scroll through your tutorial and have a few questions related to how you recommend I would go about replicating the role of two miniDSP 2x4HD in my tri amped setup using RP14 + CamillaDSP -

Current setup -
Allo streamer analog out --> NAD pre
NAD pre out -->
MiniDSP 2x4HD #1 analog in --> Analog out
Hypex NC stereo amp #1 --> bass bin #1 and high #1
Topping PA5 --> Mid #1
MiniDSP 2x4HD #2 analog in --> Analog out
Hypex NC stereo amp #2 --> bass bin #2 and high #2
Topping PA5 --> Mid #2

The miniDSP 2X4HD perform EQ for each driver, Delay for driver time alignment and FIR filters that define the crossovers and provide phase flattening for each driver. The NAD provides tuner, input selector, volume control and switch on/off using the NAD remote.

CamillaDSP -
Are Delays available for each driver ?
What number of taps are available for each channel for FIR filters ?
Is there a simple way to load FIR filter outputs from rePhrase ?
Is there a simple way to load IIR (PEQs) from REW ?
Recommended hardware to take the NAD analog out put and digitise or can the MOTU Ultralight MK5 do that as well as the outputs ?
 
Last edited:
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
Are Delays available for each driver ?

Yes -> https://github.com/HEnquist/camilladsp#delay, it can do sample (like miniDSP) and subsample delays.

What number of taps are available for each channel for FIR filters?

On a RPi4 I've personally done 16k taps x 8 channels @ 96 kHz without any issue. Henrik has done 262k taps x 8 channels at 192 kHz.

Is there a simple way to load FIR filter outputs from rePhrase?

Yes, use the 64 bit floating point (.dbl) format. If you move them to ~/camilladsp/coeffs they are available in the GUI and you can apply them there just like you can change configuration files in the GUI. The last screenshot on Part 4 shows that I have 3 FIR filters (generated from rephase) available in my GUI.

Is there a simple way to load IIR (PEQs) from REW?

I do not use IIR filters generated from REW but I do not believe there is an automated way of doing it at this time. I have done some testing between CamillaDSP and miniDSP and have not found any differences so if you generate PEQs for a miniDSP you can manually input them in to CamillaDSP.

Recommended hardware to take the NAD analog out put and digitise or can the MOTU Ultralight MK5 do that as well as the outputs?

MOTU Ultralite Mk5 can do this. It would also be a fun option because you can start with using the Ultralite Mk5 analog inputs but also experiment with using RPi4 + Ultralite Mk5 without the Allo streamer and NAD preamp. You might have other reasons for using the NAD preamp (other sources for example) but the RPi4 + Ultralite Mk5 can do everything your Allo + NAD + miniDSP setup can with much better analog performance and less DA / AD conversions.

Michael
 

Wirrunna

Member
Joined
May 27, 2021
Messages
93
Likes
45
Location
South Coast, NSW, Australia
Michael,
Thank you for your reply. In my skim through your tutorial I missed the delay info, but thinking last night I realised if there are FIR filters there will be a way of configuring delays.

The MOTU Ultralite Mk5 is available in Australia, it will just be a case of checking the suppliers for price. As it is US made, can you suggest a supplier that would ship to Australia and accept Paypal ? I have downloaded the manual and suspect that I will need a bit of guidance in the one time setup of the routing of inputs and outputs.

I have a RPi4 with a HiFiBerry hat on mounted to a 7" RPi screen, could I use this with the hat removed ? Any advantage with the screen or just run it headless. (I have used RPi PiCore Players since they started back on the RPi 1b and have a few RPi's in use - Emoncms, PiHole, PiCorePlayer - and a couple of spares in boxes.)

The NAD receiver has to stay, my wife has allowed K-Horns in the house for 30 something years on condition that they can be controlled by a remote. Also living on the NSW far south coast we are subject to fire, flood, pestilence and now pandemics and there are times when the FM radio is essential. The TV sound is also occasionally played through the K-Horns.

I also missed that you had rePhase generated filters in your gui. I will read through the tutorial again as I run up a RPi 4.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
Sweetwater does international shipping and they accept paypal. Unfortunately the Mk5 is out of stock everywhere right now so you may need to wait a few months.

In terms of screen are you talking about the 7" screen or the OLED screen in my post? If you are talking about my OLED screen solution I don't think it applies in your situation as you will be using the NAD for volume control so the screen doesn't really add anything. To me the primary purpose of the screen is volume indication when using CamillaDSP for volume control.

Overall I think the Ultralite Mk5 and CamillaDSP would be a really good solution for you. ADC and DAC are much better than 2X4HD and FIR processing power is much greater.

Michael
 

Adahn

Member
Joined
Dec 26, 2019
Messages
63
Likes
86
Great job with the tutorial. Do you have any idea what kind of latency is added by the processing?

I been meaning to try CamillaDSP as a live vocal processor for a while now, but I'm thinking the overhead from running fully fledged ubuntu server will probably be prohibitive.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
Great job with the tutorial. Do you have any idea what kind of latency is added by the processing?

I been meaning to try CamillaDSP as a live vocal processor for a while now, but I'm thinking the overhead from running fully fledged ubuntu server will probably be prohibitive.

Good question, I made some measurements of this in the past, it largely depends on chunk size and whether resampling is enabled. In general with the default settings shown here for a 96 kHz sample rate, 2048 chunk size and balanced async resampling the additional latency from processing is 60 ms. If you disable resampling this drops to 45 ms. If you halve the chunk size the processing delay roughly halves.

For A/V applications I use a HDMI extractor downstream of an Apple TV. The video processing delay between the Apple TV and my TV is around 60 ms so this matches my CamillaDSP processing delay almost exactly. The Apple TV also has the ability to adjust audio / video delay but I do not find the need to use that.

Unfortunately for live sound applications this probably will not work very well.

Michael
 
Last edited:
Top Bottom