LIRC
From Xbox-Linux
|
This page is also available in: Finnish |
when using xebian lirc with the fitting drivers is already installed
check if you have these files in /etc/lirc/
hardware.conf lircd.conf lircmd.conf
in hardware.conf you can remove the # in front of START_LIRCMD=false to disable the mouse-emulation (i did since i only wanted to control a mplayer which i start by ssh) the rest should be fine as it is
lircd.conf should already contain the mappings from xbox-remote to a list of events (SELECT, PAUSE...)
lircmd.conf is only of interrest if you want to use the mouse-emulation (so i will skip it)
now you just need to dump the following configfile to ~/.lircrc to map the lirc events to mplayer-commands
# .lircrc for mplayer control via xbox-ir # begin button = PAUSE prog = mplayer config = pause end begin button = PLAY prog = mplayer config = run end begin button = REVERSE prog = mplayer config = seek -10 0 repeat = 1 end begin button = FORWARD prog = mplayer config = seek +10 0 repeat = 1 end begin button = SKIP- prog = mplayer config = seek 0 1 end begin button = SKIP+ prog = mplayer config = seek 100 1 end begin button = STOP prog = mplayer config = quit end begin button = DISPLAY prog = mplayer config = osd end begin button = UP prog = mplayer config = dvdnav 1 end begin button = DOWN prog = mplayer config = dvdnav 2 end begin button = RIGHT prog = mplayer config = dvdnav 4 end begin button = LEFT prog = mplayer config = dvdnav 3 end begin button = SELECT prog = mplayer config = dvdnav 6 end begin button = MENU prog = mplayer config = dvdnav 5 end begin button = DOWN prog = mplayer config = dvdnav 2 end begin button = TITLE prog = mplayer config = sub_select end
have fun roh
Recompiled modules to get to work with the cheap remotes
http://www.gossamer-threads.com/lists/mythtv/users/156984#156984
Here are the files I promised: the xir and xpad drivers recompiled for Xebian 1.1.4 (kernel 2.4.31-xbox).
For those who missed the previous posts: these drivers allow you to use some cheap aftermarket xbox remotes that are not recognized by the original xir driver. On the other hand, you'll loose the support for some cheap aftermarket gamepads.
To use them, just replace the original drivers in /lib/modules/2.4.31-xbox/kernel/drivers/usb/ (make a backup first).
If you'd rather like to compile your own kernel, I also attached a patch against the 2.4.31-xbox kernel sources.
Recompiling to get a cheap generic remote working
If the above didn't work for you, try the following...
I found this in the mythtv mailing list.
http://www.gossamer-threads.com/lists/mythtv/users/156055#156055
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).

