• 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

juliangst

Addicted to Fun and Learning
Joined
Dec 11, 2021
Messages
970
Likes
992
Location
Germany
Your log shows that your playback device supports S16LE and S24LE but you configuration is set to S32LE. I would change your playback format to S24LE.

Michael
I could swear that I tried all sampleformat options... It works now with both capture and playback device set to S24LE :)
I think the next thing I'll try is setting up a USB input which seems to be possible now
 

juliangst

Addicted to Fun and Learning
Joined
Dec 11, 2021
Messages
970
Likes
992
Location
Germany
Another minor problem that occurred is that I cannot open the GUI from some browsers.
Edge works fine but Chrome and Safari on my iPhone can’t make a ‚secure connection‘ to CamillaDSP.
It’s not blocked by antivirus software so I think it’s an SSL problem. Most common fixes didn’t help though
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,509
Likes
3,354
Location
Detroit, MI
Another minor problem that occurred is that I cannot open the GUI from some browsers.
Edge works fine but Chrome and Safari on my iPhone can’t make a ‚secure connection‘ to CamillaDSP.
It’s not blocked by antivirus software so I think it’s an SSL problem. Most common fixes didn’t help though

Hmm can’t say I’ve had any issues with the GUI on a variety of platforms (Mac, Windows, iOS, Ubuntu) and browsers (Edge, safari, chrome, chromium, Firefox). The only thing I can say I’ve experienced is the first time I access the GUI I need to enter http://hostname:5000 and after that I can omit the http. Maybe @HenrikEnquist has some troubleshooting ideas?

Michael
 

HenrikEnquist

Member
Joined
Jul 1, 2021
Messages
82
Likes
110
It's not possible to make a secure connection, since the backend server doesn't have https enabled. The aiohttp server it uses does support it, but it's some work to prepare the ssl certificates it needs. Everyone needs to supply their own certificate, not something I want to force people to deal with and that's why it's disabled. I'll see if I can come up with some reasonable way to make it optional.
An alternative is to put a reverse proxy in between. Nginx for example can be used for that. It's probably a bit messier to configure, but with the advantage that it moves the https handling away from the camilladsp backend.
 

Nisse10000

Member
Joined
Nov 14, 2022
Messages
30
Likes
15
Anyone tried to get this working with Plexamp Headless? I'm getting it to install and run but I can't get any sound. I thought i would just be to change the player to loopback but it is not working. Tried different things the last two evenings without getting any further. Also tried installing on Moode with the same result. Everyting seems to be running fine but no sound.
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
501
Likes
323
Logs if any may help. IIUC the playback software is proprietary and paid for, perhaps the company who supports the software you paid for would tell you more.
 

t_im

