Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Black Screen in Samsung S22 S23 ultra and some other devices when frame processor is on. #2301

Closed
4 of 5 tasks
satyajitdas95 opened this issue Dec 18, 2023 · 9 comments 路 Fixed by #2339
Closed
4 of 5 tasks
Labels
馃悰 bug Something isn't working

Comments

@satyajitdas95
Copy link

satyajitdas95 commented Dec 18, 2023

What's happening?

Whenever I am using frameprocessor the black screen is coming . Few devices i am listing below
Samsung s22 ultra
Samsung s23 Ultra
Oneplus 10R
Motorola Edge

With-out frameprocessor everything is fine. Probably resolution of processing frame and capturing in device causing the issue. as i debugged frameprocessor is working fine. Its able to detect faces wheather 1 or 2. That means only the preivew have the problem.

Reproduceable Code

const format = getCameraFormat(device, [
    {videoResolution: {width: 480, height: 720}},
    {fps: 30},
  ]);

const frameProcessor = useFrameProcessor(frame => {
    'worklet';

    try {
      runAtTargetFps(DETECTION_FPS, () => {
        // console.log(`Detected objects.`, data.number_of_faces);
        // setNumberOfFaces(data.number_of_faces);

        const data = detectFaces(frame);
        onFaceDetected(data.number_of_faces);

        // console.log('face number----', data.number_of_faces);

        // console.log(
        //   'face tilt data----',
        //   data.face_tilted_left,
        //   data.face_tilted_right,
        // );

        onFaceTiltDetected(data.face_tilted_left || data.face_tilted_right);
        // sv.value = data.number_of_faces;
        // console.log(`Detected objects.`, data.number_of_faces);
      });
    } catch (exception) {}
  }, []);

return (
    <SafeAreaView>
      <Camera
        ref={camera}
        style={StyleSheet.absoluteFill}
        device={device}
        // isActive={isFocussed}
        onInitialized={onInitialized}
        onError={onError}
        enableZoomGesture={true}
        zoom={0.6}
        photo={true}
        video={true}
        audio={false}
        format={format}
        pixelFormat="yuv"
        orientation="portrait"
        enableHighQualityPhotos={true}
        frameProcessor={frameProcessor}
      />

      {/* <CustomText
        style={{
          fontSize: 50,
          fontWeight: '800',
          color: 'red',
          top: '50%', // this will place it halfway down
          left: '50%', // this will place it halfway across
        }}>
        {numberOfFaces}
      </CustomText> */}
    </SafeAreaView>
  );
};

Relevant log output

