atar-axis / xpadneo

Advanced Linux Driver for Xbox One Wireless Controller (shipped with Xbox One S)
https://atar-axis.github.io/xpadneo/
GNU General Public License v3.0
1.87k stars 110 forks source link

xbox cloud gaming with xbox series x controller x and y swapped and trigger not working #479

Open pascal260303 opened 3 days ago

pascal260303 commented 3 days ago

Version of xpadneo

v0.9.6

Controller Model

Connection mode

Installed Software

Protocol Information

Please help us identify at which layer the problem can be found if you want to report mapping errors or if the controller fails to be detected:

Please describe how it is failing below in the next sections.

Severity / Impact

Describe the Bug

I want to use an xbox controller to play on xbox cloud gaming but the y and y buttons are swapped, both triggers don't work and the xbox button (home button) doesn't work (would be needed to exit games). I already tried swapping back the x and y buttons with jscal but it didn't work. In jstest everything appears to be working, I can see all inputs except the xbox button. I'm using Ubuntu 22.04, gnome and wayland.

Steps to Reproduce

git clone https://github.com/atar-axis/xpadneo.git cd xpadneo sudo ./install.sh Connect xbox controller in bluetooth settings (confirmed buzzing). Start xbox cloud gaming in firefox.

Expected Behavior

The x and y buttons and trigger to work normally. Optionally the xbox button to work normally.

Screenshots / GIFs / Videos

System Information

# uname -a

Linux pascal-ThinkPad-T460s 6.5.0-41-generic #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 3 11:32:55 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

# xxd -c20 -g1 /sys/module/hid_xpadneo/drivers/hid:xpadneo/0005:045E:*/report_descriptor | tee >(cksum)
00000014: ff 00 00 95 02 75 10 81 02 c0 09 01 a1 00 09 33 09 34 15 00  .....u.........3.4..
00000028: 27 ff ff 00 00 95 02 75 10 81 02 c0 05 01 09 32 15 00 26 ff  '......u.......2..&.
0000003c: 03 95 01 75 0a 81 02 15 00 25 00 75 06 95 01 81 03 05 01 09  ...u.....%.u........
00000050: 35 15 00 26 ff 03 95 01 75 0a 81 02 15 00 25 00 75 06 95 01  5..&....u.....%.u...
00000064: 81 03 05 01 09 39 15 01 25 08 35 00 46 3b 01 66 14 00 75 04  .....9..%.5.F;.f..u.
00000078: 95 01 81 42 75 04 95 01 15 00 25 00 35 00 45 00 65 00 81 03  ...Bu.....%.5.E.e...
0000008c: 05 09 19 01 29 0c 15 00 25 01 75 01 95 0c 81 02 15 00 25 00  ....)...%.u.......%.
000000a0: 75 01 95 04 81 03 05 0c 0a b2 00 15 00 25 01 95 01 75 01 81  u............%...u..
000000b4: 02 15 00 25 00 75 07 95 01 81 03 05 0f 09 21 85 03 a1 02 09  ...%.u........!.....
000000c8: 97 15 00 25 01 75 04 95 01 91 02 15 00 25 00 75 04 95 01 91  ...%.u.......%.u....
000000dc: 03 09 70 15 00 25 64 75 08 95 04 91 02 09 50 66 01 10 55 0e  ..p..%du......Pf..U.
000000f0: 15 00 26 ff 00 75 08 95 01 91 02 09 a7 15 00 26 ff 00 75 08  ..&..u.........&..u.
00000104: 95 01 91 02 65 00 55 00 09 7c 15 00 26 ff 00 75 08 95 01 91  ....e.U..|..&..u....
00000118: 02 c0 c0                                                     ...
2986910699 1363

Controller and Bluetooth Information

xpadneo-dmesg.txt xpadneo-btmon.txt xpadneo-lsusb.txt

Additional Context

Firefox is installed from apt (not snap since I had problems with Firefox from snap in the past) Firefox version 127.0.2

kakra commented 3 days ago

This is a known behavior and is explained by the fact how browsers implement input: they use evdev to detect the button mappings, then use jsdev to actually read the inputs - but both input layers are different devices and have nothing in common. Because this creates problems sometimes, they add a layer in between which tries to fix mapping mismatches between both devices using static hard-coded tables - and this last bit is where it fails in Chrome, and seemingly also Firefox.

Browsers should use either only evdev or only jsdev but not both. If they did, everything would work fine. The browser implementations are designed around the behaviors of the stock in-kernel drivers - that is hid-microsoft for your controller. xpadneo is currently not compatible with the stock-kernel assumptions of browsers.

In case that Firefox uses SDL, you can try removing read permissions from the hidraw device of xpadneo. Usually, our udev rules do that but if you're using OpenRGB or ymk firmware, this may have overwritten our permissions.

If you want to use the gamepad in browsers, I recommend connecting via USB cable or not using xpadneo currently. There are plans to work around that in upcoming versions of xpadneo.