ValveSoftware / SteamVR-for-Linux

Issue tracker for the Linux port of SteamVR
921 stars 45 forks source link

[PERF] SteamVR gui causes a lot of stuttering #327

Open ghost opened 4 years ago

ghost commented 4 years ago

Describe the bug When launching SteamVR gui and then launching a game, you get a lot of stuttering in-game, making it unplayable. No matter what graphics settings are used in-game and video settings used in steamvr settings (even if you set resolution to the the lowest value possible). The stuttering happens around every 100ms, making VR unplayable. However if you launch a game directly with the proton binary and let proton launch steamvr, then almost all of the stuttering is gone.

For comparison, I can run half-life alyx and any other vr game on windows with no stuttering. The same issue happens when running linux-native vr titles.

To Reproduce Steps to reproduce the behavior:

  1. Run half-life alyx, or any other vr game via steam and look at stuttering.
  2. Close steamvr and instead run: STEAM_COMPAT_DATA_PATH=<path to game proton environment with pfx file> "<proton path>/proton" run <path to half-live alyx>/game/bin/win64/hlvr.exe and see almost all of the stuttering gone

Expected behavior Launching a game from steam (which launches SteamVR GUI) should have the same performance as launching proton manually without SteamVR GUI

System Information (please complete the following information):

Performance Data (optional, but very helpful):

Screenshots Here is vrmonitor frame timing when steamvr gui is open: Screenshot_2020-04-06_00-03-18 I dont know if there is a way to display vrmonitor frame timings without steamvr gui, so I cant post that info here.

When recording the game window then I notice that there is no stuttering, so the stuttering is only inside the vr headset. Im using valve index.

Zamundaaa commented 4 years ago

System Information (please complete the following information):

Performance Data (optional, but very helpful):

I just started Boneworks without starting SteamVR first and didn't get any stutter anymore after startup like usual, it's quite the difference. There still is some stutter but it's far less noticable. When I walk into the same direction I'm looking at I don't notice any at all.

The UI not starting is a bug (#209), and it seemingly now also affects the VR overlays, so I couldn't check actual performance metrics with the frame timing graph either. gpuvis also hasn't worked in quite some time (when you press on gpu_profiler_capture there should be a window that pops up) in SteamVR but you can simply install it on your own (don't know if it works for NVidia though). I made a trace but it doesn't look any different to with the UI running to me.

rstrube commented 4 years ago

Question, does starting the game manually still display the Steam VR overlay (with the HMD, controller, and basestation icons)?. Perhaps it's the overlay that's causing the problem in conjunction with the compositor?

ghost commented 4 years ago

The steam vr overlay is not displayed on my desktop when launching a game manually (that is, running proton directly from terminal). I can still see the steam vr settings (overlay?) in the hmd though when pressing the settings button on the valve index controller and that doesn't cause any stuttering.

Zamundaaa commented 4 years ago

It's not even necessary to start the game from the command line - just start it directly from Steam without starting SteamVR manually first. It will automatically start SteamVR but the window on the desktop does not appear and the overlays (except for the dashboard, at least sometimes) in VR also don't work.

Perhaps it's the overlay that's causing the problem in conjunction with the compositor?

certainly possible, although I disable compositing in KWin when in VR so I'm not entirely sure about that.

ghost commented 4 years ago

The steamvr overlay on desktop does show up for me when launching a vr game from steam, if steamvr is not already running. So i have to manually start the game to reduce stuttering

Zamundaaa commented 4 years ago

Interesting. Do you by any chance have Qt installed on your system (and if so, what version)?

ghost commented 4 years ago

Yes, Qt 5.14.2-1

I tested to stop the steamvr status gui with kill -STOP <pid> and the stuttering remains, so at least its not caused by that process (as far as I can see?)

rstrube commented 4 years ago

I know with Mutter, the unredirection (the compositor not getting involved in my understanding) only occurs with full screen applications by default Perhaps having the overlay literally placed over the mirror view is causing problems.

I think there is the option to disable the "Always on top" option for the Steam VR overlay. I'll do some testing tonight, but it might be interesting to see if the stuttering goes way if you disable that option and send that window to the background?

ghost commented 4 years ago

This stuttering happens even when not running any compositor and when the the windows is not above the mirror view

Zamundaaa commented 4 years ago

Yes, Qt 5.14.2-1

Hmm, then that's not it. Must be something else about my installation then. Thanks anyways. I also tried to stop the vrmonitor process and it did seem a little better, not as much as when it doesn't get started at all though. Interestingly after halting the vrmonitor process the frame time graph in the HMD didn't work anymore, so it's the vrmonitor providing it. No wonder it doesn't appear when the vrmonitor window doesn't work. @rstrube I explicitly disabled compositing in KWin and it whilst that helps a lot, not having the SteamVR status window open at all seems to be even better for performance.

hrkrx commented 4 years ago

I have a similar experience on Ubuntu 20.04 with stuttering, it makes beat saber expert+ levels unplayable.

i use Steam VR quite a while on linux and this stuttering is only recently becoming a problem.

Zamundaaa commented 4 years ago

I just tried it with HL:A (gotta first start another game that then starts SteamVR without UI, close that other game and start HL:A) and the difference is there as well - without the UI I can run it in 120Hz just fine, with the UI there is a lot more stutter.

Zamundaaa commented 4 years ago

So I just tried Eleven: Table Tennis (incredibly easy to run game) and even with that there's quite a lot of lost frames with the UI, using legacy reprojection / disabling async reprojection makes it better but there still are some dropped frames. This makes the game unplayable. Without the UI it runs flawlessly, at least as far as I can tell (with async reprojection on)

Zamundaaa commented 4 years ago

It looks like the vrserver in combination witht he vrwebhelpers are to blame for most of the lag. Just kill all the vrwebhelpers (make sure to close the dashboard first), the effect is instantly visible. There's still a singular reprojected frame from time to time but generally the performance is almost perfect.

Whitecatkeke commented 4 years ago

It looks like the vrserver in combination witht he vrwebhelpers are to blame for most of the lag. Just kill all the vrwebhelpers (make sure to close the dashboard first), the effect is instantly visible. There's still a singular reprojected frame from time to time but generally the performance is almost perfect.

Thanks very much. I am using an NVIDIA GPU. I found that changing the powermizer from adaptive to max performance also has a very significant effect.

duckbytes commented 2 years ago

Were there ever any updates about this? I still get this issue badly when in some vrchat worlds and killing vrwebhelper doesn't make a difference. In particular when turning my head I get really bad double vision.

DaeTheDerg commented 1 year ago

Bumping this, as it is still an ongoing issue! As previously mentioned currently the easiest way to play games without nauseating double-vision causing stutter is to launch a non-steam vr game to start the vr environment without the overlay, then close the non-steam game & launch the game on Steam you want to play.. This is very annoying, and it would be great if it could be fixed, thanks.