[mythtv-users] Re: Xbox as FE
Vladan Bato
vbato at ieee.org
Fri Oct 21 10:32:57 UTC 2005
Quoting myself:
> However I think that it's a problem with the particular remote (or better,
> the remote dongle) that I have.
>
> By poking in the /proc/usb/devices, I discovered that the remote is
> actually seen as a gamepad and handled by the xpad driver. This also means
> that lirc never sees it.
>
> I guess I'll have to spend the €30 for a genuine Microsoft DVD kit.
>
Well, I spared the €30 as I managed to make it work!
So, for the record (if anybody happens to have the same problem), here's
what I found out and what I did:
The first question was: why was the remote receiver handled by the xpad
driver. I looked at /proc/bus/usb/devices and noticed that this device
had a strange ID. Both Vendor and ProdID where ffff!
I then looked at the xpad driver sources to see what it says about this
device. And here's what I found in drivers/usb/xpad-core.c:
{ 0xffff, 0xffff, 0, "Chinese-made Xbox Controller" }, /* WTF are
device IDs for? */
It appears that there are many xbox game controllers (and apparently DVD
dongles) that have bogus IDs. The xpad driver handles them all and
assumes they are game controllers.
The question was: If I made the xir driver (the one handling the xbox
remote) recognize this device, would it work? Well, it did.
Before I explain what I did, let's write something for google to index
in case someone does a search for this:
How to make cheap chinese aftermarket DVD remotes for Xbox work with
LIRC in xebian 1.1.4:
Note: I'm writing this from memory, so it probably contains errors.
* Get the kernel sources (use apt)
* configure the sources using the config file in /boot:
* # cd /usr/src/kernel-2.4.31-xbox
* # cp /boot/config-2.4.31-xbox .config
* # make oldconfig
* # make dep
* Go to the drivers/usb directory and modify the xpad-core.c and xir.c
files:
* # cd drivers/usb
* # vi xpad-core.c
* Comment the line mentioned above (line 95) and save the file
* # vi xir.c
* Add the following line after line 83 (in the xir_device array):
{ 0xffff, 0xffff, "Chinese-made Xbox Controller" },
(Notice that it's not the same as above, there is one less element
in the struct).
* Compile the modules (I didn't know how to compile modules in a
single directory, so I compiled them all):
* # cd /usr/src/kernel-2.4.31-xbox
* # make modules
* Copy the two modules (xpad.o and xir.o) to the
/lib/modules/2.4.31-xbox/kernel/drivers/usb/ directory, overwriting the
old ones (make a backup first).
* Reboot the xbox. The xir driver should now handle the remote, and
lirc should work correctly (test it with irw).
--
Vladan Bato
vbato at ieee.org
More information about the mythtv-users
mailing list