alvr-org / ALVR

Stream VR games from your PC to your headset via Wi-Fi
MIT License
5.23k stars 470 forks source link

Good render latency, horrible controller latency on Linux (ubuntu 23.10) and Quest 2 #2082

Open Mrinohk opened 4 months ago

Mrinohk commented 4 months ago

Discussed in https://github.com/alvr-org/ALVR/discussions/2081

Originally posted by **Mrinohk** April 21, 2024 Basically title. At first I thought it was the quest hand tracking taking over but I disabled it and the issue remains. Head tracking and encode/decode are plenty fast. I can move around in VR just fine. The controllers are way behind and seem to have a weird amount of smoothing applied making Beatsaber and Ragnarock basically unplayable. Any ideas are welcome. I've fiddled around the settings for both steamvr and alvr a ton and haven't found much affect from those settings. Ryzen 7 5700x, RX6600XT, wired PC connection and 5GHz connection to the headset with the router being in the same room as both the PC and the headset.
thackel commented 4 months ago

I can confirm this wired input lag as well. Since 20.7 I have this lag which makes playing any game useless. The lag is of course also present in SteamVR. It does not matter if I am using cabled or Wifi (5GHz) connection.

I played around with lot of networking options, nothing helped to get rid of the new lag.

I am also on (K)ubuntu 23.10 but using a Pico4.

How could I help to track down the problem?

BlushBerry commented 4 months ago

I too am experiencing this issue.

I am using Garuda Linux.

What thackel said. What's needed here to get to the bottom of this issue?

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Germanreddragon94 commented 2 months ago

I am having the same issue on Linux Nobara. ALVR works fine with VRChat and everything is working great expect the controller tracking. It looks like it would stutter.

MeatH00k commented 2 months ago

Same issue here, render latency is good, but controller latency means it is unplayable. When moving the controllers even slightly they become very stuttery/laggy to the extent they become blurred. Tried in Windows via ALVR with the same settings and I don't have this problem.

Arch - KDE Wireless 5ghz Ryzen 5 3600 Nvidia 3060Ti - proprietary drivers - 555

The-personified-devil commented 2 months ago

You mentioned you had an issue with only a black screen being displayed (https://github.com/alvr-org/ALVR/issues/2201#issuecomment-2218971846), does this mean you resolved that issue or are you judging this with a black screen?

MeatH00k commented 2 months ago

You mentioned you had an issue with only a black screen being displayed (#2201 (comment)), does this mean you resolved that issue or are you judging this with a black screen?

As mentioned in the original post of #2201 you can work around this black screen to get it working by adding "~/.local/share/Steam/steamapps/common/SteamVR/bin/vrmonitor.sh %command%" to the launch parameters.

Oh, and also, I already tried to do this thing as described in "Linux Troubleshooting" in Wiki, before restarting PC, it worked.

The-personified-devil commented 2 months ago

The fact that the workaround is always needed is a known issue, I thought you were also reporting that it wasnt working with the workaround

MeatH00k commented 2 months ago

The fact that the workaround is always needed is a known issue, I thought you were also reporting that it wasnt working with the workaround

Apologies if I'd misread #2201 , but that is what was reported. The work around works, but why is it needed?

... it worked.

The-personified-devil commented 2 months ago

Apologies if I'd misread https://github.com/alvr-org/ALVR/issues/2201 , but that is what was reported. The work around works, but why is it needed?

It seems I misread the original issue, sorry for that.

Edit:

Oh, and also, I already tried to do this thing as described in "Linux Troubleshooting" in Wiki, before restarting PC, it worked.

It seems I originally understood this as the workaround having worked before they restarted their pc, but being broken at the time of reporting.

The issue is basically that steamvr added some sandboxing that breaks our stuff and we can't actually comply with it but they also have that script that disables their sandboxing for some reasons. There is a fix to allow us to run in sandboxing, but it's held up by a steamvr bug. If you want more details I'd advise you just go search around, it's been discussed multiple times prior

Germanreddragon94 commented 2 months ago

I found out that my Steam is unable to use the OpenXR from SteamVR as default, can this be the problem? Are there others who cant add the OpenXR as default and get the error "Could not read file vrmonitor..." in the settings?

Because of that I cant play BeatSaber because this game needs OpenXR, I guess with OpenXR installed it would work normally without controller stuttering.

Germanreddragon94 commented 1 month ago

I made some testing and I found out that my rendering is very bad and causes the problems. It feels that the headset tracking is normal but You can activate in Steam the latency counter and I was between 15-20 ms and that is a lot. But if I lower the settings in ALVR to very low I have 7 ms and bam no controller lagging. You should check this first.

I guess using VR in Linux is not ready yet or it is my Linux Nobara. I have a RTX 4080 so it is not my hardware. On Windows I am in the very high section of ALVR and everything works fine. I guess we have to wait and hope.

Germanreddragon94 commented 1 month ago

I was able to solve the issue for me. I did so much testing about Latency and Co that I didnt realize that my FPS was very bad for some reason. I somehow fixed it by turning on the "Use Legacy Reprojection Mode" in SteamVR. My FPS are now much higher and even playing Into the Radius with a resolution of 5440x2976 is no longer a problem.

Maybe this solves this issue for others too.

Vixea commented 1 month ago

That will work for now though that's only a hacky method the proper fix is driver direct which technically works, but because of a bug you can't launch games

Germanreddragon94 commented 1 month ago

That will work for now though that's only a hacky method the proper fix is driver direct which technically works, but because of a bug you can't launch games

To be honest I never heard of driver direct, but every better solution would make me happy because the legacy projection mode is off by default and needs to be activated on every single game. Is there a website or video which explains this issue? I would like to learn more about this issue and how to fix it properly in the future.

Mrinohk commented 1 month ago

Switching from hardware encoding to software encoding seems to have solved the issue for me. I'm under the impression that the latency was bad also for render latency but the headset was compensating for it real well.

I noticed when I looked at my monitor that the controller moved perfectly in real-time, but the headset was just slow. Again, software encode has solved the issue.

Germanreddragon94 commented 1 month ago

Interesting I tested the software encoding and it was really bad for me. Maybe my CPU is too slow because I had maybe 10 FPS even in the SteamVR menu. But its good to have more than one option

Mrinohk commented 1 month ago

Interesting I tested the software encoding and it was really bad for me. Maybe my CPU is too slow because I had maybe 10 FPS even in the SteamVR menu. But its good to have more than one option

I've got a Ryzen 7 5700X and it seems to be handling it really well. Objectively the best VR experience I've had in terms of controller latency and visual artifacts. Way better than the meta endorsed wireless experiences on windows which is wild to me.

Germanreddragon94 commented 1 month ago

I dont understand I have a Ryzen 7600X which should not having any problems either if its working with Your CPU. In VRChat everything is okay but in Into the Radius the controller make problems. A latency of 14ms is good but I guess its not enough I need 8ms or less I dont know. Its hard getting more than 72 FPS with a resolution of 2976x2720.

On Windows I have around 6-8 ms. If I force a lower latency I get the same problem, so the problem is the game itself not running well enough with my settings, I will use Windows for VR and maybe someday its working better.