2023-12-18 12:27:26.948 19617-20202 CameraSession           com.xxxxx.xxxxxx.debug        I  Successfully updated CameraSession Configuration! isActive: false
2023-12-18 12:27:26.950 19617-19634 CameraManagerGlobal     com.xxxxx.xxxxxx.debug        I  Camera 1 facing CAMERA_FACING_FRONT state now CAMERA_STATE_ACTIVE for client com.xxxxx.xxxxxx.debug API Level 2 User Id 0
2023-12-18 12:27:26.980 19617-19617 ViewRootIm...nActivity] com.xxxxx.xxxxxx.debug        I  onDisplayChanged oldDisplayState=2 newDisplayState=2
2023-12-18 12:27:27.079 19617-20203 VideoPipeline           com.xxxxx.xxxxxx.debug        I  ImageReader::onImageAvailable!
2023-12-18 12:27:27.079 19617-20203 VideoPipeline           com.xxxxx.xxxxxx.debug        I  Image Format: 35
2023-12-18 12:27:27.088 19617-32378 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBufferMultiPlanes.start()
2023-12-18 12:27:27.121 19617-32378 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBuffer.end()
2023-12-18 12:27:27.121 19617-32378 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBufferMultiPlanes.start()
2023-12-18 12:27:27.129 19617-32378 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBuffer.end()
2023-12-18 12:27:27.130 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces----1
2023-12-18 12:27:27.130 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  roll angle:4.3018637
2023-12-18 12:27:27.131 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  pitchAngle:13.791867
2023-12-18 12:27:27.131 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  yawAngle:-5.175568
2023-12-18 12:27:27.131 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  leftEyeOpenProbability:0.9515753
2023-12-18 12:27:27.131 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  rightEyeOpenProbability:0.995899
2023-12-18 12:27:27.135 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_CHEEK is an array
2023-12-18 12:27:27.135 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_CHEEK is an array
2023-12-18 12:27:27.135 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  NOSE_BRIDGE is an array
2023-12-18 12:27:27.136 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LOWER_LIP_TOP is an array
2023-12-18 12:27:27.136 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LOWER_LIP_BOTTOM is an array
2023-12-18 12:27:27.136 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  UPPER_LIP_BOTTOM is an array
2023-12-18 12:27:27.136 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  UPPER_LIP_TOP is an array
2023-12-18 12:27:27.136 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYE is an array
2023-12-18 12:27:27.136 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYE is an array
2023-12-18 12:27:27.136 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYEBROW_BOTTOM is an array
2023-12-18 12:27:27.136 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYEBROW_BOTTOM is an array
2023-12-18 12:27:27.136 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYEBROW_TOP is an array
2023-12-18 12:27:27.136 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYEBROW_TOP is an array
2023-12-18 12:27:27.136 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  NOSE_BOTTOM is an array
2023-12-18 12:27:27.136 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  FACE is an array
2023-12-18 12:27:27.136 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces222----1
2023-12-18 12:27:27.136 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces3333----1
2023-12-18 12:27:27.136 19617-20202 OpenGLContext           com.xxxxx.xxxxxx.debug        I  Initializing EGLDisplay..
2023-12-18 12:27:27.136 19617-20202 OpenGLContext           com.xxxxx.xxxxxx.debug        I  Initializing EGLConfig..
2023-12-18 12:27:27.137 19617-20202 OpenGLContext           com.xxxxx.xxxxxx.debug        I  Initializing EGLContext..
2023-12-18 12:27:27.138 19617-20202 OpenGLContext           com.xxxxx.xxxxxx.debug        I  Initializing 1x1 offscreen pbuffer EGLSurface..
2023-12-18 12:27:27.139 19617-20202 VideoPipeline           com.xxxxx.xxxxxx.debug        I  Attached Texture to Context 1
2023-12-18 12:27:27.139 19617-20202 nextlevel.debug         com.xxxxx.xxxxxx.debug        I  EglImage dataspace changed, need recreate
2023-12-18 12:27:27.153 19617-20203 VideoPipeline           com.xxxxx.xxxxxx.debug        I  ImageReader::onImageAvailable!
2023-12-18 12:27:27.153 19617-20203 VideoPipeline           com.xxxxx.xxxxxx.debug        I  Image Format: 35
2023-12-18 12:27:27.155 19617-32379 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBufferMultiPlanes.start()
2023-12-18 12:27:27.195 19617-32379 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBuffer.end()
2023-12-18 12:27:27.196 19617-32379 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBufferMultiPlanes.start()
2023-12-18 12:27:27.203 19617-32379 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBuffer.end()
2023-12-18 12:27:27.205 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces----1
2023-12-18 12:27:27.205 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  roll angle:3.4898055
2023-12-18 12:27:27.205 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  pitchAngle:13.622272
2023-12-18 12:27:27.205 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  yawAngle:-4.8422713
2023-12-18 12:27:27.205 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  leftEyeOpenProbability:0.6795901
2023-12-18 12:27:27.205 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  rightEyeOpenProbability:0.93697304
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_CHEEK is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_CHEEK is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  NOSE_BRIDGE is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LOWER_LIP_TOP is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LOWER_LIP_BOTTOM is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  UPPER_LIP_BOTTOM is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  UPPER_LIP_TOP is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYE is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYE is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYEBROW_BOTTOM is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYEBROW_BOTTOM is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYEBROW_TOP is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYEBROW_TOP is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  NOSE_BOTTOM is an array
2023-12-18 12:27:27.210 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  FACE is an array
2023-12-18 12:27:27.210 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces222----1
2023-12-18 12:27:27.210 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces3333----1
2023-12-18 12:27:27.211 19617-20203 VideoPipeline           com.xxxxx.xxxxxx.debug        I  ImageReader::onImageAvailable!
2023-12-18 12:27:27.211 19617-20203 VideoPipeline           com.xxxxx.xxxxxx.debug        I  Image Format: 35
2023-12-18 12:27:27.211 19617-20202 nextlevel.debug         com.xxxxx.xxxxxx.debug        I  EglImage dataspace changed, need recreate
2023-12-18 12:27:27.212 19617-32380 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBufferMultiPlanes.start()
2023-12-18 12:27:27.246 19617-32380 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBuffer.end()
2023-12-18 12:27:27.246 19617-32380 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBufferMultiPlanes.start()
2023-12-18 12:27:27.254 19617-32380 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBuffer.end()
2023-12-18 12:27:27.255 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces----1
2023-12-18 12:27:27.255 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  roll angle:2.5488517
2023-12-18 12:27:27.255 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  pitchAngle:10.8463
2023-12-18 12:27:27.255 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  yawAngle:-3.810643
2023-12-18 12:27:27.255 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  leftEyeOpenProbability:0.9825902
2023-12-18 12:27:27.255 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  rightEyeOpenProbability:0.9962117
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_CHEEK is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_CHEEK is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  NOSE_BRIDGE is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LOWER_LIP_TOP is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LOWER_LIP_BOTTOM is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  UPPER_LIP_BOTTOM is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  UPPER_LIP_TOP is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYE is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYE is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYEBROW_BOTTOM is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYEBROW_BOTTOM is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYEBROW_TOP is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYEBROW_TOP is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  NOSE_BOTTOM is an array
2023-12-18 12:27:27.260 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  FACE is an array
2023-12-18 12:27:27.260 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces222----1
2023-12-18 12:27:27.260 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces3333----1
2023-12-18 12:27:27.261 19617-20202 nextlevel.debug         com.xxxxx.xxxxxx.debug        I  EglImage dataspace changed, need recreate
2023-12-18 12:27:27.261 19617-20203 VideoPipeline           com.xxxxx.xxxxxx.debug        I  ImageReader::onImageAvailable!
2023-12-18 12:27:27.261 19617-20203 VideoPipeline           com.xxxxx.xxxxxx.debug        I  Image Format: 35
2023-12-18 12:27:27.262 19617-32381 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBufferMultiPlanes.start()
2023-12-18 12:27:27.300 19617-32381 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBuffer.end()
2023-12-18 12:27:27.301 19617-32381 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBufferMultiPlanes.start()
2023-12-18 12:27:27.308 19617-32381 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBuffer.end()
2023-12-18 12:27:27.310 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces----1
2023-12-18 12:27:27.310 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  roll angle:1.5458632
2023-12-18 12:27:27.310 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  pitchAngle:11.985293
2023-12-18 12:27:27.310 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  yawAngle:-2.9197173
2023-12-18 12:27:27.310 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  leftEyeOpenProbability:0.9497049
2023-12-18 12:27:27.310 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  rightEyeOpenProbability:0.995899
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_CHEEK is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_CHEEK is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  NOSE_BRIDGE is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LOWER_LIP_TOP is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LOWER_LIP_BOTTOM is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  UPPER_LIP_BOTTOM is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  UPPER_LIP_TOP is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYE is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYE is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYEBROW_BOTTOM is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYEBROW_BOTTOM is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYEBROW_TOP is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYEBROW_TOP is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  NOSE_BOTTOM is an array
2023-12-18 12:27:27.315 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  FACE is an array
2023-12-18 12:27:27.315 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces222----1
2023-12-18 12:27:27.315 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces3333----1
2023-12-18 12:27:27.316 19617-20203 VideoPipeline           com.xxxxx.xxxxxx.debug        I  ImageReader::onImageAvailable!
2023-12-18 12:27:27.316 19617-20202 nextlevel.debug         com.xxxxx.xxxxxx.debug        I  EglImage dataspace changed, need recreate
2023-12-18 12:27:27.316 19617-20203 VideoPipeline           com.xxxxx.xxxxxx.debug        I  Image Format: 35
2023-12-18 12:27:27.317 19617-32382 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBufferMultiPlanes.start()
2023-12-18 12:27:27.356 19617-32382 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBuffer.end()
2023-12-18 12:27:27.357 19617-32382 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBufferMultiPlanes.start()
2023-12-18 12:27:27.364 19617-32382 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBuffer.end()
2023-12-18 12:27:27.366 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces----1
2023-12-18 12:27:27.366 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  roll angle:1.3437126
2023-12-18 12:27:27.366 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  pitchAngle:10.697997
2023-12-18 12:27:27.366 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  yawAngle:-2.856316
2023-12-18 12:27:27.366 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  leftEyeOpenProbability:0.9845511
2023-12-18 12:27:27.366 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  rightEyeOpenProbability:0.995899
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_CHEEK is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_CHEEK is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  NOSE_BRIDGE is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LOWER_LIP_TOP is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LOWER_LIP_BOTTOM is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  UPPER_LIP_BOTTOM is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  UPPER_LIP_TOP is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYE is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYE is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYEBROW_BOTTOM is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYEBROW_BOTTOM is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYEBROW_TOP is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYEBROW_TOP is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  NOSE_BOTTOM is an array
2023-12-18 12:27:27.371 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  FACE is an array
2023-12-18 12:27:27.371 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces222----1
2023-12-18 12:27:27.371 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces3333----1
2023-12-18 12:27:27.372 19617-20202 nextlevel.debug         com.xxxxx.xxxxxx.debug        I  EglImage dataspace changed, need recreate
2023-12-18 12:27:27.372 19617-20203 VideoPipeline           com.xxxxx.xxxxxx.debug        I  ImageReader::onImageAvailable!
2023-12-18 12:27:27.372 19617-20203 VideoPipeline           com.xxxxx.xxxxxx.debug        I  Image Format: 35
2023-12-18 12:27:27.373 19617-32383 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBufferMultiPlanes.start()
2023-12-18 12:27:27.412 19617-32383 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBuffer.end()
2023-12-18 12:27:27.412 19617-32383 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBufferMultiPlanes.start()
2023-12-18 12:27:27.420 19617-32383 FaceDetectorV2Jni       com.xxxxx.xxxxxx.debug        V  detectFacesImageByteBuffer.end()
2023-12-18 12:27:27.421 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces----1
2023-12-18 12:27:27.421 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  roll angle:0.660963
2023-12-18 12:27:27.421 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  pitchAngle:9.012748
2023-12-18 12:27:27.421 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  yawAngle:-3.3791087
2023-12-18 12:27:27.421 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  leftEyeOpenProbability:0.9493871
2023-12-18 12:27:27.421 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  rightEyeOpenProbability:0.9974306
2023-12-18 12:27:27.426 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_CHEEK is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_CHEEK is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  NOSE_BRIDGE is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LOWER_LIP_TOP is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LOWER_LIP_BOTTOM is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  UPPER_LIP_BOTTOM is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  UPPER_LIP_TOP is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYE is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYE is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYEBROW_BOTTOM is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYEBROW_BOTTOM is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  LEFT_EYEBROW_TOP is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  RIGHT_EYEBROW_TOP is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  NOSE_BOTTOM is an array
2023-12-18 12:27:27.427 19617-20203 CONTOURS_LOG            com.xxxxx.xxxxxx.debug        D  FACE is an array
2023-12-18 12:27:27.427 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces222----1
2023-12-18 12:27:27.427 19617-20203 FaceDetectorPluginTag   com.xxxxx.xxxxxx.debug        D  total number of faces3333----1

