Hi!
Continuing from the "main thread" I wish to discuss and get help of implementing an infrared (?) remote control that can do:
Platform Pi5 and pCP picoreplayer with CamillaDSP.
As I understand it, I need:
I can hook up the IR to the Pi but then its get foggy ;-)
Please help!?
//
Continuing from the "main thread" I wish to discuss and get help of implementing an infrared (?) remote control that can do:
- Volume + / -
- Mute
- Play, Next, Pause
- Change config
- Tweak a PEQ parameter
Platform Pi5 and pCP picoreplayer with CamillaDSP.
As I understand it, I need:
- Pi5
- Power
- An IR receiver eye
- A remote - preferable the small metal Apple remote or the like.
I can hook up the IR to the Pi but then its get foggy ;-)
Please help!?
//
Here some of the nice post on the topic already made:
This script runs in a loop (ie. continuously), monitoring for remote control inputs at the device listed on line 12...
Wiring it is as simple as it gets: +5V...
//
There are a couple of different ways to add a remote to PCP. I'd suggest using the LIRC method to trigger a script that communicates with Camilla through the websocket.use PicorePlayer installed via SD card. I'd like to use the small Apple remote
I fired up picoreplayer on a Rpi and did some experimenting to see what might work for you. It would be possible to get my script to work but you'd still need another script or service to receive the remote control commands. I think it might be easiest to use mdsimon's excellent script here: https://github.com/mdsimon2/RPi-CamillaDSP/blob/main/flirc.pyThanks - I shall study these.
//
This script runs in a loop (ie. continuously), monitoring for remote control inputs at the device listed on line 12...
I am in the process of designing and building an 8-channel DAC with a built-in Raspberry Pi running CamillaDSP. I'll be using a VS1838 IR sensor, like this one:Thing is that I will house the Pi in a bigger box and it will not be so easy to make that dongle listen to the outside world as I intend to make the box a Faraday cage. But a drilled hole on the front for the sensor would be ok.
Soldering connecting is no problem.. its the soft side of things that I'm not so sure about... but can probably be helped if I ask nicely 🙂
Wiring it is as simple as it gets: +5V...
//
Hi!
As suggested before, the easyest way would be to add a USB dongle and use mdismon flirc.py python app. However, placing of the Pi and USB dongle can be a challenge if you want the Pi USB+ethernet ports to be available at the back of the case and have a tidy and professional looking build.
I have a Pi running CamillaDSP and a VS1838B IR receiver here in my workbench. I'll try to connect CDSP with the IR receiver through GPIO later today and let you know if it indeed works fine.
As suggested before, the easyest way would be to add a USB dongle and use mdismon flirc.py python app. However, placing of the Pi and USB dongle can be a challenge if you want the Pi USB+ethernet ports to be available at the back of the case and have a tidy and professional looking build.
I have a Pi running CamillaDSP and a VS1838B IR receiver here in my workbench. I'll try to connect CDSP with the IR receiver through GPIO later today and let you know if it indeed works fine.
My goal 🙂a tidy and professional looking build.
I have a TSOP4838 IR-modul 38 kHz coming my way that I hope will jive with a Apple remote...
Thanks - just so you know... all these .py and flirs and whatnot 🙂 is greek to me so please, if you have the patience, be simple and clear? 🙂
GPIO are pins on the Pi if I understand it correctly.
I'm planning to use this guide for IR connection:
https://docs.picoreplayer.org/projects/add-an-ir-receiver/
And I'm quite set on using pCP with Camilla...
Thanks for your attention and spent efforts in supporting me!
//
Maybe this instruction will be what I want? - I cant judge that right now...
https://docs.picoreplayer.org/components/ir/
//
https://docs.picoreplayer.org/components/ir/
//
It should work just fine, as both are 38khz.I have a TSOP4838 IR-modul 38 kHz coming my way that I hope will jive with a Apple remote...
This seems to be a nice walkthrough!
I tried with my IR receiver and it seems to work:
I don't use piCorePlayer, but using a simple python app that is not greek, but brazilian (sorry, couldn't resist 😂), I was able to get the IR sensor to send commands to the PI and to decode them correctly.
You should try to go through that article and ask for help here if you face any issues.
🙂
Thats sound good. Yes, I will digest the whole article. But I assume that I will in the end come to the point where I want to tweak camilla things and perhaps this where it will get tricky for me...
I want be able to switch between 3 different CDSP config files and have on the front 3 LEDs to indicate the chosen config (A, B or C)
While the first three is for Camilla, the three last is for Lyrion player (or is it server - got unsure...).
So I wonder how one can control pCP via the remote....:
for a Lyrion Server...
//
Thats sound good. Yes, I will digest the whole article. But I assume that I will in the end come to the point where I want to tweak camilla things and perhaps this where it will get tricky for me...
- Volume (Up / Down arrow)
- Mute (center button)
- Config (Menu pressed will shift to next config; A->B, B->C and C->A)
- Play (Triangle)
- Pause (Triangle)
- Next (Right arrow)
I want be able to switch between 3 different CDSP config files and have on the front 3 LEDs to indicate the chosen config (A, B or C)
While the first three is for Camilla, the three last is for Lyrion player (or is it server - got unsure...).
So I wonder how one can control pCP via the remote....:
- Play (Triangle)
- Pause (Triangle)
- Next (Right arrow)
for a Lyrion Server...
//
i have write a script for remote command
it has
I use a bluethoot remote control, but it is not difficult to use an infrared remote control with flirc
for now, it work on camilladsp V2 and debian 11, i try it on 12 and V3 , when it work i can post the code , if interest.
it has
- Volume + / -
- Mute
- Play, Next, Pause
- Change config (
- Tweak a PEQ parameter ( bass and treble)
- Bass treble on / bypass
- Power on off amp ( trigger auto / forced on)
- Display volume mute bass treble config on 6 digit TM1637 LED Display
I use a bluethoot remote control, but it is not difficult to use an infrared remote control with flirc
for now, it work on camilladsp V2 and debian 11, i try it on 12 and V3 , when it work i can post the code , if interest.
This sounds almost exactly what I'm looking for - yes please thank You very much! 🙂
A small display would be awesome.
Power on/off - is that controlling a relay of sort or Is it a Pi on/off perhaps?
Which remote do you use for these actions if I may ask?
//
A small display would be awesome.
Power on/off - is that controlling a relay of sort or Is it a Pi on/off perhaps?
Which remote do you use for these actions if I may ask?
//
my post are under moderation for now , i am young...
i use TM1637 LED Display 0.56 inch 6 Digits for display
relay is for power amp, but it is easy to make also for raspberrypi
for remote, i use this: https://www.audiosciencereview.com/forum/index.php?attachments/1telecom-jpg.354877/
i use TM1637 LED Display 0.56 inch 6 Digits for display
relay is for power amp, but it is easy to make also for raspberrypi
for remote, i use this: https://www.audiosciencereview.com/forum/index.php?attachments/1telecom-jpg.354877/
OK! No problem - 62 years young ;-) I suppose it's your first postings - they are moderated I think?
The link goes to just a picture so I cant find out the make - does it have a name of sort?
//
The link goes to just a picture so I cant find out the make - does it have a name of sort?
//
ok, remote is MT4 5.2 , so on aliexpress: https://fr.aliexpress.com/w/wholesale-MT4-5.2-.html?spm=a2g0o.home.search.0
display: https://fr.aliexpress.com/w/wholesa...-6-Digits.html?spm=a2g0o.productlist.search.0
Use 6 digits, they are 2 différents dimensions of leds
Use 6 digits, they are 2 différents dimensions of leds
Last edited:
It's good you started your own thread for this! (Since it's not really specific to CamillaDSP.)
The hardware side is quite easy, 38kHz is the correct IR carrier frequency, and the remote uses the NEC IR protocol. The receiver will have three leads, one for power (3.3V or 5V), one for ground, and one for data. Check the datasheet for the specific model you buy to be sure which is which. Then you just connect the leads to the correct pins on the GPIO header as shown in the picture from @dptucunduva .
Any of the pins labelled GPIO <number> can be used to connect the data lead, just be sure to note down which GPIO number you use.
There's a video about this process here:
Now, the software part can be confusing, as there are two main ways of adding a remote, using LIRC or using the remote controller built into jivelite. The LIRC method is more flexible (but more complex) and would probably be better for your desired use. I must add a big caveat here, as I setup the remote
on my PCP install to use the jivelite method, so I'm really just going off what I've worked out by reading the docs.
For some background on LIRC you can take a look at this page, which gives a comprehensive (i.e. rather long) description of the flow of events and data. Basically, you need two critical files,
Here comes the potentially tricky part, as you're going to have to write your own application program in python to take these commands and send them to CamillaDSP via the websocket, and then modify lircrc to call that program with arguments that correspond to your desired action.
As an example, let's program it to decrease the volume by 1dB on pressing the down button. Here CamillaDSP has been run with the websocket set to use port 1234 (-p 1234) and the config contains a filter called 'volume'.
lircrc would contain the section
And you'd have a python script called remote.py that contained the following code:
As you noted, the Play, Pause and Next commands actually need to go to squeezelite rather than CamillaDSP. You can invoke these commands by simply having your program call the corresponding PCP shortcut:
Note that you can also control volume using the 'pcp up' and 'pcp down' commands.
The hardware side is quite easy, 38kHz is the correct IR carrier frequency, and the remote uses the NEC IR protocol. The receiver will have three leads, one for power (3.3V or 5V), one for ground, and one for data. Check the datasheet for the specific model you buy to be sure which is which. Then you just connect the leads to the correct pins on the GPIO header as shown in the picture from @dptucunduva .
Any of the pins labelled GPIO <number> can be used to connect the data lead, just be sure to note down which GPIO number you use.
There's a video about this process here:
Now, the software part can be confusing, as there are two main ways of adding a remote, using LIRC or using the remote controller built into jivelite. The LIRC method is more flexible (but more complex) and would probably be better for your desired use. I must add a big caveat here, as I setup the remote
on my PCP install to use the jivelite method, so I'm really just going off what I've worked out by reading the docs.
For some background on LIRC you can take a look at this page, which gives a comprehensive (i.e. rather long) description of the flow of events and data. Basically, you need two critical files,
lirc.conf
, which converts the raw keycodes into data strings, and lircrc
, which specifies how those data strings are converted into commands that will be sent to an application program. lirc.conf
is easy, as you can use the one provided by Ralphy here. (It looks like that's the model of Apple remote you're using.)Here comes the potentially tricky part, as you're going to have to write your own application program in python to take these commands and send them to CamillaDSP via the websocket, and then modify lircrc to call that program with arguments that correspond to your desired action.
As an example, let's program it to decrease the volume by 1dB on pressing the down button. Here CamillaDSP has been run with the websocket set to use port 1234 (-p 1234) and the config contains a filter called 'volume'.
lircrc would contain the section
Code:
begin
remote = APL-A1294.conf
button = KEY_DOWN
repeat = 0
prog = python3.11
config = remote.py 1234 voldown
end
Code:
# set volume
from camilladsp import CamillaClient
import sys
import time
try:
port = int(sys.argv[1])
command = str(sys.argv[2])
except:
sys.exit()
cdsp = CamillaClient("127.0.0.1", port)
cdsp.connect()
if command == "voldown":
current_vol = cdsp.volume.main()
new_vol = current_vol - 1
cdsp.volume.set_main(new_vol)
As you noted, the Play, Pause and Next commands actually need to go to squeezelite rather than CamillaDSP. You can invoke these commands by simply having your program call the corresponding PCP shortcut:
Code:
import subprocess
subprocess.run(["pcp", "pause"])
Thank you very much . that clears up a bit on how this works on a higher level.
So a Pi / OS take on how to receive low level signal on an interrupt pin (?) GPIO. Then associate the different signals on the GPIO to a command and in turn which software to direct that command to - in this case two different ones. Is that about correct?
Using pCP volume, what/where is this actually done - in Jivelite or perhaps Lyrion server? Do you know? Maybe CDSP is more accurate/has higher precision? 🙂
//
So a Pi / OS take on how to receive low level signal on an interrupt pin (?) GPIO. Then associate the different signals on the GPIO to a command and in turn which software to direct that command to - in this case two different ones. Is that about correct?
Using pCP volume, what/where is this actually done - in Jivelite or perhaps Lyrion server? Do you know? Maybe CDSP is more accurate/has higher precision? 🙂
//
Using pCP volume, what/where is this actually done - in Jivelite or perhaps Lyrion server?
As far as I can tell from looking through the scripts, it sends a volume command to LMS. I have no idea whether it's better to change volume in LMS or Camilla. I found a post that says LMS is processing the volume using 24bit precision, I suspect CDSP uses more, but 24bit is already good to -144dB, so I doubt the difference would be audible.
- Home
- Source & Line
- Digital Line Level
- CamillaDSP on Pi remote control