google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.72k stars 5.18k forks source link

A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20624 (Thread-18), pid 14533 #2446

Closed arianatri closed 3 years ago

arianatri commented 3 years ago

I just Used the solution suggested here : link and by running the android app I got this error :

A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20624 (Thread-18), pid 14533 how does this happen? by setting RUN_ON_GPU to true and do not showing any movementa on camera so it fails to find any face or movement then the app will crash. is there any way to fix it or temporarily patch it?? things I tried :

adding these lines to manifest :

        android:hardwareAccelerated="true"
        android:largeHeap="true"

these lines to build.gradle :

            minifyEnabled false
            shrinkResources false

note : I am using mediapipe dependencies as :

    implementation 'com.google.mediapipe:solution-core:latest.release'
    implementation 'com.google.mediapipe:facemesh:latest.release'

and camera as

    implementation "androidx.camera:camera-core:latest.release"
    implementation "androidx.camera:camera-camera2:latest.release"
    implementation "androidx.camera:camera-lifecycle:latest.release"
arianatri commented 3 years ago

also I get a lot of noisy Logs : D/ExternalTextureConv: Created output texture: 42 width: 1088 height: 1088 is there any way to disable them?

arianatri commented 3 years ago

@eknight7 @jiuqiant may I get a hand here? :)

I see many errors as much as I can list here they are :

1- if I leave camera on without showing any face to it , after like 10-15 seconds the app will crash with error : A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20624 (Thread-18), pid 14533

2- the recognition is super laggy and if I call "@OnResume" the app will become normal for 2 seconds then it becomes slow again.

3- there is a lot of noisy logs that print : D/ExternalTextureConv: Created output texture: 42 width: 1088 height: 1088

the activity source I am working with : `package com.testapp.testiiii;

import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity;

import android.graphics.SurfaceTexture; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.FrameLayout;

import com.testapp.testiiii.utils.FaceMeshResultGlRenderer; import com.google.mediapipe.components.CameraHelper; import com.google.mediapipe.framework.MediaPipeException; import com.google.mediapipe.framework.MediaPipeRunner; import com.google.mediapipe.solutioncore.CameraInput; import com.google.mediapipe.solutioncore.ErrorListener; import com.google.mediapipe.solutioncore.SolutionGlSurfaceView; import com.google.mediapipe.solutions.facemesh.FaceMesh; import com.google.mediapipe.solutions.facemesh.FaceMeshOptions; import com.google.mediapipe.solutions.facemesh.FaceMeshResult;

import java.nio.channels.Pipe;

public class CameraActivity extends AppCompatActivity {

private FaceMesh facemesh;
private static final boolean RUN_ON_GPU = true;
private enum InputSource {
    UNKNOWN,
    CAMERA,
}
private InputSource inputSource = InputSource.UNKNOWN;
private CameraInput cameraInput;
private SolutionGlSurfaceView<FaceMeshResult> glSurfaceView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_camera);

    setupLiveDemoUiComponents();

}

@Override
protected void onResume() {
    super.onResume();
    if (inputSource == InputSource.CAMERA) {
        cameraInput = new CameraInput(this);
        cameraInput.setNewFrameListener(textureFrame -> facemesh.send(textureFrame));
       glSurfaceView.post(this::startCamera);
       glSurfaceView.setVisibility(View.VISIBLE);
    }
}

@Override
protected void onPause() {
    super.onPause();
    if (inputSource == InputSource.CAMERA) {
        glSurfaceView.setVisibility(View.GONE);
        cameraInput.close();
    }
}

private void setupLiveDemoUiComponents() {
    Button startCameraButton = findViewById(R.id.button_start_camera);
    startCameraButton.setOnClickListener(
            v -> {
                if (inputSource == InputSource.CAMERA) {
                    return;
                }
                stopCurrentPipeline();
                setupStreamingModePipeline(InputSource.CAMERA);
            });
}

/** The core MediaPipe FaceMesh setup workflow for its streaming mode. */
private void setupStreamingModePipeline(InputSource inputSource) {
    this.inputSource = inputSource;

    facemesh = new FaceMesh(this,
                             FaceMeshOptions.builder()
                            .setMode(FaceMeshOptions.STREAMING_MODE)
                            .setRunOnGpu(RUN_ON_GPU)
                            .build());
    facemesh.setErrorListener(new ErrorListener() {
        @Override
        public void onError(String message, RuntimeException e) {

        }
    });
    cameraInput = new CameraInput(this);
        // Initializes a new        stopMethodTracing(); CameraInput instance and connects it to MediaPipe FaceMesh.
        cameraInput.setNewFrameListener(textureFrame -> facemesh.send(textureFrame));
        // Initializes a new Gl surface view with a user-defined FaceMeshResultGlRenderer.
        glSurfaceView = new SolutionGlSurfaceView<>(this, facemesh.getGlContext(), facemesh.getGlMajorVersion());
        glSurfaceView.setSolutionResultRenderer(new FaceMeshResultGlRenderer());
        glSurfaceView.setRenderInputImage(true);
        facemesh.setResultListener(
                faceMeshResult -> {
                    glSurfaceView.setRenderData(faceMeshResult);
                    glSurfaceView.requestRender();
                });

        glSurfaceView.post(this::startCamera);

        FrameLayout frameLayout = findViewById(R.id.preview_display_layout);
        frameLayout.removeAllViewsInLayout();
        frameLayout.addView(glSurfaceView);
        glSurfaceView.setVisibility(View.VISIBLE);
        frameLayout.requestLayout();

}

private void startCamera() {
    cameraInput.start(
            this,
            facemesh.getGlContext(),
            CameraInput.CameraFacing.FRONT,
            glSurfaceView.getWidth(),
            glSurfaceView.getHeight());

}

private void stopCurrentPipeline() {
    if (cameraInput != null) {
        cameraInput.setNewFrameListener(null);
        cameraInput.close();
    }
    if (glSurfaceView != null) {
        glSurfaceView.setVisibility(View.GONE);
    }
    if (facemesh != null) {
        facemesh.close();
    }
}

} `

