Frogging-Family / linux-tkg

linux-tkg custom kernels
GNU General Public License v2.0
1.34k stars 169 forks source link

Global 5.16+ kernel bug, i can't use my gamepad anymore #420

Open ObscureXwing opened 2 years ago

ObscureXwing commented 2 years ago

Hi guys, I ran into a nasty problem on my Artix Linux pc, which affects all currently available (zen, liquorix, tkg, mainline, etc) kernels 5.16 and newer, including tkg, for this reason I am also posting the issue here. I have found this problem with linux-tkg 5.16.1 but it is also relevant for 5.17rc2. Here is the dmesg logs and info about my controller:

[controller info] :

Name : ThundeRobot G30 Wired Multi-Device Gamepad Connection Interface : USB Interface driver : xpad lsusb info : Bus 002 Device 008: ID 045e:028e Microsoft Corp. Xbox360 Controller dmesg info : idVendor=057e, idProduct=2009, bcdDevice= 1.19

[dmesg linux516-tkg-pds 5.16.1-237] :

[ 90.950173] usb 2-1.1: new full-speed USB device number 4 using ehci-pci [ 91.049438] usb 2-1.1: New USB device found, idVendor=057e, idProduct=2009, bcdDevice= 1.19 [ 91.049449] usb 2-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [ 91.049453] usb 2-1.1: Product: THUNDEROBOT G30 [ 91.051721] input: THUNDEROBOT G30 as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/0003:057E:2009.0006/input/input26 [ 91.051939] hid-generic 0003:057E:2009.0006: input,hidraw5: USB HID v1.11 Joystick [THUNDEROBOT G30] on usb-0000:00:1d.0-1.1/input0 [ 91.204068] nintendo 0003:057E:2009.0006: hidraw5: USB HID v81.11 Joystick [THUNDEROBOT G30] on usb-0000:00:1d.0-1.1/input0 [ 93.556856] nintendo 0003:057E:2009.0006: failed reading SPI flash; ret=-110 [ 93.556867] nintendo 0003:057E:2009.0006: using factory cal for left stick [ 95.583511] nintendo 0003:057E:2009.0006: failed reading SPI flash; ret=-110 [ 95.583519] nintendo 0003:057E:2009.0006: using factory cal for right stick [ 97.610160] nintendo 0003:057E:2009.0006: failed reading SPI flash; ret=-110 [ 97.610169] nintendo 0003:057E:2009.0006: Failed to read left stick cal, using dflts; e=-110 [ 99.636840] nintendo 0003:057E:2009.0006: failed reading SPI flash; ret=-110 [ 99.636849] nintendo 0003:057E:2009.0006: Failed to read right stick cal, using dflts; e=-110 [ 101.663488] nintendo 0003:057E:2009.0006: failed reading SPI flash; ret=-110 [ 101.663497] nintendo 0003:057E:2009.0006: using factory cal for IMU [ 101.748134] nintendo 0003:057E:2009.0006: controller MAC = FF:FF:FF:5C:8B:30 [ 102.303510] nintendo 0003:057E:2009.0006: Failed to set home LED dflt; ret=-110 [ 102.303518] nintendo 0003:057E:2009.0006: Failed to create leds; ret=-110 [ 102.306090] nintendo 0003:057E:2009.0006: probe - fail = -110 [ 102.306100] nintendo: probe of 0003:057E:2009.0006 failed with error -110 [ 102.306144] leds 0003:057E:2009.0006:blue:player-5: Setting an LED's brightness failed (-38) [ 102.306214] leds 0003:057E:2009.0006:green:player-4: Setting an LED's brightness failed (-38) [ 102.306254] leds 0003:057E:2009.0006:green:player-3: Setting an LED's brightness failed (-38) [ 102.306293] leds 0003:057E:2009.0006:green:player-2: Setting an LED's brightness failed (-38) [ 102.306329] leds 0003:057E:2009.0006:green:player-1: Setting an LED's brightness failed (-38) [obscurexwing@whiteheart ~]$

