Multimedia Player HOWTO
From Xbox-Linux
by Gerard van Dijnsen (original version from 14 April 2004)
This HOWTO is quite outdated. This site is a wiki, so you can easily update it!
| Table of contents |
Status
This first part of the howto is quite outdated. For the current driver support follow this link (http://www.xbox-linux.org/docs/howtolirc_xir.html).
After you have successfully installed the driver and got it working with freevo, feel free to follow the advice in the second part below.
Howto setup the old drivers
Introduction
For some time now, I have tried to turn my Xbox into something useful. The Xebian projects makes it possible to install Linux on the Xbox, which opens many doors to new applications. I have turned my Xbox into a multipurpose multimedia playing device using Xebian 1.0.1 and Freevo 1.4. These projects make the transition relatively easy, however, there were several issues to be tackled before it could be called useful. After a lot of Googling and experimenting I worked out how to do it and decided to write it down here. This document was adapted especially to match the Xbox-Linux project documentation style. The original version of this document along with some patch files can be found here (http://www.delgul.demon.nl/xbox/) .
Getting the Xbox remote control to work
Support for the Xbox remote control is one of the problem areas of the Xbox-Linux project in my opinion. The driver suffers from several bugs, making the remote behave badly. First off, the driver seems in a constant battle for control with the xpad driver. Changing the load order can help here, but using the xpad driver and the usb-xboxir driver at the same time often results in erratic behaviour. Furthermore, the driver suffers from jittery behaviour with at times unwanted repeated keystrokes or no action at all. Finally, the userland tool to map keys of the remote is largely undocumented and buggy. All this has been so since the beginning of the project and although remedies are known, the developers seem not to be inclined to update the driver. At the time of writing, the last maintenance entry in the code states 2002_09_02.
Patching the usb-xboxir driver
There are two reasons for patching the usb-xboxir driver:
- Remove the annoying jittery behaviour
- Remap the keys of the remote to your liking First download the CVS code for the Xbox-Linux kernel:
cd /root/ cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/xbox-linux login cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/xbox-linux co kernel
Next, download the Autorepeat patch (http://www.delgul.demon.nl/xbox/xboxir-autorepeat.patch) from Bjorn Danielsson. The original patch can be found here (http://article.gmane.org/gmane.linux.ports.xbox.devel/6907) . Now apply the patch:
cd kernel/drivers/usb/ patch < path/to/xboxir-autorepeat.patch
Before starting the compilation however, you have to adapt the key mapping in the usb-xboxir.h file. You can either do it manually or use the small patch (http://www.delgul.demon.nl/xbox/xboxir-keymap.patch/) I wrote that gives reasonable settings for use with Freevo. While still in the kernel/drivers/usb/ sudirectory, apply it with:
patch < path/to/xboxir-keymap.patch
Next, compile the module:
gcc -D__KERNEL__ -DMODULE -I/root/kernel/include/ -O3 -c usb-xboxir.c
You should not get any errors or warnings during compilation. After compilations, copy the module to a seperate directory:
mkdir /root/freevostuff cp usb-xboxir.o /root/freevostuff
You can now load it with the following commands:
rmmod usb-xboxir insmod -f /root/freevostuff/usb-xboxir.o
It will complain some about versioning differences and tainting the kernel, but it will probably work all the same. At least it did for me ;-)
Module conflicts
It seems the xpad and the usb-xboxir modules have conflicts when both are loaded at the same time. Unloading the xpad module will help. If you don't need the xpad device, leave it unloaded. If you really need it, you might be helped with using a simple:
rmmod xpad; modprobe xpad Your results may vary.
2. Run freevo on startup
Tuning XFree86
In Xebian 1.0.1, xdm is started at boot time. If you are going to use the Xbox as a standalone settop box with freevo, this behaviour is unwanted. Disable xdm in the following way:
update-rd.d -f xdm remove
Next, we want a default screen resolution of 800x600 with 24 bits color depth. Edit /etc/X11/XF86Config-4 and make sure that the following lines are in the section "Screen"Â:
DefaultDepth 24 and:
SubSection "Display"
Depth 24
Modes "800x600"
EndSubSection
Installing Freevo
Installing Freevo is not a trivial thing for the Xbox. Luckily, a special version of Freevo is available for the Xbox from the Xbox-Linux multimedia project (http://xbox-linux.sourceforge.net/docs/multimedia.html) . I used Freevo 1.4 for the Xbox (http://www.xbox-linux.org/down/temp/xboxfreevo.tar.gz) . After downloading, install it:
cd /usr/local/ tar -zxvf path/to/xboxfreevo.tar.gz
The files will now be installed in /usr/local/freevo/. Make sure the following lines are in freevo.conf:
display = x11 geometry = 800x600
Tune the settings file local_conf.py to your needs. If you want a quick start, you can use my configuration file as a base. Note however, that I removed some extra configuration plugins that I found completely unnecessary. I like to do all my network-drive mounting myself, thank you!
Testing Freevo
Actually, you should now have a working configuration. You can test it easily by doing:
cd /usr/local/freevo/ X & ./freevo
Play around a bit to see if it works to your liking. If not, tune the configuration a bit more.
Making it all work at boot time
Starting your freevo from a ssh connection every time is a bit clunky and tends to raise eyebrows with people blind to the finer points of Linux hacking, eg. 99% of the world. Time to make everything work at boot time. There are several ways to do this. The way I describe here is not very secure at all and is not recommended for your average system. However, if you do not use your Xbox as a public server, it is probably ok. First edit /root/.xinitrc to contain (only) the following lines:
xset -dpms s off & /usr/local/freevo/freevo
Add the startx command to /root/.profile:
echo startx >> /root/.profile
Next, create a file called /root/freevostuff/freevostart with the following lines:
/sbin/rmmod xpad /sbin/rmmod usb-xboxir /sbin/insmod -f /root/freevostuff/usb-xboxir.o su - root
Make the file executable:
chmod 777 /root/freevostuff/freevostart
Finally, make a symbolic link in the /etc/rc2.d/ directory (make room first):
mv /etc/rc2.d/S99rmnologin /etc/rc2.d/S98rmnologin ln -s /root/freevostuff/freevostart /etc/rc2.d/S99freevostart
At the next reboot, X and freevo should start completely automatically.
Disaster recovery
Playing with initialization scripts is always a bit dangerous. A small mistake, and the sshd daemon may not load up, effectively shutting you out. Not to worry, it has happened to me too and is easily remedied. I installed my Xebian in the game partition. The example here is for this situation. First boot the Xbox using the Xebian CD you installed the system with. Then create 2 mountpoints:
mkdir /root/game mkdir /root/mnt
Then mount the game partition and after that the rootfs filesystem:
mount -t fatx /dev/hda50 /root/game mount -t loop /root/game/debian/rootfs /root/mnt
Your root file system is now available under /root/mnt/. Make changes to correct the problem, unmount and reboot!
Concluding remarks
- It is not strictly necessary to remap the keys in the usb-xboxir.h file. It can also be done in local_conf.py or src/event.py. I did not test this myself though.
- Freevo can also work with fbdev instead of X11. It didn't work for me, but then again I didn't try very much ;-)

