Lirc reconfigure


I have a remote {connected to Raspberry PI 2, with the latest OSMC_TGT_rbp2_20151129.img installed} which outputs to /dev/usb/hiddev0 and using the sb0540 driver with lircd I can get it working fine in irw. Now, how do I reconfigure lirc to autostart with this specific dev and driver?

Sudo dpkg-reconfigure lirc doesnt work saying the lirc package is not installed on the system.

Thank you for any input on this,


I don’t know the answer to your question but I’ll give you a little insight into how Lirc is used in OSMC.

Lirc is not directly started as a service, instead it is started by the script /lib/udev/lircd_helper, which is called by udev rules in /lib/udev/rules.d/98-lircd.rules in this section:

# Ask lircd_helper to lirc devices.
SUBSYSTEM=="lirc", \
  ENV{lircd_driver}="default", \

# Ask lircd_helper to handle USB devices that do not show up as lirc devices
# and are supported by lircd. Remote controls that are USB HID devices that show
# up as event devices are not included as as they are handled by eventlircd.

If your remote is truly detected as an HID device, you are probably better off using eventlircd instead of lircd, which is controlled by /lib/udev/rules.d/98-eventlircd.rules - you can see examples in there which match based on USB device number and then enable eventlircd and optionally specify an evmap file if some buttons need remapping. (See /etc/eventlircd.d/*.evmap for examples)

# Ask eventlircd to handle USB HID devices that show up as event devices and are
# known to be remote controls. For simplicity, the event map file names have the
# format <BUSTYPE>_<VENDOR>_<PRODUCT>.evmap.

If you want a quicker more hacky solution, you could start an instance of lircd yourself from /etc/rc.local or create a custom systemd service - as long as you use the --uinput command line option to output uinput events it will be passed through eventlircd to Kodi. (You can have multiple instances of lircd running servicing different devices)

Solved. Because I only use this one remote, I edited the /lib/dev/lircd_helper file replacing the driver and device variables with “sb0540” and “/dev/usb/hiddev0” respectively. On the next reboot the lircd started with these instead with the “default” driver and “/dev/lirc0” and everyting works now.

Thank you for pointing me in the right direction.

Nice day to all.


Be aware that the way you have done this will cause your changes to be overwritten in a future OSMC update - lircd_helper is not meant to be user edited.

For a permanent solution you should be writing a udev rule in /etc/udev/rules.d/ or launching your copy of lircd from /etc/rc.local or a custom systemd service.

Mine is a quick hack indeed, been doing it like that since I can remember. Strange things happen to me every day.