Closed hadicharara closed 2 years ago
The Share button should be part of the secondary device "Consumer Control". Can you evtest that, too?
Also, the latest commit doesn't affect your model. The commit adds support for PID 0x0B20
while yours is 0x0B13
.
Did you setup any quirks parameter?
The following lines do not match:
[ 35.491846] xpadneo 0005:045E:0B13.0011: controller quirks: 0x00000050
[ 36.647742] xpadneo 0005:045E:0B13.0011: controller quirks: 0x00000010
[ 621.638738] xpadneo 0005:045E:0B13.0012: controller quirks: 0x00000050
If quirk flag 0x40 is set, XPADNEO_QUIRK_SHARE_BUTTON
is applied. But it seems sometimes it isn't. But that is actually part of the code unless you overwrote the quirks parameter via modparams, or you have two instances of the driver installed. According to the log, the driver is loaded only once.
The quirk is needed for firmware versions that place the share button at the select button bitmap position of previous versions. The flags are handled via the model database at https://github.com/atar-axis/xpadneo/blob/4fd620cd6cb80fb0c1490dc1c864108679d91ab1/hid-xpadneo/src/hid-xpadneo.c#L1256 and following lines.
I tested the secondary device Consumer Control with evtest. On first connect, no events show up when pressing the share button (probably because it sends SELECT instead). On any subsequent connects, the normal KEY_RECORD
event shows up when pressing the share button.
I have not touched the quirks parameter via modparams, and have only installed the driver once. I don't think the quirk isn't being applied all the time, as only the bugs appear only on the first connection of the controller since boot. If I disconnect and connect, it behaves normally. Maybe the quirk is not being applied on the first connection?
It should be because no other ID would match... But I see that hid-generic first claims the device which is different on my system:
[ 35.426419] hid-generic 0005:045E:0B13.0011: input,hidraw10: BLUETOOTH HID v5.13 Gamepad [Xbox Wireless Controller] on f8:34:41:65:44:8c
Could you try modprobe hid-xpadneo
once after boot before connecting the controller and see if it changes behavior? If it does, we may need to change the rebind rules in udev.
I just tried it, and running modprobe hid-xpadneo
did indeed prevent the bugs from appearing. Your intuition was correct.
A work-around would be to just load hid-xpadneo as part of the boot process. In systemd systems, you can usually create a file /etc/modules-load.d/xpadneo
and insert one module name per line.
I already applied it. Since I don't really know how udev rules work, I will remain available to test any potential fix. Thanks for the great driver!
modprobe hid-xpadneo
Confirming that this also resolves the issue with the 1708 controller I mentioned here- https://github.com/atar-axis/xpadneo/issues/337#issuecomment-1071946271
Yeah, I've been suspecting we need to change the rebind rules since a few weeks because I stumbled upon some posts that suggest unbind and bind should be issued with a small delay. I'll look into it, it's currently baked into one single rule.
Can also confirm the workaround, I added to my module list like so:
echo "hid-xpadneo" | sudo tee /etc/modules-load.d/xpadneo.conf
Is there any harm in leaving that workaround in there, it won't affect future updates I hope? (Not really a Linux expert)
Now the ◻◻ two squares view/select button is working. Thanks for your video @hadicharara it was useful to match the problem I was having just today.
Auto-loading the module on boot is a totally valid option, it won't affect future updates.
I can confirm the following new behavior: If you unload hid-xpadneo and reload it, it won't properly apply all fixups, resulting in broken Select button for some models. I'm not sure what the underlying problem is but it also seems to affect our udev rules. It looks like the kernel caches the device with our fixups applied (the SDL fixups), and upon reloading or rebinding the xpadneo driver, the module doesn't properly detect all the fixups and needed quirks. I'm also not sure yet what kernel version introduced this change. One effect from this is that on first load, it would show 0x50
quirk flags, and when reloading the driver, it would show 0x10
quirk flags (and that's actually missing the Select button fix then). Quirk flags can be observed in dmesg
.
Using modprobe hid-xpadneo quirks=<CONTROLLERMAC>+0x40
will probably work around it.
Version of xpadneo
Controller Model
Connection mode
Installed Software
Severity / Impact
Describe the Bug
When I connect my Series X controller for the first time after boot, it does weird things:
If I disconnect the controller and connect it again, al these bugs seem to go away.
Steps to Reproduce
Checkout commit
4fd620cd6cb80fb0c1490dc1c864108679d91ab1
, compile and install (latest commit as of time of writing). Boot computer, connect Series X controller (without pressing any button), and run evtest.Expected Behavior
The Select button registers as the select button. The Share button should not show up on evtest.
Screenshots / GIFs / Videos
evtest_first_connect.txt evtest_subsequent_connects.txt
video.mp4
System Information
Controller and Bluetooth Information
xpadneo-btmon.txt xpadneo-dmesg.txt xpadneo-lsusb.txt
Additional Context