Closed 777Raim closed 2 years ago
With the XBXS controller, this is most likely a Bluetooth issue we cannot work around in xpadneo directly as it is not a Bluetooth but a HID driver. I tested the latest commit for multiple months now with all three models (XB1S, XBE2, and XBXS) and hand no issues, rumble was more consistent across all games. But there's an issue with bluez that may use wrong latency settings. From your description, I read you already tried those (it's documented in the troubleshoot docs how to set those). Be sure to reboot after you applied the settings, maybe purge the bluez devices cache and remove the device, then pair it again, just to be sure.
But FWIW, could you try the previous commit? It should change nothing about the behavior except that you see more consistent rumble strengths during the game reprogramming the strength a lot of times. If the game sets rumble=0, this will pass through to the controller, as we have a special case handling for this. So everything should be fine.
What you describe (5-10 seconds, maybe even 20s sometimes) is usually a Bluetooth issue I observed, too. According to MS, you should stop using other Bluetooth devices nearby, or on the same Bluetooth adapter. Also, there's the latency issue. You should also upgrade to the latest XBXS firmware using a Windows system (rumor says there has been an update lately, I didn't try it yet). If you changed any settings (latency, firmware version), it usually requires to remove the controller from Bluetooth, purge the Bluetooth cache, then pair it again. The internal controller details seem to be a little quirky. You may even need to pair it to a different computer once to clear its internal state.
There may be a third problem: Steam may use the gamepad in hidraw mode which doesn't work quite so well due to the quirks of the XBXS controller. Try disabling Steam Input for the game or in the global Steam settings. Also check dmesg
when the gamepad connected and look for the hidraw number of the device, then revoke all access permissions from it (chmod a-rwx /dev/hidraw#
), and start the game without reconnecting the gamepad. Background: When SDL2 uses hidraw mode, it bypasses the quirks and fixes we apply for the controllers.
Try stopping/uninstalling kdeconnectd if you have that.
There's a lot of Bluetooth related information here: https://github.com/atar-axis/xpadneo/projects/11
Sorry for my english
Please don't, I could read everything perfectly. ;-)
Thanks for quick reply!
could you try the previous commit?
I used previous commit before - same behaviour. I thought last commit can help me (throttling fix) - no result, so I have to make new issue.
If you changed any settings (latency, firmware version), it usually requires to remove the controller from Bluetooth, purge the Bluetooth cache, then pair it again. The internal controller details seem to be a little quirky. You may even need to pair it to a different computer once to clear its internal state.
Yes, I updated my gamepad via Windows (now XBXS hasn't any updates). Latency changed before. Tried to do this again - nothing changed. Tried to connect to another device (Android). After that couldnt connect to PC. Connect to Windows via VirtualBox helped me. Now XBXS connect to PC (Linux) without troubles.
revoke all access permissions from it (chmod a-rwx /dev/hidraw#)
Tried that too - nothing changed.
Try stopping/uninstalling kdeconnectd if you have that.
I dont have kdeconnectd. I use GNOME with GSConnect. But it uses wifi.
P.S. I run games not via Steam - directly via wine (just use Proton version)
GSconnect may exhibit the same behavior as kdeconnectd because they largely are designed from the same code base. kdeconnectd has a bug where it spams (or something triggers it to spam) the Bluetooth radio with scanning requests (no matter how and if your phone is connected) every 10-20s which puts the receiver into discovery mode and lasts for 20s. XBXS and discovery mode do not play nice together. GSconnect may do something similar. Try stopping it and see if the problems are gone. It was covered here: https://github.com/bluez/bluez/issues/123
If you can make the same observations with GSconnect running, you should report that upstream to GSconnect.
I disabled GSConnect (turn off extension), delete bluetooth connection, clear cache, reboot - connect (with 3 time), make chmod (just in case), start game - same behaviour
Tried to disable WiFi - in my feel rumble duration was decreased, but still it's.
This may feel like it's becoming dumb or silly... But after all, MS suggest that there may be air-time concurrency issues with the controller. If disabling wifi helps the issue, then this sounds like exactly such a problem. Some ideas:
Also it may be helpful for diagnostic if you'd look at the output of btmon
to watch if there's constant BT radio activity even if you do nothing (the XBXS controller would send a battery report packet every once in a while but no bursts if you leave it sitting idle). If it spools a lot of stuff, that may be active BT scanning and you should try to stop that.
While btmon
is running and looks like it's idle, try moving the sticks (moving in circles with a steady motion works best): You should see activity immediately, it should remain as a constant stream while you move the sticks, and you should see it stop immediately if you stop moving the sticks. If there's a delay either in starting or stopping, or intermittent dropouts, there's probably some external interference with the BT protocol. You can also try button clicks while btmon
is running to get some clearer picture of latency but you should put your controller on the table and fix it in place with one hand while using the buttons, otherwise you may introduce accidental stick movement which results in a whole lot of messy btmon output.
BTW: Different models work differently when looking at them in btmon
, e.g. the XB1S controller sends input events in bursts of at least 20 packets so it may send a little longer than generating actual input. The XBE2 controller seems to send input data for at least 1-2 seconds but that depends a lot of concurrent radio activity, sometimes it constantly sends data and never stops which is probably a bug. My experience with the XBXS controller is that it sends exactly as long as you generate input, and only single packets if you generate only single inputs.
Yes, I have combined BT/WiFi adapter (laptop).
Here some output from btmon
(click to button once):
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2613 [hci0] 411.387322
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000100000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2614 [hci0] 411.387377
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000100000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2615 [hci0] 411.387385
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000100000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2616 [hci0] 411.387432
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000100000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2617 [hci0] 411.407442
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2618 [hci0] 411.452440
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2619 [hci0] 411.453070
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2620 [hci0] 411.474948
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2621 [hci0] 411.497448
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2622 [hci0] 411.519948
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2623 [hci0] 411.553694
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2624 [hci0] 411.564951
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2625 [hci0] 411.587442
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2626 [hci0] 411.609947
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2627 [hci0] 411.632442
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2628 [hci0] 411.654945
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2629 [hci0] 411.677450
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2630 [hci0] 411.699939
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2631 [hci0] 411.722454
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2632 [hci0] 411.756226
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2633 [hci0] 411.767445
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2634 [hci0] 411.789940
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2635 [hci0] 411.812445
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2636 [hci0] 411.857444
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2637 [hci0] 411.858075
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2638 [hci0] 411.879946
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2639 [hci0] 411.902448
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2640 [hci0] 411.924949
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2641 [hci0] 411.958700
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2642 [hci0] 411.969945
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2643 [hci0] 411.992453
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2644 [hci0] 412.014942
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2645 [hci0] 412.059944
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2646 [hci0] 412.060578
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2647 [hci0] 412.082450
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2648 [hci0] 412.104952
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2649 [hci0] 412.127446
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2650 [hci0] 412.161247
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2651 [hci0] 412.172442
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2652 [hci0] 412.194946
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2653 [hci0] 412.217447
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2654 [hci0] 412.273709
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2655 [hci0] 412.274322
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2656 [hci0] 412.284952
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2657 [hci0] 412.307451
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2658 [hci0] 412.329944
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2659 [hci0] 412.363711
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2660 [hci0] 412.374951
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2661 [hci0] 412.397467
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2662 [hci0] 412.419949
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2663 [hci0] 412.442444
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2664 [hci0] 412.464954
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2665 [hci0] 412.487456
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 23 #2666 [hci0] 412.509952
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: ce86a87e4580fb820000000000000000
From output I made conclusion: 45 packages of data was send/recived from XBXS at 1,12263 sec. Data continued enter to log when I released button. Is it normal or not I dont know.
No that's not how it should work: XBXS should stop sending data immediately (or maybe after 10-15ms). So I suppose your combined adapter may have driver problems because it doesn't communicate back to the gamepad properly. This is handled completely in the Bluetooth stack of the kernel and the bluez daemon, long before xpadneo sees the data.
So here's some ideas to try:
BTW: The controller has an internal rate of 100 Hz for the protocol, so it should send packets at 100 Hz, that is at 10 ms intervals. Your log shows intervals between 20-40 ms, and I assume that's why protocol data queues up and you're seeing delays and latency. You could try changing the source code to throttle the rumbler to 50ms intervals to slow down how much data xpadneo sends TO the controller but you will still see input latency of around 30ms at least which is already quite noticeable during gaming. Usually, we receive input data after 10ms in the worst case with a proper BT dongle.
Not counting internal delays in the controller, this will add another 16.6ms frame latency at 60fps, so you're already near 50ms latency which is already very noticeable.
Get a cheap BT 4.0 dongle somewhere, one for 10-15€ should do, I'd recommend a dongle with CSR chipset
I took new TB4.0: xpadneo-lsusb-NEW_DONGLE.txt
Some btmon
info
xpadneo-btmon-NEW_DONGLE.txt
In the end: nothing changed (even by fully disabling combined BT+WiFi)
upd: added btmon
output while click button once:
Bluetooth monitor ver 5.61
= Note: Linux version 5.13.12-200.fc34.x86_64 (x86_64) 0.319332
= Note: Bluetooth subsystem version 2.22 0.319335
= New Index: D4:6A:6A:15:C1:CA (Primary,USB,hci1) [hci1] 0.319336
= New Index: 00:15:83:FF:16:44 (Primary,USB,hci0) [hci0] 0.319336
= Open Index: 00:15:83:FF:16:44 [hci0] 0.319337
= Index Info: 00:15:83:FF:16:44 (Cambridge Silicon Radio) [hci0] 0.319337
@ MGMT Open: bluetoothd (privileged) version 1.20 {0x0001} 0.319338
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #1 [hci0] 3.813727
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000d00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #2 [hci0] 3.813897
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000d00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #3 [hci0] 3.813990
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000d00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #4 [hci0] 3.814355
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #5 [hci0] 3.844376
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #6 [hci0] 3.874376
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #7 [hci0] 3.904367
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #8 [hci0] 3.934370
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #9 [hci0] 3.964372
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #10 [hci0] 3.994374
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #11 [hci0] 4.024362
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #12 [hci0] 4.054365
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #13 [hci0] 4.084365
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #14 [hci0] 4.114374
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #15 [hci0] 4.144371
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #16 [hci0] 4.174374
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #17 [hci0] 4.204377
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #18 [hci0] 4.234378
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #19 [hci0] 4.264370
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #20 [hci0] 4.294369
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #21 [hci0] 4.324370
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #22 [hci0] 4.354376
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #23 [hci0] 4.384377
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #24 [hci0] 4.414382
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #25 [hci0] 4.444365
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #26 [hci0] 4.474370
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #27 [hci0] 4.504361
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #28 [hci0] 4.534373
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #29 [hci0] 4.564375
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #30 [hci0] 4.594375
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #31 [hci0] 4.624366
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #32 [hci0] 4.654373
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #33 [hci0] 4.684378
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #34 [hci0] 4.714380
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #35 [hci0] 4.744369
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #36 [hci0] 4.774386
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #37 [hci0] 4.804374
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #38 [hci0] 4.834381
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #39 [hci0] 4.864379
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #40 [hci0] 4.894374
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #41 [hci0] 4.924383
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #42 [hci0] 4.954375
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #43 [hci0] 4.984367
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #44 [hci0] 5.014377
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #45 [hci0] 5.044378
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #46 [hci0] 5.074383
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #47 [hci0] 5.104385
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #48 [hci0] 5.134376
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #49 [hci0] 5.164385
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #50 [hci0] 5.194378
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #51 [hci0] 5.224367
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #52 [hci0] 5.254374
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
> ACL Data RX: Handle 69 flags 0x02 dlen 23 #53 [hci0] 5.284383
ATT: Handle Value Notification (0x1b) len 18
Handle: 0x001e
Data: b17f957f1b7ffc810000000000c00000
upd2: Kernel: 5.13.12-200.fc34.x86_64 Bluez: 5.61
Okay, now things are getting strange... The btmon tells me the device is paired to hci0 which is the CSR dongle - so it should work. But you are still seeing the exact same problems?
Today I did some gamaped test: connect XBXS via new BT dongle and test behaviour rumble in GTAV via Wine and GTAV via Moonlight (stream from Windows). Via Moonlight gamepad rumble works perfects! But via Wine - promblems above.
In both cases the gamepad is attached to the Linux host, right?
And when you say "wine" - is it upstream wine, or Proton wine? Because those two versions differ a lot in how they use SDL and gamepads.
In both cases the gamepad is attached to the Linux host, right?
Yes
when you say "wine" - is it upstream wine, or Proton wine?
Proton-6.14-GE-2
And I found that rumble strength via Linux more heavy as Windows (real windows machine)
Tomorrow will test default wine and give results
And I found that rumble strength via Linux more heavy as Windows (real windows machine)
There are multiple possible causes for this:
modinfo hid-xpadneo
, rumble_attenuation), you can also apply scales to main and trigger motors individuallyProton-6.14-GE-2
Could you retry with Proton Experimental? That's the only version I'm testing against because it contains everything that is scheduled for being mainlined to Proton.
So, this my unhurried results: I tried:
wine-6.3-proton-experimental-43c3113-amd64
- same troublewine-6.16-amd64
- same troubleSteamProton-6.3-6c
and Epic Game Launcher
to run licensed copy of GTA - same troubleTried c_hidraw
test utility - all rumble combinations are worked out clearly and new send of data interrupts previous rumble
Is this on Fedora Core?
I cannot reproduce such behavior here with Gentoo. And your hidraw test shows that it generally works as it should.
So the only explanation left is: in games rumble is sent too fast, overwhelming the controller. In dmesg this is logged as a rumble throttle entry. If you don't see that, the games are bypassing the xpadneo driver and we cannot do anything except trying to force the games into not bypassing our driver.
In dmesg this is logged as a rumble throttle entry
By default I dont see this message in dmesg
while gaming. Tried to make chmod a-rwx /dev/hidraw#
- message didnt.
Sometime ago I saw throttle message in dmesg
, but rumble behaviour was wrong i that time.
trying to force the games into not bypassing our driver
How can I force the game uses xpadneo
driver? And how can I know the game uses xpadneo
?
ps: some info from dmesg
while connecting XBXS
[< 75,730875>] xpadneo 0005:045E:0B13.000F: pretending XB1S Windows wireless mode (changed PID from 0x0B13 to 0x02E0)
[< 0,000009>] xpadneo 0005:045E:0B13.000F: working around wrong SDL2 mappings (changed version from 0x00000507 to 0x00000903)
[< 0,000005>] xpadneo 0005:045E:0B13.000F: report descriptor size: 283 bytes
[< 0,000004>] xpadneo 0005:045E:0B13.000F: fixing up Rx axis
[< 0,000003>] xpadneo 0005:045E:0B13.000F: fixing up Ry axis
[< 0,000002>] xpadneo 0005:045E:0B13.000F: fixing up Z axis
[< 0,000002>] xpadneo 0005:045E:0B13.000F: fixing up Rz axis
[< 0,000002>] xpadneo 0005:045E:0B13.000F: fixing up button mapping
[< 0,000371>] xpadneo 0005:045E:0B13.000F: gamepad detected
[< 0,000002>] xpadneo 0005:045E:0B13.000F: enabling compliance with Linux Gamepad Specification
[< 0,000081>] input: Xbox Wireless Controller as /devices/virtual/misc/uhid/0005:045E:0B13.000F/input/input46
[< 0,000310>] xpadneo 0005:045E:0B13.000F: input,hidraw0: BLUETOOTH HID v9.03 Gamepad [Xbox Wireless Controller] on 00:15:83:ff:16:44
[< 0,000142>] input: Xbox Wireless Controller Consumer Control as /devices/virtual/misc/uhid/0005:045E:0B13.000F/input/input47
[< 0,000098>] xpadneo 0005:045E:0B13.000F: consumer control added
[< 0,000009>] xpadneo 0005:045E:0B13.000F: controller quirks: 0x00000050
[< 0,000004>] xpadneo xpadneo_welcome_rumble start
[< 0,990951>] xpadneo xpadneo_welcome_rumble took 991ms
[< 0,000023>] xpadneo 0005:045E:0B13.000F: Xbox Wireless Controller [44:16:22:90:19:46] connected
Exact same issue here. I've tried several games, and non of them are printing log into dmesg while gaming. However, after I uninstalled xpadneo and reboot, I could connect my controller via bluetooth, but the key mappings in the game are completely messed up. So I guess the games were actually using xpadneo when it's installed, and they are not bypassing xpadneo. And thus I think the rumble issue might be an issue of xpadneo itself, and it never print log for some reason (except for the welcome message)
Well, we can still control what the games see over hidraw: The hidraw reports are patched by xpadneo to show a correct mapping of an emulated original Xbox controller. But we cannot control what SDL2 sends over hidraw. Thus, you'll never see the rumble throttle message if games go via the hidraw device. SDL2 should have a working rumble throttle meanwhile but I'd need to check the source code to confirm this.
Looking at the original description (rumble continues for some time when it's supposed to stop), this still looks like some awkward Bluetooth latency problem to me. The XBXS controller may be especially sensitive here. And this may not be solved by rumble throttling. Do you see any input latency? Please look at https://github.com/atar-axis/xpadneo/issues/198#issuecomment-930528265 for LE latency parameters to set in your bluez configuration and report back.
Thank you so much for such detailed explanation Kakra. I've tried the LE config, but unfortunately, the issue persists. Here's my /etc/bluetooth/main.conf
file: main.conf.txt
Please remove the .txt
extension. I'm adding .txt
to it because github doesn't support .conf
(edit: I added ControllerMode = Dual
and changed JustWorksRepairing = always
to JustWorksRepairing = confirm
, but they didn't help. )
And cat /sys/module/bluetooth/parameters/disable_ertm
gives N
And I've recorded some log from btmon
. Here's the log file: btmon.log
And here's what I do related to the log:
sudo btmon | tee btmon.log
and keep the terminal running in background. btmon
Sorry for such a long reply and my bad English. I really don't understand the btmon log, so I really appreciate if you could help me out with this issue. Thank you good sir!
After update trouble didn't gone. But rumble behaviour changes: after start game the rumble works. But if I drive via grass the rumble works about 1-3 sec and stops at all (at that time xpadneo
logs for dmesg
this: throttling rumble reprogramming
). After that I tried to test rumble via hidraw
tool - the rumble didn't work. To start rumble work again I have to reconnect XBSX.
Some dmesg
log:
[< 0,000037>] xpadneo 0005:045E:0B13.0006: pretending XB1S Windows wireless mode (changed PID from 0x0B13 to 0x02E0)
[< 0,000003>] xpadneo 0005:045E:0B13.0006: working around wrong SDL2 mappings (changed version from 0x00000507 to 0x00000903)
[< 0,000003>] xpadneo 0005:045E:0B13.0006: report descriptor size: 283 bytes
[< 0,000003>] xpadneo 0005:045E:0B13.0006: fixing up Rx axis
[< 0,000001>] xpadneo 0005:045E:0B13.0006: fixing up Ry axis
[< 0,000001>] xpadneo 0005:045E:0B13.0006: fixing up Z axis
[< 0,000001>] xpadneo 0005:045E:0B13.0006: fixing up Rz axis
[< 0,000001>] xpadneo 0005:045E:0B13.0006: fixing up button mapping
[< 0,000265>] xpadneo 0005:045E:0B13.0006: gamepad detected
[< 0,000002>] xpadneo 0005:045E:0B13.0006: enabling compliance with Linux Gamepad Specification
[< 0,000061>] input: Xbox Wireless Controller as /devices/virtual/misc/uhid/0005:045E:0B13.0006/input/input28
[< 0,000249>] xpadneo 0005:045E:0B13.0006: input,hidraw3: BLUETOOTH HID v9.03 Gamepad [Xbox Wireless Controller] on 00:15:83:ff:16:44
[< 0,000094>] input: Xbox Wireless Controller Consumer Control as /devices/virtual/misc/uhid/0005:045E:0B13.0006/input/input29
[< 0,000088>] xpadneo 0005:045E:0B13.0006: consumer control added
[< 0,000009>] xpadneo 0005:045E:0B13.0006: controller quirks: 0x00000050
[< 0,000005>] xpadneo xpadneo_welcome_rumble start
[< 0,990746>] xpadneo xpadneo_welcome_rumble took 991ms
[< 0,000010>] xpadneo 0005:045E:0B13.0006: Xbox Wireless Controller [44:16:22:90:19:46] connected
[< 77,594542>] xpadneo 0005:045E:0B13.0006: throttling rumble reprogramming
[< 77,594542>] xpadneo 0005:045E:0B13.0006: throttling rumble reprogramming
At least this line tells us that rumble no works through the driver, so we are safe on that side.
[< 0,990746>] xpadneo xpadneo_welcome_rumble took 991ms
This looks like the kernel timing may be off a little bit: The duration is too short, it's designed to run 997ms, and usually I'm seeing values between 995 and 998, your's falls quite out of this range.
I'm not sure if you can figure out how to adjust the source code on your own and trying to install it from there... But in the file hid-xpadneo/src/xpadneo.h
is a constant XPADNEO_RUMBLE_THROTTLE_DELAY
where you could set the throttling from 10 to 15 ms to see if it improves things. Another thing to try would be upgrading to the latest version of bluez.
The workqueue timer is quite coarse in the kernel but usually it should not "undershoot". Could you tell me the output of zgrep _HZ /proc/config.gz
? Thanks.
BTW: The issue shouldn't have been auto-closed.
But in the file hid-xpadneo/src/xpadneo.h is a constant XPADNEO_RUMBLE_THROTTLE_DELAY where you could set the throttling from 10 to 15 ms
Tried change XPADNEO_RUMBLE_THROTTLE_DELAY
- nothing changed:
[< 0,990999>] xpadneo xpadneo_welcome_rumble took 991ms
Maybe I reinstalled it wrong? (#./uninstall.sh
-> edit hid-xpadneo/src/xpadneo.h
-> #./install.sh
)
Another thing to try would be upgrading to the latest version of bluez
My bluez
version is 5.62-1.fc34
Could you tell me the output of zgrep _HZ /proc/config.gz? Thanks.
$ zgrep _HZ /proc/config.gz
gzip: /proc/config.gz: No such file or directory
[< 0,990999>] xpadneo xpadneo_welcome_rumble took 991ms
This line won't change by editing the file: The initial rumbler uses fixed rumble lengths. But you may see a different result during the game.
gzip: /proc/config.gz: No such file or directory
Okay, your kernel has no config.gz support. You could try running getconf CLK_TCK
, although that just seems to return 100
anywhere.
This line won't change by editing the file: The initial rumbler uses fixed rumble lengths. But you may see a different result during the game.
I didn't try this yet, but I noticed this: if XPADNEO_RUMBLE_THROTTLE_DELAY
is 15
the rumble don't work at all.
You could try running
getconf CLK_TCK
$ getconf CLK_TCK
100
Today will try to check last commit and various XPADNEO_RUMBLE_THROTTLE_DELAY
values
if
XPADNEO_RUMBLE_THROTTLE_DELAY
is15
the rumble don't work at all.
This is strange, didn't happen when I experimented with it. Did you keep the msecs_to_jiffies
function around the value? It's important to let the kernel convert that properly.
Today tried all values (10-15) of XPADNEO_RUMBLE_THROTTLE_DELAY
- every time same behaviour: the rumble works 1-3 sec and stops at all.
Did you keep the msecs_to_jiffies function around the value? It's important to let the kernel convert that properly.
Of course, I kept msecs_to_jiffies
function
Okay, so we are on a false track here: If 15ms changes nothing at all, there's no timing issue.
If rumble stops, do inputs still work normally?
If rumble stops, do inputs still work normally?
Yes, input still works as usual
Version of xpadneo
With last commit 67585b3
Controller Model
Connection mode
Installed Software
Severity / Impact
Describe the Bug
When I play in GTA V via Wine (Proton GE) and ride the car through grass, my gamepad makes rubmle as usual. But after I stop car, gamepad continues make rumble 5-10 seconds then stops. While gamepad make rumble I tried go to main menu, but rumble didnt stop. I tried change bluetooth latency, change rumble strength - nothing changed. If I plug gamepad via USB - rumble is fine.
Expected Behavior
Rumble stops after car stops
System Information
Controller and Bluetooth Information
xpadneo-lsusb.txt xpadneo-dmesg.txt xpadneo-btmon.txt
Additional Context
Sorry for my english