google-ar / arcore-android-sdk

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

AugmentedImageDatabase in a Session on Emulator: crashes and OpenGL errors #1011

Open miredirex opened 4 years ago

miredirex commented 4 years ago

SPECIFIC ISSUE ENCOUNTERED

On emulator, having an AugmentedImageDatabase in an ARCore session crashes the app and logs a specific OpenGL error in Event Log:

Logcat stacktrace:

W/native: tracking.cc:3753 Feature descriptors not exist
    box_detector.cc:180 Detection skipped due to empty features or descriptors.
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
I/native: session.cc:2481 Update Frame Delay to 3 frames.
W/native: tracking.cc:3753 Feature descriptors not exist
    box_detector.cc:180 Detection skipped due to empty features or descriptors.
D/EGL_emulation: eglCreateContext: 0x7ffbd9c0: maj 3 min 0 rcv 3
E/EGL_emulation: tid 5207: eglMakeCurrent(1542): error 0x3009 (EGL_BAD_MATCH)
E/libEGL: eglMakeCurrent:1062 error 3009 (EGL_BAD_MATCH)
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
E/EGL_emulation: tid 5207: eglMakeCurrent(1542): error 0x3009 (EGL_BAD_MATCH)
E/libEGL: eglMakeCurrent:1062 error 3009 (EGL_BAD_MATCH)
W/native: tracking.cc:3753 Feature descriptors not exist
    box_detector.cc:180 Detection skipped due to empty features or descriptors.
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
W/native: tracking.cc:3753 Feature descriptors not exist
    box_detector.cc:180 Detection skipped due to empty features or descriptors.
I/native: performance_monitor.cc:115 Event: FeatureExtraction is taking too long, it took 135.245ms
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
E/EGL_emulation: tid 5207: eglMakeCurrent(1542): error 0x3009 (EGL_BAD_MATCH)
E/libEGL: eglMakeCurrent:1062 error 3009 (EGL_BAD_MATCH)
W/native: tracking.cc:3753 Feature descriptors not exist
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
W/native: box_detector.cc:180 Detection skipped due to empty features or descriptors.
E/native: error_policy_util.cc:260 
    ################ ARCore Native Error ##################
    BUILD_CHANGELIST:292460638
    BUILD_BASELINE_CHANGELIST:290669628
    ################### Stack Trace Begin ################
    ARCoreError: third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:204  https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc?g=0&l=204
    ARCoreError: third_party/arcore/ar/core/frame_manager.cc:344    https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/frame_manager.cc?g=0&l=344
    ARCoreError: third_party/arcore/ar/core/frame_manager.cc:144    https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/frame_manager.cc?g=0&l=144
    ARCoreError: third_party/arcore/ar/core/session.cc:1351 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/session.cc?g=0&l=1351
    ARCoreError: third_party/arcore/ar/core/c_api/session_lite_c_api.cc:63  https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/c_api/session_lite_c_api.cc?g=0&l=63
    ################### Stack Trace End #################
D/AndroidRuntime: Shutting down VM
W/native: tracking.cc:3753 Feature descriptors not exist
    box_detector.cc:180 Detection skipped due to empty features or descriptors.
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576

    --------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.my.app, PID: 5207
    com.google.ar.core.exceptions.FatalException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
        at com.google.ar.core.Session.throwExceptionFromArStatus(Session.java:143)
        at com.google.ar.core.Session.nativeUpdate(Native Method)
        at com.google.ar.core.Session.update(Session.java:67)
        at com.google.ar.sceneform.ArSceneView.onBeginFrame(SourceFile:102)
        at com.google.ar.sceneform.SceneView.doFrameNoRepost(SourceFile:90)
        at com.google.ar.sceneform.SceneView.doFrame(SourceFile:86)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:909)
        at android.view.Choreographer.doCallbacks(Choreographer.java:723)
        at android.view.Choreographer.doFrame(Choreographer.java:655)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
W/native: tracking.cc:3753 Feature descriptors not exist
    box_detector.cc:180 Detection skipped due to empty features or descriptors.
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
W/native: tracking.cc:3753 Feature descriptors not exist
    box_detector.cc:180 Detection skipped due to empty features or descriptors.
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
W/native: tracking.cc:3753 Feature descriptors not exist
    box_detector.cc:180 Detection skipped due to empty features or descriptors.
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
W/native: tracking.cc:3753 Feature descriptors not exist
    box_detector.cc:180 Detection skipped due to empty features or descriptors.
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
W/native: tracking.cc:3753 Feature descriptors not exist
    box_detector.cc:180 Detection skipped due to empty features or descriptors.
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
W/native: tracking.cc:3753 Feature descriptors not exist
    box_detector.cc:180 Detection skipped due to empty features or descriptors.
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576

