Hooking up your xbox360 wireless controller to XBMC Live 9.04
I love my XBMC, this media center plays any kind of media file without any hassle. But recently my old xbox gave up on me, so I was forced to upgrade to a new Media Center setup
.
I did not want to buy a new OS to run my new hardware so I decided to try the linux version of XBMC. After consideration I went for XBMC Live since my experience in linux is pretty basic, and I wanted everything “just to work”.
Running the Live CD was pretty straigtforward. After a few minutes my new media-center was installed on the hard drive. Everything worked flawlesly, except for my xbox 360 wireless controller. Since XBMC is beïng run from your couch, a wireless controller is pretty much a big requirement.
This tutorial describes the stepts I went trough to setup an “Xbox 360 Wireless Controller” on my XBMC Live from a Windows based machine.
Installation Summary
- The following kernel modules must be included and loaded:
- uinput
- joydev
- The xpad kernel module IS NOT LOADED.
- The following libraries and tools for compiling:
- libusb
- boost
- scons
- uinput
- The driver itself from the author’s website http://pingus.seul.org/~grumbel/xboxdrv/
Step One
By default, XBMC Live loads the joydev module. You may add the uinput module to the modules list to load at boot time.
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with “#” are ignored.
uinput
When you reboot, this module will be loaded automatically. You can check if it is running by issuing the following command:
lsmod | grep uinput
If, by any means, the joydev module isn’t running on your xbmcLive machine (test with “lsmod | grep joydev”) just add the joydev module to the /etc/modules file.
Step Two
xpad should be running on your setup, so we need to make sure that it will not be started on boot. Edit the file “/etc/modprobe.d/blacklist-oss.conf” and add the following lines below:
…
blacklist soundcard
blacklist usb-midi# XBOX 360 Wireless Controller Setup
blacklist xpad
sudo rmmod xpad
lsmod | grep xpad
Now that we have the proper modules loaded, we need the software and libraries to compile everything together. If you do not have the build-essential package, you will need that first:
sudo apt-get install build-essential
sudo apt-get install libusb-dev
sudo apt-get install libboost-date-time-dev libboost-date-time1.34.1 libboost-dev libboost-doc libboost-filesystem-dev libboost-filesystem1.34.1 libboost-graph-dev libboost-graph1.34.1 libboost-iostreams-dev libboost-iostreams1.34.1 libboost-program-options-dev libboost-program-options1.34.1 libboost-python-dev libboost-python1.34.1 libboost-regex-dev libboost-regex1.34.1 libboost-signals-dev libboost-signals1.34.1 libboost-test-dev libboost-test1.34.1 libboost-thread-dev libboost-thread1.34.1
sudo apt-get install scons
sudo apt-get install libx11
Step Four – Compiling!
Finally, after all the hassle we can go and compile the xboxdrv. Wait what, we don’t have the source code available yet? You can check the latest news on the xboxdrv on the author’s site http://pingus.seul.org/~grumbel/xboxdrv/.
To download the driver we are gonna make use of git, since this source-control system gives the added benefit that your source code can be easilly updated. You can install git by issuing the following command:
sudo apt-get git
Now it is time to subscribe to the xboxdrv repository (make sure that you are in your home directory, “cd ~”):
git clone git://github.com/Grumbel/xboxdrv.git
After the repository is added, just go to the directory and execute the build command
scons
Aaaand, if everythings worked out fine, you should have a file called xboxdrv standing proudly in the xboxdrv folder. You can now run this file as administrator and start testing your Xbox 360 Controller.
I copied the Keymap from Tony’s Blog but changed the name to start with upper caps. Since XBMC does not recognize a keymap.xml file with a lower caps character. You can get it from here: http://www.aranea.be/files/Keymap.xml
Be aware that the Keymap above requires you to start the xboxdrv with additional parameters. This is my current command to launch the driver:
xboxdrv –dpad-as-button –deadzone 12000
‘–dpad-as-button’ turns the dpad into button events instead of an axis. This is important so you can scroll in the XBMC menus.
‘–deadzone 12000′ sets a deadzone for the thumbsticks. 12000 works well with XBMC for things like analog seeking but you might want to play around with that value.
As you may notice i don’t use the additional parameters from Tony’s Blog. This is because the newer drivers does not need to know if you are adding a wireless or wired controller. (Before we where adding wid parameters… if you don’t know what I’m talking about, ignore this remark :p)
The only thing to do now is make sure that your xboxdrv is started every time you boot your HTPC, I’m currently trying to find the best sollution for this problem because the implementation for the moment is not as “koosjer”. I’ll update this post when it’s finished!
Sources:
- http://ubuntuforums.org/showthread.php?t=825464
The Ubuntu thread that provides the original tutorial for this setup on Ubuntu - http://www.stolennotebook.com/anthony/2008/09/13/using-xbmc-for-linux-with-an-xbox-360-wireless-controller-and-the-userspace-usb-driver-xboxdrv/
A blog post by Tony to get me started with the driver in XBMC and a Keymap.xml
Great tutorial!
…
Got me going for 2 straight days
Anyways, let’s make this comment useful:
I myself was fiddling with getting autostart to work and I now got something that works (on minimal Ubuntu 9.04 and XBMC SVN).
These are the steps I took:
[BEGIN PROCESS]
***Add default user “xbmc” to group “root”***
sudo usermod -a -G root xbmc
***Create file “55-permissions-uinput.rules” in etc/udev/rules.d, containing:***
KERNEL==”uinput”, MODE=”0660″, GROUP=”root”
***Alter /etc/rc.local***
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will “exit 0″ on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
./home/xbmc/xboxdrv/xboxdrv –id 0 -s -l 2 –dpad-as-button –deadzone 12000
exit 0
[END PROCESS]
This might well be not what you are looking for, but it meets my modest HTPC demands
.
greetings,
Dries
Very silly question, but how are you installing all this stuff “from a Windows based machine”. Many thanks!
Short answer: you don’t.
Long answer: In Windows you already have an Xbox 360 Wireless controller driver available. But currently XBMC does not really support it at the moment.
When you want to get your controller working in Windows you can tryout xpadder. This will emulate keyboard-presses from your controller.
@Dries Vervoort Wow, thanks for your addition! I will add this piece of code pretty soon so I can change my tutorial into a thread for the XBMC-forums.
Any update on getting xboxdrv to start on every boot?
I’m just putting together an xbmc htpc myself, in an Acer revo 3610!!
I tried this guide on 9.11-repack.
Starts out fine, and i manage to get to the installing of build essentials. But from here on i only get “could’t find package’.
did other builds have more repositories? Or am i completely missing something (I’m a big linux noob, so i try to do everything letter by letter)
awesome thankyou.
works for me after following “http://wiki.xbmc.org/index.php?title=XBMCbuntu” for installation