Camera Device

{
  "sensorOrientation": "landscape-left",
  "hardwareLevel": "full",
  "maxZoom": 8,
  "minZoom": 1,
  "supportsLowLightBoost": false,
  "neutralZoom": 1,
  "physicalDevices": [
    "wide-angle-camera"
  ],
  "supportsFocus": true,
  "supportsRawCapture": true,
  "isMultiCam": false,
  "name": "FRONT (1)",
  "hasFlash": false,
  "hasTorch": false,
  "position": "front",
  "id": "1"
}

Device

Samsung s22 ultra Android 13 and Android 14,Samsung s23 Ultra Android 13 and Android 14, Oneplus 10R Android 13,Motorola Edge Android 13

VisionCamera Version

3.6.17

Can you reproduce this issue in the VisionCamera Example app?

Yes, I can reproduce the same issue in the Example app here

Additional information

@satyajitdas95 satyajitdas95 added the 馃悰 bug Something isn't working label Dec 18, 2023
@vijaykhandal1290
Copy link

@satyajitdas95 can you give me your sample code with import package. Because i am also facing same type of issue.

@jaimeneto85
Copy link

looks like duplicate. It's same issue: #2291

@thiagosimon
Copy link

thiagosimon commented Dec 18, 2023

Hey, guys!

