Hi !
Thanks for your answer. I took a look at the links you posted but it was not really helpful. (FYI, I posted the first one )
So I went and did more research yesterday. First, when I do a jstest, I can see all button or axes are working, but not the C-stick left/right. And I know because I test all stick, that the c-stick left/right should be axe 2. But nothing is happening when I move the c-stick on that axis.
I tried the gamepad on MacOS and Windows and the c-stick is working fine on every axis. So we can assume the gamepad is not broken or something like that. It has to be with the driver or the way Linux/Recalbox read the device.
Let's try if we can read the device.
First, let's find out where events for that device go :
# ls -lattr /dev/input/by-id/usb-0079_Generic_USB_Joystick-event-joystick
lrwxrwxrwx 1 root root 10 Jan 23 19:54 /dev/input/by-id/usb-0079_Generic_USB_Joystick-event-joystick -> ../event10
Now we can read the device :
# hexdump /dev/input/event10
0000000 adb0 61ed 0000 0000 946b 0000 0000 0000
0000010 0003 0002 0081 0000 adb0 61ed 0000 0000
0000020 946b 0000 0000 0000 0000 0000 0000 0000
0000030 adb0 61ed 0000 0000 b3a0 0000 0000 0000
0000040 0003 0002 0080 0000 adb0 61ed 0000 0000
0000050 b3a0 0000 0000 0000 0000 0000 0000 0000
0000060 adb0 61ed 0000 0000 f22e 0000 0000 0000
0000070 0003 0002 007f 0000 adb0 61ed 0000 0000
0000080 f22e 0000 0000 0000 0000 0000 0000 0000
0000090 adb0 61ed 0000 0000 30ad 0001 0000 0000
00000a0 0003 0002 0080 0000 adb0 61ed 0000 0000
00000b0 30ad 0001 0000 0000 0000 0000 0000 0000
00000c0 adb0 61ed 0000 0000 a7aa 0002 0000 0000
00000d0 0003 0002 0081 0000 adb0 61ed 0000 0000
00000e0 a7aa 0002 0000 0000 0000 0000 0000 0000
00000f0 adb0 61ed 0000 0000 c6cb 0002 0000 0000
0000100 0003 0002 007f 0000 adb0 61ed 0000 0000
0000110 c6cb 0002 0000 0000 0000 0000 0000 0000
0000120 adb0 61ed 0000 0000 e62a 0002 0000 0000
0000130 0003 0002 0080 0000 adb0 61ed 0000 0000
0000140 e62a 0002 0000 0000 0000 0000 0000 0000
0000150 adb0 61ed 0000 0000 24a9 0003 0000 0000
0000160 0003 0002 0081 0000 adb0 61ed 0000 0000
0000170 24a9 0003 0000 0000 0000 0000 0000 0000
0000180 adb0 61ed 0000 0000 43dd 0003 0000 0000
0000190 0003 0002 0080 0000 adb0 61ed 0000 0000
00001a0 43dd 0003 0000 0000 0000 0000 0000 0000
00001b0 adb0 61ed 0000 0000 5724 0005 0000 0000
00001c0 0003 0002 007f 0000 adb0 61ed 0000 0000
00001d0 5724 0005 0000 0000 0000 0000 0000 0000
00001e0 adb0 61ed 0000 0000 7665 0005 0000 0000
00001f0 0003 0002 0080 0000 adb0 61ed 0000 0000
0000200 7665 0005 0000 0000 0000 0000 0000 0000
0000210 adb0 61ed 0000 0000 ce24 0006 0000 0000
0000220 0003 0002 007f 0000 adb0 61ed 0000 0000
0000230 ce24 0006 0000 0000 0000 0000 0000 0000
I got a lot of events, even if I'm not pressing any buttons on the gamepad.
For comparaison, here's what I got with an other gamepad (everything is ok with this one) :
# hexdump /dev/input/event2
I got nothing until I really press something on the gamepad.
If I do an evtest for the Gamecube USB controller :
# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: Power Button
/dev/input/event1: Power Button
/dev/input/event2: Generic X-Box pad
/dev/input/event3: HDA ATI HDMI HDMI/DP,pcm=3
/dev/input/event4: HDA ATI HDMI HDMI/DP,pcm=7
/dev/input/event5: HDA ATI HDMI HDMI/DP,pcm=8
/dev/input/event6: HDA ATI HDMI HDMI/DP,pcm=9
/dev/input/event7: HDA ATI HDMI HDMI/DP,pcm=10
/dev/input/event8: HDA ATI HDMI HDMI/DP,pcm=11
/dev/input/event9: Video Bus
/dev/input/event10: Generic USB Joystick
/dev/input/event11: HDA Intel PCH Front Mic
/dev/input/event12: HDA Intel PCH Rear Mic
/dev/input/event13: HDA Intel HDMI HDMI/DP,pcm=3
/dev/input/event14: HDA Intel HDMI HDMI/DP,pcm=7
/dev/input/event15: HDA Intel PCH Line
/dev/input/event16: HDA Intel PCH Line Out Front
/dev/input/event17: HDA Intel HDMI HDMI/DP,pcm=8
/dev/input/event18: HDA Intel HDMI HDMI/DP,pcm=9
/dev/input/event19: HDA Intel PCH Line Out Surround
/dev/input/event20: HDA Intel PCH Line Out CLFE
/dev/input/event21: HDA Intel HDMI HDMI/DP,pcm=10
/dev/input/event22: HDA Intel PCH Line Out Side
/dev/input/event23: HDA Intel PCH Front Headphone
Select the device event number [0-23]: 10
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x79 product 0x6 version 0x110
Input device name: "Generic USB Joystick "
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 288 (BTN_TRIGGER)
Event code 289 (BTN_THUMB)
Event code 290 (BTN_THUMB2)
Event code 291 (BTN_TOP)
Event code 292 (BTN_TOP2)
Event code 293 (BTN_PINKIE)
Event code 294 (BTN_BASE)
Event code 295 (BTN_BASE2)
Event code 296 (BTN_BASE3)
Event code 297 (BTN_BASE4)
Event code 298 (BTN_BASE5)
Event code 299 (BTN_BASE6)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 132
Min 0
Max 255
Flat 15
Event code 1 (ABS_Y)
Value 126
Min 0
Max 255
Flat 15
Event code 2 (ABS_Z)
Value 128
Min 0
Max 255
Flat 15
Event code 5 (ABS_RZ)
Value 134
Min 0
Max 255
Flat 15
Event code 16 (ABS_HAT0X)
Value 0
Min -1
Max 1
Event code 17 (ABS_HAT0Y)
Value 0
Min -1
Max 1
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Event type 21 (EV_FF)
Event code 80 (FF_RUMBLE)
Event code 81 (FF_PERIODIC)
Event code 88 (FF_SQUARE)
Event code 89 (FF_TRIANGLE)
Event code 90 (FF_SINE)
Event code 96 (FF_GAIN)
Properties:
Testing ... (interrupt to exit)
Event: time 1642966590.330262, type 3 (EV_ABS), code 2 (ABS_Z), value 129
Event: time 1642966590.330262, -------------- SYN_REPORT ------------
Event: time 1642966590.338261, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966590.338261, -------------- SYN_REPORT ------------
Event: time 1642966590.458259, type 3 (EV_ABS), code 2 (ABS_Z), value 129
Event: time 1642966590.458259, -------------- SYN_REPORT ------------
Event: time 1642966590.466267, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966590.466267, -------------- SYN_REPORT ------------
Event: time 1642966590.482259, type 3 (EV_ABS), code 2 (ABS_Z), value 127
Event: time 1642966590.482259, -------------- SYN_REPORT ------------
Event: time 1642966590.490258, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966590.490258, -------------- SYN_REPORT ------------
Event: time 1642966590.602255, type 3 (EV_ABS), code 2 (ABS_Z), value 127
Event: time 1642966590.602255, -------------- SYN_REPORT ------------
Event: time 1642966590.610256, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966590.610256, -------------- SYN_REPORT ------------
Event: time 1642966590.618255, type 3 (EV_ABS), code 2 (ABS_Z), value 127
Event: time 1642966590.618255, -------------- SYN_REPORT ------------
Event: time 1642966590.626255, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966590.626255, -------------- SYN_REPORT ------------
Event: time 1642966590.730270, type 3 (EV_ABS), code 2 (ABS_Z), value 127
Event: time 1642966590.730270, -------------- SYN_REPORT ------------
Event: time 1642966590.746252, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966590.746252, -------------- SYN_REPORT ------------
Event: time 1642966590.754252, type 3 (EV_ABS), code 2 (ABS_Z), value 129
Event: time 1642966590.754252, -------------- SYN_REPORT ------------
Event: time 1642966590.770251, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966590.770251, -------------- SYN_REPORT ------------
Event: time 1642966590.866249, type 3 (EV_ABS), code 2 (ABS_Z), value 127
Event: time 1642966590.866249, -------------- SYN_REPORT ------------
Event: time 1642966590.874248, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966590.874248, -------------- SYN_REPORT ------------
Event: time 1642966590.994246, type 3 (EV_ABS), code 2 (ABS_Z), value 127
Event: time 1642966590.994246, -------------- SYN_REPORT ------------
Event: time 1642966591.002244, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966591.002244, -------------- SYN_REPORT ------------
Event: time 1642966591.138242, type 3 (EV_ABS), code 2 (ABS_Z), value 129
Event: time 1642966591.138242, -------------- SYN_REPORT ------------
Event: time 1642966591.146259, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966591.146259, -------------- SYN_REPORT ------------
Event: time 1642966591.266237, type 3 (EV_ABS), code 2 (ABS_Z), value 129
Event: time 1642966591.266237, -------------- SYN_REPORT ------------
Event: time 1642966591.274237, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966591.274237, -------------- SYN_REPORT ------------
Event: time 1642966591.546232, type 3 (EV_ABS), code 2 (ABS_Z), value 127
Event: time 1642966591.546232, -------------- SYN_REPORT ------------
Event: time 1642966591.554230, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966591.554230, -------------- SYN_REPORT ------------
Event: time 1642966591.562248, type 3 (EV_ABS), code 2 (ABS_Z), value 129
Event: time 1642966591.562248, -------------- SYN_REPORT ------------
Event: time 1642966591.570230, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966591.570230, -------------- SYN_REPORT ------------
Event: time 1642966591.674228, type 3 (EV_ABS), code 2 (ABS_Z), value 127
Event: time 1642966591.674228, -------------- SYN_REPORT ------------
Event: time 1642966591.682214, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966591.682214, -------------- SYN_REPORT ------------
Event: time 1642966591.698215, type 3 (EV_ABS), code 2 (ABS_Z), value 129
Event: time 1642966591.698215, -------------- SYN_REPORT ------------
Event: time 1642966591.714215, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966591.714215, -------------- SYN_REPORT ------------
Event: time 1642966591.802239, type 3 (EV_ABS), code 2 (ABS_Z), value 127
Event: time 1642966591.802239, -------------- SYN_REPORT ------------
Event: time 1642966591.818240, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966591.818240, -------------- SYN_REPORT ------------
Event: time 1642966591.826240, type 3 (EV_ABS), code 2 (ABS_Z), value 129
Event: time 1642966591.826240, -------------- SYN_REPORT ------------
Event: time 1642966591.834238, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966591.834238, -------------- SYN_REPORT ------------
Event: time 1642966591.938236, type 3 (EV_ABS), code 2 (ABS_Z), value 127
Event: time 1642966591.938236, -------------- SYN_REPORT ------------
Event: time 1642966591.946237, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966591.946237, -------------- SYN_REPORT ------------
Event: time 1642966591.954234, type 3 (EV_ABS), code 2 (ABS_Z), value 129
Event: time 1642966591.954234, -------------- SYN_REPORT ------------
Event: time 1642966591.970234, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966591.970234, -------------- SYN_REPORT ------------
Event: time 1642966592.074234, type 3 (EV_ABS), code 2 (ABS_Z), value 129
Event: time 1642966592.074234, -------------- SYN_REPORT ------------
Event: time 1642966592.082219, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966592.082219, -------------- SYN_REPORT ------------
Event: time 1642966592.210232, type 3 (EV_ABS), code 2 (ABS_Z), value 129
Event: time 1642966592.210232, -------------- SYN_REPORT ------------
Event: time 1642966592.218228, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966592.218228, -------------- SYN_REPORT ------------
Event: time 1642966592.234229, type 3 (EV_ABS), code 2 (ABS_Z), value 127
Event: time 1642966592.234229, -------------- SYN_REPORT ------------
Event: time 1642966592.242233, type 3 (EV_ABS), code 2 (ABS_Z), value 128
Event: time 1642966592.242233, -------------- SYN_REPORT ------------
Again, lots of stuff even I don't even touch the controller.
Now the evtest with my other gamepad :
# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: Power Button
/dev/input/event1: Power Button
/dev/input/event2: Generic X-Box pad
/dev/input/event3: HDA ATI HDMI HDMI/DP,pcm=3
/dev/input/event4: HDA ATI HDMI HDMI/DP,pcm=7
/dev/input/event5: HDA ATI HDMI HDMI/DP,pcm=8
/dev/input/event6: HDA ATI HDMI HDMI/DP,pcm=9
/dev/input/event7: HDA ATI HDMI HDMI/DP,pcm=10
/dev/input/event8: HDA ATI HDMI HDMI/DP,pcm=11
/dev/input/event9: Video Bus
/dev/input/event10: Generic USB Joystick
/dev/input/event11: HDA Intel PCH Front Mic
/dev/input/event12: HDA Intel PCH Rear Mic
/dev/input/event13: HDA Intel HDMI HDMI/DP,pcm=3
/dev/input/event14: HDA Intel HDMI HDMI/DP,pcm=7
/dev/input/event15: HDA Intel PCH Line
/dev/input/event16: HDA Intel PCH Line Out Front
/dev/input/event17: HDA Intel HDMI HDMI/DP,pcm=8
/dev/input/event18: HDA Intel HDMI HDMI/DP,pcm=9
/dev/input/event19: HDA Intel PCH Line Out Surround
/dev/input/event20: HDA Intel PCH Line Out CLFE
/dev/input/event21: HDA Intel HDMI HDMI/DP,pcm=10
/dev/input/event22: HDA Intel PCH Line Out Side
/dev/input/event23: HDA Intel PCH Front Headphone
Select the device event number [0-23]: 2
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x20d6 product 0x2802 version 0x101
Input device name: "Generic X-Box pad"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 304 (BTN_SOUTH)
Event code 305 (BTN_EAST)
Event code 307 (BTN_NORTH)
Event code 308 (BTN_WEST)
Event code 310 (BTN_TL)
Event code 311 (BTN_TR)
Event code 312 (BTN_TL2)
Event code 313 (BTN_TR2)
Event code 314 (BTN_SELECT)
Event code 315 (BTN_START)
Event code 316 (BTN_MODE)
Event code 317 (BTN_THUMBL)
Event code 318 (BTN_THUMBR)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 0
Min -32768
Max 32767
Fuzz 16
Flat 128
Event code 1 (ABS_Y)
Value -1
Min -32768
Max 32767
Fuzz 16
Flat 128
Event code 3 (ABS_RX)
Value 0
Min -32768
Max 32767
Fuzz 16
Flat 128
Event code 4 (ABS_RY)
Value 0
Min -32768
Max 32767
Fuzz 16
Flat 128
Event code 16 (ABS_HAT0X)
Value 0
Min -1
Max 1
Event code 17 (ABS_HAT0Y)
Value 0
Min -1
Max 1
Event type 21 (EV_FF)
Event code 80 (FF_RUMBLE)
Event code 81 (FF_PERIODIC)
Event code 88 (FF_SQUARE)
Event code 89 (FF_TRIANGLE)
Event code 90 (FF_SINE)
Event code 96 (FF_GAIN)
Properties:
Testing ... (interrupt to exit)
Once again, nothing until I press something on the gamepad.
Here I am right now... I guess it's weird that the faulty gamepad is generating that much events... or maybe not.