Wednesday, 25 April 2012

Xbox DVD Dongle and lirc

I've started building the new man room in the house complete with a projector. Before its all finished I've decided to tackle the software side of things. The PJ will be hooked up to my Linux desktop via HDMI

First problem: I dont want to use a keyboard/mouse to watch videos. I want a remote.

I did have a working homebrew serial IR receiver but it looks like its died at some point. The next best thing I have laying around is an old Xbox 1 DVD dongle (and remote). Easy you would think... nope.

Firstly I had to be able to physically connect the dongle to a USB port. The Xbox used the USB protocol but just a non-standard connector (thanks M$). 5 minutes with a soldering iron and that problem was solved:



Now to the software side of things. In lirc the xbox dongle used the atiusb kernel module which, for whatever reason, is no longer maintained and doesnt work with newer kernels. Thankfully someone has split it from the atiusb module and created a working lirc_xbox module - all well and good until I find out that its only available in lirc-0.9.1 and higher. My yum repo is only on lirc-0.9.0 :(

Thanks to someone on the ubuntu forums there are instructions for getting the module compiled separately to the main lirc software and avoiding rpm dependency hell.

For Fedora 16 I did the below and all is good:

git clone git://lirc.git.sourceforge.net/gitroot/lirc/lirc
wget http://old.nabble.com/attachment/31787507/0/lirc_0.9.1_lirc_xbox_driver.patch
cd lirc/
patch -p1 <../lirc_0.9.1_lirc_xbox_driver.patch
vi drivers/lirc_xbox/lirc_xbox.c

remove the line #include <linux/smp_lock.h>
./autogen.sh ./configure -with-driver=userspace cd drivers/lirc_xbox/ make make install
 A quick test with irw and it looks good:

$ irw
00000000000000a6 00 UP XboxDVDDongle
00000000000000a6 01 UP XboxDVDDongle
00000000000000a6 02 UP XboxDVDDongle
00000000000000a7 00 DOWN XboxDVDDongle
00000000000000a7 01 DOWN XboxDVDDongle
00000000000000a9 00 LEFT XboxDVDDongle
00000000000000a9 01 LEFT XboxDVDDongle
00000000000000a9 00 LEFT XboxDVDDongle
00000000000000a9 01 LEFT XboxDVDDongle
00000000000000dd 00 SKIP- XboxDVDDongle
00000000000000a8 00 RIGHT XboxDVDDongle
00000000000000a8 01 RIGHT XboxDVDDongle
00000000000000a8 02 RIGHT XboxDVDDongle
00000000000000ea 00 PLAY XboxDVDDongle
00000000000000ea 01 PLAY XboxDVDDongle
00000000000000ea 02 PLAY XboxDVDDongle

Even works with XBMC out of the box :)

No comments:

Post a Comment