And that's it, my controller does not correctly display the backlight in this state anymore, and it is impossible to use, no reaction to any presses, apparently it starts to be detected as a nintendo controller, which is not correct, because I connect it to the pc and not to nintendo. Before kernel 5.16 this gamepad felt absolutely fine, all the buttons worked, vibration, backlighting, including the 4 programmable buttons that are behind the gamepad. Connecting my ThundeRobot G30 to the system also didn't cause any problems or need to install drivers, previously i just plug it into any Linux computer and it worked perfectly.

For example I built 10 minutes ago a kernel version of linux515-tkg-pds 5.15.21-245 and my ThundeRobot G30 feels again fine and works fine with this kernel, attaching the dmesg log :

[ 365.188981] usb 2-1.1: new full-speed USB device number 5 using ehci-pci [ 365.279854] usb 2-1.1: New USB device found, idVendor=057e, idProduct=2009, bcdDevice= 1.19 [ 365.279864] usb 2-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [ 365.279868] usb 2-1.1: Product: THUNDEROBOT G30 [ 365.281924] input: THUNDEROBOT G30 as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/0003:057E:2009.0006/input/input26 [ 365.282462] hid-generic 0003:057E:2009.0006: input,hidraw5: USB HID v1.11 Joystick [THUNDEROBOT G30] on usb-0000:00:1d.0-1.1/input0 [ 367.561520] usb 2-1.1: USB disconnect, device number 5 [ 367.786982] usb 2-1.1: new full-speed USB device number 6 using ehci-pci [ 367.878604] usb 2-1.1: New USB device found, idVendor=045e, idProduct=028e, bcdDevice= 1.19 [ 367.878613] usb 2-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=3 [ 367.878617] usb 2-1.1: Product: Xbox 360 Controller [ 367.878620] usb 2-1.1: SerialNumber: 12340000 [ 367.924072] input: Microsoft X-Box 360 pad as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/input/input27 [ 367.924204] usbcore: registered new interface driver xpad [obscurexwing@whiteheart ~]$

With kernel 5.15.21 everything works fine, just plugged in via USB and no problems!

I don't know if this information is useful for you guys or not, whether you can do something about it or not, but TKG kernel is also affected by this problem, so I found it necessary to share this information with you guys, next I am going to make an official report about this kernel error

ObscureXwing commented 2 years ago

Ok now it's working, i found temporary workaround, blacklisted "hid_nintendo" kernel module and rebooted, connected my ThundeRobot G30, and now it's working fine.

But anyway, this is kinda weird, i think this is nintento driver problem, or kernel problem, something like, i don't know

// For users who encounter similar problems but do not know how to blacklist a kernel module:

execute "sudo nano /etc/modprobe.d/nonintendo.conf"

// p.s nano is the text editor I prefer to use, you can use the name of another one instead of nano and paste here this line :

blacklist hid_nintendo

Press CTRL+O to write changes, press Enter, and CTRL+X to exit, done.

RafaelLinux commented 11 months ago

THANK YOU OBSCURE

I have a joystick gamepad "EasySMX SL-9111". It can work in three modes:

In Windows, it was always detected like "ESM Gamepad 1.5". In Linux, Plasma detect it like "Nintendo Switch Pro". However, no one game detected it.

Worse, the only application that detected the joystick was Firefox. Chrome, Steam, Yuzu .... no other program detected it.

After fiddling around in the settings, I found out that actually, this joystick and many others is based on the "Thunderobot G30" and on one occasion, Linux detected it and I could use it in all games!!!! Then I tried to find out as much information as possible about that model running on Linux ... but I couldn't get it to not detect as "Thunderobot" anymore.

Then I came to this thread and tried your solution and then the joystick was not only detected as "Microsoft X-Box 360" in all programs, but it worked!!!!!

After a reboot, with your solution, it is detected as "Thunderrobot G30" and I can finally play everything with my joystick. I only have problems when using it in emulators that require the "Nintendo Switch Pro", because the A-B and X-Y buttons are swapped.

So THANK YOU VERY MUCH