Event Log emulator errors:

23:49   Emulator: C:\buildbot\src\android\emu-master-dev\external\qemu\android\android-emugl\host\libs\Translator\GLES_V2\GLESv2Imp.cpp:
23:49   Emulator: glEGLImageTargetTexture2DOES:3818 error 0x500
23:49   Emulator: glTexImage2D: got err pre :( 0x501 internal 0x1908 format 0x1908 type 0x1401
23:49   Emulator: glTexImage2D: got err pre :( 0x501 internal 0x1908 format 0x1908 type 0x1401
23:49   Emulator: glTexImage2D: got err pre :( 0x501 internal 0x1908 format 0x1908 type 0x1401

VERSIONS USED

STEPS TO REPRODUCE THE ISSUE

WORKAROUNDS (IF ANY)

Using a physical device

ADDITIONAL COMMENTS

zhmxiaowo commented 3 years ago

I have the same issue in unreal engine 4.26 when i let the application enter background and return the forground

021-07-08 16:51:46.708 2472-7353/com.fdage.test1 I/native: session.cc:3141 Update Frame Delay to 2 frames.
2021-07-08 16:51:46.709 2472-7353/com.fdage.test1 E/libEGL: eglCreateContextImpl:981 error 3006 (EGL_BAD_CONTEXT)
2021-07-08 16:51:46.709 2472-7353/com.fdage.test1 E/native: error_policy_util.cc:263 
    ################ ARCore Native Error ##################
    BUILD_CHANGELIST:356413513
    BUILD_BASELINE_CHANGELIST:353781137
    ################### Stack Trace Begin ################
    ARCoreError: third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:344  https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc?g=0&l=344
    ARCoreError: third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:53   https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc?g=0&l=53
    ARCoreError: third_party/arcore/ar/core/frame_manager.cc:421    https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/frame_manager.cc?g=0&l=421
    ARCoreError: third_party/arcore/ar/core/frame_manager.cc:299    https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/frame_manager.cc?g=0&l=299
    ARCoreError: third_party/arcore/ar/core/session.cc:1596 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/session.cc?g=0&l=1596
    ARCoreError: third_party/arcore/ar/core/c_api/session_lite_c_api.cc:75  https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/c_api/session_lite_c_api.cc?g=0&l=75
    ################### Stack Trace End #################

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

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

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

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

    ARCoreError: third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:344
     egl_error=12294frame manager shared context: eglCreateContext failed. [type.googleapis.com/util.ErrorSpacePayload='ArStatusErrorSpace::AR_ERROR_FATAL']
    ################### Undecorated Trace End  #################
yangchengjian commented 2 years ago

@zhmxiaowo Did you solve this problem? I have the same error in arcore-android-sdk : 1.29.0

2022-02-05 13:31:19.163 1057-1192/org.mozilla.geckoview_example E/native: E0205 13:31:19.163177    1192 error_policy_util.cc:263] 
    ################ ARCore Native Error ##################
    BUILD_CHANGELIST:411607243
    BUILD_BASELINE_CHANGELIST:410343041
    ################### Stack Trace Begin ################
    ARCoreError: third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:344  https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc?g=0&l=344
    ARCoreError: third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:53   https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc?g=0&l=53
    ARCoreError: third_party/arcore/ar/core/frame_manager.cc:422    https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/frame_manager.cc?g=0&l=422
    ARCoreError: third_party/arcore/ar/core/frame_manager.cc:300    https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/frame_manager.cc?g=0&l=300
    ARCoreError: third_party/arcore/ar/core/session.cc:1744 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/session.cc?g=0&l=1744
    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:1744

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

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

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

    ARCoreError: third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:344
     egl_error=12297frame 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:344
    third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:53
    third_party/arcore/ar/core/frame_manager.cc:422
    third_party/arcore/ar/core/frame_manager.cc:300
    third_party/arcore/ar/core/session.cc:1744

    ################### Undecorated Trace End  #################

    [          1644039079.163  1057: 1192 E/android_ndk_in_arcore : arcore::background_renderer::new
    third_party/rust/arcore/src/rearcore::lib::on_draw ArSession_update error, ar_status_update = -2��������������������������������������������������������������

    [          1644039079.163  1057: 1192 E/android_ndk_in_arcore : arcore::background_renderer::new
    third_party/rust/arcore/src/rearcore::lib::on_draw ArCamera_getTrackingState error, camera_tracking_state = 1�����������������������������������������������������������������������������������v
yangchengjian commented 2 years ago

@inio @shan95008 Please help