ALVR icon indicating copy to clipboard operation
ALVR copied to clipboard

Jerky head tracking with "0" every few secs

Open orangpelupa opened this issue 6 years ago • 34 comments

when i set trackingframeoffset to -1, it looks even worse.

the "jerk" looks like "image doubling"

example, easiest to see on contrast line. A line like this (many lines in steam VR default screen without Home launched)

|

at random time, usually every few secs, will look like this when i move my head around

||

I only experience this with GTX 1660 Super + i5 4460

it was smooth sailing on RX580 + Ryzen 7 1700

orangpelupa avatar Dec 05 '19 10:12 orangpelupa

I think this is NVENC's issue on TURING

googling around, https://www.google.com/search?q=nvenc+stutter since 2019 some people complains about stuttering in NVENC

i tried OBS Studio to record UFOTEST https://www.testufo.com/ghosting#background=004040&separation=160&pps=240&graphics=bbufo.png&pursuit=1

The results are: NVENC = stutter X264 CPU = smooth

recorded via NVENC Geforce Xprience and NVENC+CPU OBS running on GTX 1660 SUPER driver 441.41 w10 1909

NVENC OBS https://www.youtube.com/watch?v=_xVmxAdF9ak&feature=youtu.be NVENC GFE https://www.youtube.com/watch?v=SL7ZoJ3oJ2Y&feature=youtu.be X264 CPU OBS https://www.youtube.com/watch?v=ZkdKyOXy3UY&feature=youtu.be

Dang, i should have bough Radeon Vega instead of GTX 1660 SUPER

EDIT:

Findings

  • I manually set the framerate limit on RTSS and it does eliminate the stutter in NVENC recording (thru Geforce experience and OBS) but the game world i see in Quest still stutter
  • The "display VR view" window on Steam VR also shows the stutter.

steps to reproduce

  1. turn on ALVR and steam VR, now you are in the "grid world"
  2. turn on the "Display vr view" on steam vr hamburger menu
  3. put your thumb on the Quest proximity sensor and rotate around the headset
  4. the view in "VR VIEW" will stutter every 1 sec or so.

orangpelupa avatar Dec 06 '19 04:12 orangpelupa

Could this be the stuttering you are seeing? https://youtu.be/oYs5O1-_DxM

Definitely seems to be something off with the head tracking. Took a while to figure out exactly what was bothering me, I think the ATW is mitigating the problem to some degree. But recording this on the PC makes it painfully obvious that head-tracking is extremely stuttery.

coroiu avatar Dec 06 '19 22:12 coroiu

I'm pretty sure you are dropping frames in SteamVR. Please open the SteamVR menu and select Developer -> Advanced Frame Timings.

You should not have any spikes above the idle block.

@orangpelupa The i5 4460 is below the minimum spec for VR. Same goes for #83. Your PC is struggling with VR and ALVR is on top of that. ALVR needs a high-end PC and has even higher system requirements as a Rift-S!

@coroiu If you can see this stuttering on the PC it can only be two things: Rendering problems as stated above or the tracking packages don't reach ALVR on the PC. My guess would also be the rendering.

JackD83 avatar Dec 07 '19 08:12 JackD83

@coroiu yep! It's like that. Controllers didn't stutter but when moving head around, stutters like that

@JackD83 sorry I already packed my quest to be sold so I can't give the frame timing screenshot

When I watch the frame time while in steam vr floating world (not home) there were no spikes and the head tracking stutters.

when I tried LA moire VR I do get lots of spikes and there are two stutters.

  1. Stutters of head and hand (this shows spike on stream vr timing)
  2. Only head stutter (didnt show spikes)

orangpelupa avatar Dec 07 '19 09:12 orangpelupa

My PC is not dropping frames at least, I'm not so sure that it has to do with rendering. I couldn't record the Advanced Frame Timings but I used OpenVR Advanced Settings to show another version. The problem is not as pronounced in the following videos, but it is still clearly there. I'm also uploading a slow-mo version of it where it's easier to see what is actually happening. It looks like the tracking is jumping back to where it was a few frames ago, but hard to say.

Whole video: https://youtu.be/zkBM6a2uzFE Slow mo: https://youtu.be/jMsOjPtymqI

Oh and I'm running on an i7-6700 + GTX 970 (RTX 2070 is in the mail, can probably test next week)

coroiu avatar Dec 07 '19 09:12 coroiu

When I tested a few days ago, My frame timing were smoother than yours and under 2ms. And it still stutter.

I was seeing the frame timing while in the steam vr floating home menu (the one with grids on the floor and aurora as the sky), not the steam home. So there were practically nothing heavy to render.

I should have recorded it before packing my quest and flying to another island.

