Kodi Community Forum

Full Version: Using xboxdrv
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys,

I'm using xboxdrv on ubuntu 12.04 and am hoping someone else on here may be a bit more familiar than I am. Basically, the only way I could get my xbox 360 wireless controller to work with the pr-branch of retroplayer was to use xboxdrv, I use an aeon-nox custom menu to launch the driver before launching a ROM. I created a couple different menu's for each controller config type, and have SNES and NES working great. One thing I can't get to work is using multiple controllers for two player games. I'm using a config file, one for each different controller style (NES, SNES, PSX, etc), and call it like:

xboxdrv --config path-to-config/SNES.xboxdrv

I've tried connecting two like this:

xboxdrv --wid 0 --config path-to-config/SNES.xboxdrv #controller 1

xboxdrv --wid 1 --config path-to-config/SNES.xboxdrv #controller 2

but only the first controller works within xbmc and the full screen gameplay. I also tried daemon mode by calling:

xboxdrv --daemon --config path-to-config/SNES.xboxdrv and then inside the config file adding:


but I can't get it to work.

Is anybody familiar with how to do this, or is there a better approach?

Thanks for any help.
okay, initially, my configuration was just simulating key presses using configuration like:


Which will not allow XBMC to distinguish multiple controllers (you can get both controllers to connect, but they will control the same player using any of the libretro cores). Using the xboxdrv driver, my Xbox 360 controller has the name "Xbox Gamepad (userspace driver)", which you need to put into the keymap you can find in this forum in order for XBMC to recognize your device.

I was then able to get two player working once I put that controller name in an <altname>Xbox Gamepad (userspace driver)</altname> field for each heading.

Maybe that will save others time.
Hi, rushingjs.

I'm in exactly the same boat, would you mind posting your xboxdrv configs?

Thanks a lot,
Sure! This is my config for SNES and NES. I love being able to use the joysticks instead of the D-pad too. A couple of things to note here, make sure your device name is correct just to be sure, if you search your xbmx.log for "Enabled Joystick:" it will give you the name XBMC uses as a reference. Also led=2 means it lights up player number 1 (it's an n-1 scheme, so led=4 would light up player 3, etc). Funny thing that I'm pretty sure is a hack (meaning there is a more proper way to do it), I had to not only reorder my button numbers using jstest-gtk, but in order to not change the keymap for xbmc, I had to insert "dummy" buttons for TL and TR and RL and RT. My understanding may be incorrect, but the joystick buttons are ordered and can be referenced by js_0, js_1, etc. so say TL and TR are generally assigned to js_5 and js_6, respectively. If I just omitted them from my xboxdrv config, then whatever is assigned to js_7 and js_8 (select and start), would replace js_5 and js_6, so now select and start would act as my left and right top triggers, which is obviously undesirable. So as a hack i inserted the trigger happy keys as placeholders so the assignments wouldn't get shifted. I'm sure there is something I am missing (a better way), but it worked and I didn't feel like putting more time into it as this is just a temporary setup to test. But I still had to reorder and save the ordering using jstest-gtk.

I'm sure there is lots I am doing wrong here. Also see the script I wrote to setup the driver upon startup.

Also the keymap I mentioned above is here, I named it Keymap.xml and put it in my userdata/keymaps folder. You have to add your xbmc referenced joystick name to each secondary grouping of altnames (the first is for windows, second is for linux, as stated in the keymap file header). See this thread for more information.

ui-clear = true
device-name = "Xbox Gamepad (userspace driver)"








# EOF #


import sys;
import os;
from subprocess import call;
from time import sleep;
import string;

def main():


    os.system('xboxdrv --wid 0 --config /path/to/config/SNES1.cfg &')
    os.system('xboxdrv --wid 1 --config /path/to/config/SNES2.cfg &')

if __name__ == "__main__":
Awesome, thanks!! I'll give that try.