This post was saved / ported from a previous site migration. You may encounter missing images, dead links, and strange formatting. Sorry about that!

Intel NUC, remote controls, and Fedora 22

Media System Administration linux Technology

I’ve had a fun time getting kodi to work with my new remote on an Intel NUC. So, in case you’re in a similar situation, here’s what worked for me! These instructions are for Fedora 22 and the hardware I linked to in this paragraph, but a lot of the instructions should be applicable in slightly different situations as well.

  1. Update your Intel NUC to the latest bios. At least on the RYH line, they fixed some problems with the IR receiver in a recent update.
  2. In the NUC bios, make sure the IR port is enabled and set the IR controller type to “RC6”. Kodi works much better out of the box with this protocol. Some of your buttons aren’t going to work right, though. The hard part is fixing that.
  3. Do not install lirc. lirc is an unintentional trap created by well-meaning people. It will not help you here.
  4. Instead of lirc, install v4l-utils to get ir-keytable:
    dnf -y install v4l-utils
  5. Now, here’s why you don’t want lirc: with an RC6 receiver, the kernel is going to parse your remote’s input and output keyboard events. Unfortunately, many of the keysyms it sends aren’t properly handled by Xorg. So, you need to remap those keysyms to working keysyms of your choice. To do that, you need exactly one bit of the process described here. Copy the /etc/rc_keymaps/rc6_mce file provided by wstewart at that link, and then run the command they mention:
    ir-keytable -c -p RC-5,RC-6 -w /etc/rc_keymaps/rc6_mce
    You’ll need to get that command to run at startup, as well. I found that all the rest of wstewart’s instructions were unnecessary with a modern kernel and kodi installation.
  6. Now, fire up kodi, and bask in the glory of your remote working correctly!
If you want to remap what some of the buttons do, you can get the scancodes with ir-keytable -t, then edit /etc/rc_keymaps/rc6_mce. See the kodi keyboard shortcuts page for details on what keypress you need to send. If you can’t figure out what the constant name for a key is, (most of them are obvious) refer to the kernel source’s input.h.