libretro / swanstation

GNU General Public License v3.0
126 stars 22 forks source link

[Steam Deck] Major performance hit when using DualShock due to rumble #55

Open ds22x opened 1 year ago

ds22x commented 1 year ago

Description

Crosspost from https://github.com/libretro/beetle-psx-libretro/issues/872

When using the Analog Controller (DualShock) controller profile on the Steam Deck, performance takes a major hit (E.G. Crash Bandicoot Warped, using default settings, and Vulkan renderer at 3x, witnessing a drop from around 300fps to around 130fps when fastforwarding without the use of the Powertools plugin) due to apparently the rumble polling, as commenting out https://github.com/libretro/swanstation/blob/9c2ed9e91774f1d96b5105e4c68e06143ec741a8/src/libretro/libretro_host_interface.cpp#L1305-L1306 gives me the same fps when not using the DualShock profile. Trying out the same situation on my Windows 11 PC, using the XInput controller driver vs the SDL2 controller driver used on the Steam Deck, shows no such performance hit.

Expected behavior

Be able to use the DualShock controller profile without having to incur a (major) performance penalty.

Actual behavior

As per the description, a major drop in fps occurs

Version/Commit

Environment information

LibretroAdmin commented 1 year ago

What input / joypad driver is RetroArch using on your Steam Deck system?

ds22x commented 1 year ago

SDL2. Tried using the other ones, but SDL2 is the only one that actually works with the build in controls.

LibretroAdmin commented 1 year ago

OK, if you change it to some other input/joypad driver combo, you don't get the same performance dropoff?

ds22x commented 1 year ago

That's correct, yes

ds22x commented 1 year ago

Crosspost from https://github.com/libretro/beetle-psx-libretro/issues/872#issuecomment-1399096335

So the problem seems to be caused by specifically by Steam Input, as, when active, will allow for the Steam Deck's build-in rumble to work with the SDL2 driver, at the expense of the previously mentioned performance drop. When in desktop mode (and on a separate Linux PC I used for testing for that matter) with Steam closed, rumble will not work with either the build-in controls or any external controllers I tried (DS4, DS5, and Xbox One), with the only way to get any rumble working being by using Udev with a DS4 controller, which didn't produce any drop in performance between a rumble and non-rumble capable controller profile.

DarthMew commented 1 year ago

Wouldn't be the first time Steam messes something up. I assume you also tried disabling rumble from the Steam Deck's settings?

It does sound like more of a problem with the SDL2 driver, as SwanStation (and Beetle PSX from the looks of it) don't do anything special to achieve rumble that the other cores you mentioned do. PCSX ReARMed especially as it has the same two rumble motor setup as SwanStation and Beetle PSX, although it does have an option to disable rumble (allowing rumble by default), which would explain it in that case if you have ever changed the option.

Regardless of that though, the only thing I could do on my end is to add the same option from ReARMed to SwanStation so people can at least use the DualShock without having to deal with an increased performance requirement.