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.92k stars 111 forks source link

hid_xpadneo doesn't load (Xbox Series X|S Wireless controller) #316

Closed MageJohn closed 2 years ago

MageJohn commented 2 years ago

Version of xpadneo

0.9.r88.g2900363-1

(from the AUR xpadneo-dkms-git package, built Wed 27 Oct 2021)

Controller Model

Connection mode

Installed Software

Severity / Impact

Describe the Bug

I've paired the controller by copying the link keys from Windows 10 as a workaround to the disconnect-reconnect loop issue.

The issue now is that on connecting, the controller doesn't rumble or show up as a gamepad. Running lsmod | grep xpad shows hid_xpadneo is not loaded. After seeing #275, I checked and hid_microsoft is not installed (I only build the kernel modules I need to keep compile times down), and I diffed lsmod output before and after connecting, and no modules were loaded or unloaded.

Steps to Reproduce

Successfully pair and connect the controller, or reconnect an already paired controller.

Expected Behavior

The hid_xpadneo module to be loaded and the controller to work.

System Information

# uname -a
Linux Juris 5.14.14-xanpre0-rog-1 #1 SMP Fri, 22 Oct 2021 17:13:23 +0000 x86_64 GNU/Linux
# xxd -c20 -g1 /sys/module/hid_xpadneo/drivers/hid:xpadneo/0005:045E:*/report_descriptor | tee >(cksum)
xxd: /sys/module/hid_xpadneo/drivers/hid:xpadneo/0005:045E:*/report_descriptor: No such file or directory
4294967295 0

Controller and Bluetooth Information

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

Additional Context

Output from running udevadm monitor while connecting the controller. xpadneo-udevadm.txt

kakra commented 2 years ago

The XBXS controller needs uhid and (probably) Bluetooth HIDP to work: BLE-style controllers aren't detected by the kernel HID system, bluez provides a user-space helper to inject BLE HID into the kernel, uhid will then provide a virtual HID device that kernel HID drivers can pick up. Your kernel may be stripped down too much.

After you provide the proper kernel modules for uhid and BLE-HID, the kernel should use hid-microsoft or hid-generic for the device (in that order of preference), unless you install hid-xpadneo and the udev rules which rebind the device to the hid-xpadneo driver when udev detects a supported VID/PID.

If you're using the latest preview firmware for your controller, it may change to PID 0xB20 which is not yet fully supported by xpadneo: The controller is generally working but the mapping is not correct. Please look at #315 in that case.

Your udevadm monitor and dmesg output look like your Bluetooth stack is missing virtual HID support (most probably uhid is missing in the kernel).

https://wiki.gentoo.org/wiki/Bluetooth_input_devices

MageJohn commented 2 years ago

Aha, that's solved it! I didn't have uhid built. The controller works perfectly now.

kakra commented 2 years ago

Todo:

tonyrh commented 2 years ago

Aha, that's solved it! I didn't have uhid built. The controller works perfectly now.

Hi, I have the same issue, how do you fix it? Do I have to build a custom kernel?

kakra commented 2 years ago

If you're using a distribution kernel, look if there is a module package otherwise raise an issue in the distribution bug tracker.