ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.24k stars 175 forks source link

Misdetection of Bluetooth-connected Xbox Series X/S Controller results in wrong inputs #8352

Open d-muis opened 2 years ago

d-muis commented 2 years ago

Your system information

Please describe your issue in as much detail as possible:

Xbox Series X/S controller connects through Bluetooth and all inputs are verified to work as intended outside of Steam. When launching any Steam game, controller shows unexpected behavior - seemingly random inputs, even at idle state. In controller settings in big picture mode, the controller is incorrectly detected as an Xbox One controller which I believe is the source of the issue, as there's no presets for the Series X/S controller. When attempting calibration, the right joystick input is incorrect - vertical axis is instead horizontal and horizontal movement has no effect. Upon investigating the controller layout, you can find that it's incorrect, it can luckily be fixed with manual remapping. When connecting the controller via a USB-C cable, this issue does not occur.

This issue persists on both Official Repository and Flathub releases. It's also present on older kernels. Opting into Steam beta doesn't help either. Updating the firmware of the Xbox Series X/S controller using Windows Store's "Xbox Accessories" application does not solve this problem but is recommended for other connectivity issues. The chip used for Bluetooth connection is Intel's AX210 with Bluetooth 5.2. I don't think this issue is Manjaro-specific either, seems like Steam is missing the Xbox Series X/S controller presets which results in wrong default inputs.

Steps for reproducing this issue:

  1. Install and run Manjaro Gnome
  2. Connect the Xbox Series X/S controller using Bluetooth
  3. Verify that all controller inputs are correct using any website or application
  4. Install and run Steam from Official Repositories or Flathub
  5. Go into big picture mode and controller settings
  6. Controller will be incorrectly detected as an Xbox One Controller
  7. Calibration and controller layout will show the resulting wrong inputs
ronoaldo commented 1 year ago

I'm having a potentially similar issue. I have the Xbox Wireless Controller and it connected via blueooth after I installed xpadneo. The controller is detected by steam but the input events don't work.

ronoaldo commented 1 year ago

I can confirm that using the controller works on the Heroic Games Launcher UI (i.e., the controller is recognized after I install xpadneo and update the firmware of the controller from another windows install). I can pair and feel the controller rumble. It works on system but Steam do not recognize any input from it.

ronoaldo commented 1 year ago

I'm feeling this issue is not with steam because the device is detected differently when using USB vs when using Bluetooth.

Over cable, it is detected as Xbox Series S|X Controller by xinput and is properly detected by both the jstest program as well as from the wine/proton joystick test (from wine control panel -> game controllers -> joystick test tab).

Over bluetooth (using hid-xpadneo driver on kernel 6.0.10) it is detected as Microsoft Wireless Controller and it works from jstest/web browser/Heroic UI but it is not detected by wine/steam/wine games. So, I'm not sure what part of the stack is buggy here but clearly the bluetooth + wine combo is not working properly.

ronoaldo commented 1 year ago

After doing some research I figured out what was causing issues for me. With the help of xpadneo Discord I learned that OpenRGB (which I also was using) was adding a generic udev rule to allow reading from hidraw device and making Steam confuse. Removing OpenRGB itself did not cleaned up everything so I had to also remove the udev rule file from OpenRGB from my system. After that, Steam Input is now detecting the controller from the controller configuration UI! Wine joystick test also works!

D33M0N commented 1 year ago

Removing OpenRGB itself did not cleaned up everything so I had to also remove the udev rule file from OpenRGB from my system.

which one was it?

ronoaldo commented 1 year ago

For me it was at /etc/udev.d/60-openrgb.rules. OpenRGB 0.8 seems to ship a more fine grained file generated from the supported devices and avoids this, but if the dangling old rules file is at the etc directory it may cause the observed issues. I'm not sure if I was the one that installed that file manually while I was using AppImage or if this is an issue with the way the .deb is built.

If you are referring to the rule specific, I'm not sure ... I no longer have the file on my system, but browsing the version 0.7 (which sort of shipped the generic udev file) on Gitlab I recovered it:

https://gitlab.com/CalcProgrammer1/OpenRGB/-/blob/6128731df697e116d04ea2644c46c268a5cd3448/60-openrgb.rules#L20

The line 20 seems to be the buggy one. It grants access to any hidraw attached device and that seems to make the program read from there first instead of the event device that xpadneo provides, thus the program recognizes the controller however it doesn't read anything useful from the hidraw one.