ValveSoftware / SteamVR-for-Linux

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

[BUG] Latency and Artifacts #588

Open Gladox114 opened 1 year ago

Gladox114 commented 1 year ago

Describe the bug There are Artifacts inside the Valve Index which disappear and reappear. Latency is very noticeable without Beta even with Composition off in KDE (I guess composition shouldn't matter when Direct Mode is working). With SteamVR Beta, the latency is a bit less, but still noticable. Additionally, SteamVR says "SteamVR failed to initialized for unknown reasons. (Error: Shared IPC Compositor Init Failed (303))" but this message doesn't pop up when SteamVR beta is disabled, seems like it doesn't make a difference.

To Reproduce Steps to reproduce the behavior:

  1. Use Arch Linux with 6.3.7-Kernel and KDE (X11) and have an AMD 6750xt?

Expected behavior Everything should work smooth and fine.

System Information (please complete the following information):

Screenshots Video of artifacts on Imgur

Additional context None

Note: Commenters who are also experiencing this issue are encouraged to include the "System Information" section in their replies.

Gladox114 commented 1 year ago

Seems like it works way better in KDE Wayland (No Artifacts and no noticable Latency), but I notice that Half Life Alyx has a glitchy back-and-forth vision when Head is moving. I also noticed that I can see the glitchy texture around the Rendered screen when Looking straight. I guess its because of XWayland (Edit: I assume its not because the SteamVR start location has it too and it never changes)

kzdixon commented 1 year ago

Seems like it works way better in KDE Wayland (No Artifacts and no noticable Latency), but I notice that Half Life Alyx has a glitchy back-and-forth vision when Head is moving. I also noticed that I can see the glitchy texture around the Rendered screen when Looking straight. I guess its because of XWayland.

That behavior you're seeing is when Async Reprojection is not active in your game. The overlay will look fine but then the game will suffer if its underperforming. Normally the overlay has issues and the games are fine, it can take a few restarts of SteamVR or even your entire system to get it to realize that it should be using Async Reprojection.

Gladox114 commented 1 year ago

So I now understand why X11 was so problematic... because Async Reprojection (enableLinuxVulkanAsync) has caused all the latency and Artifacts you see in the Video. It doesn't matter if I use Wayland or X11, I too get Artifacts on Wayland when I set enableLinuxVulkanAsync to "true", but the difference was that the default for X11 (KDE and XFCE tested) was enableLinuxVulkanAsync to be enabled by default while on Wayland (KDE tested) it was disabled by default.

After setting enableLinuxVulkanAsync to false, it then also worked on X11 but it has still the same Issues I had on Wayland with Half Life Alyx, it jitters (double vision glitchiness)

I also found this post talking about this problem. but I assume its only about big latency and not latency+artifacts.

kzdixon commented 1 year ago

You'll very much want to make sure enableLinuxVulkanAsync is enabled for games. The overlay will just suffer regardless unless you're running something like a Quest 2 externally via ALVR and letting that handle ASW on-device.

Gladox114 commented 1 year ago

Seems like my Issue is a duplicate of #230 and games like Beat Saber tend to work smooth enough to be playable but it has mild jitters every now and then, especially when head is turned fast.

Gladox114 commented 1 year ago

I think the issue I thought was a duplicate is unrelated to this issue.

I have massive glitches on the Screen when enableLinuxVulkanAsync is enabled and the glitches tend to be looking different depending on which Quality setting for the Steam Overlay is set.

With the Web Console I found some spamming lines:

lighthouse: LHR-A7DF6DD1: Updated IMU calibration: Accel bias change 0.01m/s/s
lighthouse: Updating tilt for 598F4DFA:  Old= 28.82, -0.50, 3.70741e-06 <- 0.69 deg -> new= 29.15, -1.13, 6.34077e-07   result=29.15, -1.13, 6.34077e-07
lighthouse: Saved LighthouseDB rev 200 to /home/yuki/.local/share/Steam/config/lighthouse/lighthousedb.json
Unflushed events requested in CGpuTiming::GetDeltas!
No Vulkan command buffer open in CGpuTiming::MarkEvent!
Unflushed events requested in CGpuTiming::GetDeltas!
No Vulkan command buffer open in CGpuTiming::MarkEvent!
Unflushed events requested in CGpuTiming::GetDeltas!
No Vulkan command buffer open in CGpuTiming::MarkEvent!
...
// Those 2 Lines are spammed over 100 times //
...
Unflushed events requested in CGpuTiming::GetDeltas!
No Vulkan command buffer open in CGpuTiming::MarkEvent!
Unflushed events requested in CGpuTiming::GetDeltas!
No Vulkan command buffer open in CGpuTiming::MarkEvent!
0 - entering standby
Unflushed events requested in CGpuTiming::GetDeltas!
[System] Unknown Transition from 'SteamVRSystemState_Ready' to 'SteamVRSystemState_Standby'.
Fri Jun 16 2023 18:41:58.959538 - Socket closed
Fri Jun 16 2023 18:41:58.959574 - Unable to read message from socket: 2
Fri Jun 16 2023 18:41:58.959503 - Socket closed
Fri Jun 16 2023 18:41:58.959596 - Process 19401: vrstartup disconnected (Thread(0x0x7f0120000c60/0x0x7f)
Fri Jun 16 2023 18:41:58.959609 - 0 - leaving standby
Fri Jun 16 2023 18:41:58.959556 - Unable to read message from socket: 11
Fri Jun 16 2023 18:41:58.959593 - Process vrstartup (19401) disconnected (Thread(0x0x7f2268000ea0/0x0x7f)
Fri Jun 16 2023 18:41:58.959614 - Lost pipe connection from vrstartup (19401)
Fri Jun 16 2023 18:41:58.959795 - AppInfoManager.ProcessQuit processid=19401 eLaunchingApp=LaunchingApp_None
Fri Jun 16 2023 18:41:59.026758 - No Vulkan command buffer open in CGpuTiming::MarkEvent!
Fri Jun 16 2023 18:41:59.028027 - Unflushed events requested in CGpuTiming::GetDeltas!
Fri Jun 16 2023 18:41:59.033806 - No Vulkan command buffer open in CGpuTiming::MarkEvent!
Fri Jun 16 2023 18:41:59.034690 - Unflushed events requested in CGpuTiming::GetDeltas!
Fri Jun 16 2023 18:41:59.041518 - No Vulkan command buffer open in CGpuTiming::MarkEvent!
Fri Jun 16 2023 18:41:59.042468 - Unflushed events requested in CGpuTiming::GetDeltas!
...
// Those 2 new lines will be spammed over 100 times
....

I found out that I can save the html page for better readability (colors) for others to look at. Just open the file in any browser I guess. https://gist.github.com/Gladox114/5b86da738df6a3de1448835369865ca6

codingcatgirl commented 1 year ago

Given all the long-term well established issues, i'd enjoy an official statement from Valve on whether SteamVR on linux is still supported at all.

Vixea commented 1 year ago

It's definitely still supported it's just well as you kinda say slow progress

Gladox114 commented 1 year ago

I would love to experiment with different types of Linux OSes. Can someone provide a working Linux OS with drivers for any AMD 6000 series GPU?

Gladox114 commented 1 year ago

After gathering much information about Valve Index on SteamVR Linux on Linux Discord Server, I realised that actually many games are working perfectly fine but SteamVR Dashboard, loading screens mid-game and the startplace of SteamVR are all having glitchy artifacts. I just never tried to start a game with it...

icedream commented 1 year ago

I got similar artifacts as described happening on my end as well. It seems to indeed be bound to enableLinuxVulkanAsync being enabled.

This only happens in SteamVR's own UI, games do not have this issue for me. Note that the VR view in SteamVR does not expose this issue either, just the headset's screen.

https://github.com/ValveSoftware/SteamVR-for-Linux/assets/807772/3e28f95e-4abb-4b27-b166-b6924ae8359e

icedream commented 1 year ago

Another nugget of information: Increasing the resolution makes it more obvious that the glitches prefer to appear on the left eye much more than the right eye. Not exclusively however.

Happens on the current beta on a 7900XTX.

yaomtc commented 1 year ago

Artifacts have gone away for me with yesterday's 1.27 update.

icedream commented 1 year ago

I can confirm I no longer see the artifacts with the current stable version either.

icedream commented 1 year ago

Hm, the issues sort of came back after a while. Not sure what caused it to regress yet.

Gladox114 commented 1 year ago

Haven't tested 1.27, but on 1.27.5 it still has glitches, but it seems like its less than on 1.26 . I remember having constant glitches on 1.26 while currently, after waiting a bit, the glitches disappear for a few seconds and come back randomly on 1.27.5 .

Additionally my whole Desktop liked to freeze because of some DRM leasing problem with my AMDGPU (couldn't even start SteamVR in the first place), after a full Arch Linux update, the issue only happens when the Headset wants to go to sleep.

When starting SteamVR, it very often happens at the beginning, that the black border part of the screen eye is not black but full of glitches and the Dashboard cannot open. A SteamVR Headset restart helps. The border is then black again, and I can see the Dashboard again.

kisak-valve commented 1 year ago

that the black border part of the screen eye is not black but full of glitches

Hello @Gladox114, that should be the issue that is being tracked at #480.

Gladox114 commented 1 year ago

I get the feeling that the issue is handling the over all issue of the glitched border. But I assume that the behavior I noticed (that mostly only comes after booting the PC) is that SteamVR is not fully started yet and is unable to start the Dashboard and clear the swapchain. Feels entirely different, because after Headset restart the issue is gone, unlike the #480 issue.

icedream commented 1 year ago

I found out that if I remote into my Linux PC running Sunshine via Moonlight I am able to record the VR headset output as rendered.

This is with the current SteamVR stable running for a while and Linux 6.5.2-arch1-1 (Arch Linux's linux package) as of the time of writing this:

https://github.com/ValveSoftware/SteamVR-for-Linux/assets/807772/f52ef9bb-ca23-4f58-ae69-23ecf5965aa4

Danielduel commented 1 year ago

Hi @Gladox114,

We have pretty similar setups and your problems doesn't exist for me - I play mostly Beat Saber (1500+ hours on steam, I think I would feel delays if they were there), I don't have perfect framerate on extremely modded maps, but generally it is very stable and without delays.

I have disabled hmd sleep - I have whole vr setup on power switch. So can't speak about glitches from that. Can test it tho.

On hmd start I don't have major glitches, only 3d controllers while in dashboard have glitched models/uvmaps/textures - it is superweird.

Feel free to ask questions, also - you can enable 120Hz after Mesa/Kernel shipped a fix few months ago. I don't have to modify stock option of "enableVulkanAsync" or anything like that while on Wayland.

I use the workaround from https://github.com/ValveSoftware/SteamVR-for-Linux/issues/588#issuecomment-1719483665 because the right eye border issue affects me.

@icedream - recent kernels had problem with drm amdgpu stream being nulled, could you retest with 6.5.3 (6.5.3 is the first confirmed to work, I am not sure about 6.5.2)? It is already shipped for arch.

icedream commented 1 year ago

@Danielduel Unfortunately, I still have the artifacts in 6.5.3.

6.5.4 is available meanwhile, I'm looking into whether that fixes it.