ValveSoftware / SteamVR-for-Linux

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

Reprojection causing stutter #277

Open mSparks43 opened 4 years ago

mSparks43 commented 4 years ago

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.

kedodrill commented 4 years ago

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.

atavener commented 4 years ago

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.

Vash63 commented 4 years ago

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.

kedodrill commented 4 years ago

@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.

Vash63 commented 4 years ago

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

atavener commented 4 years ago

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?

kedodrill commented 4 years ago

@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.

atavener commented 4 years ago

@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!

edwin-v commented 4 years ago

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.

Vash63 commented 4 years ago

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.

mSparks43 commented 4 years ago

->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.

edwin-v commented 4 years ago

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.

Zamundaaa commented 4 years ago

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.

mSparks43 commented 4 years ago

->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.

Zamundaaa commented 4 years ago

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)

ZarathustraDK commented 4 years ago

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 commented 4 years ago

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.

povibi commented 4 years ago

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

Zamundaaa commented 4 years ago

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).

kedodrill commented 4 years ago

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.

rnd-ash commented 4 years ago

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!

Zamundaaa commented 4 years ago

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.

yshui commented 4 years ago

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?

rnd-ash commented 4 years ago

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.

Zamundaaa commented 4 years ago

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.

yshui commented 4 years ago

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.

rnd-ash commented 4 years ago

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.

yshui commented 4 years ago

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)

rnd-ash commented 4 years ago

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.

kedodrill commented 4 years ago

@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.

shazow commented 4 years ago

Would be great if there was some kind of official baseline report done by Valve developers on Linux so they can confirm whether we should expect ~similar performance as Windows, or whether we're all gaslighting ourselves into pretending that non-stop jitter is just how it is.

Even with the latest SteamVR Beta (1.13.6), it's still an issue. Tried with both HTC Vive and Valve Index, on an Nvidia GTX 1080 which is buttery smooth on Windows. No compositor on my window manager. Present in both SteamVR Home and Half Life Alyx.

melvyn2 commented 3 years ago

Running Manjaro with Steam-native on the stable steamvr branch, I am also getting this issue. Turning on legacy reprojection fixes the artifacting (black triangles and tearing), but I still get stutter when moving my head. Disabling my compositor doesn't fix this. Btw, you can toggle legacy reprojection in the per-app video settings, but no longer globally.

mSparks43 commented 3 years ago

While the beta as of last month is much better, this seems connected to #214

mathew2214 commented 3 years ago

i have this same issue. has anybody found a way to just disable reprojection all together? its ruining my VR experience. my threadripper 1950x and amd rx 5700 should be able to run HL:A, but this reprojection nonsense makes it unplayable. Valve, please fix.

ZarathustraDK commented 3 years ago

i have this same issue. has anybody found a way to just disable reprojection all together? its ruining my VR experience. my threadripper 1950x and amd rx 5700 should be able to run HL:A, but this reprojection nonsense makes it unplayable. Valve, please fix.

I don't think you can disable reprojection completely (neither would you want to), you can choose between legacy and asynchronous reprojection under Settings --> Video --> Per-app display options (or something to that accord). There you can basically turn legacy reprojection on/off, if it's off you're using asynchronous reprojection instead (if your GPU supports it ofc). Async sucks right now because it reprojects past frames/frames that are too late, which is a damn shame because you can get a sense of what a big step up it is from legacy reprojection (which halves your fps and causes stutter when reprojection kicks in.). Still, as it is right now, legacy reprojection is the closest to playable you can get right now.

CPU: Ryzen 5900X Motherboard: Asus Prime x570 Pro RAM: 3733MHz XMP RAMP GPU: Asus 6800 XT TUF OC Storage: Corsair MP600 1TB Distro: Pop OS Proton 6.3-1 SteamVR 1.16

tunbridgep commented 3 years ago

I am also getting the stutters. Changing to legacy reprojection mostly fixed it, but I am still getting extremely bad performance overall on my RTX 3070. On Windows I can run Alyx on max at 90Hz on my vive with no issues whatsoever. On Linux it chugs on Low settings occasionally.

Valve has talked a lot about making Linux a first-class-citizen for gaming, but the reality is that their Linux development seem to be way, way behind where they are at with Windows and I would class VR on Linux as "technically usable" but not much better than that. Not holding out hope that we will get fixes anytime soon, either, as we are <1% of the Steam user base.

Valve, if you're going to leave SteamVR for Linux in a sorry state, can you at least open source it so people who actually care can fix it for you?

Matombo commented 3 years ago

Last thing I heared was Valve Monado for the future, and making it possible to use it as a backend for both SteamVR and OpenXR application. This will hopefully bring Linux support on par with Windows. However support seems not to be there yet: https://monado.freedesktop.org/#supported-hardware

Quick explanation of OpenXR (not to be confused with OpenVR): Steam currently embraces the SteamVR API to programm games to run on the OpenVR Backend+Driver for The HTC Vive Headsets and Valve Index. Contrary to the name: OpenVR is not open source. OpenXR (API) does not try to replace OpenVR (Backend) but SteamVR (API). The open source backend+driver developed in tandem with OpenXR is Monado which tries to support all headsets exept the Oculus stuff (I guess fb wants to keep it's walled garden). But valve anounced some time back that when Monado is working they will start embracing OpenXR for new games instead of SteamVR and also update SteamVR so that older games not rewritten with OpenXR also use Monado as the backend.

PS.: OpenVR and Monado both actually split up in 2 parts internally: the Backend and the driver. Monado brings it's own Index driver, but can also use libsurvive as an alternative.

SpookySkeletons commented 1 year ago

You can now play VRChat on Monado directly.

https://www.youtube.com/watch?v=7n8EPR6ghW4

Devs required for both the OpenComposite project and the Monado project. https://gitlab.com/znixian/OpenOVR https://gitlab.freedesktop.org/monado/monado/-/tree/main