• 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

OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,365
Location
Detroit, MI
Nice writeup, thanks. Since you're using it for the FLIRC I guess you've not tried using the USB-C port as a USB input. A recent (5.14?) kernel update should make gadget audio compatible with Windows 10 but I've not got round to testing it yet.

I have not tried gadget mode yet and would need to manually upgrade the kernel from 5.13 to do so, sorry.

Michael
 

feynman

Member
Joined
May 17, 2019
Messages
76
Likes
154
Location
Arizona
Intent of this thread is to provide a tutorial for setting up CamillaDSP on a RPi4. There is a lot of really good information scattered through ASR, DIYAudio and the CamillaDSP GitHub but there also appears to be a lot of apprehension. My goal is to describe in detail the how and why of implementing CamillaDSP with a variety of hardware and ease some of that apprehension.

I realize this tutorial is quite long and I am sure it looks pretty daunting to the uninitiated. I felt the same way when trying to figure this stuff out a few months ago. My advice is to take it step by step, go slowly and ask questions. Some DIY projects are not worth the effort but this one definitely is. At the end of this project you will have a DSP with almost unparalleled processing power in a very small form factor, easily configured via web interface all at a very low cost compared to other commercial options.

Before we get started I would like to especially @HenrikEnquist for developing CamillaDSP. I’ve long been skeptical of computer based DSP but CamillaDSP to me is a game changer. It easily runs on minimal hardware and overall just seems exceptionally well designed. I’ve replaced all of my miniDSP systems with RPi4s running CamillaDSP and could not be happier.

The tutorial will be divided in to 4 parts, Part 1 will talk through background on CamillaDSP, Part 2 will cover how to get a working CamillaDSP setup, Part 3 will document specific CamillaDSP configuration files for various multichannel DACs and Part 4 will talk through more advance stuff such as the GUI, displays, IR receivers, trigger output options and cases.

A lot of the motivation behind this thread started from the ASR Open Source Streamer thread and I would like to thank everyone that participated in that thread as it really pushed me to explore computer based DSP more. As this thread is really more based on how to use CamillaDSP rather than how to build a streamer (although that will also be covered!) I figured it was better to start a new separate thread.

As a disclaimer I am not a programmer or DSP expert, my primary motivation is finding better ways to implement DIY active speakers. If you see a better way to do something or want more explanation please speak up! These instructions have been developed over the last 6 months or so as I learned how to implement CamillaDSP and found better / quicker ways to set it up but I am always learning.

Thank you for all of this.
 

TimW

Major Contributor
Joined
Aug 15, 2018
Messages
1,065
Likes
1,407
Location
Seattle, WA
Awesome great job!

Have you looked at the miniDSP USBStreamer? It could be used with an ADAT interface for I/O, there are plenty of those on the market new or used with adequate performance.

Another option would be to use the USBStreamer Kit or MCHStreamer in I2S_Toslink configuration for use in a DIY streamer. It could have whatever combination of 10in/10out I/O desired depending on what DIY boards can be obtained or designed. This could be built into the same case as the RPI and screen.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,365
Location
Detroit, MI
I do have a MCHStreamer but have not used it with CamillaDSP. Just to make sure I understand correctly you are saying use the USB to ADAT functionality with CamillaDSP applying processing for the ADAT outputs and then route that to an ADAT multichannel DAC? I assume the main advantage here being that older non-USB ADAT DACs are inexpensive? If you can't tell I am a bit of gear hoarder so definitely not opposed to exploring this further, do you have any particular ADAT interfaces in mind?

I am not a huge of the MCHStreamer I2S functionality as it only has one ground pin and only one of MCLK/LRCLK/BCLK which makes interfacing with multiple stereo I2S DACs difficult. I do have the 8 channel DIYINHK ES9016 and ES9038 DACs but DIYINHK also provides an XMOS board that is perfectly pin compatible which I would prefer over the MCHStreamer (I have used this board succesfully with CamillaDSP). I've had some luck splitting LRCLK/BCLK to up to 2 stereo I2S DACs if they have onboard ASRC and do not require MCLK but when I tried 3 DACs I got the occasional dropout and 4 DACs was a definite no-go. I also have an Ian Canada McFIFO / McDualXO which provides 4x of MCLK/LRCLK/BCLK but that adds some pretty considerable cost. Overall I've found it very hard to beat a plug and play option like the MOTU Ultralite Mk5 with a DIY I2S setup, I do wish Okto still produced DIY boards as they would be great building blocks for such a project.

Michael
 

TimW

Major Contributor
Joined
Aug 15, 2018
Messages
1,065
Likes
1,407
Location
Seattle, WA
I do have a MCHStreamer but have not used it with CamillaDSP. Just to make sure I understand correctly you are saying use the USB to ADAT functionality with CamillaDSP applying processing for the ADAT outputs and then route that to an ADAT multichannel DAC? I assume the main advantage here being that older non-USB ADAT DACs are inexpensive? If you can't tell I am a bit of gear hoarder so definitely not opposed to exploring this further, do you have any particular ADAT interfaces in mind?

