Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Using XBMCbuntu Eden...

I'm having trouble creating udev rules for my controllers. I have a dual arcade stick that has two separate usb connections, and I am having no trouble writing the udev rules for these because they show up as separate usb devices, but I also have a Mayflash dual N64 adapter, and a dual playstation adapter. Each of these show up as a single usb device, and I don't know how to differentiate between them in the udev matching rules.

Prior to writing the udev rules, all six controllers were detected as js0, js1, js2 ... js5, but their numbering would be random upon a reboot, which was particularly problematic with mame which I would then have to reconfigure to use the new joystick number (very tedious).

The problem is that, for example, if the Mayflash adapter is detected as js1 and js2, I would look at the details with udevadm info --attribute-walk --name /dev/input/js1, but all static properties are identical for js1 and js2. At this stage I am not concerned about what happens when I change the port they are plugged into as I am happy just to leave them all connected to their respective ports and change the udev rules file if I need to in the future. But, the physical usb connection is the same for both controllers on a single usb input, so this doesn't help me. The rules file I have written so far looks like

#Arcade Stick
KERNEL=="js?",ATTRS{name}=="DragonRise Inc.   Generic   USB  Joystick  ",ATTRS{phys}=="usb-0000:00:1d.0-2.1/input0",NAME="input/js0"
KERNEL=="js?",ATTRS{name}=="DragonRise Inc.   Generic   USB  Joystick  ",ATTRS{phys}=="usb-0000:00:1d.0-2.4/input0",NAME="input/js1"


#N64
KERNEL=="js?",ATTRS{name}=="HuiJia USB GamePad",ATTRS{phys}=="usb-0000:00:1d.0-2.2/input0", NAME="input/js2"
KERNEL=="js?",ATTRS{name}=="HuiJia USB GamePad",ATTRS{phys}=="usb-0000:00:1d.0-2.2/input0", NAME="input/js3"



#PS2
KERNEL=="js?",ATTRS{name}=="Twin USB Joystick",ATTRS{phys}=="usb-0000:00:1d.0 2.3/input0", NAME="input/js4"
KERNEL=="js?",ATTRS{name}=="Twin USB Joystick",ATTRS{phys}=="usb-0000:00:1d.0-2.3/input0", NAME="input/js5"

Obviously, I wasn't expecting this to work perfectly because there's nothing to differentiate between the two PS2 inputs and the two N64 inputs, but I was surprised that even the first of each does not work properly.

What I end up with is something like:

/dev/input/js0 is Dragonrise joystick with KERNEL == js5 
/dev/input/js1 is Dragonrise joystick with KERNEL == js0 
/dev/input/js2 is Twin USB Joystick   with KERNEL == js2 
/dev/input/js3 is Huijia USB GamePad  with KERNEL == js3 
/dev/input/js4 is Huijia USB GamePad  with KERNEL == js4
/dev/input/js5 is Dragonrise joystick with KERNEL == js5

So clearly, apart from the first two being renamed from js5 and js0 to js0 and js1 respectively, nothing has been renamed. I have no idea where to go from here, but there must be a way to do it, and I'm hoping someone here has an idea of how to do this. I think this should be enough info to clearly explain my issue, but happy to provide clarifications if they are needed.

Thanks in advance :)

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.