• 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,477
Likes
3,315
Location
Detroit, MI
Python has some fairly in-depth time handling, including timezone awareness that can come in handy when clocks change around this time of year.
https://docs.python.org/3/library/datetime.html
If you keep it in the application you can brighten it when there's some user input than dim it again after a few seconds to reduce burn-in on the oled. Another option would be to use a light sensor so brightness is related to ambient light rather than time of day.

Self adhesive laminating pouches can make quite a tidy solution. Print up a sheet to cover the back panel with any labels you want, laminate, trim to size and stick in position. Your call on whether to make the necessary cutouts for connectors before or after sticking.

Thanks! Good info all around, definitely had not thought of the laminating pouches.

As it stands the display goes blank after 10 seconds of no user input to avoid OLED burn in. However it is a bit unnecessarily bright at night.

Michael
 

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,580
Likes
2,197
PS: Didn't realize that Audiophonics display is meant to be used with an Audiophonics aluminum case -> https://www.audiophonics.fr/en/diy-...essories-for-evo-sabre-dac-black-p-14656.html. That could be a really nice way to get a finished product for this type of setup and also gives the opportunity to play around with the rotary encoder. I may buy one and see what I can do with it. Obviously will have some extra cutouts unless you use their DAC but as it is all on the back I am not that fussed about it.

Michael
I did know it but to be honest never thought about using the case for the Camilla setup. Has the cutouts for the pi and I bet my 2x4HD fits besides, if not with the case, naked. I bet something can be done as well to have the track tittle or something like that in the second screen.... hmm.....
 

TheMadcap

Member
Joined
May 5, 2020
Messages
26
Likes
2
For your setup probably best to pursue one of the pre-made options like moOde, volumio or SuperPlayer. They all have CamillaDSP and I believe all will handle sample rate switching so the CamillaDSP sample rate matches your file sample rate.

You could use this guide and set your player output to the Loopback although your player would need to be set to resample to match the constant sample rate of CamillaDSP. I am not sure what the capabilities of your upnp renderer are but you can use a higher sample rate (96 kHz, 192 kHz, etc) if you want to retain the inaudible ultrasonic information.

You could also use the ALSA CDSP plugin -> https://github.com/scripple/alsa_cdsp to automatically restart CamillaDSP with sample rates matching your playback file.

Personally I like to have a constant sample rate in CamillaDSP. I don't think I am losing anything by resampling to 44 kHz and I like being to easily switch configurations in the GUI.

The RPi4 is plenty powerful and I don't it is worth pursuing another option if your desire is to increase processing power.

Michael
Thanks for your effort. I quickly installed moode to give it a try. But I couldn't figure out how to feed my music to Kef system. If I enable upnp server on moode, I can see the upnp from Kef and it can feed music from my hdd, but I believe it doesn't apply dsp to the music. Besides that, I can't feed music to Kefs when I play from Spotify.

I guess I am not going to be able to do that through network. I probably need to use coax interface somehow.
 

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,580
Likes
2,197
Thanks for your effort. I quickly installed moode to give it a try. But I couldn't figure out how to feed my music to Kef system. If I enable upnp server on moode, I can see the upnp from Kef and it can feed music from my hdd, but I believe it doesn't apply dsp to the music. Besides that, I can't feed music to Kefs when I play from Spotify.

I guess I am not going to be able to do that through network. I probably need to use coax interface somehow.
I believe with mode you would need to physically plug your raspberry to the speakers and stream to the raspberry, not to the speakers. To stream from the raspberry to the speakers via WiFi you would need something like LMS. I don't know if it is possible to install for instance LMS to a raspberry running camilladsp and have the outcome of Camilla streamed. It would be very interesting. Others might know how to do it.
 

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,681
Likes
2,959
I believe with mode you would need to physically plug your raspberry to the speakers and stream to the raspberry, not to the speakers. To stream from the raspberry to the speakers via WiFi you would need something like LMS. I don't know if it is possible to install for instance LMS to a raspberry running camilladsp and have the outcome of Camilla streamed. It would be very interesting. Others might know how to do it.
I would say possible, but not easy. The old BruteFIRDRC plugin that archimago tested did much the same with BruteFIR, allowing you to apply filters or convolutions per endpoint running on the server then streaming the modified audio out to the endpoint. You would need a similar plugin using camilladsp but I don't think there is one yet. There was a project called YCLD working on it but the thread went quiet a while back.
 

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,580
Likes
2,197
Guys, very dumb question. I am struggling to find long ribbon cables with Dupont connectors to use with raspberry pi gpio. With long I mean 50-100 cm. 99% of what I see in Amazon is 10-20cm.

This makes me wonder if there is any impediment to use such long connections?
 

bluefuzz

Major Contributor
Joined
Jan 17, 2020
Messages
1,043
Likes
1,772
I am struggling to find long ribbon cables with Dupont connectors
You can buy ribbon cable by the meter and add the connectors yourself. I used to use 5m long ribbon cables as speaker cables under a carpet ...

This makes me wonder if there is any impediment to use such long connections?
100 cm shouldn't be a problem.
 
  • Like
Reactions: MCH
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,477
Likes
3,315
Location
Detroit, MI
Guys, very dumb question. I am struggling to find long ribbon cables with Dupont connectors to use with raspberry pi gpio. With long I mean 50-100 cm. 99% of what I see in Amazon is 10-20cm.

This makes me wonder if there is any impediment to use such long connections?