I am not a huge of the MCHStreamer I2S functionality as it only has one ground pin and only one of MCLK/LRCLK/BCLK which makes interfacing with multiple stereo I2S DACs difficult. I do have the 8 channel DIYINHK ES9016 and ES9038 DACs but DIYINHK also provides an XMOS board that is perfectly pin compatible which I would prefer over the MCHStreamer (I have used this board succesfully with CamillaDSP). I've had some luck splitting LRCLK/BCLK to up to 2 stereo I2S DACs if they have onboard ASRC and do not require MCLK but when I tried 3 DACs I got the occasional dropout and 4 DACs was a definite no-go. I also have an Ian Canada McFIFO / McDualXO which provides 4x of MCLK/LRCLK/BCLK but that adds some pretty considerable cost. Overall I've found it very hard to beat a plug and play option like the MOTU Ultralite Mk5 with a DIY I2S setup, I do wish Okto still produced DIY boards as they would be great building blocks for such a project.

Michael

I just found your DIYINHK DAC thread, very cool and the performance is good enough. I only wish it had balanced outputs but that is not a big deal. Recently learned about the SparkFun THAT 1646 OutSmarts adapter board which could be used although it would degrade performance slightly. The DIYINHK XMOS board is a good option if you will only use streaming direct to the rpi but the miniDSP MCHStreamer adds other input options. Is there a way to add more inputs to the rpi with another device?

About the ADAT connection, yes I am saying process the signals in CamillaDSP and output the channels to the MCHStreamer via USB which then outputs via ADAT to a multichannel converter. You could also do the reverse since many of these ADAT devices have analog inputs and ADAT output. This has been a standard way of adding I/O to pro audio interfaces for many years so there are many older devices available on the market at reduced cost. Some devices that fit the bill would be 8 channel mic preamps like the Behringer Ultragain ADA8200 or Focusrite Octopre. Or AD/DA converters like the RME ADI-8 or Lucid 88192. Or obsolete firewire interfaces from the likes of MOTU or Presonus although they may require configuration via firewire which would be a no go. There are many products with a range of features which include analog outputs and ADAT input from the typical pro audio brands Lynx, M-Audio, Alesis, Apogee, Aphex, Ferrofish, etc.

EDIT: Going through your DIYINHK thread I see that the all in price of implementing that board probably isn't worth it compared to a commercial solution. And unless the price of the USBStreamer + ADAT interface is significantly less than the $600 for a MOTU Ultralite Mk5 it probably isn't worth it either since you will get worse performance and no digital inputs. I wonder if my Ultralite Mk4 or Focusrite Scarlett 18i20 Gen 3 will work well with CamillaDSP.
 
Last edited:

bcurtin

Member
Joined
Oct 9, 2019
Messages
28
Likes
11
Thanks so much for this! Just got through a nearly identical process to get CamillaDSP running on a Pi4, but hadn't set up the web interface so will do that now.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,365
Location
Detroit, MI
I just found your DIYINHK DAC thread, very cool and the performance is good enough. I only wish it had balanced outputs but that is not a big deal. Recently learned about the SparkFun THAT 1646 OutSmarts adapter board which could be used although it would degrade performance slightly. The DIYINHK XMOS board is a good option if you will only use streaming direct to the rpi but the miniDSP MCHStreamer adds other input options. Is there a way to add more inputs to the rpi with another device?

About the ADAT connection, yes I am saying process the signals in CamillaDSP and output the channels to the MCHStreamer via USB which then outputs via ADAT to a multichannel converter. You could also do the reverse since many of these ADAT devices have analog inputs and ADAT output. This has been a standard way of adding I/O to pro audio interfaces for many years so there are many older devices available on the market at reduced cost. Some devices that fit the bill would be 8 channel mic preamps like the Behringer Ultragain ADA8200 or Focusrite Octopre. Or AD/DA converters like the RME ADI-8 or Lucid 88192. Or obsolete firewire interfaces from the likes of MOTU or Presonus although they may require configuration via firewire which would be a no go. There are many products with a range of features which include analog outputs and ADAT input from the typical pro audio brands Lynx, M-Audio, Alesis, Apogee, Aphex, Ferrofish, etc.