orangpelupa avatar Dec 07 '19 09:12 orangpelupa

Are you close to a window? I get this tracking back jumps when I'm close to and facing a window. Sunlight has also something to do with it. GTX 970 is also the minimum for VR

I'm not so sure that it has to do with rendering.

If missing frames, the tracking can not be updated and reprojection kicks in to compensate for your head movement but not for the controller. Tracking information is a very small package that is not altered and fed into SteamVR

Please test one other thing: Create a folder called "logs" inside the ALVR folder next to the ALVR.exe In the ALVR debug settings, enable the "debugCaptureOutput" checkbox. This will create a very large video file of the output send to the HMD. You can watch the file using FFPlay. See if there are the same problems visible

JackD83 avatar Dec 07 '19 09:12 JackD83

I wouldn't say close (to a window), but that would mean having the same issue outside of ALVR as well, which I am not (no stuttering in Oculus Home on the Quest).

The controllers are just the most convenient way of showing the problem. The issue is present even without them (moving your head while looking at an object in-game, the whole world just kind of stutters back and forth).

I did the test and the stutter is present in the dumped video file as well.

I tried to test the issue with VRidge, but damn ALVR works better. VRidge is completely unplayable :( So I tried Oculus Link instead (wow, the low latency is impressive) and there was no stutter whatsoever. So my PC hardware can definitely keep up. I even tried lowering ALVR to 50% resolution, just to make the comparison fair - no dice.

Looking at ALVR I am seeing some packet loss, but it's very weird, it seems to only occur when I'm moving the actual headset. It's not much though, jumps to 8 packets/s and then down to 0 again. Keeping the headset still shows almost no packet loss at all. I have line of sight to an AC-66U 3 meters away.

coroiu avatar Dec 07 '19 11:12 coroiu

Hmm maybe these are a different issues?

in my case, there were zero packet loss.

Only when the headset moves the stutter occurs, of it stays still, no stutter (the controller moved around just fine)

orangpelupa avatar Dec 07 '19 14:12 orangpelupa

Just installed my 2070, same problem

coroiu avatar Dec 07 '19 17:12 coroiu

been having the same problem I have 866mbs connect with wifi right next to the router pc is plugged in 1080ti ryzen 1700x and I get like 1 or 2 dropped frames every few seconds no matter what the settings are set to.

clementkirton avatar Dec 08 '19 00:12 clementkirton

I agree with @orangpelupa, I think we have now 3 different issues.

@coroiu I checked your videos again and I'm not sure what I' seeing. Do you get the jumps on view of the HMD or only on the controller? The jumps on the controller have to be considered "normal". In the case of the video, you are moving your tracking reference (the headset) and the controllers. Together with the delay of ~50-70ms, the position of the controller in some frames are only a guess. Moving the tracking reference makes it some times a bad guess that gets corrected once the next position arrives. You can check this if you go to the other tab of alvr and set the pose offset to 0.1 or higher. Then you will have no jumping but very slow moving controllers.

@ all Network transmission is a very fundamental part of ALVR. Every hiccup, imperfection etc. gets a response in the streaming and we humans are very perceptible to those errors. Your network has to be flawless! With all the errors I have seen from may people, I doubt that Oculus will release a wireless link version that does not come with dedicated hardware for the PC that they can control.

For your own network, check the following:

  • 5gzh Wifi, use a separate ssid for the 5hz and 2,4ghz part. The Quest tends to jump frequencies
  • PC has to be wired to the router/AP
  • Check if you have the only AP on the 5ghz channel. If not, it won't be perfect. Nothing you can do
  • Limit the channel with to 40mhz, 80mhz is causing problems

If you cannot meet all these criteria, you will get problems! If you still have problems, try a different AP just for the quest.

Some more things are listed here

JackD83 avatar Dec 08 '19 09:12 JackD83

For those with windows 10, use USB 5GHz wifi.

  1. Turn on wifi Hotspot on an android phone, and set it to 5ghz
  2. Connect computer wifi to phone
  3. Turn on windows 10 Hotspot
  4. Disconnect computer wifi from phone Hotspot (keep the computer Hotspot active) and turn off phone Hotspot

This will give you the lowest possible latency, and cleanest connection. Direct wifi connection to quest at 5ghz.

You need to do those hoops with Android phone Hotspot because windows 10 Hotspot not always have 5ghz option and even if you get that option, the 5ghz sometimes broken (everything looks fine but quest cant see it or can't get ip address, etc)

orangpelupa avatar Dec 08 '19 11:12 orangpelupa

Ok, so maybe they are different issues. Let's forget about the Controller/Head jumping and just focus on the head jitters. Here's a test where I am simply moving my head (clip is slowed down in the middle), and I have to admit that the video from the quest looks like packet loss. I just think it's odd that moving my hands doesn't trigger anything like that (but I'm guessing moving my head results in a lot more video information needing transmission?)

Clip: https://youtu.be/Wy9iGEb6ndw (ex: 0:14-0:15)

I also dumped the ALVR capture during the same session. This is probably the most interesting part, but if you say that this is related to the packet loss then i give up :). Anyway, the capture just kind of jumps exactly when the Quest shows video artifacts. So I'm guessing this has to be due to tracking information being lost, or something happening in the driver. What do you think? Is this how packet loss manifests?

Clip: https://youtu.be/lWSFQK7fC6Y (ex: 0:07-0:08)

Ps. I meet all of the above criteria, wired gigabit connection to an AC66U 3m away from Quest running a 5GHz 40MHz wide AP with separate SSID on a completely free channel in the upper bands (tried it with lower as well). I've also tried connecting directly to my PC using the 5GHz WiFi m2 card I got with the motherboard (verified 5GHz-only hotspot). No difference. Tried increasing buffer, lower resolution, lower bitrate, raising it, changing tracking frame offset, changing controller pose offset (though this is related to controller issue, so ignore), you name it. Maybe it's just not meant to be ¯\(ツ)/¯

coroiu avatar Dec 08 '19 21:12 coroiu

Very good videos! Seeing them we can rule out any tracking issues :) The tracking does influence the content of the video e.g. the movement, the video feed itself is not affected by it. Even if you disable the head tracking completely, you would get a nice but disorienting video feed.

The video player on the PC seems to be capable of handling more errors than on the quest. That's why you see only a small hiccup on the PC and a larger error on the quest. In your other video, the quest did handle it better.

As the error is also present in the encoded video, network seems also not the issue.

That leaves two possibilities I can think of:

  • There is some kind of encoding error while encoding the frame of the game.
  • There is a lag/disruption/stutter in the pipeline Game -> SteamVR -> Encoder

What you could try: Fresh windows installation, all drivers, no geforce experience, latest SteamVR and try again. That is the only advice I have left.

JackD83 avatar Dec 09 '19 07:12 JackD83

Btw try recording UFO TEST on chrome via OBS Studio nvenc or GeForce experience video recording function.

If the ufo stutters, you are affected by NVENC bug that has been there since the launch of turing RTX series. Just like me.

orangpelupa avatar Dec 09 '19 12:12 orangpelupa

Recording my desktop with Nvidia experience resulted in surprisingly no stutter. So maybe you have multiple issues @orangpelupa , or we don't have the same issue. I've also tried searching for "SteamVR stutter" but nothing has worked. However, as it turns out, SteamVR doesn't actually stutter, the stutter is only present in the ALVR dump (and the quest). I plan on doing the same test as above and also checking the log to see if there could be anything in there. Otherwise I don't know, I don't think I will be doing a clean install, to much work and I don't really think it will solve the problem (I appreciate the advice though :smile: ).

coroiu avatar Dec 10 '19 07:12 coroiu

I'm starting to wonder if this might be related to encoding stutter in NVENC after all. This seems very familiar https://www.youtube.com/watch?v=8YaVkrwalmw . Apparently the fix they've applied in OBS is related to GPU priorities. After some digging I found the commit with the fix: https://github.com/obsproject/obs-studio/commit/ec769ef008b748f7dfba211daec9eb203ea4bea0 .

What do you think @JackD83 ?

coroiu avatar Dec 10 '19 10:12 coroiu

After much trial and error, I think I might have managed to hack the fix into ALVR. It's not pretty, but it compiles. And... I think it might have fixed it, seems like no more stutter in the encoding dump at least, I'll try to play for a longer period and see. I'll fork and upload tomorrow, but here's the compiled version of the driver if anyone wants to try https://drive.google.com/open?id=1Rkp-Nypq4gfN1pCB7UWUHPgo6yW-Tc-k

You'll have to run SteamVR as administrator, which I think means that you have to run steam in compatibility mode (right click -> properties -> compat -> run as admin). The log should say if the fix fails or succeeds.

Edit: Had some time to push it now: https://github.com/coroiu/ALVR/commit/04a0f10fa3e116b4a7fa55bcc293f9b1159375e6

coroiu avatar Dec 12 '19 19:12 coroiu

IDK I have tried everything now and still getting frame drops and i did not get them like 2 weeks ago. I have an 866mbit connection 40hz and I'm the only one on the 5ghz channel my PC is not the problem even if I set it to 25% res I still get 0 - 1 frame drops every few seconds. I get this even in a blank steam world it's not performance-related. even with the driver still does it no idea what left to try.

clementkirton avatar Dec 13 '19 05:12 clementkirton