Consti10 / FPV_VR_OS

Latest version of FPV_VR, open source under LGPL
GNU Lesser General Public License v2.1
66 stars 26 forks source link

SuperSync still has problem "screen tearing"[Do not know WHY] #10

Closed kissingfire123 closed 2 years ago

kissingfire123 commented 2 years ago

Hi Consti10: I'd like to practice lowest latency VR with "Strip-Render" (or "Beam Racing") . I think your code is completely reasonalble. But unluckly, I switch VR-Setting to SuperSync , and adjust my Xiaomi12 to 120Hz screen refresh rate , then I see sawtooth flasing.

Ps: I use Android Studio to debug the program, and found out VSYNC.h print warning info --> "Got VSYNC in the future".

kissingfire123 commented 2 years ago

attach a picture which shows the problem call from FBRManager::warpEyesToFrontBufferSynchronized FPV-VR-stack-Call

kissingfire123 commented 2 years ago

image

Consti10 commented 2 years ago

Hello,

The problem here is most likely that at the time FPV_VR was written, there was no 120hz support on android yet.

And even as of now, there is no way (to my knowledge) of reading the vsync timing info exact enough from the android system for 120hz (assuming a really powerfull GPU).

If you want to thinker with it, you already found the parts of the code that would need to be modified for 120hz - but I don't have any plans to work on that, since you can always use "Disable VSYNC" and live with the almost unnoticable tearing.

One more thing: Instead of 8.3ms (half a frame 60hz) the GPU must be capable of warping the scene for one eye at 4.15 ms - I am not sure if that is even possible on the highest performance flagship phones.

Consti10 commented 2 years ago

Regarding VSYNC timing - in theory, the task is simple (we need to know when the VSYNC starts and how long it takes) - unfortunatlely, android does not make this information easily accessible, so VSYNC.h was always a bit of a hack.

kissingfire123 commented 2 years ago

@Consti10 Thanks so much for repling. I found the key reson is "Can't render(offscreen+onScreen) an eye within half sreen-refresh".I decided to create a framebuffer queue to store offScreen result ,and render within 2 refresh frames. Wish it works