• 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

A fast calculation tells me sound travels ca 3 mm in 10 microseconds. So if your speakers are going to be a couple of steps away of your ears....
 
What is your application, exactly?
Perhaps it is something that pro-audio already has a solution for?

There are techniques to get the latency down to zero or near-zero with a DSP convolution engine (see Gardner paper, et al), so-called Non-Uniform Partitioning, etc. But, other conditions must also be present in the processing chain to achieve minimal latency: min-phase filtering, hardware transit times (buffer size), etc.
I was responding more in the vein of the person who was asking about using this for live audio DSP (presumably for a live hall performance).

Personally, I'm just looking for 8 channel DSP that could ideally work with real time media (*cough* video games *cough*) up to 120fps or 8.33ms delays. This is much more reasonable although it does look like the answer is to drop the chunk size, and thus the number of taps down further and maybe hardcode a 2 channels per core relationship for parallelization. I think this is within the range of the Pi4's capabilities, but the upstream delays (of extracting the audio, converting to I2S, converting the I2S to PCM, reading the PCM from the USB interface) and then downstream delay of the DAC would probably add a few ms total so the actual DSP would need to happen in ~2ms I think to hit the end number.

But it would be really nice to be able to feed a live analog signals into the system from instruments and get amplified playback corrected for the room with as little latency as possible. I'll have to read that paper, and then a few other papers to understand that paper, and then even make sure my theoretical extraction chain works. Then I can actually start worrying about how to process the signals :)
 
the actual DSP would need to happen in ~2ms I think to hit the end number.

That is not too difficult. I've measured < 1ms on my own creation.

I'll have to read that paper, and then a few other papers to understand that paper,

lol. Yes, that's the way it works.
I have a stack of rabbit-holes research sitting on my desk from various efforts.
 
I was going to ask about various other alternatives to reduce the delay but it looks like the baseline for inaudible times delays is 10 microseconds which is magnitudes lower (0.01ms) so even splitting the computational load among multiple cores/clustering pi's is going to be insufficient. It looks like the way forward on this is to leave the actual processing to a FPGA. So we'd need a container that can parse CamillaDSP generated filters and program the FPGA?

How do commercial DSP solutions manage this?
A couple ms for the roudtrip + whatever the specific filters you gonna use add could be in the realm of workable. But to achieve that you'd need an OS specifically designed for the task, with a realtime kernel for starters.

Commercial DSP use custom embedded OSes; not full fat linux.
 
A couple ms for the roudtrip + whatever the specific filters you gonna use add could be in the realm of workable. But to achieve that you'd need an OS specifically designed for the task, with a realtime kernel for starters.

Commercial DSP use custom embedded OSes; not full fat linux.
Manjaro has real-time kernels, never have used one though, so not sure how they perform with audio. Would something like that be appropriate for these kind of things?
 
Manjaro has real-time kernels, never have used one though, so not sure how they perform with audio. Would something like that be appropriate for these kind of things?
A barebones arch installation with a realtime kernel would certainly be a step in the right direction if anyone wanna give it a try. No idea if it's gonna be good enough though.

This sounds more like a freebsd job tbh.
 
