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

8BitDo uses Nintendo layout #414

Closed Shatur closed 1 year ago

Shatur commented 1 year ago

Version of xpadneo

0.9.5

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 have XBox Series X gamepad and it works perfectly with xpadneo. However if I try to connect 8BitDo SN30 Pro - it uses Nintendo layout. It doesn't happen without xpadneo. And the documentation says that this feature is disabled by default. If I connect the gamepad via cable - it uses Xbox layout. The described issue happens when I install xpadneo and connect the gamepad via Bluetooth.

Steps to Reproduce

Just connect the gamepad with xpadneo installed.

Expected Behavior

It should use XBox layout by default.

Screenshots / GIFs / Videos

System Information

# uname -a
Linux AcerAspire5 6.1.22-1-lts #1 SMP PREEMPT_DYNAMIC Thu, 30 Mar 2023 14:10:04 +0000 x86_64 GNU/Linux
# xxd -c20 -g1 /sys/module/hid_xpadneo/drivers/hid:xpadneo/0005:045E:*/report_descriptor | tee >(cksum)
00000000: 05 01 09 05 a1 01 85 01 09 01 a1 00 09 30 09 31 15 00 27 ff  .............0.1..'.
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 0a 15 00 25 01 75 01 95 0a 81 02 15 00 25 00  ....)...%.u.......%.
000000a0: 75 06 95 01 81 03 05 01 09 80 85 02 a1 00 09 85 15 00 25 01  u.................%.
000000b4: 95 01 75 01 81 02 15 00 25 00 75 07 95 01 81 03 c0 05 0f 09  ..u.....%.u.........
000000c8: 21 85 03 a1 02 09 97 15 00 25 01 75 04 95 01 91 02 15 00 25  !........%.u.......%
000000dc: 00 75 04 95 01 91 03 09 70 15 00 25 64 75 08 95 04 91 02 09  .u......p..%du......
000000f0: 50 66 01 10 55 0e 15 00 26 ff 00 75 08 95 01 91 02 09 a7 15  Pf..U...&..u........
00000104: 00 26 ff 00 75 08 95 01 91 02 65 00 55 00 09 7c 15 00 26 ff  .&..u.....e.U..|..&.
00000118: 00 75 08 95 01 91 02 c0 85 04 05 06 09 20 15 00 26 ff 00 75  .u........... ..&..u
0000012c: 08 95 01 81 02 c0                                            ......
3445511648 1458

Controller and Bluetooth Information

sudo dmesg
[ 5238.655802] xpadneo 0005:045E:02E0.000F: reverting to original version (changed version from 0x00001130 to 0x00000903)
[ 5238.655807] xpadneo 0005:045E:02E0.000F: reverting to original product (changed PID from 0x028E to 0x02E0)
[ 5238.732568] hid-generic 0005:045E:02E0.000F: unknown main item tag 0x0
[ 5238.732644] input: 8Bitdo SN30 Pro as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-6/1-6.1/1-6.1:1.0/bluetooth/hci0/hci0:256/0005:045E:02E0.000F/input/input40
[ 5238.732861] hid-generic 0005:045E:02E0.000F: input,hidraw9: BLUETOOTH HID v9.03 Gamepad [8Bitdo SN30 Pro] on 08:5b:d6:52:ea:53
[ 5292.919297] loaded hid-xpadneo v0.9.5
[ 5292.978214] xpadneo 0005:045E:02E0.000F: buggy firmware detected, please upgrade to the latest version
[ 5292.978217] xpadneo 0005:045E:02E0.000F: pretending XB1S Windows wireless mode (changed PID from 0x02E0 to 0x028E)
[ 5292.978219] xpadneo 0005:045E:02E0.000F: working around wrong SDL2 mappings (changed version from 0x00000903 to 0x00001130)
[ 5292.978221] xpadneo 0005:045E:02E0.000F: report descriptor size: 307 bytes
[ 5292.978222] xpadneo 0005:045E:02E0.000F: fixing up report descriptor size
[ 5292.978311] xpadneo 0005:045E:02E0.000F: battery detected
[ 5292.978313] xpadneo 0005:045E:02E0.000F: enabling compliance with Linux Gamepad Specification
[ 5292.978344] input: 8Bitdo SN30 Pro as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-6/1-6.1/1-6.1:1.0/bluetooth/hci0/hci0:256/0005:045E:02E0.000F/input/input41
[ 5292.978447] xpadneo 0005:045E:02E0.000F: input,hidraw9: BLUETOOTH HID v11.30 Gamepad [8Bitdo SN30 Pro] on 08:5b:d6:52:ea:53
[ 5292.978451] xpadneo 0005:045E:02E0.000F: controller quirks: 0x00000027
[ 5293.638903] xpadneo 0005:045E:02E0.000F: 8Bitdo SN30 Pro [e4:17:d8:37:fc:7c] connected

xpadneo-btmon.txt xpadneo-dmesg.txt

Additional Context

kakra commented 1 year ago

The v0.9 branch of the driver actually defaults to Nintendo mappings, so what you're seeing is expected behavior. You can add quirks=e4:17:d8:37:fc:7c:0x07 as a modprobe parameter to disable this mapping. v0.10 (still in development) will default to Nintendo mappings off because too many people complained although I think the driver should return what is printed on the buttons.

Unfortunately, the current v0.10 branch has issues with rumble for 8BitDo which I could fix once I get hands on such a controller myself.

Shatur commented 1 year ago

The v0.9 branch of the driver actually defaults to Nintendo mappings, so what you're seeing is expected behavior.

Got it, thank you! Then we probably should update the README.md.

You can add quirks=e4:17:d8:37:fc:7c:0x07 as a modprobe parameter to disable this mapping

Thanks, it works.

too many people complained although I think the driver should return what is printed on the buttons.

Makes sense and I personally don't mind using Nintendo layout. But this way it works inconsistently when I connect the gamepad over the USB (it uses Xbox layout) because xpadneo driver doesn't handle USB connection.

kakra commented 1 year ago

The docs should be correct in the v0.9 branch: https://github.com/atar-axis/xpadneo/tree/release/v0.9

If you find it does not, then yes, it should be fixed. But I'm pretty sure you looked at the master branch docs, not at those coming within the download archive for v0.9, maybe?

Shatur commented 1 year ago

Oh, you are right, my bad, thank you!

A bit off-topic question, but if I want to use Nintendo layout to make it consistent with the USB mode I should use something like xboxdrv?

kakra commented 1 year ago

You can ask offtopic questions in our Discord channel. I think it should be possible to use Steam Input to remap the USB mode - at least if you have that installed (and Steam is running). Otherwise, there would also be anti-micro. I'm not sure if xboxdrv would have any benefits here. OTOH, Steam Input should currently not be used with xpadneo (but that may be partially fixed with latest Proton versions, I didn't check yet, I just had a chat with a developer and we exchanged some ideas how to make it compatible).