Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
bkane's avatar
bkane
Protege
9 years ago

Gear VR Crash after taking off headset and putting it back on

We're seeing the same "GLES-MALI OOM error: failed to allocate CPU memory" crash that albmarvil reported in the big Unity version thread. Here's another log and a bit more information about our repro case.

We're using:
Unity v5.5.0p1, Oculus Utilities v1.10.0, OVRPlugin v1.10.0, SDK v1.0.4.0.
To reproduce the crash, we simply need to remove the headset (so that the game pauses), and then put the headset back on after a short while. A few seconds often isn't enough, but a minute or two seems to do the trick. Then the game crashes upon trying to reenter VR mode:
12-14 12:40:11.891  3046  4565 E BufferQueueProducer: [SurfaceView] cancelBuffer: slot 0 is not owned by the producer (state = 2)
12-14 12:40:11.891 26151 26712 D : NULL == surf->write_back_color_buffer
12-14 12:40:11.891 26151 26712 W : GLES-MALI OOM error: failed to allocate CPU memory (gles_fb_first_drawcall_cb at hardware/samsung_slsi/MaliT760_r7p0_Istor/product/gles/src/fb/mali_gles_fb_module_api.c:1290)
12-14 12:40:11.891 3436 3436 D WifiStateMachine: setWifiScanMove bMove = 0
12-14 12:40:11.891 3436 3436 I WifiStateMachine: not vehicle, sendMessageDelayed CMD_SET_SCAN_MOVE with 0
12-14 12:40:11.891 26151 26712 W OVR_GlUtils: SetWarpState GL Error: GL_OUT_OF_MEMORY
12-14 12:40:11.891 26151 26712 E OVR_GlUtils: GL_OUT_OF_MEMORY
12-14 12:40:11.891 26151 26712 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 26712 (OVR::TimeWarp)
In these logs, the game is started at about 12:32. The headset is removed at around 12:34 (line ~8000). It is then put back on at around 12:40 (line ~10977).

Note that the same crash occurs if you remove the phone from the headset after a little while instead of putting the headset back on.

10 Replies

Replies have been turned off for this discussion
  • vrdaveb's avatar
    vrdaveb
    Oculus Staff
    Thanks for the detailed report. We're debugging this.
  • JianZ's avatar
    JianZ
    Expert Protege
    Hey bkane

        we had trouble to repro the crash here, does this happen to you for any apps ?  or only your app?  Is that possible we get a minimal unity source project with the problem from you ? so we can debug into it.

    Thanks  
  • Hi JianZ,

    Sorry for the delay in getting back to you. I was having difficulty reproducing this outside of our own project but I believe I've narrowed it down. The problem appears to lie with setting:
            QualitySettings.antiAliasing = 4;
    If you do this on the first frame of execution, the app will crash immediately with the "GLES-MALI OOM error" as before. If you perform it after the first frame (as we do in our game), then we see the behaviour where you need to remove the headset for roughly 10 seconds, at which point the game will crash the next time it enters VR mode (i.e. when you put the headset back on, or remove the phone).

    I've created a fairly minimal repro project here: https://www.dropbox.com/s/pa94bt8ee343w57/2016_12_20_GearVRRemovalCrash.zip?dl=0

    It does contain Oculus Utilities 1.10 as well as some modified ProjectSettings to enable VR, but otherwise is just a basic scene with a single script.

    Some important notes:
    - The crash occurs on 5.5.0p1 as well as 5.5.0p2
    - Tested on an S6
    - You must wait 10 seconds with the headset off to see the crash. Not sure what happens, but the crash does not occur if you put the headset back on too quickly
    - OVRManager.display.recommendedMSAALevel returns "4", which appears to be causing a problem. I suspect the "Use recommended MSAA level" feature of OVRCameraRig would therefore be sufficient to reproduce this problem too.

    Procedure:
    1. Open the repro project
    2. Open the "scene" scene
    3. Build and run the game for Android, using the current scene
    4. Put the headset on when prompted
    5. Once you see the skybox, remove the headset but keep the phone inserted
    6. Wait a minimum of 10 seconds (very important)
    7. Put the headset back on
    8. Observe crash
    Hope this helps! I've confirmed that removing calls to set QualitySettings.antiAliasing solves the issue for our game.

    - Ben
  • JianZ's avatar
    JianZ
    Expert Protege
    Thanks Ben, that should help a lot to narrow down the problem, I'll debug the project and post back what I found 
  • Hello, We are seeing a similar crash on our UE4 project. We haven't been able to narrow down the exact cause, but it happens after moving between a few maps. I'm currently seeing it on an S6 Edge, I assume it would happen on other S6 devices as well. I don't know how related our crash is to the one you are discussing, but any information from your findings might help us track it down. Specifically, we're seeing this error:

    GLES-MALI OOM error: failed to allocate GPU memory (gles_drawp_draw_common at hardware/samsung_slsi/MaliT760_r7p0_Istor/product/gles/src/draw/mali_gles_draw_internal.c:1885)


  • JianZ's avatar
    JianZ
    Expert Protege
    We are still on this,
    yes, it a bit weird, so far this only happen on MALI ( S6 ),  S7 is fine.
    @brockheinz  are you changing antialising setting runtimely as well?

  • As far as I'm aware we're not touching the antialiasing setting, but we'll double check. If you have any thoughts as to things we can look for or try, we can add it to our list of things to investigate. 
  • JianZ's avatar
    JianZ
    Expert Protege
    On Unity,  it is confirmed the issue was caused by deleting eye buffer when it is still using by the compositor, we are working on a change to let textureswapchain to handle eyebuffer life cycle, then we can defer the deletion when re-allocate the buffer,  For now, I'll suggest to avoid any buffer reallocation operation dynamically on Gear VR ( eg, changing msaa, changing eye buffer size etc ).

    On Unreal, I think this could be a different issue since it already handle the textureSwapChain correctly,  ARM driver seems reporting a lot of unrelated error as OOM, need figure out what it is exactly,  @brockheinz  if you can share a repro project , we can look into it.