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

Controllers do not register as joysticks after reboot #476

Closed AccaliaDeElementia closed 4 weeks ago

AccaliaDeElementia commented 4 weeks ago

Pairing an Xbox Elite (1) controller or an Xbox Series X controller via the KDE control panel with xpadneo install works flawlessly.... until i reboot my system. After reboot the controller will connect via bluetooth, but xpadneo does not pick either model of controller up.

Version of xpadneo

0.9.6 - via AUR package xpadneo-dkms

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

Pairing an Xbox Elite (1) controller or an Xbox Series X controller via the KDE control panel with xpadneo install works flawlessly.... until i reboot my system. After reboot the controller will connect via bluetooth, but xpadneo does not pick either model of controller up.

Forgetting the controller and re-pairing will cause the controller to be picked up again and work flawlessly, until the next reboot.

Steps to Reproduce

Pair controller using KDE system config, observe that the controller works flawlessly, including power cycling the controller and reconnecting.

Reboot the host machine, observe that while the controller will automatically connect, it is not detected as a joystick and xpadneo is not attaching to the device. No lines appear in dmesg when connecting.

Forget the controller in the KDE control panel and re-pair, observe that it is connected successfully and dmesg shows xpadneo grabbing the device

Expected Behavior

Connecting the controller after reboot works.

I'm not sure if this is a bluez issue or an xpadneo issue, but i cannot seem to figure it out, and attempting the various fixes suggested when googling or reading the docs/issues result in either breaking the bluetooth pairing process entirely or no change in behavior.

Screenshots / GIFs / Videos

System Information

# uname -a
Linux Alexis 6.9.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 31 May 2024 15:14:45 +0000 x86_64 GNU/Linux

Without xpadneo detecting the controller

# xxd -c20 -g1 /sys/module/hid_xpadneo/drivers/hid:xpadneo/0005:045E:*/report_descriptor | tee >(cksum)
zsh: no matches found: /sys/module/hid_xpadneo/drivers/hid:xpadneo/0005:045E:*/report_descriptor
4294967295 0

With xpadneo detecting the controller after fresh pairing

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 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 0c 09 01 a1 01 0a 85 00  ...%.u..............
000000c8: 15 00 26 ff 00 95 01 75 08 81 02 0a 99 00 15 00 26 ff 00 95  ..&....u........&...
000000dc: 01 75 04 81 02 15 00 25 00 95 01 75 04 81 03 0a 81 00 15 00  .u.....%...u........
000000f0: 26 ff 00 95 01 75 04 81 02 15 00 25 00 95 01 75 04 81 03 c0  &....u.....%...u....
00000104: 05 0f 09 21 85 03 a1 02 09 97 15 00 25 01 75 04 95 01 91 02  ...!........%.u.....
00000118: 15 00 25 00 75 04 95 01 91 03 09 70 15 00 25 64 75 08 95 04  ..%.u......p..%du...
0000012c: 91 02 09 50 66 01 10 55 0e 15 00 26 ff 00 75 08 95 01 91 02  ...Pf..U...&..u.....
00000140: 09 a7 15 00 26 ff 00 75 08 95 01 91 02 65 00 55 00 09 7c 15  ....&..u.....e.U..|.
00000154: 00 26 ff 00 75 08 95 01 91 02 c0 05 0c 09 01 85 0c a1 01 0a  .&..u...............
00000168: 9e 00 15 00 26 ff 00 95 01 75 08 81 02 0a a1 00 15 00 26 ff  ....&....u........&.
0000017c: 00 95 01 75 08 81 02 0a a2 00 15 00 26 ff 00 95 01 75 08 81  ...u........&....u..
00000190: 02 0a a3 00 15 00 26 ff 00 95 01 75 08 81 02 c0 c0 05 01 09  ......&....u........
000001a4: 06 a1 01 85 05 05 07 19 e0 29 e7 15 00 25 01 75 01 95 08 81  .........)...%.u....
000001b8: 02 95 01 75 08 81 03 95 06 75 08 15 00 25 65 05 07 19 00 29  ...u.....u...%e....)
000001cc: 65 81 00 c0                                                  e...
2376472410 2192

Controller and Bluetooth Information

xpadneo-reconnect-btmon.txt and xpadneo-reconnect-dmesg.txt are after a fresh boot and connecting the controller and resulted in no detected controller

xpadneo-new-pairing-btmon.txt and xpadneo-new-pairing-dmesg.txt are after forgetting the controller and initiating a pair and resulted in a detected and working controller

xpadneo-lsusb.txt xpadneo-reconnect-btmon.txt xpadneo-reconnect-dmesg.txt xpadneo-new-pairing-btmon.txt xpadneo-new-pairing-dmesg.txt

Additional Context

kakra commented 4 weeks ago

From your description, it first sounds like a udev issue. But looking at the logs, this is more likely an issue with bluez. This was most likely fixed in the later firmware versions but your version is up to date. So probably something isn't handled properly for your Bluetooth chipset in bluez.

Please check the troubleshooting for bluez and adjust some settings, to see if it helps: https://github.com/atar-axis/xpadneo/blob/master/docs/TROUBLESHOOTING.md (do not use the ERTM work-around on modern kernels).

Also, lately I've discovered that my original Xbox XB1S controller doesn't automatically reconnect. Press and hold 1 second on the connect button fixes that and it connects.

AccaliaDeElementia commented 4 weeks ago

Hmm....

looks like on arch, or with recent enough versions of bluez the JustWorksRepairing setting is required to properly load xpadneo after a reboot.

after... i honestly lost track of how many reboots it took, but here's the bluetooth config that appears to reliably work, at least with my bluetooth controller:

█▓▒░accalia@Alexis░▒▓██▓▒░ Thu Jun 06 11:18:08 
~/ grep -e '^[^#]' /etc/bluetooth/main.conf
[General]
JustWorksRepairing = always
[BR]
[LE]
[GATT]
[CSIS]
[AVDTP]
[Policy]
[AdvMon]
█▓▒░accalia@Alexis░▒▓██▓▒░ Thu Jun 06 11:18:24 
~/