Wireless xbox controller device index random?

Hi!

My system is a arch linux build with xboxdrv and I have 4 x wireless xbox 360 controllers. I’m using the udev input driver in retroarch. I have an annoying issue which I don’t know is due to the xboxdrv driver or retroarch, so I’m asking at both forums. When I uses more than one controller it seems as it is completely random which device index they get. For instance, the controller lighting up the player 1 led could appear as device index 3 in retroarch, led 2 as device 0 and so on… This is very annoying as you usually have to test all 4 controllers to find the one that is currently player 1. Is this solvable? Even if they are wireless and all of them appear as one usb device there must be something that distinguish them? Can it be solved in retroarch by changing the input driver? Anyone knows some xboxdrv trick?

So greatful for any help!

Radius was working making the controllers with identical VID/PID get a number attached to their name in the input settings to tell them apart, which may help with your issues if/when it gets merged but maybe not. I’m not sure if the numbers will reflect the controllers’ LEDs or not.

Ok, that sounds interesting. But could someone explain to me how it works with udev in retroarch? I mean, my gamepads exists in /dev/input as js0, js1, js2, js3, but I expect that these indexes has nothing to do with the “player index”, but is just assigned when they are found by linux? Are these numbers (jsX) the same as the device index in retroarch? If so, maybe there is a way to figure out how to make xboxdrv light up the led corresponding to the device index, but not sure how. Xboxdrv also have an index, but I have no idea how this maps to jsX or device index in udev:

$ xboxdrv --list-controller

id | wid | idVendor | idProduct | Name ----±----±---------±----------±------------------------------------- 0 | 0 | 0x045e | 0x0719 | Microsoft Xbox 360 Wireless Controller (PC) (Port: 0) 0 | 1 | 0x045e | 0x0719 | Microsoft Xbox 360 Wireless Controller (PC) (Port: 1) 0 | 2 | 0x045e | 0x0719 | Microsoft Xbox 360 Wireless Controller (PC) (Port: 2) 0 | 3 | 0x045e | 0x0719 | Microsoft Xbox 360 Wireless Controller (PC) (Port: 3)

Any information that could help me would be useful!

I did some experiments now and figured out it’s actually not random. The controllers get the correct led lit in the order they are started, i.e. 1, 2, 3, 4. But the device index in retroarch is always this:

Led 1: Index 3 Led 2: Index 0 Led 3: Index 1 Led 4: Index 2

Have no idea where they are enumerated like this, if it is a xboxdrv issue, retroarch or udev. Any ideas? For now my workaround is of course to just remap them according to this order, but of course it’s annoys me.

1 Like