Using Apple TV Remote on OSMC Linux

#1

Hi All.

I’ve recently installed OSMC on an old Apple TV to use it to run Homebridge among other things. It works really well, and gave new life to an old machine I had sitting around!

As part of my tinkering though, I’d love to get the Apple TV remote to work in Linux as well as in Kodi (where it works fine). I’ve done some exploring and found that it runs eventlircd and atvclient and found the lircd.conf files, but no matter what I do I can’t get the remote commands to come up in ircat. Has anybody got any tips on getting this to work? I’ve done a lot of googling but documentation on eventlircd and atvclient is sparse. I know this is an old product, but I’d love to use the remote to drive the Homebridge install.

Appreciate your help!

0 Likes

#2

You need to stop eventlircd for irrecord to work correctly IIRC.

0 Likes

#3

lircd needs to be stopped before using irrecord, not eventlircd.

sudo systemctl stop lircd_helper@lirc0

use irrecord then

sudo systemctl start lircd_helper@lirc0 (or reboot)

Current versions of OSMC already have profiles for both the silver and white Apple remotes, however the last AppleTV build is now very old (and unsupported) and I’m not sure if those profiles went into the last AppleTV build or not.

If they are not there it should be possible to copy them from here though:

apple-silver-A1294-lircd and apple-white-A1156-lircd. There is both a conf file and an image that is displayed in my osmc remotes. These files normally reside in /etc/lirc/

Edit: I see you’re trying to use the remote “in linux” not Kodi. If you do not want to use it in Kodi at all then you would need to permanently disable the lircd service to prevent it “grabbing” the port. You could do this by masking the service:

sudo systemctl mask lircd_helper@lirc0

This would prevent our version of lirc from running and leave the /dev/lirc device free to be accessed by something else.

0 Likes

#4

Thanks for your help, but I must still be missing something. I’ve run the systemctl command you specify to disable lirc, and I’ve also found the conf file in the etc/lirc directory and created a symlink from lircd.conf in that directory to the apple-silver.conf file. But when I run irrecord it still says that it could not get file information on /dev/lirc0, and could not init hardware. I’ve also tried disabling atvclient (I just killed the process), but it still doesn’t work. If I use irw or ircat to monitor it doesn’t pick up the buttons at all.

Do I need to run lircd manually, and/or download a version of lircd to run instead of just leaving eventlircd running from the original install? I’m honestly not sure how that part works, everything I’ve seen suggests the remote is not connected at all, but when I run Kodi sure enough it works (assuming I haven’t killed any processes!). How does atvclient fit into the picture? Do I need it at all if I’m not planning to run the remote in Kodi? If I could just get to the point where lirc can see the button presses I’d be a happy man (I’m pretty sure I know how it works from there!).

Thanks for all your help, much appreciated.

0 Likes