google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.95k stars 1.22k forks source link

Black screen on Samsung S7 (Android 7) ; and on other devices/Android versions? #1523

Open agGitHub opened 2 years ago

agGitHub commented 2 years ago

SPECIFIC ISSUE ENCOUNTERED

On my Samsung S7 (Android 7) (and only on this device among my few test devices), I get a black screen on the AR session. Due to an exception on session.update(). I don't know if this bug occurs on other devices or Android versions. So I consider it as potentially frequent as it happens on one of my test devices.

Please tell me how to fix this problem.

Here is the error log:

2022-06-30 11:49:21.155 10779-11127/com.mycompany.myproject E/native: E0000 00:00:1656582561.155423   11127 error_policy_util.cc:263] 
    ################ ARCore Native Error ##################
    BUILD_CHANGELIST:452219294
    BUILD_BASELINE_CHANGELIST:452219294
    ################### Stack Trace Begin ################
    ARCoreError: third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:351  https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc?g=0&l=351
    ARCoreError: third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:60   https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc?g=0&l=60
    ARCoreError: third_party/arcore/ar/core/frame_manager.cc:420    https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/frame_manager.cc?g=0&l=420
    ARCoreError: third_party/arcore/ar/core/frame_manager.cc:328    https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/frame_manager.cc?g=0&l=328
    ARCoreError: third_party/arcore/ar/core/session.cc:1739 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/session.cc?g=0&l=1739
    ARCoreError: third_party/arcore/ar/core/c_api/session_lite_c_api.cc:76  https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/c_api/session_lite_c_api.cc?g=0&l=76
    ################### Stack Trace End #################

    ################### Undecorated Trace Begin  #################
    INTERNAL: 
    ARCoreError: third_party/arcore/ar/core/session.cc:1739

    ARCoreError: third_party/arcore/ar/core/frame_manager.cc:328

    ARCoreError: third_party/arcore/ar/core/frame_manager.cc:420

    ARCoreError: third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:60

    ARCoreError: third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:351
     egl_error=12294frame manager shared context: eglCreateContext failed. [type.googleapis.com/util.ErrorSpacePayload='ArStatusErrorSpace::AR_ERROR_FATAL']
    === Source Location Trace: ===
    third_party/arcore/ar/core/status.cc:171
    third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:351
    third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:60
    third_party/arcore/ar/core/frame_manager.cc:420
    third_party/arcore/ar/core/frame_manager.cc:328
    third_party/arcore/ar/core/session.cc:1739

    ################### Undecorated Trace End  #################
2022-06-30 11:49:21.160 10779-11127/com.mycompany.myproject E/GLSurfaceRenderer: Exception on the OpenGL thread
    com.google.ar.core.exceptions.FatalException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
        at com.google.ar.core.Session.throwExceptionFromArStatus(Session.java:14)
        at com.google.ar.core.Session.nativeUpdate(Native Method)
        at com.google.ar.core.Session.update(Session.java:2)
        at com.mycompany.myproject.GLSurfaceRenderer.onDrawFrame(GLSurfaceRenderer.java:630)
        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1562)
        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1262)

VERSIONS USED

STEPS TO REPRODUCE THE ISSUE

  1. launch AR session (camera permission is allowed)
  2. black screen !

WORKAROUNDS (IF ANY)

Not found.

ADDITIONAL COMMENTS

Probably a rare bug, as I don't have many bad feedbacks in production but certainly a few percents of devices ; not acceptable.

sandyfriend commented 2 years ago

Could you try on Sample code to see if it works. from the error log you updated, it seem related with your GL thread.

E/GLSurfaceRenderer: Exception on the OpenGL thread