Apple TV Linux IR Howto
From AwkwardTV
[edit] How to setup IR for Linux on the Apple TV
Install lirc version >= 0.8.2.
(Ubuntu 6.10 and 7.04 must be upated. The 7.10/gutsy "src.deb" may be rebuilt (.dsc,.diff.gz,.orig.tar.gz). Use dpkg-source -x to extract, and ( cd package ; dpkg-buildpackage ) to build. )
lirc versions <= 0.8.2 do not flag repeat events for a apple hiddev device. The patch on the lirc sourceforge site fixes this:
lirc-0.8.2-macmini-repeat.patch
apt-get source lirc cd lirc-0.8.2 patch -p1 < ../*lirc-0.8.2-macmini-repeat.patch dpkg-buildpackage dpkg -i ../lirc*deb
If your kernel has not already been updated apply the apple hiddev patch.
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 6b21a21..3621df1 100644
--- linux-2.6.22/drivers/hid/usbhid/hid-quirks.c 2008-03-13 15:21:34.000000000 +0000
+++ linxu-2.6.22/drivers/hid/usbhid/hid-quirks.c 2008-03-13 15:22:03.000000000 +0000
@@ -62,6 +62,8 @@
#define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a
#define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b
#define USB_DEVICE_ID_APPLE_IR 0x8240
+#define USB_DEVICE_ID_APPLE_IR_1 0x8241
+#define USB_DEVICE_ID_APPLE_IR_2 0x8242
#define USB_VENDOR_ID_ASUS 0x0b05
#define USB_DEVICE_ID_ASUS_LCM 0x1726
@@ -304,6 +306,8 @@
{ USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IR, HID_QUIRK_IGNORE },
+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IR_1, HID_QUIRK_HIDDEV },
+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IR_2, HID_QUIRK_HIDDEV },
{ USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_CIDC, 0x0103, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_HIDCOM, HID_QUIRK_IGNORE },
(See usb mailing list for an explanation. Though that patch is missing 0x8242. [1] )
Apply patch. Rebuild and install usbhid.ko.
cd /usr/src/linux ; make SUBDIRS=`pwd`/drivers/hid modules
Install module, Reboot, or reload module.
Download hardware.conf
Put that in /etc/lirc/
For my system, I had to edit the file and change:
DEVICE="/dev/usb/hiddev0"
Generate lircd.conf with:
irrecord -H macmini -d /dev/usb/hiddev0 lircd.conf
Yes, the intial press is a whole line of dots.
I named the buttons PLUS, MINUS, PREV, NEXT, PLAY, MENU
Put that file in /etc/lirc/
(Note, that you actually are not limited to the AppleTV remote. I recorded the remote of a dead DVD player, and concatenated the lircd.conf files, so both remotes can be used. -don )
restart lirc
download dot-lircrc
Install that as .lircrc
Then I play a external DVD with: vlc --intf lirc --alsadev iec958 /dev/scd0
Alternate vlc settings, which may work better for the Apple TV remote:
begin prog = vlc button = PLAY config = key-nav-activate end begin prog = vlc button = MINUS config = key-nav-down end begin prog = vlc button = PLUS config = key-nav-up end begin prog = vlc button = NEXT config = key-chapter-next end begin prog = vlc button = PREV config = key-chapter-prev end begin prog = vlc button = MENU config = key-disc-menu end
