You are not logged in.

#1 2017-06-26 22:32:30

forbi
Member
Registered: 2013-12-21
Posts: 45

Joystick no detected by udev.

If I test js0 or js1 with jstest they work just fine, but since udev does't detect them I can't use them with sdl2. (mame in this case)

Any idea?

/dev/input

by-id/    event0  event10  event12  event14  event2  event4  event6  event8  js0 mice
by-path/  event1  event11  event13  event15  event3  event5  event7  event9  js1 mouse0

js0 - js1 - event 14 - event15

/dev/input/by-id/ 

lrwxrwxrwx 1 root root  10 Jun 26 19:24 usb-INNEX_SNES_Controller_USB-event-if00 -> ../event14
lrwxrwxrwx 1 root root  10 Jun 26 19:24 usb-INNEX_SNES_Controller_USB-event-if01 -> ../event15
lrwxrwxrwx 1 root root   9 Jun 26 13:51 usb-Logitech_Optical_USB_Mouse-event-mouse -> ../event1
lrwxrwxrwx 1 root root   9 Jun 26 13:51 usb-Logitech_Optical_USB_Mouse-mouse -> ../mouse0

/dev/input/by-path/ 

lrwxrwxrwx 1 root root   9 Jun 26 13:51 pci-0000:00:16.0-usb-0:1:1.0-event-mouse -> ../event1
lrwxrwxrwx 1 root root   9 Jun 26 13:51 pci-0000:00:16.0-usb-0:1:1.0-mouse -> ../mouse0
lrwxrwxrwx 1 root root  10 Jun 26 19:24 pci-0000:02:00.0-usb-0:1.3:1.0-event -> ../event14
lrwxrwxrwx 1 root root  10 Jun 26 19:24 pci-0000:02:00.0-usb-0:1.3:1.1-event -> ../event15
lrwxrwxrwx 1 root root   9 Jun 26 13:51 platform-pcspkr-event-spkr -> ../event4

dmesg

[  +0.110799] input: INNEX SNES Controller USB as /devices/pci0000:00/0000:00:09.0/0000:02:00.0/usb2/2-1/2-1.3/2-1.3:1.0/0003:1292:5366.0014/input/input29
[  +0.000285] hid-generic 0003:1292:5366.0014: input,hidraw1: USB HID v1.00 Gamepad [INNEX SNES Controller USB] on usb-0000:02:00.0-1.3/input0
[  +0.007520] input: INNEX SNES Controller USB as /devices/pci0000:00/0000:00:09.0/0000:02:00.0/usb2/2-1/2-1.3/2-1.3:1.1/0003:1292:5366.0015/input/input30
[  +0.000301] hid-generic 0003:1292:5366.0015: input,hidraw2: USB HID v1.00 Joystick [INNEX SNES Controller USB] on usb-0000:02:00.0-1.3/input1

Offline

#2 2017-06-27 09:29:44

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Joystick no detected by udev.

It seems to me udev is working just fine, what do you think creates all those symlinks in /dev/input/by-id/ and /dev/input/by-path/?

I'd say your problem is somewhere else.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2017-06-27 14:59:14

forbi
Member
Registered: 2013-12-21
Posts: 45

Re: Joystick no detected by udev.

@R00KIE But I find that when I connect another controller that works with sdl2, it shows the following :

╰─$ ls /dev/input/by-path/ -la
total 0
drwxr-xr-x 2 root root 140 Jun 27 11:55 ./
drwxr-xr-x 4 root root 440 Jun 27 11:55 ../
lrwxrwxrwx 1 root root   9 Jun 27 11:52 pci-0000:00:16.0-usb-0:1:1.0-event-mouse -> ../event1
lrwxrwxrwx 1 root root   9 Jun 27 11:52 pci-0000:00:16.0-usb-0:1:1.0-mouse -> ../mouse0
lrwxrwxrwx 1 root root   9 Jun 27 11:55 pci-0000:02:00.0-usb-0:1.3:1.0-event-joystick -> ../event2
lrwxrwxrwx 1 root root   6 Jun 27 11:55 pci-0000:02:00.0-usb-0:1.3:1.0-joystick -> ../js0
lrwxrwxrwx 1 root root   9 Jun 27 11:52 platform-pcspkr-event-spkr -> ../event6
╰─$ ls /dev/input/by-id/ -la
total 0
drwxr-xr-x 2 root root 120 Jun 27 11:55 ./
drwxr-xr-x 4 root root 440 Jun 27 11:55 ../
lrwxrwxrwx 1 root root   9 Jun 27 11:52 usb-Logitech_Optical_USB_Mouse-event-mouse -> ../event1
lrwxrwxrwx 1 root root   9 Jun 27 11:52 usb-Logitech_Optical_USB_Mouse-mouse -> ../mouse0
lrwxrwxrwx 1 root root   9 Jun 27 11:55 usb-Logitech_Wireless_Gamepad_F710_43A090A5-event-joystick -> ../event2
lrwxrwxrwx 1 root root   6 Jun 27 11:55 usb-Logitech_Wireless_Gamepad_F710_43A090A5-joystick -> ../js0

As you can see, it creates a event-joystick and joystick symlinks.

Offline

#4 2017-06-27 20:08:11

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Joystick no detected by udev.

You might want to investigate which udev rule is responsible for that then, I'd guess it would be 60-persistent-input.rules which seems to be a catch all/generic rule. You will have to compare both your gamepads and what the rule is expecting and see if you spot a difference that might explain why for one of them some symlinks are not created.