I encountered an issue in my app on Android 11 physical devices. The successful solution for reading QR codes involved the following settings:

"react-native-vision-camera": "3.6.12",
"react-native-worklets-core": "^0.2.2",
"react-native": "0.72.7"

If you're using CodeScanner, you can achieve success with just the following statement:

const onCodeScanned = useMemo(() => {
    return {
        codeTypes: ['qr'],
        onCodeScanned: !isActive
            ? () => null
            : (codes: Code[]) => {
                // Reading performed
            },
    };
}, []);

I had to lock the library version at 3.6.12, and at least for me, this solution worked.
I hope it helps you too!

@sudeepgupta11
Copy link

I am also facing the same issue with Samsung A Series devices.

@CodeReset
Copy link

I sometimes encounter a black screen or black stripes during takeSnapshot on version 2.15.2 of react-native-vision-camera. It may not be related to react-native-vision-camera but rather to Android 14, Samsung 22, or Samsung 23. I haven't been able to reproduce the issue on other devices.

@Imamyable
Copy link

Imamyable commented Dec 20, 2023

Maybe something that might narrow down the possible causes of the error. I have tested it on two different samsung phones (s20 and s22 and for me the problem seems to appear when

  • frameprocessors are enabled
  • pixelFormat is set to yuv
  • android version is 11

When I'm using the s22 phone with android 13, frameproccessors on and pixelformat yuv everything seems to work well. I'm thinking there might be an issue with the available pixelformats on different android versions?

I've been trying to read the docs for the different androud versions and I'm not sure its a dead end, Both android versions shoud support the pixelformat YUV_420_888 that is specified in the lib. But I'm thinking there might be something that makes the selected format fall back to native.
Maybe someone else can get some ideas from my findings?

Android docs:
https://source.android.com/docs/compatibility/11/android-11-cdd#7_5_4_camera_api_behavior
https://source.android.com/docs/compatibility/13/android-13-cdd#754_camera_api_behavior

@ambrishshukla001
Copy link

same issue always open black screen camera is not opening

@Keyur-Rao
Copy link

Keyur-Rao commented Dec 28, 2023

Stylesheet.absoluteFill is required it not applied then getting white screen and without SafeAreaView black screen appeared.


@mrousavy
Copy link
Owner

mrousavy commented Jan 5, 2024

Hey! Thanks for reporting this issue.

I've been working the past days on making sure the Camera lifecycle is safely handled and released when needed, so this crash doesn't occur anymore.

I just created a PR for this - can you please this to see if that fixes the issue for you? #2339

If this fixes your issue, please consider 馃挅 sponsoring me on GitHub 馃挅 to support me / thank me for building VisionCamera and continuously improving it.

If this does not fix your issue, please clone the repo, check out the branch fix/blackscreen (the PR above), run the Example app, reproduce your issue there and share the adb logcat logs with me (upload to pastebin or gist) so I can investigate this further.

Thank you! 馃檹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃悰 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants