Using XBMC for Linux with an XBOX 360 Wireless Controller and the Userspace USB Driver xboxdrv

tonymagro | media center, xbmc | Saturday, September 13th, 2008

If you are running XBMC for Linux you can use your Xbox1 (wired), Xbox360 (wired) and Xbox 360 (wireless) controller as a remote just like your original xbox controller with your original Xbox. If you want to use a wireless Xbox 360 controller with Linux you will need to purchase an Xbox 360™ Wireless Gaming Receiver for Windows®. Despite the Wireless Gaming Receiver being branded as “For Windows” it is fairly easy to get it working quite well under Linux.

The Linux kernel has built in support for the Xbox gamepads via a kernel module. The latest SVN XBMC has a default Keymap.xml with support for this driver. This module works well enough but a nice alternative is to use the Userspace Xbox/Xbox360 USB Gamepad Driver for Linux. I found it to be more stable and easier to get up and running. The only downside is that you will have to write your own Keymap.xml but you can use my Keymap.xml which mimics the original Xbox controller binding as closely as possible.

See the README in the source of the Gamepad Driver for instructions on how to get it running or if you run Ubuntu Linux there is a How-to on the Ubuntu forums at http://ubuntuforums.org/showthread.php?t=825464

I start the Userspace Xbox/Xbox360 USB Gamepad Driver with following options:
xboxdrv --wid 0 -s -l 2 --dpad-as-button --deadzone 12000
‘-s’ puts the driver in silent mode so it won’t spam the screen with messages.
‘-l 2′ tells led light 1 on the controller to blink twice and then stay lit.
‘–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.

In order for XBMC for linux to use this driver you have to create your own Keymap.xml file with the correct joystick entries. The joystick name is “Xbox Gamepad (userspace driver)”. If you want to save some time you can use my Keymap.xml. Place it in your ~/.xbmc/userdata/ folder.

Download Keymap.xml

Update: jstultz pointed out that it is very important that the filename be Keymap.xml, not keymap.xml.
Checkout this discussion on the xbmc forums:
http://xbmc.org/forum/showthread.php?p=219809#post219809

After running the xboxdrv command and placing the Keymap.xml file in your userdata folder you can start xbmc. You should then be able to use your controller with XBMC.

If the controller doesn’t work then the problem is most likely permissions. Make sure the user you run xboxdrv and xbmc as has all the correct permissions to access usb devices and joysticks.

The wireless Xbox 360 controller turns off automatically after a certain amount of inactivity. As a result the battery lasts longer then other controllers I’ve tried. You can also use the rechargeable battery which makes it a pretty nice solution for a XBMC media center controller. Pressing the Xbox button on the controller will power the controller back on and it will start functioning again so don’t be worried about the controller not working after it powers off.

Powered by WordPress | Theme by Roy Tanck