sgowroji commented 3 years ago

Hi @arianatri, Could you please provide the below details.

  1. Which device are you testing the above? And the device configuration.
  2. Logs are printed from "ExternalTextureConverter" gradle API. You can try this for disabling the logs.
  3. Can you provide a video to show the lagging. Thanks!
jiuqiant commented 3 years ago

Lagging can be sigificiant if the device's gpu is not powerful enough. Basically, if the pipeline is running slow, it will accumulate more and more frames to process and also it will slow down the camera capturing and screen rendering if the app runs everything on GPU. Try setting RUN_ON_GPU to false to run the pipeline on CPU to see if it helps.

arianatri commented 3 years ago

Hi @arianatri, Could you please provide the below details.

  1. Which device are you testing the above? And the device configuration.
  2. Logs are printed from "ExternalTextureConverter" gradle API. You can try this for disabling the logs.
  3. Can you provide a video to show the lagging. Thanks!

Device config : Samsung A515
android version: 10 (Q) API level 29 GPU vendor ARM Supported ABIS : arm64-v8a , armeabi-v7a, armeabi

I did disabled the logs, thanks for that.

actually, it is a 3 seconds delay rather than a lag! like I move my hand and after 3 seconds it shows the movement in the app

I am working on taking the video will be posted soon.

arianatri commented 3 years ago

Lagging can be sigificiant if the device's gpu is not powerful enough. Basically, if the pipeline is running slow, it will accumulate more and more frames to process and also it will slow down the camera capturing and screen rendering if the app runs everything on GPU. Try setting RUN_ON_GPU to false to run the pipeline on CPU to see if it helps.

using CPU makes the detection very slow and laggy. and the problem (fatal signal 6) is still there.

arianatri commented 3 years ago

I got full log of this error :

