• 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!

RPi + CamillaDSP Tutorial

Hi

I need to control volume via the websocket. I read documentation but as a linux noob there are questions left. Is there any "websocket for idiots" example?

Are the commands tcp or udp?

Thanks :)
 
A bit more detail would be helpful. Is there a reason you can't use one of the existing GUIs for volume control? What's your preferred programming language?
 
Hi

I want to adjust volume in the last possible place before amps. This is in my case CDSP. I want to map this to my flirc remote control on my player HTPC (win 11). So I need to send tcp/udp/.... commands to the rpi with CDSP over ethernet for global volume up/down. I did so in the past with an AVR and that worked good. Should be possible with the websocket or?

Comprehensive so far?
 
One thing that I've noticed for all DACs other than the Okto dac8 PRO is that CamillaDSP will report a buffer underrun when coming out of paused state.

I'd set silence threshold and timeout to default and see if you still are seeing underruns with CamillaDSP always in the running state. Given the underruns do not seem audible I would question if they are actually occurring in normal playback.

Michael
Thanks a lot for your help and your great guide!

The problem is definitely solved. I listened to music for over 2 and half hours without a single underrun. Before logging in here, I was actually thinking to myself this little box is pure magic! It took a while to get there (first Pi/no Linux experience), but it's very satisfying seeing it running flawlessly now. Couldn't be more happy with my solution!

It would have been nice with Tidal connect, in a similar way as Raspotify. I'm trying to figure out Docker and if there are some of the github repositories that will work to provide a 44.1kHz loopback output. So still a bit to fiddle with. Or maybe I just need to learn Squeezelite.

But to be honest I use Airplay most of the time anyway for convinience. So it's not a big deal.

And of course, I need to learn how to take full advantage of CamillaDPS (I have no experience with FIR filters).
 
For anyone looking for a 4 output channel interface with volume control for all all 4 channels, I got the following reply from Audient about their ID14 mk2:

Q:
Is it possible to control the level of all 4 line outs simultaneously with the volume knob?
This is for use in a hifi setup where the level of all 4 line outs needs to be the same.
I have the same question for the Evo 8.

A:
Yes this is possible by assigning all four line outputs to main mix, then the main encoder will adjust the levels of each simultaneously.
This is not possible with the EVO 8 however.

The Audient ID14 Mk2 has not been discussed much here at ASR. So here is a link to a youtube review by Julian Krause:

TL;DW: It has CS43198 DACs, 96Hz max sample rate, perfectly flat frequency response from 10Hz to 40kHz, 125.5 dBa dynamic range, distortion level was below what his equipment was able to measure.

Product page:


I'm tempted to return my Focusrite Scarlett 4i4 gen2 for this, thought the saying goes not to mess with a working system. It's 200 Eurodollars here, vs. 167 for the Scarlett, and it would look nice together with a FLIRC Pi case. Not a big fan of the horizontal layout for hifi purposes. That's the only minus I see.

Thoughts?
 
Yes this is possible by assigning all four line outputs to main mix, then the main encoder will adjust the levels of each simultaneously.
Does it work on linux too, or does it require their custom app? As the manufacturer says that main knob is an encoder. IMO very likely it's just sending HID keys over USB.

You can get any USB volume knob from Aliexpress and adjust softvol volume with a simple script, e.g. https://github.com/neildavis/alsa_volume_from_usb_hid
 
Hi somebodyelse

And...how to start the Python skripts then from another PC? Ssh python script?
 
And...how to start the Python skripts then from another PC? Ssh python script?
I suppose that's an option. I assumed you'd run it on the HTPC triggered by the remote presses. You'd need to change the IP address from 127.0.0.1. to the Pi's. Also the example sets an absolute level, not an increment/decrement as you probably want for the remote, so that's another change you'd need to make.
 
The script seems to include camillaclient. How to provide this on the win htpc?
 
Does it work on linux too, or does it require their custom app? As the manufacturer says that main knob is an encoder. IMO very likely it's just sending HID keys over USB.
Thanks. That's a question I would have never thought to ask. I can see that it's likely you're right.


You can get any USB volume knob from Aliexpress and adjust softvol volume with a simple script, e.g. https://github.com/neildavis/alsa_volume_from_usb_hid
Thanks for the link and info!
 
I will check that. Tried Yesterday a shutdown of thr pi via putty ssh in command line. Takes several seconds. So no option for volume change (especially incremental)
 
I will check that. Tried Yesterday a shutdown of thr pi via putty ssh in command line. Takes several seconds. So no option for volume change (especially incremental)
This is odd, it should be much quicker (<1s).
Most likely, ssh authentication hanging for some reason. Check ssh in the console and see how long it takes.
There are various ways to speed up authentication:
https://www.tecmint.com/speed-up-ssh-connections-in-linux/
 
Last edited:
@Olombo: Well, incremental volume control by ssh-ing to RPi for every step does not sound technically nice. Even with fast SSH login the overhead is large. Especially when accessing from windows, IMO. It would be nice if you could just send commands to an existing ssh connection by copying them to some named pipe/socket, but I am not sure this is possible in windows - no proper named pipes like in unix.

The python+CDSP solution is not technically nice either because you have to start python every incremental volume step. Technically not nice but most likely OK for your purpose. Perhaps a nicer solution would be using some small websocket client like https://github.com/vi/websocat which is under 2MB for windows https://github.com/vi/websocat/releases
 
Puh. I apreciate your help. But I have the feeling I have to leave full volume in CDSP and adjust in player. This is too complex for me. In the end the difference where volume is adjusted should be way below any audibility as long as gain matching is ok (and this is good in my setup). Maybe one day a RF volume remote directly to the pi...
 
This is too complex for me. In the end the difference where volume is adjusted should be way below any audibility as long as gain matching is ok (and this is good in my setup)
Since CDSP runs at float64, it makes no difference where your volume control is in the digital chain.
 
Following up on this, my Mk5 has almost no audible noise when powering on, powering off or unplugging from the wall. This is a with a Hypex NC252MP amplifier from Audiophonics and TRS to XLR cables. There is very subtle "pff" noise when powering off, certainly not a scary pop or click.

In comparison my Okto sometimes has a much louder click when powering down, but this may be due to shutdown of the amplifiers (I use a triggered 12 V power strip) rather than the Okto.

I've been thinking about how to quantify turn on / off pop and the best I can come up with is a peak FFT while measuring the connected amplifier output through a voltage divider. I'll see if I can make some measurements this week and see if they correlate with my perception of the noise.

Michael
this is curious. Today i tested my subs separately. This is what i have all together:
Mk5 > TRS to XLR > Boxem NC252MP
Mk5 > TRS to RCA "ring floating" > 2 Aiyima A07 max > 2 passive subs

Switching off the Mk5 pressing the on/off button > no noise
Switching off the raspberry pi while all other devices stay on > no noise
Switching off the Mk5 by pulling DC > both MC252MP and subs quite loud "pop" independently of actual audio signal present or not
Switching off the Mk5 by pulling wallwart from the wall > both MC252MP and subs quite loud "pop" independently of actual audio signal present or not

i wonder why you don't have off noise, could it be firmware related?
 
Back
Top Bottom