alvr-org / ALVR

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

Occasional jitter #273

Open zmerp opened 4 years ago

zmerp commented 4 years ago

Often ALVR appears jittery when moving the head horizontally. It's probably not the video stream because the oculus universal menu also appears jittery (with ALVR stream in the background). The same thing happens to a lesser degree with VD. This could be caused by unoptimized code. One of the causes could be the webview that gets rendered constantly even when not shown. This could also be caused by uneven video encoding/decoding times across frames. A workaround is implementing the latency minimization/regulation system. This system increases (frame queue) latency until the number of missed deadlines per hour (that cause jitter) falls below a certain threshold.

maxer456 commented 4 years ago

The WebView itself only renders when it needs to due to a change on the page, not each frame. Only its SurfaceTexture's updateTexImage() gets called each frame, which should not cause jitter like that.

What I found out so far is that each time I experience the jitter, I can pair it to an error log from OutputFrameQueue about the FrameQueue being full (OutputFrameQueue.java:71), which points to the uneven decoding times you've described.

Vixea commented 1 year ago

Possibly also be closed

zmerp commented 1 year ago

This is not fixed completely. The main problem described by this issue is mitigated by fixed frame buffering support, but needs OpenXR Phase Sync to allow for dynamic frame buffering. Furthermore the "staircase latency" is on the path to be fixed soon, as well as microjitter caused by tracking poll on the SteamVR side.