Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

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

Discussion in 'VR' started by Orion, Sep 28, 2021.

  1. Orion

    Orion

    Joined:
    Mar 31, 2008
    Posts:
    249
    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: https://pastebin.com/dGth3g7J

    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?
     
    Last edited: Sep 29, 2021
  2. Orion

    Orion

    Joined:
    Mar 31, 2008
    Posts:
    249
    I still haven't been able to fix this. It does happen more often with low battery.
     
  3. Joits

    Joits

    Joined:
    Jul 12, 2016
    Posts:
    29
    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.
     
  4. Orion

    Orion

    Joined:
    Mar 31, 2008
    Posts:
    249
    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.
     
  5. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    3,477
    Update the oculus integration to v34 and oculus xr to the latest pre release, as well as xr integration and try to build again
     
  6. Orion

    Orion

    Joined:
    Mar 31, 2008
    Posts:
    249
    @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!
     
    DevDunk likes this.
  7. Joits

    Joits

    Joined:
    Jul 12, 2016
    Posts:
    29
    If anyone is struggeling with the same issue. I fixed mine by swtiching to Legacy XR framework instead of OpenXR
     
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    3,477
    That's really not recommended. Starting a new project using a legacy system is a bad idea
     
  9. EdwinWiseOne

    EdwinWiseOne

    Joined:
    Apr 26, 2021
    Posts:
    10
    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.
     
  10. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    3,477
    Vulkan or OpenGLES?
     
  11. x1alphaz1

    x1alphaz1

    Joined:
    Dec 19, 2020
    Posts:
    21
    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.
     
  12. Giammy47

    Giammy47

    Joined:
    Aug 1, 2017
    Posts:
    8
    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?
     
  13. EdwinWiseOne

    EdwinWiseOne

    Joined:
    Apr 26, 2021
    Posts:
    10
    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)
     
  14. gareth_withVR

    gareth_withVR

    Joined:
    Nov 11, 2020
    Posts:
    4
    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.
     
  15. Artemis1997

    Artemis1997

    Joined:
    Apr 25, 2019
    Posts:
    2
    Hi everyone, I have same problem here any update/solutions ?
     
  16. gareth_withVR

    gareth_withVR

    Joined:
    Nov 11, 2020
    Posts:
    4
    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
     
  17. dev_34Disorder

    dev_34Disorder

    Joined:
    Aug 7, 2018
    Posts:
    47
    Same issue here. Started happening after i added a directional light to my scene.
     
  18. EdBlais

    EdBlais

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    300
    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.
     
    DevDunk likes this.
  19. nikokoneko

    nikokoneko

    Joined:
    Feb 20, 2015
    Posts:
    35
    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.
     
  20. dev_34Disorder

    dev_34Disorder

    Joined:
    Aug 7, 2018
    Posts:
    47
    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.
     
  21. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    3,477
    You can profile on all platforms. You can do so via usb or WiFi (quest 2 runs on android).
    Bug reports really help everyone out
     
  22. dev_34Disorder

    dev_34Disorder

    Joined:
    Aug 7, 2018
    Posts:
    47
    Glad we agree on that. Here's reproduction steps for anyone who's willing to take the time to make an example project and file the report:
    - Make a project with OpenXR + OVR
    - Make a scene with an XR rig
    - Add a sphere opposite the direction where the player will be looking at when the game starts
    - Duplicate the sphere numerous times and arrange in a cubical grid. 10000 did the trick for me with the eyeTextureResolutionScale set to 2 on every frame (cuz otherwise it just reverts to 1, same thing with changing tracking origin mode, how on earth is this acceptable)
    - Deploy to Quest 2 and run
    - Turn around and observe the chaos

    And thanks for the profiler tip, will be helpful.
     
  23. unitydevelopers-greg

    unitydevelopers-greg

    Joined:
    Nov 15, 2018
    Posts:
    11
    Same here reproduced with Unity 2021.3.14f1
    Fingers crossed this will be fixed quite promptly as it makes any complex VR project with Unity virtually impossible.
     
  24. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    3,477
    What's the bug report id?