SteamVR-for-Linux icon indicating copy to clipboard operation
SteamVR-for-Linux copied to clipboard

Reprojection causing stutter

Open mSparks43 opened this issue 5 years ago • 37 comments

In linux it seems like reprojection is causing jerks/stutter when turning your head. black edges of this video seem to capture/demonstrate it. not obvious looking at the screen/display

https://youtu.be/kBHrKW9LZl8

also reported by linux steamvr vive user for xp11 (that video is made with openhmd openvr driver), he doesnt have the same problems on windows, but since i do not have a windows machine capable of vr this isnt an option for me.

it would be nice if reprojection could be completely disabled in order to confirm/reject it as the culprit.

using "legacy reprojection" does improve the situation slightly, since enabling legacy reprojection gives a 50% frame boost.

https://youtu.be/5AohchEvJEU

But still have to close my eyes when turning more than a degree or two a second.

mSparks43 avatar Dec 06 '19 02:12 mSparks43

I'm not sure of a direct answer to this, but do you have any compositors running when trying to use VR? I usually run compton, but I always kill the process before going into VR. I have noticed better performance and tracking with it off. I also kill my blue light filter app, redshift and have noticed better results with that off as well.

kedodrill avatar Dec 10 '19 16:12 kedodrill

I've only had my Index (and using SteamVR on Linux) for three weeks, but this has been my experience the entire time. I've been wondering whether Linux users have been silently accepting this as the state of SteamVR-for-Linux, or if this is fixable on my side.

To be clear, it's like reprojection is happening for every frame, even when frametimes are down to 4ms (HMD refresh is only set to 90Hz). And maybe that's exactly what's happening, and not a terrible idea since reprojection reduces the apparent latency. Then my problem is that the reprojection is not oriented well -- since the overall result of a smooth head-turn is slightly juddery experience with some visible (flickering) black borders. As if the final pos+orient measure for reprojection was noisy...

Maybe my problem is instead with tracking? I've used the index in two different environments with the same behavior. Controllers seem pretty stable... and really the view isn't too bad except during any head-rotation.

atavener avatar Dec 21 '19 19:12 atavener

I've only had my Index (and using SteamVR on Linux) for three weeks, but this has been my experience the entire time. I've been wondering whether Linux users have been silently accepting this as the state of SteamVR-for-Linux, or if this is fixable on my side.

To be clear, it's like reprojection is happening for every frame, even when frametimes are down to 4ms (HMD refresh is only set to 90Hz). And maybe that's exactly what's happening, and not a terrible idea since reprojection reduces the apparent latency. Then my problem is that the reprojection is not oriented well -- since the overall result of a smooth head-turn is slightly juddery experience with some visible (flickering) black borders. As if the final pos+orient measure for reprojection was noisy...

Maybe my problem is instead with tracking? I've used the index in two different environments with the same behavior. Controllers seem pretty stable... and really the view isn't too bad except during any head-rotation.

I still think it's with the reprojection, it's just more noticeable with head movement as you have the entire view changing instead of just your hands.

And I'm not sure if it's Linux users silently accepting it or like me and keeping a Windows install around just for VR because I literally get motion sick if I try to play VR in Linux.

Vash63 avatar Dec 21 '19 22:12 Vash63

@atavener @Vash63

What hardware are you both running? I have an RX 480 and a Ryzen 1600. I recently bought an RX 5700 but it's on its way.

I'm wondering because I have experienced VR on Windows before and have not really noticed any difference.

EDIT: There is a huge difference on Windows. The performance is much, much better.

kedodrill avatar Dec 24 '19 19:12 kedodrill

I'm on a Ryzen 3900X and an RTX 2080. The difference is night and day between Windows and Linux for me.

Vash63 avatar Dec 26 '19 15:12 Vash63

What hardware are you both running? I have an RX 480 and a Ryzen 1600. I recently bought an RX 5700 but it's on its way.

RTX 2070 and i5-9600K. I figured with the problematic AMD/ATI past under Linux I'd stick with NVidia and their proprietary drivers. Maybe/hopefully less of an issue with Vulkan, but I'm surprised how bleeding-edge drivers are still always a necessity to even function.

I can't report any Windows experience. But what I am experiencing seems inadequate to what the involved hardware should be easily capable of. Really, it seems like something isn't working correctly. A sweep of my head left-to-right over a 2-second interval should appear smooth and realistic in something like SteamVR Home. Well, it should be smooth in almost all cases, but even this simple case is slightly rough.

If I can manually disable all reprojection maybe I can see if that improves things?

atavener avatar Dec 29 '19 06:12 atavener

@atavener I've actually found that AMD works great on Linux. Drivers are simply in the kernel and work really well. I've had zero issues with my 1600 & RX 480 setup.

SteamVR Home always does that for some reason, and I usually just launch the game from my library to avoid it. When playing games I don't notice any stutter, except for in a couple games that are more taxing on my hardware so they run at low framerates (so I am very thankful for reprojection at that point). I'm getting in an RX 5700 soon and will update how things have changed with that here...but I really havent had issues with the smoothness of my games. I'm not directly comparing it to Windows, but I have played VR on Windows and it was very much the same. Even SteamVR Home on Windows was just stuttery and weird.

