ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.19k stars 173 forks source link

Bluetooth controller vibrating constantly when using Steam Link to connect to Steam on Linux PC #8107

Open ghost opened 2 years ago

ghost commented 2 years ago

Devices used, Ipad 8th generation 2020 M1 Mac mini Dell Optiplex 9010, I73770K 32gb ram, 2.5tb fast SSD storage, Games and controllers work fine on system its self.

Steam Link tested on iPad, and Mac is up to date. Controllers used are Xbox One and Xbox Series X controllers, firmware up to date. Linux version on Target machine, Ubuntu 20.04 Not using any beta software Yes, I have checked for updates to all software on Linux PC, iPad, and Mac, all up to date. Steam client on target machine is up to date,

Using either the Xbox Series X or Xbox One controller connected via Bluetooth to either my iPad or Mac and then using Steam Link on either device to connect to Steam on my Linux PC causes the vibration motors in the controller to start vibrating wildly. Specifically the left vibration motor. This starts any time I try to run any game, regardless of what game it is.

Side note, connecting the same iPad and Mac setups to my room mate's Windows 10 PC did not cause the same issue, that works just fine. This seems to be specific to the Linux Steam Client.

To reproduce this issue, Connect a bluetooth Xbox controller to an iPad or Mac Use Steam Link to connect to steam on a Linux PC. Try to play any game, your controller should now be vibrating uncontrollably.

kakra commented 2 years ago

Does this happen right at the start of a game, or the first time the game should rumble the controller? In the latter case, there may be an issue with the Bluetooth protocol: While developing the xpadneo driver, we found that the controller doesn't like rumble data to be sent faster than 10ms intervals per frame - otherwise the controller seems to crash/desync internally and doesn't stop the rumble motors.

ghost commented 2 years ago

It starts somewhere between pressing the "play game" button and the actual game starting, somewhere in that second or two. I wasn't using xpadneo, I had used the xow and xone drivers, (never both at the same time). I tried one, then the other, then uninstalling both just to see what would happen and in every case, the same controller worked fine on the actual PC, but vibrated uncontrollably when used via steam link.

kakra commented 2 years ago

Okay, then it's not that protocol thing but something different. I just wanted to differentiate between those two.

slimjim2234 commented 2 years ago

been having steamlink linux bluetooth xbox controller issues for a while now. another thread about it https://steamcommunity.com/app/353380/discussions/0/3124912256628622960/

kakra commented 2 years ago

We lately had this discussion on the xpadneo Discord server: It was solved after revoking user session access to the hidraw device, so there's probably something broken in SDL and its hidapi driver.

pc-2198x commented 2 years ago

I am also experiencing this issue. Xbox controller will vibrate constantly once a game is launched when the controller is connected via bluetooth. The controller will continue to vibrate until it is manually turned off.

EDIT

Apparently OpenRGB udev rules was the culprit. Removed OpenRGB udev rules fixed the vibration issue.

andrebrait commented 1 year ago

This is 100% reproducible on the Steam Deck with an Xbox Series X controller.

Pick a game that has a ton of rumble (e.g. Dirt Rally 2.0) and it vibrates like crazy. It's as if there is some sort of queue of vibration events that can never be interrupted and once the game sends them, they will execute for a looooooong time. Even exiting the game doesn't cease the rumble.

It happens when playing directly on the Steam Deck as well as when streaming from my Windows PC to the Deck.

kakra commented 1 year ago

With BLE firmware 5.x of the Xbox controllers, rumble programming needs to be throttled to 20hz (intervals of 50ms, the previous firmware supported 100hz, intervals of 10ms). Steam Input uses SDL, as far as I know, and SDL does not have this fix. You can use the xpadneo driver and disable Steam Input to work around this problem, except that installing xpadneo on the Steam Deck may be a bit difficult. Even the plain HID drivers of the kernel do not properly support this, as they do rumble at 50hz (20ms intervals).

andrebrait commented 1 year ago

With BLE firmware 5.x of the Xbox controllers, rumble programming needs to be throttled to 20hz (intervals of 50ms, the previous firmware supported 100hz, intervals of 10ms). Steam Input uses SDL, as far as I know, and SDL does not have this fix. You can use the xpadneo driver and disable Steam Input to work around this problem, except that installing xpadneo on the Steam Deck may be a bit difficult. Even the plain HID drivers of the kernel do not properly support this, as they do rumble at 50hz (20ms intervals).

@kakra according to this article, the kernel driver should support it properly now.

But yeah, using xpadneo isn't a real solution for the Deck. Some work is needed somewhere else for that.

kakra commented 1 year ago

@kakra according to this article, the kernel driver should support it properly now.

This is only for supporting rumble at all. The problem is in the ff-memless driver. But I was a little wrong, it actually uses 20hz intervals for envelope updates: https://github.com/torvalds/linux/blob/4da34b7d175dc99b8befebd69e96546c960d526c/drivers/input/ff-memless.c#L28

The real problem is something else: It can calculate the start of new envelopes for intervals lower than what the Xbox controller firmware supports, and that's crashing the rumble loop in the controller leading to endless or queued rumble.

What ff-memless needs, is another effect state for calculating a timeout to not send new rumble commands before. I'm working on such a patch in an effort of upstreaming parts of features from xpadneo to the kernel. But that may take some time because some stuff still needs to settle. Currently, such a rumble throttler is in xpadneo, xone, xow. The kernel doesn't really have one as it's only an envelope update interval. And SDL still throttles to 100hz (when I looked last).

The other thing is that Steam Input and SDL simply bypass such driver knowledge by using hidraw directly (for many devices, not for all). So they need to implement their own knowledge of such limitations. Thus, preventing hidraw access for the Steam Deck Client could also work around your problem but then again, the mappings may be messed up because the HID descriptor of the Xbox controllers is just silly, and the kernel drivers don't care, plus ff-memless isn't really throttling rumble commands.

kisak-valve commented 1 year ago

Hello @kakra, can you report your findings to the upstream SDL issue tracker as well if it hasn't been already?