indeed moode audio doesn't support multichannel through usb (only through hdmi). i read that it may be supported in moode 8 newer kernel wich will support more dac and multichannel.
Hi,
After some experimenting trials I can confirm that moode/camilla can output 8 channels audio through xonar u7 USB dac. I followed the instructions here (post #8):

 
Last edited:
I really do not know much about Moode but I do not think it supports multichannel audio at this time. You could try using my configuration with specifying 8 channels on the loopback and adjusting the routing matrix (0->0, 1->1, 2->2, 3->3, etc) accordingly. Then specify the loopback as your Moode output device and see if it works.

Michael

Multichannel (>2) sources is indeed not supported. It concentrate on playback of stereo sources. There are current no facilities for using analog or digital inputs. However multichannel output is supported in combination with CamillaDSP.

Only if a specific audio device is supported or not, depends of the device is supported by the used kernel. For the current moode 7.6.1 that is 5.4.77 build #1371. The brave can install own kernels, only you will loose some patches like Allo Usbridge SIG, loopback device 384k, rpidac 384k support.

New moode 8 will indeed have a newer kernel.
 
When I first posted this thread I mentioned the attached drawings had some changes compared to case pictures which were attached. These were relatively small dimensional changes the biggest being a height reduction for the FLIRC IR receiver hole for a much tighter fit. The pictures have now been updated to reflect the current case design.

With that being said if anyone is interested in my old front panels (one 10 mm single sided machining front panel and one 3 mm front panel) I am happy to send them out for just the cost of shipping.

I've also been exploring relatively cheap (<$200) used ADAT interfaces on the suggestion of @TimW for use with a miniDSP MCHStreamer. Some of these interfaces can be had for closer to $100 making them one of the cheapest ways to get 8 channels of output. The MCHStreamer works great with CamillaDSP and I assume that the miniDSP USBStreamer also works great.

The most important feature in selecting an ADAT interface is that it needs to be able to function in standalone mode without being connected to a computer. In that regard I've come across two different configurations, interfaces that can be configured via computer and then act in standalone mode (MOTU 896HD, M-Audio Profire 2626, Focusrite 18i20 2nd, MOTU Ultralite Mk5) and those which can be configured via the interface itself (MOTU 828 Mk2/3, MOTU Traveler Mk1/3). I recently picked up a MOTU Traveler Mk1 for $100 and made some quick measurements, definitely not a world beater but performance is OK as long as you understand the potential for noise issues with high gain amplifiers and/or high sensitivity speakers. Definitely an option to keep in mind for those that are price sensitive. The other big advantage with ADAT is that it is Linux agnostic, if you can set up routing on your interface it will work with the MCHStreamer.

MOTU Traveler Mk1, 2mV output, Cosmos ADC stereo mode, 1.7V input setting. 26 uV residual noise.
travelermk1_2mvout_1.7vadc_stereo.png


MOTU Traveler Mk1, 2V output, Cosmos ADC stereo mode, 4.5 V input setting. THD = -115 dB, N = -94 dB, THD+N = -94 dB.
travelermk1_2vout_4.5vadc_stereo.png


MOTU Traveler Mk1, 4V output, Cosmos ADC stereo mode, 8.5 V input setting. THD = -102 dB, N = -97 dB, THD+N = -95 dB.
travelermk1_4vout_8.5vadc_stereo.png


Michael
 
Last edited:
Any thoughts on how well CamillaDSP might work on Raspberry Pi OS now that the 64-bit version is out of beta?

I tried it when it was in beta, I can say that the Ultralite Mk5 definitely did not work on it.

The new version of Raspberry Pi OS released in late January is running 5.10 kernel, :facepalm:, I believe the MOTUs have some fixes that were enacted in 5.11. Still I might give Raspberry Pi OS Lite 64 bit a try and see how it goes.

Any reason you are looking to use Raspberry Pi OS? GUI? Something else?

Michael
 
Any reason you are looking to use Raspberry Pi OS? GUI? Something else?
More just curiosity on my part since I'm very familiar with Raspberry Pi OS. I have a couple Pi's at home running RPiOS that I use for networking: Pi-hole, Homebridge, etc. But if I were to create a dedicated audio setup with CamillaDSP it would not be hard to load up a Pi with 64-bit Ubuntu Server instead.
 
More just curiosity on my part since I'm very familiar with Raspberry Pi OS. I have a couple Pi's at home running RPiOS that I use for networking: Pi-hole, Homebridge, etc. But if I were to create a dedicated audio setup with CamillaDSP it would not be hard to load up a Pi with 64-bit Ubuntu Server instead.

Gave it a try and at first everything seemed to go well and thought it might be an alternative to Ubuntu but unfortunately that was not to be :(.

Setup was pretty much the same other than wifi setup is a bit different, you need to enable ssh from the SD card for headless setup and you need to install git. However I ran in to the following issues.

1) With Ultralite Mk5 connected it would not connect to wifi after a restart. If I connected the Ulralite Mk5 after startup the Ultralite Mk5 would be recognized and wifi would work.
2) Cannot install lgpio (for display) using apt, could compile this of course but that it is more work.
3) Although CamillaDSP appears to run correctly and I see both input and output levels via the the CamillaDSP GUI I get no sound output from the Ultralite Mk5.