Do you really want cables that are 1 meter long? Seems like a lot.

You can make your own pretty easily, there are a lot of 0.1" pitch housing / crimp contacts that will work with 20-24 awg wire. For quick jobs I'll just heat shrink tubing over the contact but if I want something permanent I'll buy the appropriate housing. A 40 position housing on the RPi and a 20 position housing on the display would work well.

40 position housing -> https://www.te.com/usa-en/product-1-104482-8.html
20 position housing -> https://www.te.com/usa-en/product-104482-9.html
contacts -> https://www.te.com/usa-en/product-1-104479-0.html

Michael
 
  • Like
Reactions: MCH

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,580
Likes
2,197
Do you really want cables that are 1 meter long? Seems like a lot.

You can make your own pretty easily, there are a lot of 0.1" pitch housing / crimp contacts that will work with 20-24 awg wire. For quick jobs I'll just heat shrink tubing over the contact but if I want something permanent I'll buy the appropriate housing. A 40 position housing on the RPi and a 20 position housing on the display would work well.

40 position housing -> https://www.te.com/usa-en/product-1-104482-8.html
20 position housing -> https://www.te.com/usa-en/product-104482-9.html
contacts -> https://www.te.com/usa-en/product-1-104479-0.html

Michael
The objective is to leave the display+flirc head discretely under the tv and stuff the raspberry and the rest of boxes inside a cabinet just under. Will need at least 50cm.
I eventually found and ordered the one below that is 1m and has a 16 pin female connector in one end and loose Dupont connectors on the other. This gives the freedom to connect the pins freely to the raspberry gpio without needing to to do the connections myself (I never did and I don't know how easy/difficult it is)

My question was because I thought that if the long assembled cables are so rare... maybe it is for a reason!
I couldnt find a straight answer online besides "depends what you are connecting", what makes sense. So I will give it a try and see.

image001.jpg

 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,477
Likes
3,315
Location
Detroit, MI
Let us know how it works out!

Biggest issue I think would be voltage drop across relatively long / thin wires but don't know if this will really be an issue in practice.

Michael
 

phofman

Senior Member
Joined
Apr 13, 2021
Messages
489
Likes
319
I would be careful about contact quality of these 1-pin duponts. Also very easy to disengage, fasten it properly.

What is the required data speed in the connection?
 

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,580
Likes
2,197
I would be careful about contact quality of these 1-pin duponts. Also very easy to disengage, fasten it properly.

What is the required data speed in the connection?
Can always cut the loose duponts and attach a housing as per Michael's post if I have trouble. So far I have a shorter cable with loose connectors and have been working fine for a week now, let's see.
The application is the OLED display of this tutorial.
 

phofman

Senior Member
Joined
Apr 13, 2021
Messages
489
Likes
319
I do not know at what SPI rate the setup is configured. You can always lower the rate, if needed, at the expense of the display refresh rate. Maybe I would consider interleaving the data wires with ground wires to avoid crosstalk, like it was in old 80-wire PATA cables.
 

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,580
Likes
2,197
I do not know at what SPI rate the setup is configured. You can always lower the rate, if needed, at the expense of the display refresh rate. Maybe I would consider interleaving the data wires with ground wires to avoid crosstalk, like it was in old 80-wire PATA cables.
Hm, there are 2 ground and 8 data wires (4 to 11) if I understand correctly. Could just connect more wires to ground if I get into trouble?

01 -> ground
02 -> 3.3 V
03 -> no connection
04 -> GPIO 26
05 -> GPIO 13
06 -> GPIO 6
07 -> GPIO 5
08 -> GPIO 22
09 -> GPIO 27
10 -> GPIO 17
11 -> GPIO 18
12 -> GPIO 23
13 -> ground
14 -> GPIO 16
15 -> GPIO 12
16 -> GPIO 25
 

phofman

Senior Member
Joined
Apr 13, 2021
Messages
489
Likes
319
Could just connect more wires to ground if I get into trouble?
The principle is to separate neighboring high-speed wires with ground wires between them. Applies only to high-speed, i.e. probably just SPI MOSI, MISO, SCLK. But most likely you will be fine without any precautions.

Also the ground wires in between can act as return paths for the SPI single-ended signals. But at the expected speeds it's probably no need to consider.
 
  • Like
Reactions: MCH

jdubs

Member
Forum Donor
Joined
Mar 12, 2018
Messages
97
Likes
19
Is there a way to increase the refresh rate of CamillaGUI? I know you can change it for the VU meters...but I would love to have the volume refresh when I change it with flirc (it doesn't do that currently...I need to reload the page in the browser).

-Jim
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,477
Likes
3,315
Location
Detroit, MI
Have you tried using the latest version of the GUI? I am pretty sure that it will update the volume shown in the GUI even if you change the volume outside of the GUI but I am not at home to verify.

Michael
 
  • Like
Reactions: MCH

jdubs

Member
Forum Donor
Joined
Mar 12, 2018
Messages
97
Likes
19
Yeah, I'm on 1.0.0. Lmk what you find with your setup as mine definitely doesn't refresh with changes done via flirc.

-Jim
 

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,580
Likes
2,197
Hi guys, I switched recently from the old GUI version, that did not update, to the new one that does both in my computer and my phone where I use the simplified version. Nice improvement and almost no delay since the moment I press the button of the remote. I use Chrome in both if it helps (?)
 
Top Bottom