New Member
Joined
Nov 15, 2022
Messages
4
Likes
6
mdsimon2, thanks for your tutorial ! I used it as a base for my own project. Some things I've added/did differently: automatic intermittent inaudible low frequency tone to keep my sub powered on when listening to music at low volume (/prevent from going into standby); master volume with a physical knob (rotary encoder with software debouncing); display showing the main volume, CamillaDSP and player (squeezelite) status (playing/stopped/muted/...), switching CamillaDSP configs with a button, mute/play the player and CamillaDSP with another button, and also a bluetooth streamer (currently a "standalone" config that has nothing to do with CamillaDSP but I plan to test CamillaDSP in the signal path some day to add crossfeed). I can post the link to instructions if anyone's interested.
If that wasn't for you I probably wouldn't have started this project (and I wouldn't have spent so many hours on it :) )
Cheers !
 

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,641
Likes
2,251
mdsimon2, thanks for your tutorial ! I used it as a base for my own project. Some things I've added/did differently: automatic intermittent inaudible low frequency tone to keep my sub powered on when listening to music at low volume (/prevent from going into standby); master volume with a physical knob (rotary encoder with software debouncing); display showing the main volume, CamillaDSP and player (squeezelite) status (playing/stopped/muted/...), switching CamillaDSP configs with a button, mute/play the player and CamillaDSP with another button, and also a bluetooth streamer (currently a "standalone" config that has nothing to do with CamillaDSP but I plan to test CamillaDSP in the signal path some day to add crossfeed). I can post the link to instructions if anyone's interested.
If that wasn't for you I probably wouldn't have started this project (and I wouldn't have spent so many hours on it :) )
Cheers !
Hey, I would appreciate if you post how you made those features. I am mostly interested on the volume knob. Do you think it can be done wirelessly with a second pi or something like that? (I believe there is even a pi pico microcontroller with wifi now)
 

t_im

New Member
Joined
Nov 15, 2022
Messages
4
Likes
6
Do you think it can be done wirelessly with a second pi or something like that?
Sure - there's nothing that prevents the volume knob (or whatever that connects to CamillaDSP with pycamilladsp) to be on a remote device.

My instructions are on this github repo ; the python programs I've coded are overkill to only manage the volume knob so to save you some time I've quickly hacked together a few classes from the various programs to only provide the volume knob functionality - see that program ; you'll need to have pymedia_rotary_encoder.py and pymedia_cdsp.py in your path. You'll also have to change the pins and gpio chip values obviously (in main() at the end of the file). Again - that's a quick hack (took 10 minutes to merge the required functions and classes and strip most of what was unused) - but it works well on my setup. I haven't tested it on a rpi though (I can try to run the program on a rpi3 tomorrow to see if libgpiod works there but I don't have a spare rotary encoder to test).
Hope this helps ! (PM if you have problems / need help).

[edit1 - I forgot: you can run the program with a debug loglevel like so: `LOGLEVEL=debug python3 standalone_remote_volume.py`]
[edit2 - refactored some of the code to be easier to re-use with standalone components]

[edit3: some pics -
1.jpg
2.jpg
]
[edit4 - no error when running on a rpi3 (as mentioned I don't have a spare encoder to test but there's no reason it shouldn't work)
- `sudo apt install python3-libgpiod gpiod python3-pip git`
- `pip3 install git+https://github.com/HEnquist/pycamilladsp.git`
- make sure your user is in the `gpio` group
- make sure /dev/gpiochip* is owned by group gpio (if not see i2c_gpio.md in my docs - you'll need some udev rules)
- make sure camilladsp is listening on the right address (by default it's localhost when only specifying a port).
]
 
Last edited:

Nisse10000

Member
Joined
Nov 14, 2022
Messages
30
Likes
15
Logs if any may help. IIUC the playback software is proprietary and paid for, perhaps the company who supports the software you paid for would tell you more.
Yes, I guess it makes sense but since I'm using it in another way than that they suggested I thought that someone here might have run into similar problem. Somehow I finally got it to work so I'm happy now.

If someone else is interested it is possible to get it working. I have not tested switching between different sources though. I started with CamillaDSP according to the first post. Then installed Plexamp. What I think made the difference for me was when I updated to the latest release with node 16. I started with another thread on the moode forum but never got it working. And I got some update on my Linux skills. Thanks @mdsimon2 for the original post.
 

ChristianN

Member
Joined
Dec 3, 2020
Messages
38
Likes
2
Hi

I read the OP post on Okto Pro8 dac - Camilla DSP, which sound right for my setup, where i run a 2.4 I would like to reuse the system for movies in combination a separate center speaker, So for movies would use more speakers than normal hifi listening and hence have its own DSP configuration for each situation.

My question is if its possible to switch inputs on the okto ( TV, Streamer etc) and the have the camilla DSP apply the corresponding configurations? And if not, how would i swich the configuration the easiest? ( by remote if possible )

Second thing I could not read up on: Can the Camilla DSP( Raspberry) be connected to the okto, but also at the same time to a laptop , where is shows up as a soundcard, I can send sound towards to perform REW measurements ?
 

jhenderson0107

Active Member
Joined
Jun 10, 2021
Messages
197
Likes
447
Location
California
...Can the Camilla DSP( Raspberry) be connected to the okto, but also at the same time to a laptop , where is shows up as a soundcard, I can send sound towards to perform REW measurements ?
Not to my knowledge.

But a speaker system whose crossover is implemented via Camilla DSP can be measured using REW. Switch to a Camilla DSP profile which captures input via analog line-in channels rather than a stream. Connect the outputs of a (second) sound device attached to the laptop to the analog line-inputs of the Camilla DSP sound device. Then use REW normally.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,509
Likes
3,354
Location
Detroit, MI
I read the OP post on Okto Pro8 dac - Camilla DSP, which sound right for my setup, where i run a 2.4 I would like to reuse the system for movies in combination a separate center speaker, So for movies would use more speakers than normal hifi listening and hence have its own DSP configuration for each situation.

My question is if its possible to switch inputs on the okto ( TV, Streamer etc) and the have the camilla DSP apply the corresponding configurations? And if not, how would i swich the configuration the easiest? ( by remote if possible )

What specifically are your sources (number of channels, format, etc)? Switching configurations in CamillaDSP is relatively simple via the CamillaDSP GUI. However if you are changing from a streamer configuration (RPi as a source) to an AES input configuration you will need to also change the Okto mode from Pure USB to USB / AES.

You could also add a display to the RPi to give you an indication of the current configuration but that would be a bit redundant as the Okto already has a very nice display for volume indication.

Second thing I could not read up on: Can the Camilla DSP( Raspberry) be connected to the okto, but also at the same time to a laptop , where is shows up as a soundcard, I can send sound towards to perform REW measurements ?

Look in to running the raspberry pi in gadget mode (there is a link in the second post of this tutorial). This would allow a chain of laptop -> usb to rpi running camilladsp -> okto (pure USB mode).

Michael
 

ChristianN

Member
Joined
Dec 3, 2020
Messages
38
Likes
2
Not to my knowledge.

But a speaker system whose crossover is implemented via Camilla DSP can be measured using REW. Switch to a Camilla DSP profile which captures input via analog line-in channels rather than a stream. Connect the outputs of a (second) sound device attached to the laptop to the analog line-inputs of the Camilla DSP sound device. Then use REW normally.
Hi thx, didmnt know that it had an analog input without extra boards, il have a tRy once i Can get My hands on a rasberry pi.
 

ChristianN

Member
Joined
Dec 3, 2020
Messages
38
Likes
2
What specifically are your sources (number of channels, format, etc)? Switching configurations in CamillaDSP is relatively simple via the CamillaDSP GUI. However if you are changing from a streamer configuration (RPi as a source) to an AES input configuration you will need to also change the Okto mode from Pure USB to USB / AES.
My sources would be optical spdif or toslink from both tv and streamer, that would be converted to aes. So only two stereo inputs channels. I did not plan on using the raspberry as a streamer, as I thought it would require a sort of web login to the raspberry every time I would use it, where my current streamer uses airplay - nice and simple. Some googling reveals that raspberry can use AirPlay, but if I did that using okto usb mode would I then still be able to also switch to the tv sound from the aes input ?


You could also add a display to the RPi to give you an indication of the current configuration but that would be a bit redundant as the Okto already has a very nice display for volume indication.
Yes I would like to use the okto volume and remote, that’s why I went down this road.
Look in to running the raspberry pi in gadget mode (there is a link in the second post of this tutorial). This would allow a chain of laptop -> usb to rpi running camilladsp -> okto (pure USB mode).

Michael
Thx, tried to find it without luck, but if it’s possible that’s fine for planning now, then I’ll figure it out when I get the parts.
 

juliangst

Addicted to Fun and Learning
Joined
Dec 11, 2021
Messages
970
Likes
992
Location
Germany
Just received the USB power splitter to use a USB device as a source in Gadget Mode. Had some errors at first but works like a charm now.
Not sure if I should use the Pi with CamillaDSP as a DSP or stick to EQ Apo for PC usage.
Both work excellently for my use case

Edit: one thing thats a bit buggy is switching inputs by switching configs. When switching to my Loopback config (for airplay) it will still play the USB output's audio. After reselecting camillaDSP on my IOS device it will eventually work tho
 
Last edited:
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,509
Likes
3,354
Location
Detroit, MI
My sources would be optical spdif or toslink from both tv and streamer, that would be converted to aes. So only two stereo inputs channels. I did not plan on using the raspberry as a streamer, as I thought it would require a sort of web login to the raspberry every time I would use it, where my current streamer uses airplay - nice and simple. Some googling reveals that raspberry can use AirPlay, but if I did that using okto usb mode would I then still be able to also switch to the tv sound from the aes input ?

Although the Okto has 4x AES inputs they all need to be clock sync'd. Unless your streamer has the ability to be clocked by your TV (which I highly doubt is possible) this means you effectively only have a single stereo AES input.

There are a few options to use multiple inputs with the Okto. By far the easiest is to use a digital input / output miniDSP (OpenDRC-DI, nanodigi, SHD, Flex digital) upstream of the Okto. You can change sources on the miniDSP and the output will always be at a constant sample rate so no need to switch CamillaDSP configurations or input mode on the Okto. Such a setup is described in detail in Part 3 of the tutorial.

You could also use a simple TOSLINK switcher but unless your TV and streamer are outputting at the same sample rate you will need to switch CamillaDSP configurations to accommodate the rate changes.

As mentioned in my initial reply you can also use the RPi as a streamer but that will require you to switch not only CamillaDSP configurations but also the Okto input mode (between Pure USB and USB / AES). This is probably the most complicated way of doing it but requires the least amount of additional gear.

There is no right answer here, just whatever works best for you from a usability standpoint. Personally I use an OpenDRC-DI upstream of my Okto with three sources: 1) Apple TV 2) Raspberry Pi streamer with an Allo digione HAT and 3) Mac mini. 99% of the time I just use the Apple TV for audio/video source and airplay but changing sources is relatively easy.

Michael
 

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,641
Likes
2,251
I have experimented a bit with several toslink sources > toslink 4x1 switch with remote control > minidsp 2x4 > raspberry pi with camilladsp and it worked pretty darn good. Besides the additional features, the fact that the minidsp takes different sample rates without complain and resamples everything before throwing it out to the pi, makes it a perfect toslink input card IMO.
I found the weak point was knowing which toslink input was active in the switch when you start the system, but as the one I was using had a led with a different color depending on the active input, it was easy to know once used to it.
 

ChristianN

Member
Joined
Dec 3, 2020
Messages
38
Likes
2
Although the Okto has 4x AES inputs they all need to be clock sync'd. Unless your streamer has the ability to be clocked by your TV (which I highly doubt is possible) this means you effectively only have a single stereo AES input.

There are a few options to use multiple inputs with the Okto. By far the easiest is to use a digital input / output miniDSP (OpenDRC-DI, nanodigi, SHD, Flex digital) upstream of the Okto. You can change sources on the miniDSP and the output will always be at a constant sample rate so no need to switch CamillaDSP configurations or input mode on the Okto. Such a setup is described in detail in Part 3 of the tutorial.

You could also use a simple TOSLINK switcher but unless your TV and streamer are outputting at the same sample rate you will need to switch CamillaDSP configurations to accommodate the rate changes.

As mentioned in my initial reply you can also use the RPi as a streamer but that will require you to switch not only CamillaDSP configurations but also the Okto input mode (between Pure USB and USB / AES). This is probably the most complicated way of doing it but requires the least amount of additional gear.

There is no right answer here, just whatever works best for you from a usability standpoint. Personally I use an OpenDRC-DI upstream of my Okto with three sources: 1) Apple TV 2) Raspberry Pi streamer with an Allo digione HAT and 3) Mac mini. 99% of the time I just use the Apple TV for audio/video source and airplay but changing sources is relatively easy.

Michael
Thanks for replying. I was looking to replace the minidsp for the okto for one control point. but it seems I need minidsp and the okto and a raspberry. What i was hoping to do, was having one input from the TV, which would have its own routing with 8 speakers and DSP correction/filtering. And then another 2 channel input from streamer ( raspberry if need be or a standalone streamer) which would use fewer speakers and have it own DSP correction/filtering. So in anycase there needs to be the option to switch DSP config and routing easily as inputs are shifted daily.
Optimally i would control it all from the okto by input and central volume control and the DSP configs would follow as predertermined by the input channel. I would not opt for swichting the okto between aes and usb all the time. So all signal sources would need to go through the raspberry or okto first hand. my initial idea was, that all was send to the okto as: (TV or Streamer)> okto->raspberry>okto>8/4 ch speakers . the inputs may not be synced, but is that a problem as they are not both used at the same time.?
Alternative1 is to get some addon to let the tv enter the raspberry which would double as streamer.
Otherwise it seems to be a little futile and then maybe I should setlle for unbalanced connections and get the MiniDSP flex 2x8 or Presonus 192 or similar pro sound card, both much cheaper ?
 
Top Bottom