It might work well for other DACs but certainly not the Ultralite Mk5.

Michael
 
Hello,
Seems that the spdif inputs and outputs of the hifiberry digi+ i/o can be used simultaneously, according to this:


Has anyone tried, or do you think it is possible, to take a spdif signal to the hifiberry in, apply do the dsp in camilladsp, and output the processed signal to the hifiberry spdif out? It would make a versatile standalone dsp i could use in between my tv and my dac...

Thank you for your comments
 
Hello,
Seems that the spdif inputs and outputs of the hifiberry digi+ i/o can be used simultaneously, according to this:


Has anyone tried, or do you think it is possible, to take a spdif signal to the hifiberry in, apply do the dsp in camilladsp, and output the processed signal to the hifiberry spdif out? It would make a versatile standalone dsp i could use in between my tv and my dac...

Thank you for your comments

I tried the DIGI+ I/O at some point and it worked with CamillaDSP. In my notes I only have stuff about the input but I am 99% sure that I also tried using it as a playback device and the output worked as well. Biggest issue with the DIGI+ I/O is that it does not have an ASRC so you need to send the sample rate that CamillaDSP expects. This works really well if your source has a constant sample rate and doesn't work well if it has a variable sample rate. I think you could probably institute rate switching based on measured sample rate from the DSP but I have not done it.

Michael
 
  • Like
Reactions: MCH
I tried the DIGI+ I/O at some point and it worked with CamillaDSP. In my notes I only have stuff about the input but I am 99% sure that I also tried using it as a playback device and the output worked as well. Biggest issue with the DIGI+ I/O is that it does not have an ASRC so you need to send the sample rate that CamillaDSP expects. This works really well if your source has a constant sample rate and doesn't work well if it has a variable sample rate. I think you could probably institute rate switching based on measured sample rate from the DSP but I have not done it.

Michael
Thanks. Would be to use with the tv, that always outputs 48 kHz, so might be worth a try...
In the meantime i reminded that my soundblaster x-fi hd has optical in and out, so i mightglook at that first. The problem at the moment with the soundblaster is that for some reason alsamixer does not see the optical input (windows does see it, so it must be working). Lets see if i find a solution for this first and if not i will give the hifiberry a try.
 
Hello,
Seems that the spdif inputs and outputs of the hifiberry digi+ i/o can be used simultaneously, according to this:


Has anyone tried, or do you think it is possible, to take a spdif signal to the hifiberry in, apply do the dsp in camilladsp, and output the processed signal to the hifiberry spdif out? It would make a versatile standalone dsp i could use in between my tv and my dac...

Thank you for your comments

This project is very promising, but unfortunately it involves some hardware design, which is out of my league:
 
Last edited:
Michael,

While I have the GUI displaying in offline mode I can't save any filters and therefore I'm limited in my evaluation until MOTU starts production. I have just dug out a Roland Edirol USB Audio Interface UA-1EX that I used some years ago when I was building passive crossovers. I recall that this device has a non flat frequency response but as it has both analog input and output I thought I would give it a go with the RPi CamillaDSP to see if I can get CamillaDSP online and be able to really explore the functionality. Any tips for configuring will be welcome, preferably by the GUI.
 
Back
Top Bottom