CamillaDSP on Pi remote control

If there is a handler skeleton / working one, I suppose I might be able to grasp the structure and modify it for my needs. I'm known to have once written someting like program code that actually executed android something I expected :-D - but it was a vary long time ago... so I see myself as a beginner...

//
 
The problem is that the remote handlers baked into PCP are only written to send commands to squeezelite. It’s a really stripped-down system to cut out the overhead. A remote handler is just going to be a list of
Code:
if command == "volume-up":
  <send vol up command>
elif command == "volume-down":
  <send volume down command>
... etc
and working out the right commands to send.
 
Yeah, using evdev as the device handler lets you handle keyboard input events in a flexible manner. There is a libevdev package in the tinycore repository, so it might be possible to shoehorn this onto PCP, though you’d need to install the right python libraries too. But it’s a good example of the stuff available in standard Linux that has been removed from PCP.

The main core of the script is a good example of what I was talking about - just a long ‘if … elif… ‘ chunk where you just need to work out the correct code to send the commands you want.

The existing handler is squeezelite itself, I don’t see any way of ‘extending’ that without going into the squeezelite code and recompiling it. I suppose you could try modifying the Jivelite wrappper, but that looks really complex.
 
Aha - I thought that was a separate entity external to the "player"... well.... as lost as ever... 🙂 as I assumed, I would need serious help to pull this one off..

I wonder if one could persuade the pCP owner or maybe the player owner to do some kind of support / interface to make this easier...?

//
 
Yeah, using evdev as the device handler lets you handle keyboard input events in a flexible manner. There is a libevdev package in the tinycore repository, so it might be possible to shoehorn this onto PCP, though you’d need to install the right python libraries too.

yes, this was the problem when I tried.

Simple things in Linux become very complicated in Picore, because I don't know how it works...

especially installing python library like raspberrypi-tm1637 or glob2
 
Do the GOIP pins generate interrupts when a button is pushed on the remote? I suppose so. I also suppose these interrupts are handled by the OS. And if so, there is should be some sort of a subscription function for the application to be informed when such events has occurred and get to now what happened. Right?

Is there limitation that only one application instance may subscribe to know of these events? If not, it must be possible to introduce yet a subscriber to act on certain events - no?

So even if squeezelite is informed of these events, could an other program do the same? I.e. be an event handler of remote keystrokes and just ignore the ones about play/stop etc and act on others that squeezelite don't understand.

Trying to grasp the SW architecture....

//
 
yes, this was the problem when I tried.

Simple things in Linux become very complicated in Picore, because I don't know how it works...

especially installing python library like raspberrypi-tm1637 or glob2
You can create an extension with the python libraries you need in this way:
1) Ensure the following extensions are loaded (available in the repository): compiletc.tcz, squashfs-tools.tcz, python3.11-dev.tcz and python3.11-pip.tcz
2) Use the following commands:

Code:
pip install --upgrade pip
mkdir -p ~/tmp/usr/local/lib/python3.11/site-packages
cd ~/tmp/usr/local/lib/python3.11/site-packages
pip install --target . raspberrypi-tm1637
cd
mksquashfs tmp py3.11-rapsberrypi-tm1637-1.3.7.tcz
(I think it's a good idea to include the version in the extension name, this seems to be the current version.)
Then load the tcz file into /etc/sysconfig/tcedir/optional and include it in onboot.lst as usual.
You can do the same for glob2.

I've just upgraded to PCP 10.0.0 and notice the repository now carries a pre-made extension for the python evdev libraries, so it shouldn't be too hard to get your code working on PCP.
 
Last edited:
@charlesky ,

I was able to create and install the tm1637 and glob2 python modules. Your instructions were precise and sufficient. evdev is already installed when Bluetooth is enabled in picoreplayer.

But there is a problem...

I was able to pair the remote with bluetoothctl (with the web interface no pairable inputs) but it does not appear in /dev/input and therefore no longer detected by evdev.

So I'm stuck, any ideas?
 
This story is starting to become complicated, especially because I don't use PCP and I have a script which automatically installs everything necessary in raspberrypiOs in 3 minuts...

I will share it soon in another thread, after a friend test in rpi5 (I have rpi4 only).