Difference between revisions of "Apple TV Linux IR Howto"

From AwkwardTV
Jump to: navigation, search
(How to setup IR for Linux on the Apple TV)
Line 12: Line 12:
  
 
If your kernel has not already been updated apply the apple hiddev patch.
 
If your kernel has not already been updated apply the apple hiddev patch.
 +
 +
<pre>
 +
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 },
 +
</pre>
  
 
[http://cbg.dyndns.org/store/apple-remote-quirk-hiddev.patch apple-remote-quirk-hiddev.patch] Change USB_DEVICE_ID_APPLE_REMOTE2 to be 0x8241
 
[http://cbg.dyndns.org/store/apple-remote-quirk-hiddev.patch apple-remote-quirk-hiddev.patch] Change USB_DEVICE_ID_APPLE_REMOTE2 to be 0x8241

Revision as of 07:04, 14 March 2008

How to setup IR for Linux on the Apple TV

Install lirc 0.8.2.

(Ubuntu 6.10 and 7.04 must be upated. I downloaded and rebuilt the 7.10/gutsy "src.deb" (.dsc,.diff.gz,.orig.tar.gz). Use dpkg-source -x to extract, and ( cd package ; dpkg-buildpackage ) to build. )

Note, the current lirc version appears not to flag repeat events. The patch on the lirc sourceforge site fixes this:

lirc-0.8.2-macmini-repeat.patch


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 },

apple-remote-quirk-hiddev.patch Change USB_DEVICE_ID_APPLE_REMOTE2 to be 0x8241 Apply patch. It applies to 2.6.22 or 2.6.23. 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/hiddev0"

Generate lircd.conf with:

irrecord -H macmini -d /dev/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

This page was helpful: LinuxOnMacbookPro

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