2021-08-24 18:03:48.357 22507-22507/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-08-24 18:03:48.358 22507-22507/? A/DEBUG: Build fingerprint: 'samsung/a51nsxx/a51:10/QP1A.190711.020/A515FXXU4CUA1:user/release-keys'
2021-08-24 18:03:48.358 22507-22507/? A/DEBUG: Revision: '6'
2021-08-24 18:03:48.358 22507-22507/? A/DEBUG: ABI: 'arm64'
2021-08-24 18:03:48.359 22507-22507/? A/DEBUG: Timestamp: 2021-08-24 18:03:48+0430
2021-08-24 18:03:48.360 22507-22507/? A/DEBUG: pid: 17749, tid: 22428, name: Thread-15  >>> com.randompackagename.myapp <<<
2021-08-24 18:03:48.360 22507-22507/? A/DEBUG: uid: 10357
2021-08-24 18:03:48.360 22507-22507/? A/DEBUG: signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
2021-08-24 18:03:48.360 22507-22507/? A/DEBUG:     x0  0000000000000000  x1  000000000000579c  x2  0000000000000006  x3  00000077c78d97c0
2021-08-24 18:03:48.360 22507-22507/? A/DEBUG:     x4  473a3a6570697061  x5  473a3a6570697061  x6  473a3a6570697061  x7  7265666675427570
2021-08-24 18:03:48.360 22507-22507/? A/DEBUG:     x8  00000000000000f0  x9  ab400562e594e2a7  x10 0000000000000001  x11 0000000000000000
2021-08-24 18:03:48.360 22507-22507/? A/DEBUG:     x12 fffffff0fffffbdf  x13 6e61206465766965  x14 0000000000000010  x15 00000078a6159412
2021-08-24 18:03:48.360 22507-22507/? A/DEBUG:     x16 00000078a615f8c0  x17 00000078a613c940  x18 000000778e5d4000  x19 0000000000004555
2021-08-24 18:03:48.361 22507-22507/? A/DEBUG:     x20 000000000000579c  x21 00000000ffffffff  x22 00000077c78d9d80  x23 00000077accccb7a
2021-08-24 18:03:48.361 22507-22507/? A/DEBUG:     x24 00000077c78dc020  x25 00000077c78dc020  x26 000000000000002e  x27 0000000000000000
2021-08-24 18:03:48.361 22507-22507/? A/DEBUG:     x28 00000077c78d9b10  x29 00000077c78d9860
2021-08-24 18:03:48.361 22507-22507/? A/DEBUG:     sp  00000077c78d97a0  lr  00000078a60f1108  pc  00000078a60f1134
2021-08-24 18:03:48.462 22507-22507/? A/DEBUG: backtrace:
2021-08-24 18:03:48.462 22507-22507/? A/DEBUG:       #00 pc 0000000000083134  /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: 2e5014b39c80fbfdd68b1554b60542e2)
2021-08-24 18:03:48.462 22507-22507/? A/DEBUG:       #01 pc 0000000000f51584  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000)
2021-08-24 18:03:48.462 22507-22507/? A/DEBUG:       #02 pc 0000000000f50c60  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (google::LogMessage::SendToLog()+1068)
2021-08-24 18:03:48.462 22507-22507/? A/DEBUG:       #03 pc 0000000000f511f4  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (google::LogMessage::Flush()+220)
2021-08-24 18:03:48.462 22507-22507/? A/DEBUG:       #04 pc 0000000000f545a0  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (google::LogMessageFatal::~LogMessageFatal()+16)
2021-08-24 18:03:48.462 22507-22507/? A/DEBUG:       #05 pc 0000000000509c28  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (mediapipe::GpuBuffer const& mediapipe::Packet::Get<mediapipe::GpuBuffer>() const+220)
2021-08-24 18:03:48.462 22507-22507/? A/DEBUG:       #06 pc 0000000000508d24  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (Java_com_google_mediapipe_framework_PacketGetter_nativeGetGpuBuffer+92)
2021-08-24 18:03:48.462 22507-22507/? A/DEBUG:       #07 pc 0000000000140350  /apex/com.android.runtime/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.462 22507-22507/? A/DEBUG:       #08 pc 00000000001375b8  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.462 22507-22507/? A/DEBUG:       #09 pc 000000000014608c  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+276) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.462 22507-22507/? A/DEBUG:       #10 pc 00000000002dfde8  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #11 pc 00000000002db0c8  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #12 pc 000000000059c1c8  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+368) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #13 pc 0000000000131994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #14 pc 000000000009cf24  [anon:dalvik-classes5.dex extracted in memory from /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk!classes5.dex] (com.google.mediapipe.framework.PacketGetter.getTextureFrame+12)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #15 pc 000000000059c4c8  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #16 pc 0000000000131994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #17 pc 00000000000aacb8  [anon:dalvik-classes5.dex extracted in memory from /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk!classes5.dex] (com.google.mediapipe.solutioncore.ImageSolutionResult.acquireInputTextureFrame+12)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #18 pc 000000000059992c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #19 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #20 pc 00000000000ab4d8  [anon:dalvik-classes5.dex extracted in memory from /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk!classes5.dex] (com.google.mediapipe.solutioncore.SolutionGlSurfaceViewRenderer.setRenderData)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #21 pc 000000000059992c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #22 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #23 pc 00000000000ab5ec  [anon:dalvik-classes5.dex extracted in memory from /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk!classes5.dex] (com.google.mediapipe.solutioncore.SolutionGlSurfaceView.setRenderData+4)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #24 pc 000000000059992c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.463 22507-22507/? A/DEBUG:       #25 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #26 pc 000000000000117c  [anon:dalvik-classes3.dex extracted in memory from /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk!classes3.dex] (com.randompackagename.myapp.CameraActivity.lambda$setupStreamingModePipeline$3$CameraActivity+4)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #27 pc 000000000059992c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #28 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #29 pc 0000000000000d74  [anon:dalvik-classes3.dex extracted in memory from /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk!classes3.dex] (com.randompackagename.myapp.CameraActivity$$ExternalSyntheticLambda3.run+8)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #30 pc 000000000059b120  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1740) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #31 pc 0000000000131a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #32 pc 00000000000aad7c  [anon:dalvik-classes5.dex extracted in memory from /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk!classes5.dex] (com.google.mediapipe.solutioncore.OutputHandler.run+20)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #33 pc 000000000059992c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #34 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #35 pc 00000000000aaf44  [anon:dalvik-classes5.dex extracted in memory from /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk!classes5.dex] (com.google.mediapipe.solutioncore.SolutionBase$$ExternalSyntheticLambda0.process+4)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #36 pc 00000000002b0a34  /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.4949923168810918565+240) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #37 pc 000000000058ac24  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1012) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #38 pc 0000000000140468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #39 pc 0000000000137334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #40 pc 000000000014606c  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.464 22507-22507/? A/DEBUG:       #41 pc 00000000004aaa38  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #42 pc 00000000004abd88  /apex/com.android.runtime/lib64/libart.so (art::InvokeVirtualOrInterfaceWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+424) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #43 pc 00000000003939b0  /apex/com.android.runtime/lib64/libart.so (art::JNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+632) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #44 pc 0000000000368740  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType)+2372) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #45 pc 0000000000356aa8  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+72) (BuildId: 5fb7e63a8f4f3438ed333085cfa11554)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #46 pc 00000000004eb240  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+116)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #47 pc 00000000004e8f94  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (mediapipe::android::Graph::CallbackToJava(_JNIEnv*, _jobject*, std::__ndk1::vector<mediapipe::Packet, std::__ndk1::allocator<mediapipe::Packet>> const&)+708)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #48 pc 0000000000cdf640  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (mediapipe::tool::CallbackCalculator::Process(mediapipe::CalculatorContext*)+348)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #49 pc 0000000000d19384  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (mediapipe::CalculatorNode::ProcessNode(mediapipe::CalculatorContext*)+1016)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #50 pc 0000000000d06a84  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (mediapipe::internal::SchedulerQueue::RunCalculatorNode(mediapipe::CalculatorNode*, mediapipe::CalculatorContext*)+312)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #51 pc 0000000000d06500  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (mediapipe::internal::SchedulerQueue::RunNextTask()+232)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #52 pc 0000000000d3ac50  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (mediapipe::ThreadPool::RunWorker()+392)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #53 pc 0000000000d3a894  /data/app/com.randompackagename.myapp-ixgpSpxm2RiZra9jmIAWmA==/base.apk (offset 0x36d000) (mediapipe::ThreadPool::WorkerThread::ThreadBody(void*)+1388)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #54 pc 00000000000e28e0  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 2e5014b39c80fbfdd68b1554b60542e2)
2021-08-24 18:03:48.465 22507-22507/? A/DEBUG:       #55 pc 000000000008503c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 2e5014b39c80fbfdd68b1554b60542e2)
2021-08-24 18:03:49.281 4688-4688/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_08
2021-08-24 18:03:49.328 4570-4612/? E/BufferQueueProducer: [SurfaceView - com.randompackagename.myapp/com.randompackagename.myapp.CameraActivity@54d886c@0#0] disconnect: not connected (req=1)
2021-08-24 18:03:49.335 4498-4498/? E/audit: type=1701 audit(1629812029.328:21963): auid=4294967295 uid=10357 gid=10357 ses=4294967295 subj=u:r:untrusted_app:s0:c101,c257,c512,c768 pid=17749 comm="Thread-15" exe="/system/bin/app_process64" sig=6 res=1
2021-08-24 18:03:49.440 5048-5245/? E/InputDispatcher: channel 'd7beff3 com.randompackagename.myapp/com.randompackagename.myapp.CameraActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2021-08-24 18:03:49.440 5048-5245/? E/InputDispatcher: channel '97d6bd3 com.randompackagename.myapp/com.randompackagename.myapp.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2021-08-24 18:03:49.547 4607-22446/? E/Camera3-OutputStream: [VSync] getBufferLockedCommon: Stream 0: wait for dequeued buffer exceeds 30ms (209)ms
2021-08-24 18:03:49.547 4607-4769/? E/Surface: queueBuffer: error queuing buffer to SurfaceTexture, -32 [TransactFailed]
2021-08-24 18:03:49.547 4607-22446/? E/Camera3-OutputStream: getBufferLockedCommon: Stream 0: Can't dequeue next output buffer: Broken pipe (-32)
2021-08-24 18:03:49.547 4607-4769/? E/Camera3-OutputStream: [VSync] returnBufferCheckedLocked: Stream 0: wait for queue buffer exceeds 30ms (190)ms
2021-08-24 18:03:49.547 4607-4769/? E/Camera3-OutputStream: returnBufferCheckedLocked: Stream 0: Error queueing buffer to native window: Broken pipe (-32)
2021-08-24 18:03:49.547 4607-22446/? E/CameraDeviceClient: notifyError: pid=17749, errorCode=3
2021-08-24 18:03:49.547 4607-22446/? E/CameraDeviceClient: notifyError: pid=17749, skipClientNotification=false
2021-08-24 18:03:49.551 4607-31029/? E/CameraDeviceClient: notifyError: pid=17749, errorCode=0
2021-08-24 18:03:49.551 4607-31029/? E/CameraDeviceClient: notifyError: pid=17749, skipClientNotification=false
2021-08-24 18:03:49.551 4607-31029/? E/CameraDeviceClient: Disconnect from CameraDeviceClient
jiuqiant commented 3 years ago

Based on your log message, it seems to be an issue when getting the gpu image data. It's unclear to me what's going wrong. Probably need a samsung galaxy a51 device or similar to reproduce this. Unfortunately, I don't have any samsung devices on hand right now. Will go back to this issue when I get one.

arianatri commented 3 years ago

I tested the face effect sample (downloaded the apk from samples) and it seems fine! no error at all! But when I try to use the face mesh sample app it crashes... so my guess will be that openGL is faulty somehow.

jiuqiant commented 3 years ago

How about the face landmark prebuilt apk? It's available at https://google.github.io/mediapipe/solutions/face_mesh#face-landmark-example.

arianatri commented 3 years ago

@jiuqiant Face Effect Example is working fine (with no errors) Face Landmark Example has the same errors as mine(slow with 3-2 sec. delay and crashes after a while).

arianatri commented 3 years ago

@jiuqiant @sgowroji any progress yet?

jiuqiant commented 3 years ago

We fixed a bug that may potentially cause this issue and uploaded mediapipe 0.8.8-alpha-2 at https://maven.google.com/web/index.html?#com.google.mediapipe. Please let us know if the problem is solved.

google-ml-butler[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] commented 3 years ago

Closing as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] commented 3 years ago

Are you satisfied with the resolution of your issue? Yes No