Application randomly freezes on start (unable to submit Oculus frame)

So during development, I noticed that every now and then when starting up the application on the Quest 2 (our only platform right now), the camera freezes up.

This is using Unity 2020.3.15f2 with OculusXR plugin 1.9.1 and XR Interaction Toolkit 1.0.0-pre.6, on Oculus v33.

Some parts of the view are rendered, some are left black. I can look around (in what has already been rendered), and started audio keeps playing, but the view doesn’t update. When I restart the game it works fine again.

I feel that it happens more likely if I move the headset around a lot while it starts up, whereas if I hold still the chance is higher that it loads correctly.

This is what logcat gives me:

I’ve managed to get it to happen while it runs, by triggering a lot of UI animations at once. This is the log from VrApi: 09-28 16:40:13.670 9893 9981 I VrApi : FPS=72/72,Prd=48ms,Tear=0,Early=6,Sta - Pastebin.com

From what I can tell, leading up to the crash there is some flickering, and this in the log:

I have googled the

message but to no avail. Does anyone know why this might happen or how I could get closer to finding out what causes it?

I still haven’t been able to fix this. It does happen more often with low battery.

I’m running into the same error, just with Oculus integration.

20:36:26.167 15514 16247 W Telemetry: [OpenXR] space handle invalid;

20:36:26.167 15514 16247 E OVRPlugin: [XRCMD][failure][XR_ERROR_HANDLE_INVALID]: xrEndFrame(m_xrSession, &frameEndInfo),Software/OculusSDK/Integrations/OVRPlugin/Main/Src/Util/CompositorOpenXR.cpp:3379(Software/OculusSDK/Integrations/OVRPlugin/Main/Src\Util/CompositorOpenXR.h:125)

20:36:26.167 15514 16247 E Unity: [XR] Unable to submit Oculus frame

Did you find a cause for this issue? Its the same symptons, suddenly complete crash, and the frame is just hanging.

I’m glad to hear I’m not the only one with this issue anymore.

I still haven’t figured out what causes it, though.

Update the oculus integration to v34 and oculus xr to the latest pre release, as well as xr integration and try to build again

@DevDunk : I’ve tried what you’ve said, and at the very least the weird flickering that often preceded the freeze/crash is gone now. So that’s already an improvement. I haven’t managed to reproduce the crash so far (but it’s pretty random, we’ll see).

Thanks!

1 Like

If anyone is struggeling with the same issue. I fixed mine by swtiching to Legacy XR framework instead of OpenXR

That’s really not recommended. Starting a new project using a legacy system is a bad idea

I’m definitely seeing this error on the Quest 2 using Unity 2021.2.12f1 … a lot, in some instances. I think it’s related to slow rendering? I have some things that I haven’t threaded yet that may be exceeding frame time. But it’d be nice if it didn’t freeze the display.

I find that if I pause and un-pause my headset the rendering restarts. But this is of course unacceptable once this project goes public.

Vulkan or OpenGLES?

i noticed a similar behavior on one of my projects.
to reproduce the problem:
Unity crashes after opening a scene while the OCCLUSION CULLING tab is opened.

workaround:
deleted the occlusion generated file from the Folder of the scene, and regenerated occlusion again after opening ur scene with Inspector TAB Active.

Issue started after upgrading unity project from 2020.2.1f1 to 2020.3.15.f2.
i upgraded all Inbuilt unity packages and i’m not using any 3rd party library.

I have a similar behaviour, my app freezes when I open up the overlay menu by pressing the oculus button. This doesn’t always happen, sometimes it takes to open up the menu 3 or 4 times and then it freezes. Btw is really annoying. Any fix for this?

Ooo I should monitor this thread.

I’m in Vulkan right now, but have it in GLES too.

And I get a lot of screen glitching, where the image jumps; this tends to precede the unable to submit (and then the screen freezes; a pause and un-pause on the headset resets it)

Did anyone manage to find a solution/workaround for this? I’ve had this issue for months, and have spent way too much time for my liking on it.

Hi everyone, I have same problem here any update/solutions ?

I solved it by removing the Oculus package(s) completely from the project and only using OpenXR… Quite annoying how the Oculus Quest 2 has problems using the Oculus package

Same issue here. Started happening after i added a directional light to my scene.

If you can reproduce the performance issue in the same scene with and without a directional light, could you create two scenes, one with and one without the light source and submit a bug report explaining the issue. If possible, please include some profiler results so that we can confirm we get the same results when testing using the submitted project.

1 Like

I had exactly the same issue here. After removing completely Oculus package and using OpenXR instead for Quest 2, I tested thoroughly and still didn’t encounter this problem.

I’ve never submitted a bug report before and am a bit busy right now, but if i do end up compiling one i’ll be sure to link it here. Also, i’m working on a mac so i don’t think i can hook my Quest 2 up to the profiler in any way.

I did notice some things though, so i’ll share that:

  • Pressing the power button twice (sleep → wake) always fixes the freeze
  • The freeze is a lot more likely to happen when getting a quest notification (battery low, controller not connected, no wifi, etc.)
  • More stuff in the scene also increases the likelihood of the freeze

I’m pretty sure the freeze happens whenever the Quest just can’t keep up performance-wise, no matter what’s causing the strain (as long as it’s on the GPU.)

Just wanted to also mention that i’m kind of in a tough spot since my project uses hand recognition, so removing the OVR package is out of the question for me. If anyone finds some other consistent workaround, please post it in this thread.