EDIT: This is no longer my experience after installing a Windows partition and playing there. VR on Windows is much smoother - the performance is very good.

kedodrill avatar Dec 29 '19 13:12 kedodrill

@kedodrill Hah, well damn, if that's a SteamVR Home thing it would certainly explain things. Now that you mention it, I really haven't noticed it as much in actual games. Vanishing Realms had some kind of stutter which wasn't quite the same. I think Space Pirate Trainer was fine, as well as SPAZ (Win VR version running through Proton). I couldn't play much of Skyrim because of the overlay not working, so I couldn't enter a name... but I think it was okay too.

I haven't gotten much into any games because it seemed the continual updates of SteamVR before Christmas broke one thing or another each day (I guess to get a new non-beta Release, focused on Windows). And since then I've been distracted by Holiday visitors. In a few more days I'll dive into some games with an eye to view-stability.

Thanks for sharing your experience! It sounds like I shouldn't have become hung up on Home as a basic test environment!

atavener avatar Dec 30 '19 04:12 atavener

I still think it's with the reprojection, it's just more noticeable with head movement as you have the entire view changing instead of just your hands.

I agree. Back when you were able to turn it off everything was smooth for me. I honestly have no idea why off is not a standard option.

edwin-v avatar Jan 04 '20 15:01 edwin-v

Off shouldn't be an option as proper reprojection is pretty essential for comfort in VR. They need to fix the reprojection not add an option to disable it. They also need to implement asynchronous reprojection on Nvidia and motion smoothing, both of which greatly help on Windows and are default.

Vash63 avatar Jan 04 '20 15:01 Vash63

->not add an option to disable it. Adding an option to disable it would allow confirmation that it is reprojection that is the source of the stutters, therefore allow us to say with certainty that it is broken and needs fixing. Right now I'm working "ok" with a custom openHMD/SteamVR build https://github.com/mSparks43/PSVR-SteamVR-openHMD without starting steamVR first. Start SteamVR first and its unusable. Something needs fixing, not 100% sure what.

mSparks43 avatar Jan 04 '20 16:01 mSparks43

Agreed that the whole reprojection thing needs to be fixed. Did some Talos just now. Total mess with it on. With it on "legacy" I get a consistent < 10 ms frametime. Which means that reprojection still messes stuff up when it is not needed at all.

Unfortunately the 440.44 driver messed something up badly (probably the g-sync fix) and now even turning your head is a bad thing.

edwin-v avatar Jan 04 '20 20:01 edwin-v

Wait, so when you check "use legacy reprojection mode" then reprojection is not actually off for you? AMD user here, it disables not Async Reprojection (as wanted) but then the system doesn't reproject at all anymore unless you use the debug command. It's either "always on reprojection" or "no reprojection". When an app doesn't deliver the frame rate then it simply drops every 5th or 10th frame or so. That often sadly still performs better than Async Reprojection because it doesn't throttle random frames in games running just fine but I'm wondering if that itself is a bug, too.

Zamundaaa avatar Jan 07 '20 00:01 Zamundaaa

->so when you check "use legacy reprojection mode" This option has been removed (settings page doesnt even open in 1.9.16 anyway), and even when it existed it wasn't clear whether or not it was still reprojecting.

mSparks43 avatar Jan 07 '20 11:01 mSparks43

Yeah you have to use the linux_temp beta to go back. They should really put that option in the new UI, too, if it's not already there (don't remember and can't really test). It's very clear wether or not it's reprojecting though because you can see that in the frame time graph (green means the frame is not reprojected, orange means it is, pink means frame is dropped, idk about red)

Zamundaaa avatar Jan 07 '20 18:01 Zamundaaa

Just wanted to chime in. Also experiencing the stutter (Ryzen 3900x and Nvidia 2080ti). It definitely seems to be a SteamVR-problem because to a lesser/greater extent it bleeds into whatever game you run. An especially gnarly example is VRChat on Proton 3.16-9: Standing still everything looks great and fluid, move your head from side to side and people/architecture basically dissolve into a cloud of disjointed out-of-sync scanlines.

I feel that getting this one issue fixed for SteamVR would solve a lot of problems in a lot of games in regards to stutter/performance.

EDIT: Could this be related to the Gsync/Freesync-issue? https://github.com/ValveSoftware/SteamVR-for-Linux/issues/196#issuecomment-513195028 . I happen to have a Freesync-monitor, what about the rest of you experiencing the stutter?

MORE EDIT: I turned down the refresh rate from 120Hz to 90Hz on my Index. This seems to get rid of the off-kilter stutter (feels like "normal" lag now), and it made my menu-buttons usable again making it possible to summon the Steam-overlay. Theory: Valve have only done the bare necessities to make SteamVR on Linux work probably probably concentrated on 90Hz since both the Vive and Index can run this refresh rate. Stuttering-incidents occurs because Index owners are offered to up the Hz to 120 on the first run which isn't fully fleshed out on Linux yet.

ZarathustraDK avatar Jan 07 '20 22:01 ZarathustraDK

