immersive-web / webxr-polyfill

Use the WebXR Device API today, providing fallbacks to native WebVR 1.1 and Cardboard
Apache License 2.0
378 stars 84 forks source link

Random requestSession() -> requestPresent() hang on Oculus Go #136

Open timothyallan opened 4 years ago

timothyallan commented 4 years ago

Hey everyone. I'm pulling my hair out with this one. I get what seems to be random hangs on this line here on my Oculus Go only. https://github.com/immersive-web/webxr-polyfill/blob/master/src/devices/WebVRDevice.js#L246

It seems to be about every 1 in 5 times I enter/exit immersive mode, I just get the white spinner. Sometimes it happens the first time, sometimes I am able to go in/out 10 times before it hangs. I'm using Three's WebXRManager to handle that end of things and calling requestSession with navigator.xr.requestSession('immersive-vr', { optionalFeatures: ['local-floor', 'bounded-floor'] })

If I force quit the browser using the "Oculus" button on the controller (back button doesn't function anymore), I exit immersive mode, and the promise resolves successfully.

I put a catch statement on the line, and it's never called. There are no errors raised, no warnings, no nothing, it always resolves whether or not it 'actually' worked, or I had to force quit.

Here's the fun part. If I am actively moving my head while entering immersive mode, I have a higher percentage of it actually working than if I keep it perfectly still. Is there some magic in Oculus land which is dependent on receiving gyro information before entering immersive?