Another thing I would test is if deleting the js/event symlinks for the F710 gamepad will make it stop working with sdl2, take this as a sanity check just in case the symlinks don't matter and sdl2 enumerates/finds joysticks some other way, in which case the problem would be somewhere else.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2017-06-27 20:20:17

forbi
Member
Registered: 2013-12-21
Posts: 45

Re: Joystick no detected by udev.

R00KIE wrote:

Another thing I would test is if deleting the js/event symlinks for the F710 gamepad will make it stop working with sdl2, take this as a sanity check just in case the symlinks don't
matter and sdl2 enumerates/finds joysticks some other way, in which case the problem would be somewhere else.

Yep. you were right. I deleted all the symlinks and it keeps working just fine. I don't know where to start looking for the other controllers. Right now I'm using Mame with wine, since "wine controller" works just fine.

Offline

#6 2017-06-27 21:00:18

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: Joystick no detected by udev.

I don't know where to start looking for the other controllers.

Strace the sdl client, grep for "open".

Offline

#7 2017-06-27 21:18:49

forbi
Member
Registered: 2013-12-21
Posts: 45

Re: Joystick no detected by udev.

seth wrote:
I don't know where to start looking for the other controllers.

Strace the sdl client, grep for "open".

Ok, did the strace and filter for open:

https://pastebin.com/gvRr6NYh

https://pastebin.com/DYR0bm3p [Joystick that works]

The event device is event2 in both cases.

I don't know what should I look for, I mean, I can see that there is a "Read Only" message, but it shows to the working controller too.

Offline

#8 2017-06-27 21:32:14

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Joystick no detected by udev.

I might compare the output of 'udevadm info -a /dev/xyz' (point it a the js/event file of both gamepads) and see if you can spot any differences besides the obvious such as names, vid, pid. There must be a reason why udev doesn't create the symlinks and know why might help find out why it doesn't work for sdl2.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#9 2017-06-27 21:47:14

forbi
Member
Registered: 2013-12-21
Posts: 45

Re: Joystick no detected by udev.

R00KIE wrote:

I might compare the output of 'udevadm info -a /dev/xyz' (point it a the js/event file of both gamepads) and see if you can spot any differences besides the obvious such as names, vid, pid. There must be a reason why udev doesn't create the symlinks and know why might help find out why it doesn't work for sdl2.

Ok, I just did that, and the output looks almost the same.

The only diffenrece can be spoted in this image:
image.png

And I presume that the difference is because it's not one controller, but two. So that's why it has another extra parent.

Pd: and the driver ofcourse it's different, since one uses xpad, and the other one usbhid

Last edited by forbi (2017-06-27 21:48:37)

Offline

#10 2017-06-27 22:03:14

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: Joystick no detected by udev.

Failing device:
open("/sys/devices/pci0000:00/0000:00:09.0/0000:02:00.0/usb2/2-1/2-1.3/2-1.3:1.0/0003:1292:5366.000C/input/input22/js0/uevent", O_RDONLY|O_CLOEXEC) = 11
open("/sys/devices/pci0000:00/0000:00:09.0/0000:02:00.0/usb2/2-1/2-1.3/2-1.3:1.1/0003:1292:5366.000D/input/input23/js1/uevent", O_RDONLY|O_CLOEXEC) = 11 # couple of times

Working device:
open("/sys/devices/pci0000:00/0000:00:09.0/0000:02:00.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input21/js0/uevent", O_RDONLY|O_CLOEXEC) = 11 # couple of times
open("/dev/input/js0", O_RDONLY)        = 9

Smells a bit as if SDL is confused by the second device?
Is that one of those gamepads that you can daisychain? (Ie attach a second pad and link that through)?

Offline

#11 2017-06-27 22:05:47

forbi
Member
Registered: 2013-12-21
Posts: 45

Re: Joystick no detected by udev.

seth wrote:

Failing device:
open("/sys/devices/pci0000:00/0000:00:09.0/0000:02:00.0/usb2/2-1/2-1.3/2-1.3:1.0/0003:1292:5366.000C/input/input22/js0/uevent", O_RDONLY|O_CLOEXEC) = 11
open("/sys/devices/pci0000:00/0000:00:09.0/0000:02:00.0/usb2/2-1/2-1.3/2-1.3:1.1/0003:1292:5366.000D/input/input23/js1/uevent", O_RDONLY|O_CLOEXEC) = 11 # couple of times

Working device:
open("/sys/devices/pci0000:00/0000:00:09.0/0000:02:00.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input21/js0/uevent", O_RDONLY|O_CLOEXEC) = 11 # couple of times
open("/dev/input/js0", O_RDONLY)        = 9

Smells a bit as if SDL is confused by the second device?
Is that one of those gamepads that you can daisychain? (Ie attach a second pad and link that through)?

It's this thing;

image.png

Offline

#12 2017-06-27 22:13:19

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: Joystick no detected by udev.

Do you have one or two gamepads attached? Tried swapping slots?

Offline

#13 2017-06-27 22:17:41

forbi
Member
Registered: 2013-12-21
Posts: 45

Re: Joystick no detected by udev.

seth wrote:

Do you have one or two gamepads attached? Tried swapping slots?

I have two, but I tried every combination, 1, 2, switch, etc. It works for everything, but for SDL.

Offline

#14 2017-06-27 22:44:31

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Joystick no detected by udev.

You could try asking in the sdl mailing list. They should be able to ask the correct questions and point you in the right direction.

You already have a good amount of information from what you've tried and what you know, just gather everything and ask. Maybe they know of a similar problem and possible workarounds or maybe it could be a simple fix once they figure out what the problem is and what to fix.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB