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

Vibration / rumble stops working after reconnecting the controller [Xbox Series S] #444

Open arnxxau opened 7 months ago

arnxxau commented 7 months ago

Version of xpadneo

434 latest commit

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

Vibration / rumble works when starting the game but after reconnecting the controller with the game opened (power off -> power on) it stops working. For example if it turns off because of inactivity and then you power it on again

Steps to Reproduce

Expected Behavior

Vibration / rumble should start working after restart of the game

Observations / workaround

I found out that I could re-enable the vibration / rumble by closing and opening the game again. I also observed that the welcome rumble start plays correctly even after the restart of the controller

System Information

# uname -a
6.6.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 08 Nov 2023 16:05:38 +0000 x86_64 GNU/Linux

I also tried with the latest Nobara Linux Kernel (6.59 fsync 201)

# 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 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

Bus 003 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

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

kakra commented 7 months ago

This is a known issue due to how xpadneo offers rumble support to games, and games using the wrong SDL API to query rumble support. We can probably work around this from the xpadneo side, but the SDL project lately stated that games really should use a different API to query for rumble support.

Until then, you should be able to work around it by disabling the welcome rumble in the driver. This tightens the time frame between device detection and offering the rumble feature which will probably work around that race condition in SDL - at least most of the time.

arnxxau commented 7 months ago

Thank you :)! Is there a way to disable the welcome rumble without commenting the function in the code? I can't seem to find any option in the configure.sh script

kakra commented 7 months ago
# modinfo hid-xpadneo
[...]
parm:           ff_connect_notify:(bool) Connection notification using force feedback. 1: enable, 0: disable. (bool)
[...]

;-)

So you actually add that parameter to the module load options.

arnxxau commented 7 months ago

Working! Thanks again ! : )

kakra commented 7 months ago

Thanks for confirming. Please leave this opened so I can implement a fix.

orbea commented 5 months ago

but the SDL project lately stated that games really should use a different API to query for rumble support.

The newer API is also not applicable for some use cases, for example some emulators emulate controllers that have wildly different layouts than SDL2 expects for modern games. Was it ever confirmed that the newer API even fixes this?

RobotRoss commented 4 months ago

Just wanted to say that I was also having this issue and that disabling ff_connect_notify also fixed this for me on a Gulikit KingKong2 Pro controller.

Disabled using echo 0 | sudo tee /sys/module/hid_xpadneo/parameters/ff_connect_notify (found in the xpadneo docs here - https://github.com/atar-axis/xpadneo/blob/master/docs/CONFIGURATION.md )

kakra commented 4 months ago

@RobotRoss I closed your other report as duplicate then. You can apply the setting permanently:

# /etc/modprobe.d/xpadneo.conf
options hid-xpadneo ff_connect_notify=0

The next version will disable that by default, or switch to a different method.

RobotRoss commented 4 months ago

@RobotRoss I closed your other report as duplicate then. You can apply the setting permanently:

# /etc/modprobe.d/xpadneo.conf
options hid-xpadneo ff_connect_notify=0

The next version will disable that by default, or switch to a different method.

That issue should be reopened, seems to be a different problem. See comment on the other issue.