Anybody tried the new Nvidia-driver 440.48.02? ( https://developer.nvidia.com/vulkan-driver ) Seems to be a lot of juicy bits in there relating to Vulkan-extensions, which SteamVR and DXVK (and through that, Proton) could use. I'd do it myself, but it's a binary blob and I'm kinda rusty at CLI, can't figure out how to unload gnome on PopOS so I can install it (it fails if an xserver is running).

EDIT: Scratch that, figured it out, still stuttering.

ZarathustraDK avatar Jan 19 '20 13:01 ZarathustraDK

Using steam-native + steamvr beta on archlinux instead of the steam runtime and steamvr stable takes away all the reprojection stutter for me. The only downside is that steamvr complains about vrclient.so and disables the ability to launch games from inside the headset. I don't know if it works better because the system libs performs better or because it fails to load reprojection.

EDIT: Only helped on beat saber, other games still stutter

povibi avatar Feb 15 '20 19:02 povibi

Hmm, using steam-native doesn't help for me (AMD user though). Could you try a GPU profiler to see what's happening with its (not) stuttering? On my 5700 XT I get this with gpuvis: Screenshot_20200220_223951 If you zoom in on it then you'll see that the vrcompositor doesn't seem to run at the speed of the display (the blue vertical lines are the VBlank timings) and thus sometimes renders twice in a frame and sometimes not at all. I wonder if this is because of a driver problem (would then only be this way for me, or perhaps all AMD users) or a problem in SteamVR (would also happen with NVidia).

Zamundaaa avatar Feb 20 '20 21:02 Zamundaaa

Just a quick note to everyone with performance issues - the stability of my framerate and my framerate as a whole increased dramatically when using a mutter based DE. I was using XFCE with the compton compositor, but I've since switched to Budgie using mutter. Everything I have played has run better with more stable framerates - sometimes with an increase of 10 - 20 fps. I strongly recommend switching over to a mutter based DE, or at least logging into one when you want to play VR.

kedodrill avatar Mar 16 '20 15:03 kedodrill

I can say the same with KDE. It appears simply turning off the compositor (which mutter does automatically if your in a fullscreen window) helps a LOT!

rnd-ash avatar Mar 16 '20 20:03 rnd-ash

It does indeed help. Most of the most horrible stutter is gone; while reprojecting it still looks like the frames would jump a little back and forth, but not as bad as before. For those on Plasma: click on the SteamVR window, press Alt+F3 -> more actions -> configure special application settings -> Appeareance & Fixes -> on the bottom you can set it to always block compositing automatically. IMO it would be great if SteamVR would do this automatically, as not all VR games are in fullscreen.

Zamundaaa avatar Mar 17 '20 13:03 Zamundaaa

It's perplexing why turning off the X compositor helps, as all of the VR stuff basically completely bypass the X server. Unless you are not using direct mode?

yshui avatar Mar 17 '20 20:03 yshui

Its possible (maybe), that the VR app's windows' are waiting for the compositor, possibly causing the entire application to stutter. So direct mode, yes, is faster, but if the main window is still waiting for the compositor, it could be waiting on that.

rnd-ash avatar Mar 17 '20 20:03 rnd-ash

Well the compositing obviously uses some resources (pretty much negligible though). AFAIK (not exactly sure about that though) it also VSyncs the apps to the monitor they're on, at for example 60Hz.

Zamundaaa avatar Mar 17 '20 20:03 Zamundaaa

Its possible (maybe), that the VR app's windows' are waiting for the compositor

I think this is unlikely. The HMD has a different refresh rate than most of the monitors (90/144 vs 60 fps), if the app's window are really waiting for the compositor, then the frame rate will be 60 fps.

yshui avatar Mar 18 '20 08:03 yshui

who knows. however I found disabling night light in gnome or KDE has a MASSIVE improvement in performance. definatly something is going on with xorg causing stutter, even if the VR headset uses direct mode.

seriously, if you enable night light and try VR, good luck. every frame lags slightly so it's super sickening, even if the VR monitor says latency is still good, which is strange.

rnd-ash avatar Mar 18 '20 08:03 rnd-ash

it also VSyncs the apps to the monitor they're on

Whether an app vsyncs does not really depend on the compositor. An app could choose to sync its frame rate without a compositor, it could also choose to not vsync even when a compositor is running (e.g. you can still run glxgears at 1000 fps when a compositor is running: vblank_mode=0 glxgears)

yshui avatar Mar 18 '20 08:03 yshui

direct mode definatly is enabled.

as I said before, perhaps the way dxvk is handling frames on the desktop monitor side, perhaps that's what is introducing stutters. in steamvr home, which has no active window on the desktop, there is little to no stutter, but as soon as entering a game with a desktop window, stutter ensues until compositing is disabled, or in my case, until I turned off night light.

rnd-ash avatar Mar 18 '20 08:03 rnd-ash

@kisak-valve Has there been any official testing done on this issue or other major performance issues? I have an installation of Windows and the performance difference is extreme. Trying to play on Linux makes me sick because of the reprojection / stuttering.

kedodrill avatar May 15 '20 21:05 kedodrill