Some suggestions for handling IR remotes

I wanted to enhance my remote control environment at home within my raspberry pi4 running current osmc. That worked, but I did not understand the details. Thus I did a deeper analysis of all IR related configuration files (as far as I can tell). And I discovered some inconsistencies which I propose to be resolved:

Handling of ir-keytable

There are two folders containing toml configuration files /etc/rc_keymaps and /usr/lib/udev/rc_keymaps. The first one is empty, the second one contains files. The configuration file /etc/rc_maps.cfg point into the empty folder, but naming all those files as available within the udev subfolder. As far as I can tell only the udev 70-infrared.rules loads keytables, exactly those from /etc/rc_maps.cfg - in short, nothing. Thus I propose to move the rc_keymaps from udev folder into /etc to make it work. I could not test my proposal since I don’t own a related IR device. But maybe the files within udev folder are intended as samples to be used after changing them - then everything is fine as is.

Path mismatch /var/run/lirc with /usr/var/run/lirc

irexec & irw are suffering. My proposed solution - replace /usr/var/run/lirc by a symbolic link onto /var/run/lirc. Afterwards one can run irw without options, despite eventlircd is running. I myself did create a custom /etc/systemd/system/irexec.service - but there exist already a working /lib/systemd/system/irexex.service - only with the wrong path /usr/sbin/irexec (and a better configuration filename irexec.lircrc).

I also tried to get rid of the lircd option –uinput and use the recommended service lircd-uinput. That failed. lircd-uinput writes onto /dev/uinput - nobody is reading from (e.g. irw fails).

Hope my suggestions are welcome, Michael

Use Bluetooth remote , I use skyglass remote

Not forgotten.

We are re-working the remote support and I’m discussing this with @darwindesign.
Some testing would be appreciated when we have something

Cheers

Sam

In the meantime I’ve a working IR setup for receiving & sending.

I’ve learned that different file pathes exist to allow for tweaking files without loosing them by a fresh apt update, more precise - files within /etc are preferred over those from /lib. Thus I’ve stopped to modify distribution files, instead I store my changes within /etc. E.g. I did populate /etc/rc_keymaps with my modified/used keymaps leaving /lib/udev/key_maps untouched. Same for my modifications regarding systemd - I do provide a “private” eventlircd.service within folder /etc/systemd/system leaving the delivered one at /lib/systemd/system/eventlircd.service untouched. systemd daemon prefers the one within /etc over the one within /lib.

I also no longer need/use /usr/var/run/lirc. If I want to see key events, I call “irw /var/run/lirc/lircd” directly with path. The same soccket can be read by multiple programs in parallel without disturbing each other, e.g. irw, mediacenter, and irexec all run in parallel seeing the same events from the same socket /var/run/lirc/lircd.

In my setup two services must be running: eventlircd and irexec (no lircd). Both are “interwoven” - stopping eventlircd will automatically stop irexec. And stopping eventlircd is mandatory if one wants to use “ir-keytable -t” (e.g. to grab unknown IR codes). After re-starting eventlircd one has to restart irexec, too.

Of course I might help with testing, but I run exactly one raspberry pi4 as “production” server, there is no spare one. Thus I wouldn’t update that pi4 “in place”. If there is a trixie version available, I will prepare a separate SD card for testing purpose. Thus I can go back to the current bullseye without much effort. I do have automated scripts to apply all my changes onto a fresh raspberry installation with all services/tools used. But of course I do expect minor glitches from my scripts - it’s a fresh OS kernel with probabely changed utilities.

If you want I might provide all my tweaked IR setup files.

Regards, Michael

As the current system is now all legacy the logical path forward I’m thinking is switching to ir-keytable exclusively.

I think moving towards a single IR configuration method makes sense, but I’d be a little concerned about troubleshooting existing setups after the change.

One thing that might help is a short migration guide with two separate checks. First, stop eventlircd and use ir-keytable -t to confirm the receiver is detecting the expected scancodes. Then restart the services and check whether those same buttons actually trigger the right actions in Kodi.

That way, if something stops working, it’s easier to tell whether the problem is with the keymap itself or somewhere further along the chain.

I’d also suggest including a simple backup and rollback procedure. Some people only have one Raspberry Pi running their media setup, and I imagine they’d be hesitant to risk breaking a working remote just to test the new configuration.

If we go down this path there shouldn’t be a complicated troubleshooting path as it is literally just the kernel decoder and a toml file. You can use an ir-ctl command to confirm the raw input is working and from there it is just a matter of enabling the correct toml file. There would be no other software in the chain. I was told by Gemini that the number of receivers that are in use today on media centers that are not supported at the kernel level would be estimated at 1-2%. I assume most of these are likely in use by people running old HTPC’s so would not be running OSMC. I just can’t imagine that enough people would be impacted by compatibility to justify a fallback lirc system like LibreElec setup when they transitioned years ago. My understanding is LE’s fallback system was more to do with the immaturity of ir-keytable and how it often had issues on supported hardware. My understanding is that these problems have resolved and it is quite mature now.

Also, this change would not be happening with a regular update but rather in a future version of OSMC which would be a clean install only setup. As such there should be plenty of feedback from early adopters for people to understand what they are getting themselves into. In my mind, how I envision a transition playing out, is that for the overwhelming majority of people who’s remote doesn’t just automatically work, there will only be the issue of going into the My OSMC addon and selecting their remote. I foresee an issue with people running advanced Kodi keymaps such that there is differences in the naming of some of their buttons necessitating some small tweaks to their Kodi keymap. I don’t see how that would be an avoidable issue though.