Although I initially had quite a bit of enthusiasm for those DIYINHK board my interest has definitely waned. The cost ends up being rather high once you add power supplies and the turn on / off pop is deadly. I actually blew a woofer in a cheap test speaker using one of the DACs (don't remember if it was the ES9016 or ES9038), from measuring the response during turn on / off it looks like it outputs rather high level DC. I did pick up a Furman power sequencer to help deal with that but ended up getting the Ultralite Mk5 shortly thereafter and the DIYINHK DACs have been sitting around unused. As an experiment I am actually going to try and add an Ian Canada I/V stage to the ES9016 this weekend which will give balanced outputs and hopefully improved analog performance, although again all of this makes it even less cost competitive compared to the Ultralite Mk5.

It is rather easy to use another device as capture device. For example I've used a miniDSP 2X4HD as a CamillaDSP capture device and then a separate USB DAC as a playback device. This works pretty nice as the 2X4HD has an ASRC so you can send a variety of sample rates via TOSLINK and convert them to a constant 96 kHz rate for CamillaDSP. It would also be very easy to add some minidsp-rs code to add source selection of the 2X4HD to the OLED display which would be pretty cool.

Thanks for the info on the ADAT interfaces, I was doing a bit of googling and saw a few of those pop up. Will need to sift through some of the specs / reviews and see if I can find one that looks decent. Could be a good budget option for those looking for a lot of channels and even lower cost than the Ultralite Mk5.

Michael
 

TimW

Major Contributor
Joined
Aug 15, 2018
Messages
1,065
Likes
1,407
Location
Seattle, WA
It is rather easy to use another device as capture device. For example I've used a miniDSP 2X4HD as a CamillaDSP capture device and then a separate USB DAC as a playback device. This works pretty nice as the 2X4HD has an ASRC so you can send a variety of sample rates via TOSLINK and convert them to a constant 96 kHz rate for CamillaDSP. It would also be very easy to add some minidsp-rs code to add source selection of the 2X4HD to the OLED display which would be pretty cool.
That would be very cool. I have a miniDSP SHD that I really like as a preamp but the limited number of outputs has always bothered me. The idea of a DIY CamillaDSP based alternative is interesting.

The Behringer ADA8200 is cheap and ugly but if you look at the measured performance on SOS it looks to be about as good as the DIYINHK.
BehringerADA8200-05-XqfFKvzN0umXlvziWZn4NyMrsCmrevNC.jpg

For $220 new or or less you get 8 1/4" balanced or unbalanced inputs and 8 XLR balanced or unbalanced outputs with adequate performance. Keep in mind a single 8 channel ADAT connection is limited to 44.1/48kHz.
 

simbloke

Senior Member
Forum Donor
Joined
May 30, 2019
Messages
355
Likes
585
Location
North Wales, UK
....
Wow that's an amazingly detailed write-up! You've certainly made me think it's worth looking at. I'll see if I can get it done on my Intel NUC. No display and the IR receiver will be different, but the rest should work.

Thanks for taking your time to save the rest of a lot of time researching this
:)
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,365
Location
Detroit, MI
Agree that distortion looks pretty good on the Behringer but I've become a bit weary of noise performance on some of these lower end pro audio DACs, from that review:

A reasonably useful indication of converter quality is the AES17 dynamic-range figure, and in the case of the ADA 8200 my tests obtained values of 103dB (A-wtd) for the A-D stage, and 104.5dB (A-wtd) for the D-A stage. To be blunt, both are quite disappointing figures, since most modern mid-range interfaces achieve around 110-115dB, and the best high-end converters are delivering figures in the low- to mid-120s. Having said that, the combined A-D and D-A chip used here is only specified with a dynamic range of 105dB — so Behringer's engineers have clearly extracted the best possible performance from it.

Let's say we knock off 3 dB converting from dB(A) to dB we are now at ~102 dB DR at 4.88 V (16 dBu). I like to normalize everything to 2 V so knock another 7-8 dB off and you are looking at ~94 dB DR which is really pretty poor, much worse than a miniDSP 2X4HD or 4X10HD or even a Focusrite 18i20 2nd gen.

Has anyone seen any measurements of the Evolve II-4K HDMI v2.0 / Multi-Channel DAC, spec'd performance looks too good to be true? For those looking for unbalanced outputs that could be a good option using the RPi HDMI output.

Michael
 

Miercoles2022

Member
Joined
Jan 8, 2022
Messages
19
Likes
27
Location
Maryland, USA
Thank you so very much for this fantastic thread! Exceptional guidance on getting started with CamillaDSP.

The HDMI 8channel DAC is a new discovery. It could be the budget king if it works out… I’ll be keeping an eye out for any measurements/reviews there.

I have been debating getting the Ultralite mk5, but for a lot less money and extra simplification, that HDMI DAC is hard to ignore.
 

beneix

Member
Joined
Dec 25, 2021
Messages
14
Likes
5
Thanks for this, it has given me a nudge to revisit my plan to get CamillaDSP up and running on my RPi4 with HififBerry DAC+DSP, taking an S/PDIF input and using the analogue output.. Was there a particular reason you went with Ubuntu rather than Raspbian?
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,365
Location
Detroit, MI
From the second post:

I prefer Ubuntu Server as it is very stable and has a newer kernel than Raspberry Pi OS and other audio based distributions (Moode, Volumio, etc) which is important for many multichannel USB DACs.

In particular the Ultralite Mk5 gives strange noises on Raspberry Pi OS (Raspian). I have not tried the MOTU M4 on Raspberry Pi OS but I believe there may be similar issues. As I understand changes were made to the 5.11 kernel and beyond to better support the MOTU multichannel DACs. In the future Raspberry Pi OS may be a viable option when the kernel gets updated.

Michael
 

beneix

Member
Joined
Dec 25, 2021
Messages
14
Likes
5
From the second post:

I prefer Ubuntu Server as it is very stable and has a newer kernel than Raspberry Pi OS and other audio based distributions (Moode, Volumio, etc) which is important for many multichannel USB DACs.
Thanks, I should have read more carefully. Now that I have, just a small thing: You suggest for Windows users to install Windows Subsystem for Linux (WSL); I thought that was for running Linux binaries on Windows – if the requirement is to have a terminal window on the RPi, surely Putty would be a better bid?

Great tutorial, I will find a few quiet hours when I can follow it. Chapeau!

Oh, and one question regarding the OS choice. I just read in one of your other posts that
The DAC+ DSP is a lot more capable but does have some quirks. It does nothing out of the box unless you load a DSP profile to it. This requires you to install HifiBerry's dsptoolkit which unfortunately does not work on Ubuntu Server 21.04 as it uses RPi.GPIO which was eliminated as of the 5.11 kernel.
Does this mean that you can't use Ubuntu if the DAC+DSP is to be used, even if it is not at all used for DSP duties but only for digital in and analogue out (with CamillaDSP processing in between), as I am planning to do? Is the dsptoolkit required to get the sound card recognised by the system?

If anyone here has successfully used 64-bit Raspbian with CamillaDSP, I'd be grateful for some feedback and tips.
 
Last edited:
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,365
Location
Detroit, MI
Thanks, I should have read more carefully. Now that I have, just a small thing: You suggest for Windows users to install Windows Subsystem for Linux (WSL); I thought that was for running Linux binaries on Windows – if the requirement is to have a terminal window on the RPi, surely Putty would be a better bid?

Great tutorial, I will find a few quiet hours when I can follow it. Chapeau!

Oh, and one question regarding the OS choice. I just read in one of your other posts that

Does this mean that you can't use Ubuntu if the DAC+DSP is to be used, even if it is not at all used for DSP duties but only for digital in and analogue out (with CamillaDSP processing in between), as I am planning to do? Is the dsptoolkit required to get the sound card recognised by the system?

If anyone here has successfully used 64-bit Raspbian with CamillaDSP, I'd be grateful for some feedback and tips.
Admittedly I do not know much about windows. I purchased my first windows computer in 10 years at the end of last year and WSL seemed very easy to me. Of course there are other SSH options so feel free to use what you are comfortable with.

You do need dsptoolkit to use the DAC+DSP. As mentioned in the other thread I’ve used the DAC+DSP successfully on Raspberry Pi OS, I know @dorirod had some issues but I have not been able to replicate.

Another alternative to the DAC+DSP is the miniDSP 2x4HD. It has a built in ASRC and is much more user friendly. They are very popular so you can probably find a used one relatively easy. It doesn’t have a TOSLINK or SPDIF output so you need to use a USB input DAC. I am away from home the next few days but I can check the latency of the setup when I return if that is an issue.

Michael
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,365
Location
Detroit, MI
Do you think it's possible to configure CamilaDSP with a bluetooth client (sink) than a USB DAC?

I think this should be possible using bluealsa. My wife has some AirPods so I can try it as a proof of concept. I plan on ordering a digital output miniDSP Flex when it becomes available and that should allow some measurements of the Bluetooth performance. It seems like bluealsa supports LDAC so I don’t anticipate a drop in performance.

Michael
 

ChrisMmm

New Member
Joined
Jan 13, 2022
Messages
2
Likes
2
Hi Michael,

As promised here is my feedback on following your turorial (twice now). I had marked 4 items but the second time I went through the build process I realised 2 things related to my error, missed out a "CD .." at one point. So only 2 minor issues.
When you log in as "temp", I think because there is no home directory for that logon, when you cut'n'paste line commends you cannot use arrow keys to go back and edit. Simple solution was to type in the whole line with the necessary changes each time.
I was wondering why squeezelite service wasn't starting. Turns out when you edit /etc/default/squeezelite cun'n'pasting the 2 lines to the bottom, the " at the end of the first line is in italics so there is an error when it starts. Rest of the cut'n'paste is fine. Took me a while to find that one!

Otherwise well written and plenty clear enough for somebody with a little Linux knowledge to follow.

Cheers and thanks again.
 
Top Bottom