pedroSG94 / RTSP-Server

Plugin of rtmp-rtsp-stream-client-java to stream directly to RTSP player.
Apache License 2.0
199 stars 63 forks source link

Can I set the resolution of surfaceView to 1280*720, then set the resolution for rtsp client displaying to a lower value. #129

Closed Shaooooo closed 1 week ago

Shaooooo commented 2 weeks ago

I try to use 1280720 in Camera1Base.class and prepareVideo(1280, 720, 20, 1200 1024, rotation). It could be displaying normal on android device screen. but I try to test the rtsp client by VLC media player. The screen was so bad in VLC.

pedroSG94 commented 2 weeks ago

Hello,

Your bitrate is really low for 1280720 resolution try with: 4000 1000 You have a guide of bitrate here: https://support.google.com/youtube/answer/2853702?hl=en

Shaooooo commented 2 weeks ago

Hello,

Your bitrate is really low for 1280720 resolution try with: 4000 1000 You have a guide of bitrate here: https://support.google.com/youtube/answer/2853702?hl=en

Hi bro, thanks for your reply. I've tried to change the value of bitrate, the screen(1280720) still looks stutter and unstable, also create connection slowly. Is there any other way to make the video(1280720) playing smoothly?

There are two videos which is 1280720 and 640360 difference.

https://github.com/user-attachments/assets/0d1e1de3-0ac6-4541-8cc9-4bf40268fd35

https://github.com/user-attachments/assets/d0140fe2-4ea7-4f7c-9ef4-5d114f708791

pedroSG94 commented 2 weeks ago

Hello,

If you are using a SurfaceView, please replace it with a OpenGlView because SurfaceView performance is much worse than OpenGlView using camera1. The reason is that with SurfaceView the video frame are handled using CPU (I modify manually byte array from camera to rotate it) producing a low fps.

Shaooooo commented 2 weeks ago

Hello,

If you are using a SurfaceView, please replace it with a OpenGlView because SurfaceView performance is much worse than OpenGlView using camera1. The reason is that with SurfaceView the video frame are handled using CPU (I modify manually byte array from camera to rotate it) producing a low fps.

Hello, I was using AutoFitTextureView.class. I'll try your suggestion. By the way , is there a wiki about OpenGlView?

pedroSG94 commented 2 weeks ago

I haven't a wiki. You only need use OpenGlView class in the XML adding this param to the XML view:

      app:aspectRatioMode="adjust"

For example:

    <com.pedro.library.view.OpenGlView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/surfaceView"
      app:aspectRatioMode="adjust"
      />

In the Activity you need replace your surfaceTextureListener to (the code inside callbacks is the equivalent to the app example):

openglview.holder.addCallback(object: SurfaceHolder.Callback {
      override fun surfaceCreated(holder: SurfaceHolder) {
      }

      override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {
        if (!rtspServerCamera1.isOnPreview) {
          rtspServerCamera1.startPreview()
          adaptPreview()
        }
      }

      override fun surfaceDestroyed(holder: SurfaceHolder) {
          if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && rtspServerCamera1.isRecording) {
            rtspServerCamera1.stopRecord()
            bRecord.setBackgroundResource(R.drawable.record_icon)
            PathUtils.updateGallery(this, recordPath)
          }
          if (rtspServerCamera1.isStreaming) {
            rtspServerCamera1.stopStream()
            bStream.setImageResource(R.drawable.stream_icon)
          }
          if (rtspServerCamera1.isOnPreview) rtspServerCamera1.stopPreview()
          ScreenOrientation.unlockScreen(this)
      }

    })
Shaooooo commented 2 weeks ago

I haven't a wiki. You only need use OpenGlView class in the XML adding this param to the XML view:

      app:aspectRatioMode="adjust"

For example:

    <com.pedro.library.view.OpenGlView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/surfaceView"
      app:aspectRatioMode="adjust"
      />

In the Activity you need replace your surfaceTextureListener to (the code inside callbacks is the equivalent to the app example):

openglview.holder.addCallback(object: SurfaceHolder.Callback {
      override fun surfaceCreated(holder: SurfaceHolder) {
      }

      override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {
        if (!rtspServerCamera1.isOnPreview) {
          rtspServerCamera1.startPreview()
          adaptPreview()
        }
      }

      override fun surfaceDestroyed(holder: SurfaceHolder) {
          if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && rtspServerCamera1.isRecording) {
            rtspServerCamera1.stopRecord()
            bRecord.setBackgroundResource(R.drawable.record_icon)
            PathUtils.updateGallery(this, recordPath)
          }
          if (rtspServerCamera1.isStreaming) {
            rtspServerCamera1.stopStream()
            bStream.setImageResource(R.drawable.stream_icon)
          }
          if (rtspServerCamera1.isOnPreview) rtspServerCamera1.stopPreview()
          ScreenOrientation.unlockScreen(this)
      }

    })

Hello. First Thanks a lot, Now my OpenGlView and VLC client are all work good. Second there is a new problem. When I use OpenGlView, the code runs into the red rect. It makes the callback method public void onPreviewFrame(byte[] data, Camera camera) no response. image

Why there is no set callback. If I add the code camera.setPreviewCallback(this); in the red rect. Is it allowed?

pedroSG94 commented 2 weeks ago

Hello,

You don't need a callback using OpenGlView because the VideoEncoder is using a surface to render video frames instead of use byte arrays. It is allowed but no recommended. You shouldn't use the callback because it is not needed (you are feeding VideoEncoder rendering a surface so send byte arrays is not needed). Also, you will need modify the library a bit to avoid send byte arrays to VideoEncoder and the CPU usage will be higher because you are working with that byte arrays.

Shaooooo commented 2 weeks ago

Hello,

You don't need a callback using OpenGlView because the VideoEncoder is using a surface to render video frames instead of use byte arrays. It is allowed but no recommended. You shouldn't use the callback because it is not needed (you are feeding VideoEncoder rendering a surface so send byte arrays is not needed). Also, you will need modify the library a bit to avoid send byte arrays to VideoEncoder and the CPU usage will be higher because you are working with that byte arrays.

I got it. actually I really need the nv21 data from the camera frame callback to my APP logic, If I can't get it from onPreviewFrame, is there any other way get it?

pedroSG94 commented 2 weeks ago

You have other way but using camera2. The only problem is that your app need min API 21 (in most of cases it is not a problem). You only need replace RstpServerCamera1 to RstpServerCamera2. After that you can use this method to receive frames in yuv from the camera2:

   //listen for yuv images. Call it any time after the preview is started
    rstpServerCamera2.addImageListener(ImageFormat.YUV_420_888, 1) { image ->
      //this must be without a thread because image class is released after this callback
      val buffer = image.planes[0].buffer
      val yuv = ByteArray(buffer.capacity())
      buffer.get(yuv)
      //recommended create a thread now and use the yuv byte array in that thread to avoid block this callback
    }

    //stop listen for yuv images
    rstpServerCamera2.removeImageListener()
Shaooooo commented 2 weeks ago

You have other way but using camera2. The only problem is that your app need min API 21 (in most of cases it is not a problem). You only need replace RstpServerCamera1 to RstpServerCamera2. After that you can use this method to receive frames in yuv from the camera2:

   //listen for yuv images. Call it any time after the preview is started
    rstpServerCamera2.addImageListener(ImageFormat.YUV_420_888, 1) { image ->
      //this must be without a thread because image class is released after this callback
      val buffer = image.planes[0].buffer
      val yuv = ByteArray(buffer.capacity())
      buffer.get(yuv)
      //recommended create a thread now and use the yuv byte array in that thread to avoid block this callback
    }

    //stop listen for yuv images
    rstpServerCamera2.removeImageListener()

Hello. Mr I've tried to use rstpServerCamera2 and OpenGlView. When I run App with them, the screen is black.

use camera2 and openGlView

code snippet 1

code snippet 2

I'm sure that use camera1 and AutoFitTextureView was work good.

Shaooooo commented 2 weeks ago

You have other way but using camera2. The only problem is that your app need min API 21 (in most of cases it is not a problem). You only need replace RstpServerCamera1 to RstpServerCamera2. After that you can use this method to receive frames in yuv from the camera2:

   //listen for yuv images. Call it any time after the preview is started
    rstpServerCamera2.addImageListener(ImageFormat.YUV_420_888, 1) { image ->
      //this must be without a thread because image class is released after this callback
      val buffer = image.planes[0].buffer
      val yuv = ByteArray(buffer.capacity())
      buffer.get(yuv)
      //recommended create a thread now and use the yuv byte array in that thread to avoid block this callback
    }

    //stop listen for yuv images
    rstpServerCamera2.removeImageListener()

Hello. Mr I've tried to use rstpServerCamera2 and OpenGlView. When I run App with them, the screen is black.

use camera2 and openGlView

code snippet 1

code snippet 2

I'm sure that use camera1 and AutoFitTextureView was work good.

04-05 00:35:18.229 20062 20062 D gjx : CameraDemoActivity onCreate: =========================================================================================== 04-05 00:35:18.460 20062 20062 D gjx : surfaceCreated: 04-05 00:35:18.460 20062 20062 I CameraManagerGlobal: Connecting to camera service 04-05 00:35:18.465 353 12218 W ServiceManager: Permission failure: android.permission.CAMERA_OPEN_CLOSE_LISTENER from uid=10121 pid=20062 04-05 00:35:18.483 20062 20100 E SurfaceManager: GL already released 04-05 00:35:18.506 20062 20100 I SurfaceManager: GL initialized 04-05 00:35:18.516 268 726 D gps_ql : Error connecting rild-nmea (Connection refused) 04-05 00:35:18.516 268 726 D gps_ql : fail to open GPS channel ! 04-05 00:35:18.522 20062 20100 E SurfaceManager: GL already released 04-05 00:35:18.543 20062 20100 I SurfaceManager: GL initialized 04-05 00:35:18.553 20062 20062 I Camera2ApiManager: optimal resolution set to: 640x480 04-05 00:35:18.560 20062 20062 E SurfaceView: Exception configuring surface 04-05 00:35:18.560 20062 20062 E SurfaceView: java.lang.IllegalArgumentException: cameraId was null 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:717) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:653) 04-05 00:35:18.560 20062 20062 E SurfaceView: at com.pedro.encoder.input.video.Camera2ApiManager.openCameraId(Camera2ApiManager.java:820) 04-05 00:35:18.560 20062 20062 E SurfaceView: at com.pedro.library.base.Camera2Base.startPreview(Camera2Base.java:528) 04-05 00:35:18.560 20062 20062 E SurfaceView: at com.pedro.library.base.Camera2Base.startPreview(Camera2Base.java:511) 04-05 00:35:18.560 20062 20062 E SurfaceView: at com.pedro.library.base.Camera2Base.startPreview(Camera2Base.java:545) 04-05 00:35:18.560 20062 20062 E SurfaceView: at com.pedro.library.base.Camera2Base.startPreview(Camera2Base.java:562) 04-05 00:35:18.560 20062 20062 E SurfaceView: at com.pedro.library.base.Camera2Base.startPreview(Camera2Base.java:571) 04-05 00:35:18.560 20062 20062 E SurfaceView: at com.pedro.sample.CameraDemoActivity$onCreate$1.surfaceCreated(CameraDemoActivity.kt:74) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.view.SurfaceView.updateSurface(SurfaceView.java:1153) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.view.SurfaceView.lambda$new$0$SurfaceView(SurfaceView.java:173) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.view.-$$Lambda$SurfaceView$w68OV7dB_zKVNsA-r0IrAUtyWas.onPreDraw(Unknown Source:2) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1093) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3094) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1948) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8177) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.view.Choreographer.doCallbacks(Choreographer.java:796) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.view.Choreographer.doFrame(Choreographer.java:731) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.os.Handler.handleCallback(Handler.java:938) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.os.Handler.dispatchMessage(Handler.java:99) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.os.Looper.loop(Looper.java:223) 04-05 00:35:18.560 20062 20062 E SurfaceView: at android.app.ActivityThread.main(ActivityThread.java:7664) 04-05 00:35:18.560 20062 20062 E SurfaceView: at java.lang.reflect.Method.invoke(Native Method) 04-05 00:35:18.560 20062 20062 E SurfaceView: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 04-05 00:35:18.560 20062 20062 E SurfaceView: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 04-05 00:35:18.579 224 226 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 00:35:18.579 224 226 D gralloc4: got new private_handle_t instance @0xb400006f4562aad0 for buffer 'com.pedro.sample/com.pedro.sample.CameraDemoActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 1280, height : 720, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677418, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 00:35:18.579 224 226 D gralloc4: plane_info[0]: offset : 0, byte_stride : 5120, alloc_width : 1280, alloc_height : 720 04-05 00:35:18.579 224 226 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 00:35:18.607 20062 20085 I OpenGLRenderer: Davey! duration=707ms; Flags=1, IntendedVsync=86755337962204, Vsync=86755754628854, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=86755763575297, AnimationStart=86755763668922, PerformTraversalsStart=86755766013922, DrawStart=86756036806908, SyncQueued=86756038778283, SyncStart=86756039300950, IssueDrawCommandsStart=86756039426075, SwapBuffers=86756042868033, FrameCompleted=86756045671825, DequeueBufferDuration=892500, QueueBufferDuration=1595709, GpuCompleted=435607035081224, 04-05 00:35:18.619 444 471 I ActivityTaskManager: Displayed com.pedro.sample/.CameraDemoActivity: +804ms 04-05 00:35:18.649 224 226 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 00:35:18.649 224 226 D gralloc4: got new private_handle_t instance @0xb400006f45629d50 for buffer 'com.pedro.sample/com.pedro.sample.CameraDemoActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 1280, height : 720, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677419, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 00:35:18.649 224 226 D gralloc4: plane_info[0]: offset : 0, byte_stride : 5120, alloc_width : 1280, alloc_height : 720 04-05 00:35:18.649 224 226 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 00:35:18.659 444 29889 W ActivityManager: Unable to start service Intent { cmp=com.zkteco.edk.hardware.encrypt.service/.ZkCheckActivationService } U=0: not found 04-05 00:35:18.660 17853 17893 E ADK-TASK:ZkLoopJob.executeJobInThreadPool(L:157): JOB_CHECK_ACTIVATION execute failed, task ZkCheckActivationEndTask running failed. error code:-1 04-05 00:35:18.678 444 915 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.CameraDemoActivity} -- com.pedro.sample -- mode=0 04-05 00:35:18.837 444 467 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.CameraDemoActivity} -- com.pedro.sample -- mode=0 04-05 00:35:18.838 444 467 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.CameraDemoActivity} -- com.pedro.sample -- mode=0 04-05 00:35:18.849 444 466 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.CameraDemoActivity} -- com.pedro.sample -- mode=0 04-05 00:35:18.868 184 441 E BufferQueueProducer: com.pedro.sample/com.pedro.sample.MainActivity#0 disconnect: not connected (req=1) 04-05 00:35:18.876 20062 20085 W libEGL : EGLNativeWindowType 0xb4000079a5167230 disconnect failed 04-05 00:35:18.937 2520 2556 V ADK-TASK:f.c(L:15): finish execute ZkCheckActivationServiceTask 04-05 00:35:18.937 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationServiceTask execute finished, cast time:1206, ret:0 04-05 00:35:18.938 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationServerTask start execute 04-05 00:35:18.938 2520 2556 V ADK-TASK:m.c(L:1): start execute ZkStartActivationServerTask 04-05 00:35:18.939 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationServerTask execute finished, cast time:0, ret:0 04-05 00:35:18.939 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationClientTask start execute 04-05 00:35:18.940 2520 2556 V ADK-TASK:l.c(L:1): start execute ZkStartActivationClientTask 04-05 00:35:18.940 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationClientTask execute finished, cast time:1, ret:0 04-05 00:35:18.940 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckLocalStorageActivationTask start execute 04-05 00:35:18.941 2520 2556 V ADK-TASK:h.c(L:1): start execute ZkCheckLocalStorageActivationTask 04-05 00:35:18.941 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckLocalStorageActivationTask execute finished, cast time:1, ret:0 04-05 00:35:18.942 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckSoftwareActivationTask start execute 04-05 00:35:18.942 2520 2556 V ADK-TASK:j.c(L:1): start execute ZkCheckSoftwareActivationTask 04-05 00:35:18.942 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckSoftwareActivationTask execute finished, cast time:1, ret:0 04-05 00:35:18.943 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckHardwareActivationTask start execute 04-05 00:35:18.943 2520 2556 V ADK-TASK:g.c(L:1): start execute ZkCheckHardwareActivationTask 04-05 00:35:18.943 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckHardwareActivationTask execute finished, cast time:1, ret:0 04-05 00:35:18.944 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationEndTask start execute 04-05 00:35:18.944 2520 2556 V ADK-TASK:e.c(L:1): start execute ZkCheckActivationEndTask 04-05 00:35:18.944 2520 2556 V ADK-TASK:e.c(L:5): finish execute ZkCheckActivationEndTask 04-05 00:35:18.945 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationEndTask execute finished, cast time:1, ret:-1 04-05 00:35:18.946 2520 2556 E ADK-TASK:o.l(L:27): JOB_CHECK_ACTIVATION execute failed, task ZkCheckActivationEndTask running failed. error code:-1 04-05 00:35:19.516 268 726 D gps_ql : Error connecting rild-nmea (Connection refused) 04-05 00:35:19.517 268 726 D gps_ql : fail to open GPS channel ! 04-05 00:35:19.552 2520 2543 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_RUNTIME Task:ZkCheckRuntimeTask start execute 04-05 00:35:19.553 2520 2543 V ADK-TASK:i.c(L:1): start execute ZkCheckRuntimeTask 04-05 00:35:19.553 2520 2543 V ADK-TASK:i.c(L:6): finish execute ZkCheckRuntimeTask 04-05 00:35:19.554 2520 2543 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_RUNTIME Task:ZkCheckRuntimeTask execute finished, cast time:3, ret:0 04-05 00:35:20.517 268 726 D gps_ql : Error connecting rild-nmea (Connection refused) 04-05 00:35:20.517 268 726 D gps_ql : fail to open GPS channel ! 04-05 00:35:18.857 444 466 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.CameraDemoActivity} -- com.pedro.sample -- mode=0 04-05 00:35:20.662 444 29889 W ActivityManager: Unable to start service Intent { cmp=com.zkteco.edk.hardware.encrypt.service/.ZkCheckActivationService } U=0: not found 04-05 00:35:20.664 17853 17893 E ADK-TASK:ZkLoopJob.executeJobInThreadPool(L:157): JOB_CHECK_ACTIVATION execute failed, task ZkCheckActivationEndTask running failed. error code:-1 04-05 00:35:20.836 444 1114 E TaskPersister: File error accessing recents directory (directory doesn't exist?). 04-05 00:35:20.947 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationServiceTask start execute 04-05 00:35:20.948 2520 2556 V ADK-TASK:f.c(L:1): start execute ZkCheckActivationServiceTask 04-05 00:35:20.952 444 29889 W ActivityManager: Unable to start service Intent { cmp=com.zkteco.edk.hardware.encrypt.service/.ZkCheckActivationService } U=0: not found 04-05 00:35:21.035 254 18919 D AudioHardwareTiny: do_out_standby,out = 0xed8c01e0,device = 0x8 04-05 00:35:21.032 0 0 I : rk817_digital_mute 1 04-05 00:35:21.037 254 18919 D alsa_route: route_set_controls() set route 24 04-05 00:35:21.038 254 18919 D AudioHardwareTiny: close device 04-05 00:35:21.034 0 0 I rk817_playback_path_put: set playback_path 0, pre_path 4 04-05 00:35:21.041 444 29889 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4 04-05 00:35:21.518 268 726 D gps_ql : Error connecting rild-nmea (Connection refused) 04-05 00:35:21.518 268 726 D gps_ql : fail to open GPS channel ! 04-05 00:35:21.556 2520 2543 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_RUNTIME Task:ZkCheckRuntimeTask start execute 04-05 00:35:21.557 2520 2543 V ADK-TASK:i.c(L:1): start execute ZkCheckRuntimeTask 04-05 00:35:21.557 2520 2543 V ADK-TASK:i.c(L:6): finish execute ZkCheckRuntimeTask 04-05 00:35:21.558 2520 2543 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_RUNTIME Task:ZkCheckRuntimeTask execute finished, cast time:3, ret:0 04-05 00:35:22.155 2520 2556 V ADK-TASK:f.c(L:15): finish execute ZkCheckActivationServiceTask 04-05 00:35:22.156 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationServiceTask execute finished, cast time:1209, ret:0 04-05 00:35:22.158 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationServerTask start execute 04-05 00:35:22.158 2520 2556 V ADK-TASK:m.c(L:1): start execute ZkStartActivationServerTask 04-05 00:35:22.159 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationServerTask execute finished, cast time:1, ret:0 04-05 00:35:22.160 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationClientTask start execute 04-05 00:35:22.161 2520 2556 V ADK-TASK:l.c(L:1): start execute ZkStartActivationClientTask 04-05 00:35:22.162 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationClientTask execute finished, cast time:2, ret:0 04-05 00:35:22.163 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckLocalStorageActivationTask start execute 04-05 00:35:22.164 2520 2556 V ADK-TASK:h.c(L:1): start execute ZkCheckLocalStorageActivationTask 04-05 00:35:22.165 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckLocalStorageActivationTask execute finished, cast time:2, ret:0 04-05 00:35:22.166 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckSoftwareActivationTask start execute 04-05 00:35:22.167 2520 2556 V ADK-TASK:j.c(L:1): start execute ZkCheckSoftwareActivationTask 04-05 00:35:22.168 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckSoftwareActivationTask execute finished, cast time:2, ret:0 04-05 00:35:22.169 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckHardwareActivationTask start execute 04-05 00:35:22.169 2520 2556 V ADK-TASK:g.c(L:1): start execute ZkCheckHardwareActivationTask 04-05 00:35:22.170 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckHardwareActivationTask execute finished, cast time:2, ret:0 04-05 00:35:22.171 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationEndTask start execute 04-05 00:35:22.172 2520 2556 V ADK-TASK:e.c(L:1): start execute ZkCheckActivationEndTask 04-05 00:35:22.173 2520 2556 V ADK-TASK:e.c(L:5): finish execute ZkCheckActivationEndTask 04-05 00:35:22.174 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationEndTask execute finished, cast time:2, ret:-1 04-05 00:35:22.175 2520 2556 E ADK-TASK:o.l(L:27): JOB_CHECK_ACTIVATION execute failed, task ZkCheckActivationEndTask running failed. error code:-1 04-05 00:35:22.519 268 726 D gps_ql : Error connecting rild-nmea (Connection refused) 04-05 00:35:22.519 268 726 D gps_ql : fail to open GPS channel ! 04-05 00:35:22.669 17853 17893 E ADK-TASK:ZkLoopJob.executeJobInThreadPool(L:157): JOB_CHECK_ACTIVATION execute failed, task ZkCheckActivationEndTask running failed. error code:-1 04-05 00:35:23.519 268 726 D gps_ql : Error connecting rild-nmea (Connection refused) 04-05 00:35:23.520 268 726 D gps_ql : fail to open GPS channel ! 04-05 00:35:23.560 2520 2543 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_RUNTIME Task:ZkCheckRuntimeTask start execute 04-05 00:35:23.561 2520 2543 V ADK-TASK:i.c(L:1): start execute ZkCheckRuntimeTask 04-05 00:35:23.561 2520 2543 V ADK-TASK:i.c(L:6): finish execute ZkCheckRuntimeTask 04-05 00:35:23.562 2520 2543 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_RUNTIME Task:ZkCheckRuntimeTask execute finished, cast time:3, ret:0 04-05 00:35:24.090 0 0 W : [drm] vp1 Esmart0-win0 act_w[33] MODE 16 == 1 04-05 00:35:24.176 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationServiceTask start execute 04-05 00:35:24.176 2520 2556 V ADK-TASK:f.c(L:1): start execute ZkCheckActivationServiceTask 04-05 00:35:24.520 268 726 D gps_ql : Error connecting rild-nmea (Connection refused) 04-05 00:35:24.520 268 726 D gps_ql : fail to open GPS channel ! 04-05 00:35:24.671 17853 17893 E ADK-TASK:ZkLoopJob.executeJobInThreadPool(L:157): JOB_CHECK_ACTIVATION execute failed, task ZkCheckActivationEndTask running failed. error code:-1 04-05 00:35:25.380 2520 2556 V ADK-TASK:f.c(L:15): finish execute ZkCheckActivationServiceTask 04-05 00:35:25.381 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationServiceTask execute finished, cast time:1205, ret:0 04-05 00:35:25.381 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationServerTask start execute 04-05 00:35:25.382 2520 2556 V ADK-TASK:m.c(L:1): start execute ZkStartActivationServerTask 04-05 00:35:25.382 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationServerTask execute finished, cast time:1, ret:0 04-05 00:35:25.383 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationClientTask start execute 04-05 00:35:25.384 2520 2556 V ADK-TASK:l.c(L:1): start execute ZkStartActivationClientTask 04-05 00:35:25.385 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationClientTask execute finished, cast time:1, ret:0 04-05 00:35:25.386 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckLocalStorageActivationTask start execute 04-05 00:35:25.386 2520 2556 V ADK-TASK:h.c(L:1): start execute ZkCheckLocalStorageActivationTask 04-05 00:35:25.389 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckLocalStorageActivationTask execute finished, cast time:1, ret:0 04-05 00:35:25.392 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckSoftwareActivationTask start execute 04-05 00:35:25.393 2520 2556 V ADK-TASK:j.c(L:1): start execute ZkCheckSoftwareActivationTask 04-05 00:35:25.394 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckSoftwareActivationTask execute finished, cast time:3, ret:0 04-05 00:35:25.394 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckHardwareActivationTask start execute 04-05 00:35:25.395 2520 2556 V ADK-TASK:g.c(L:1): start execute ZkCheckHardwareActivationTask 04-05 00:35:25.395 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckHardwareActivationTask execute finished, cast time:1, ret:0 04-05 00:35:25.396 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationEndTask start execute 04-05 00:35:25.396 2520 2556 V ADK-TASK:e.c(L:1): start execute ZkCheckActivationEndTask 04-05 00:35:25.396 2520 2556 V ADK-TASK:e.c(L:5): finish execute ZkCheckActivationEndTask 04-05 00:35:25.396 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationEndTask execute finished, cast time:1, ret:-1 04-05 00:35:25.397 2520 2556 E ADK-TASK:o.l(L:27): JOB_CHECK_ACTIVATION execute failed, task ZkCheckActivationEndTask running failed. error code:-1 04-05 00:35:25.520 268 726 D gps_ql : Error connecting rild-nmea (Connection refused) 04-05 00:35:25.521 268 726 D gps_ql : fail to open GPS channel ! 04-05 00:35:25.563 2520 2543 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_RUNTIME Task:ZkCheckRuntimeTask start execute 04-05 00:35:25.564 2520 2543 V ADK-TASK:i.c(L:1): start execute ZkCheckRuntimeTask 04-05 00:35:25.564 2520 2543 V ADK-TASK:i.c(L:6): finish execute ZkCheckRuntimeTask 04-05 00:35:25.564 2520 2543 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_RUNTIME Task:ZkCheckRuntimeTask execute finished, cast time:1, ret:0 04-05 00:35:25.730 600 600 I KeyButtonView: Back button event: ACTION_DOWN 04-05 00:35:25.732 444 518 D InputDispatcher: Waiting to send key to Window{f6c420e u0 com.pedro.sample/com.pedro.sample.CameraDemoActivity} because there are unprocessed events that may cause focus to change 04-05 00:35:25.736 444 829 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4 04-05 00:35:25.737 254 27214 D AudioHardwareTiny: start_output_stream:865 out = 0xed8c01e0,device = 0x8,outputs[OUTPUT_HDMI_MULTI] = 0x0 04-05 00:35:25.737 254 27214 D AudioHardwareTiny: card0 id:rockchiphdmi 04-05 00:35:25.737 254 27214 D AudioHardwareTiny: HDMI card, got card=0,device=0 04-05 00:35:25.737 254 27214 D AudioHardwareTiny: card1 id:rockchiprk809co 04-05 00:35:25.737 254 27214 D AudioHardwareTiny: SPEAKER card, got card=1,device=0 04-05 00:35:25.737 444 29889 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4 04-05 00:35:25.738 254 27214 D AudioHardwareTiny: No exist proc/asound/card2/id, break and finish parsing 04-05 00:35:25.738 254 27214 D AudioHardwareTiny: dump out device info 04-05 00:35:25.738 254 27214 D AudioHardwareTiny: dev_info SPEAKER card=1, device:0 04-05 00:35:25.738 254 27214 D AudioHardwareTiny: dev_info HDMI card=0, device:0 04-05 00:35:25.738 254 27214 D AudioHardwareTiny: out->Device : 0x8 04-05 00:35:25.738 254 27214 D AudioHardwareTiny: out->SampleRate : 48000 04-05 00:35:25.738 254 27214 D AudioHardwareTiny: out->Channels : 2 04-05 00:35:25.738 254 27214 D AudioHardwareTiny: out->Formate : 0 04-05 00:35:25.738 254 27214 D AudioHardwareTiny: out->PreiodSize : 512 04-05 00:35:25.738 254 27214 D alsa_route: route_info->sound_card 0, route_info->devices 0 04-05 00:35:25.738 254 27214 D alsa_route: route_set_controls() set route 8 04-05 00:35:25.439 0 0 I chatty : uid=0(root) logd identical 67 lines 04-05 00:35:25.472 0 0 W : [drm] vp1 Esmart0-win0 act_w[33] MODE 16 == 1 04-05 00:35:25.735 0 0 I rk817_playback_path_put: set playback_path 4, pre_path 0 04-05 00:35:25.735 0 0 I rk817_codec_power_up: power up playback 04-05 00:35:25.743 0 0 I rk817_set_dai_sysclk: MCLK = 12288000Hz 04-05 00:35:25.743 0 0 I rk817_hw_params: sample rate = 48000Hz 04-05 00:35:25.748 254 27214 D AudioHardwareTiny: start_output_stream:966, out = 0xed8c01e0 04-05 00:35:25.745 0 0 I : rk817_digital_mute 0 04-05 00:35:25.763 600 600 I KeyButtonView: Back button event: ACTION_UP 04-05 00:35:24.179 444 29889 I chatty : uid=1000(system) Binder:444_21 identical 2 lines 04-05 00:35:24.670 444 29889 W ActivityManager: Unable to start service Intent { cmp=com.zkteco.edk.hardware.encrypt.service/.ZkCheckActivationService } U=0: not found 04-05 00:35:25.765 444 464 D AutofillManagerService: onBackKeyPressed() 04-05 00:35:25.766 444 518 D InputDispatcher: Waiting to send key to Window{f6c420e u0 com.pedro.sample/com.pedro.sample.CameraDemoActivity} because there are unprocessed events that may cause focus to change 04-05 00:35:25.765 0 0 W : [drm] vp1 Esmart0-win0 act_w[33] MODE 16 == 1 04-05 00:35:25.785 224 226 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 00:35:25.785 224 226 D gralloc4: got new private_handle_t instance @0xb400006f4562aad0 for buffer 'screenshot'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 720, height : 1280, req_format : 0x1, producer_usage : 0x333, consumer_usage : 0x333, internal_format : 0x0, stride : 720, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x1, size : 3686400, layer_count : 1, backing_store_size : 3686400, backing_store_id : 962072677420, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 00:35:25.785 224 226 D gralloc4: plane_info[0]: offset : 0, byte_stride : 2880, alloc_width : 720, alloc_height : 1280 04-05 00:35:25.785 224 226 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 00:35:25.970 444 829 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4 04-05 00:35:25.970 313 396 W APM::AudioPolicyEngine: getDevicesForStrategy() unknown strategy: -1 04-05 00:35:25.987 980 997 I droid.launcher: NativeAlloc concurrent copying GC freed 13618(625KB) AllocSpace objects, 1(28KB) LOS objects, 49% free, 3676KB/7353KB, paused 116us total 166.737ms 04-05 00:35:25.987 980 997 W droid.launcher: Reducing the number of considered missed Gc histogram windows from 205 to 100 04-05 00:35:25.995 224 226 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 00:35:25.995 224 226 D gralloc4: got new private_handle_t instance @0xb400006f45629d50 for buffer 'com.pedro.sample/com.pedro.sample.MainActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 720, height : 1280, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677421, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 00:35:25.997 224 226 D gralloc4: plane_info[0]: offset : 0, byte_stride : 2880, alloc_width : 720, alloc_height : 1280 04-05 00:35:25.997 224 226 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 00:35:26.000 224 29396 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 00:35:26.000 224 29396 D gralloc4: got new private_handle_t instance @0xb400006f45628010 for buffer 'com.pedro.sample/com.pedro.sample.MainActivity#0'. share_fd : 10, share_attr_fd : 11, flags : 0x4, width : 720, height : 1280, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677422, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 00:35:26.000 224 29396 D gralloc4: plane_info[0]: offset : 0, byte_stride : 2880, alloc_width : 720, alloc_height : 1280 04-05 00:35:26.000 224 29396 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 00:35:26.003 224 29396 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 00:35:26.003 224 29396 D gralloc4: got new private_handle_t instance @0xb400006f4562a0b0 for buffer 'com.pedro.sample/com.pedro.sample.MainActivity#0'. share_fd : 10, share_attr_fd : 8, flags : 0x4, width : 720, height : 1280, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677423, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 00:35:26.003 224 29396 D gralloc4: plane_info[0]: offset : 0, byte_stride : 2880, alloc_width : 720, alloc_height : 1280 04-05 00:35:26.003 224 29396 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 00:35:26.010 224 29396 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 00:35:26.010 224 29396 D gralloc4: got new private_handle_t instance @0xb400006f45628010 for buffer 'com.pedro.sample/com.pedro.sample.MainActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 1280, height : 720, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677424, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 00:35:26.010 224 29396 D gralloc4: plane_info[0]: offset : 0, byte_stride : 5120, alloc_width : 1280, alloc_height : 720 04-05 00:35:26.010 224 29396 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 00:35:26.079 600 616 I ndroid.systemu: NativeAlloc concurrent copying GC freed 32093(1230KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 7528KB/14MB, paused 168us total 229.391ms 04-05 00:35:26.079 600 616 W ndroid.systemu: Reducing the number of considered missed Gc histogram windows from 156 to 100 04-05 00:35:26.127 444 502 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.MainActivity} -- com.pedro.sample -- mode=0 04-05 00:35:26.128 224 29396 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 00:35:26.128 224 29396 D gralloc4: got new private_handle_t instance @0xb400006f4562a0b0 for buffer 'com.pedro.sample/com.pedro.sample.MainActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 1280, height : 720, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677425, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 00:35:26.128 224 29396 D gralloc4: plane_info[0]: offset : 0, byte_stride : 5120, alloc_width : 1280, alloc_height : 720 04-05 00:35:26.128 224 29396 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 00:35:26.156 224 29396 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 00:35:26.156 224 29396 D gralloc4: got new private_handle_t instance @0xb400006f45628010 for buffer 'com.pedro.sample/com.pedro.sample.MainActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 1280, height : 720, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677426, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 00:35:26.156 224 29396 D gralloc4: plane_info[0]: offset : 0, byte_stride : 5120, alloc_width : 1280, alloc_height : 720 04-05 00:35:26.156 224 29396 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 00:35:26.252 444 467 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.MainActivity} -- com.pedro.sample -- mode=0 04-05 00:35:26.256 444 467 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.MainActivity} -- com.pedro.sample -- mode=0 04-05 00:35:26.273 444 466 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.MainActivity} -- com.pedro.sample -- mode=0 04-05 00:35:26.298 20062 20100 I SurfaceManager: GL released 04-05 00:35:26.299 20062 20100 E SurfaceManager: GL already released 04-05 00:35:26.300 184 1068 E BufferQueueProducer: SurfaceView - com.pedro.sample/com.pedro.sample.CameraDemoActivity#0 disconnect: not connected (req=1) 04-05 00:35:26.302 20062 20100 W libEGL : EGLNativeWindowType 0xb4000079a52912f0 disconnect failed 04-05 00:35:26.311 20062 20100 I SurfaceManager: GL released 04-05 00:35:26.311 20062 20100 E libEGL : call to OpenGL ES API with no current context (logged once per thread) 04-05 00:35:26.321 184 203 E BufferQueueProducer: com.pedro.sample/com.pedro.sample.CameraDemoActivity#0 disconnect: not connected (req=1) 04-05 00:35:26.321 20062 20085 W libEGL : EGLNativeWindowType 0xb4000079a5293500 disconnect failed 04-05 00:35:26.354 20062 20062 D gjx : CameraDemoActivity onDestroy: =========================================================================================== Here is the logcat.

pedroSG94 commented 2 weeks ago

Hello,

Your code is not like in my example:

Shaooooo commented 2 weeks ago

Hello,

Your code is not like in my example:

  • Move the code from surfaceCreated to surfaceChanged callback
  • Add this to xml OpenGlView:
app:aspectRatioMode="adjust"
  • adaptPreview method is no longer necessary, remove it

It is the example of https://github.com/pedroSG94/RTSP-Server. follow your steps. the screen still black.

rtspServerCamera1.startPreview() happened an exception

04-05 01:11:07.730 20519 20519 D gjx : CameraDemoActivity onCreate: =========================================================================================== 04-05 01:11:07.744 313 396 W APM::AudioPolicyEngine: getDevicesForStrategy() unknown strategy: -1 04-05 01:11:07.744 444 27623 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4 04-05 01:11:07.869 20519 20519 D gjx : surfaceCreated: 04-05 01:11:07.870 20519 20519 D gjx : surfaceChanged: 04-05 01:11:07.880 20519 20576 E SurfaceManager: GL already released 04-05 01:11:07.899 20519 20576 I SurfaceManager: GL initialized 04-05 01:11:07.912 20519 20576 E SurfaceManager: GL already released 04-05 01:11:07.931 20519 20576 I SurfaceManager: GL initialized 04-05 01:11:07.939 20519 20519 I Camera2ApiManager: optimal resolution set to: 640x480 04-05 01:11:07.944 20519 20519 E SurfaceView: Exception configuring surface 04-05 01:11:07.944 20519 20519 E SurfaceView: java.lang.IllegalArgumentException: cameraId was null 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:717) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:653) 04-05 01:11:07.944 20519 20519 E SurfaceView: at com.pedro.encoder.input.video.Camera2ApiManager.openCameraId(Camera2ApiManager.java:820) 04-05 01:11:07.944 20519 20519 E SurfaceView: at com.pedro.library.base.Camera2Base.startPreview(Camera2Base.java:528) 04-05 01:11:07.944 20519 20519 E SurfaceView: at com.pedro.library.base.Camera2Base.startPreview(Camera2Base.java:511) 04-05 01:11:07.944 20519 20519 E SurfaceView: at com.pedro.library.base.Camera2Base.startPreview(Camera2Base.java:545) 04-05 01:11:07.944 20519 20519 E SurfaceView: at com.pedro.library.base.Camera2Base.startPreview(Camera2Base.java:562) 04-05 01:11:07.944 20519 20519 E SurfaceView: at com.pedro.library.base.Camera2Base.startPreview(Camera2Base.java:571) 04-05 01:11:07.944 20519 20519 E SurfaceView: at com.pedro.sample.CameraDemoActivity$onCreate$1.surfaceChanged(CameraDemoActivity.kt:78) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.view.SurfaceView.updateSurface(SurfaceView.java:1165) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.view.SurfaceView.lambda$new$0$SurfaceView(SurfaceView.java:173) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.view.-$$Lambda$SurfaceView$w68OV7dB_zKVNsA-r0IrAUtyWas.onPreDraw(Unknown Source:2) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1093) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3094) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1948) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8177) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.view.Choreographer.doCallbacks(Choreographer.java:796) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.view.Choreographer.doFrame(Choreographer.java:731) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.os.Handler.handleCallback(Handler.java:938) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.os.Handler.dispatchMessage(Handler.java:99) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.os.Looper.loop(Looper.java:223) 04-05 01:11:07.944 20519 20519 E SurfaceView: at android.app.ActivityThread.main(ActivityThread.java:7664) 04-05 01:11:07.944 20519 20519 E SurfaceView: at java.lang.reflect.Method.invoke(Native Method) 04-05 01:11:07.944 20519 20519 E SurfaceView: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 04-05 01:11:07.944 20519 20519 E SurfaceView: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 04-05 01:11:07.960 224 224 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 01:11:07.960 224 224 D gralloc4: got new private_handle_t instance @0xb400006f45629c30 for buffer 'com.pedro.sample/com.pedro.sample.CameraDemoActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 1280, height : 720, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677502, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 01:11:07.960 224 224 D gralloc4: plane_info[0]: offset : 0, byte_stride : 5120, alloc_width : 1280, alloc_height : 720 04-05 01:11:07.960 224 224 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 01:11:07.990 444 471 I ActivityTaskManager: Displayed com.pedro.sample/.CameraDemoActivity: +480ms 04-05 01:11:08.037 224 224 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 01:11:08.037 224 224 D gralloc4: got new private_handle_t instance @0xb400006f45629b10 for buffer 'com.pedro.sample/com.pedro.sample.CameraDemoActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 1280, height : 720, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677503, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 01:11:08.037 224 224 D gralloc4: plane_info[0]: offset : 0, byte_stride : 5120, alloc_width : 1280, alloc_height : 720 04-05 01:11:08.037 224 224 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 01:11:08.049 444 630 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.CameraDemoActivity} -- com.pedro.sample -- mode=0 04-05 01:11:08.126 268 726 D gps_ql : Error connecting rild-nmea (Connection refused) 04-05 01:11:08.126 268 726 D gps_ql : fail to open GPS channel ! 04-05 01:11:08.205 444 467 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.CameraDemoActivity} -- com.pedro.sample -- mode=0 04-05 01:11:08.206 444 467 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.CameraDemoActivity} -- com.pedro.sample -- mode=0 04-05 01:11:08.227 444 466 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.CameraDemoActivity} -- com.pedro.sample -- mode=0 04-05 01:11:08.230 184 441 E BufferQueueProducer: com.pedro.sample/com.pedro.sample.MainActivity#0 disconnect: not connected (req=1) 04-05 01:11:08.230 20519 20542 W libEGL : EGLNativeWindowType 0xb4000079a539f8e0 disconnect failed 04-05 01:11:08.265 224 224 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 01:11:08.265 224 224 D gralloc4: got new private_handle_t instance @0xb400006f45629c30 for buffer 'Sprite#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 33, height : 42, req_format : 0x1, producer_usage : 0x8933, consumer_usage : 0x8933, internal_format : 0x0, stride : 48, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x1, size : 8064, layer_count : 1, backing_store_size : 8064, backing_store_id : 962072677504, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 01:11:08.266 224 224 D gralloc4: plane_info[0]: offset : 0, byte_stride : 192, alloc_width : 33, alloc_height : 42 04-05 01:11:08.266 224 224 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 01:11:08.296 0 0 W : [drm] vp1 Esmart0-win0 act_w[33] MODE 16 == 1 04-05 01:11:08.540 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationServiceTask start execute 04-05 01:11:08.540 2520 2556 V ADK-TASK:f.c(L:1): start execute ZkCheckActivationServiceTask 04-05 01:11:08.234 444 466 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.CameraDemoActivity} -- com.pedro.sample -- mode=0 04-05 01:11:08.542 444 27623 W ActivityManager: Unable to start service Intent { cmp=com.zkteco.edk.hardware.encrypt.service/.ZkCheckActivationService } U=0: not found 04-05 01:11:08.909 17853 17893 E ADK-TASK:ZkLoopJob.executeJobInThreadPool(L:157): JOB_CHECK_ACTIVATION execute failed, task ZkCheckActivationEndTask running failed. error code:-1 04-05 01:11:09.126 268 726 D gps_ql : Error connecting rild-nmea (Connection refused) 04-05 01:11:09.126 268 726 D gps_ql : fail to open GPS channel ! 04-05 01:11:09.447 2520 2543 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_RUNTIME Task:ZkCheckRuntimeTask start execute 04-05 01:11:09.448 2520 2543 V ADK-TASK:i.c(L:1): start execute ZkCheckRuntimeTask 04-05 01:11:09.448 2520 2543 V ADK-TASK:i.c(L:6): finish execute ZkCheckRuntimeTask 04-05 01:11:09.448 2520 2543 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_RUNTIME Task:ZkCheckRuntimeTask execute finished, cast time:2, ret:0 04-05 01:11:09.744 2520 2556 V ADK-TASK:f.c(L:15): finish execute ZkCheckActivationServiceTask 04-05 01:11:09.745 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationServiceTask execute finished, cast time:1209, ret:0 04-05 01:11:09.745 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationServerTask start execute 04-05 01:11:09.746 2520 2556 V ADK-TASK:m.c(L:1): start execute ZkStartActivationServerTask 04-05 01:11:09.747 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationServerTask execute finished, cast time:2, ret:0 04-05 01:11:09.748 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationClientTask start execute 04-05 01:11:09.749 2520 2556 V ADK-TASK:l.c(L:1): start execute ZkStartActivationClientTask 04-05 01:11:09.750 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkStartActivationClientTask execute finished, cast time:1, ret:0 04-05 01:11:09.751 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckLocalStorageActivationTask start execute 04-05 01:11:09.752 2520 2556 V ADK-TASK:h.c(L:1): start execute ZkCheckLocalStorageActivationTask 04-05 01:11:09.753 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckLocalStorageActivationTask execute finished, cast time:2, ret:0 04-05 01:11:09.754 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckSoftwareActivationTask start execute 04-05 01:11:09.755 2520 2556 V ADK-TASK:j.c(L:1): start execute ZkCheckSoftwareActivationTask 04-05 01:11:09.755 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckSoftwareActivationTask execute finished, cast time:2, ret:0 04-05 01:11:09.756 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckHardwareActivationTask start execute 04-05 01:11:09.758 2520 2556 V ADK-TASK:g.c(L:1): start execute ZkCheckHardwareActivationTask 04-05 01:11:09.759 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckHardwareActivationTask execute finished, cast time:3, ret:0 04-05 01:11:09.759 2520 2556 V ADK-TASK:o.l(L:14): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationEndTask start execute 04-05 01:11:09.760 2520 2556 V ADK-TASK:e.c(L:1): start execute ZkCheckActivationEndTask 04-05 01:11:09.760 2520 2556 V ADK-TASK:e.c(L:5): finish execute ZkCheckActivationEndTask 04-05 01:11:09.761 2520 2556 D ADK-TASK:o.l(L:20): Job:JOB_CHECK_ACTIVATION Task:ZkCheckActivationEndTask execute finished, cast time:1, ret:-1 04-05 01:11:09.761 2520 2556 E ADK-TASK:o.l(L:27): JOB_CHECK_ACTIVATION execute failed, task ZkCheckActivationEndTask running failed. error code:-1 04-05 01:11:10.127 268 726 D gps_ql : Error connecting rild-nmea (Connection refused) 04-05 01:11:10.127 268 726 D gps_ql : fail to open GPS channel ! 04-05 01:11:10.361 600 600 I KeyButtonView: Back button event: ACTION_DOWN 04-05 01:11:10.364 444 518 D InputDispatcher: Waiting to send key to Window{e409163 u0 com.pedro.sample/com.pedro.sample.CameraDemoActivity} because there are unprocessed events that may cause focus to change 04-05 01:11:10.369 444 27623 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4 04-05 01:11:10.433 600 600 I KeyButtonView: Back button event: ACTION_UP 04-05 01:11:10.436 444 518 D InputDispatcher: Waiting to send key to Window{e409163 u0 com.pedro.sample/com.pedro.sample.CameraDemoActivity} because there are unprocessed events that may cause focus to change 04-05 01:11:08.908 444 27623 W ActivityManager: Unable to start service Intent { cmp=com.zkteco.edk.hardware.encrypt.service/.ZkCheckActivationService } U=0: not found 04-05 01:11:10.441 444 464 D AutofillManagerService: onBackKeyPressed() 04-05 01:11:10.447 444 519 D InputDispatcher: Received a new pointer down event, stop waiting for events to process and just send the pending key event to the focused window. 04-05 01:11:10.448 444 518 W InputDispatcher: Dispatching key to Window{e409163 u0 com.pedro.sample/com.pedro.sample.CameraDemoActivity} even though there are other unprocessed events 04-05 01:11:10.454 600 600 I KeyButtonView: Back button event: ACTION_DOWN 04-05 01:11:10.456 224 224 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 01:11:10.456 224 224 D gralloc4: got new private_handle_t instance @0xb400006f45629b10 for buffer 'screenshot'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 720, height : 1280, req_format : 0x1, producer_usage : 0x333, consumer_usage : 0x333, internal_format : 0x0, stride : 720, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x1, size : 3686400, layer_count : 1, backing_store_size : 3686400, backing_store_id : 962072677505, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 01:11:10.456 224 224 D gralloc4: plane_info[0]: offset : 0, byte_stride : 2880, alloc_width : 720, alloc_height : 1280 04-05 01:11:10.456 224 224 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 01:11:10.457 444 518 D InputDispatcher: Waiting to send key to Window{e409163 u0 com.pedro.sample/com.pedro.sample.CameraDemoActivity} because there are unprocessed events that may cause focus to change 04-05 01:11:10.465 444 29406 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4 04-05 01:11:10.513 600 600 I KeyButtonView: Back button event: ACTION_UP 04-05 01:11:10.526 444 518 W InputDispatcher: Waiting because no window has focus but ActivityRecord{a60a1a2 u0 com.pedro.sample/.MainActivity t1491} may eventually add a window when it finishes starting up. Will wait for 5000ms 04-05 01:11:10.526 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4999ms 04-05 01:11:10.527 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4998ms 04-05 01:11:10.528 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4997ms 04-05 01:11:10.537 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4988ms 04-05 01:11:10.538 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4988ms 04-05 01:11:10.539 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4987ms 04-05 01:11:10.539 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4986ms 04-05 01:11:10.540 444 27623 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4 04-05 01:11:10.541 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4984ms 04-05 01:11:10.541 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4984ms 04-05 01:11:10.543 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4982ms 04-05 01:11:10.544 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4981ms 04-05 01:11:10.573 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4952ms 04-05 01:11:10.520 444 464 D AutofillManagerService: onBackKeyPressed() 04-05 01:11:10.580 444 1114 E TaskPersister: File error accessing recents directory (directory doesn't exist?). 04-05 01:11:10.602 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4923ms 04-05 01:11:10.619 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4906ms 04-05 01:11:10.654 224 224 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 01:11:10.654 224 224 D gralloc4: got new private_handle_t instance @0xb400006f45629c30 for buffer 'com.pedro.sample/com.pedro.sample.MainActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 720, height : 1280, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677506, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 01:11:10.654 224 224 D gralloc4: plane_info[0]: offset : 0, byte_stride : 2880, alloc_width : 720, alloc_height : 1280 04-05 01:11:10.654 224 224 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 01:11:10.657 224 224 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 01:11:10.657 224 224 D gralloc4: got new private_handle_t instance @0xb400006f45629b10 for buffer 'com.pedro.sample/com.pedro.sample.MainActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 720, height : 1280, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677507, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 01:11:10.658 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4868ms 04-05 01:11:10.658 224 224 D gralloc4: plane_info[0]: offset : 0, byte_stride : 2880, alloc_width : 720, alloc_height : 1280 04-05 01:11:10.658 224 224 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 01:11:10.660 224 29396 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 01:11:10.660 224 29396 D gralloc4: got new private_handle_t instance @0xb400006f45628010 for buffer 'com.pedro.sample/com.pedro.sample.MainActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 720, height : 1280, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677508, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 01:11:10.660 224 29396 D gralloc4: plane_info[0]: offset : 0, byte_stride : 2880, alloc_width : 720, alloc_height : 1280 04-05 01:11:10.660 224 29396 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 01:11:10.665 224 29396 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 01:11:10.665 224 29396 D gralloc4: got new private_handle_t instance @0xb400006f4562a0b0 for buffer 'com.pedro.sample/com.pedro.sample.MainActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 1280, height : 720, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677509, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 01:11:10.665 224 29396 D gralloc4: plane_info[0]: offset : 0, byte_stride : 5120, alloc_width : 1280, alloc_height : 720 04-05 01:11:10.665 224 29396 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 01:11:10.668 313 396 W APM::AudioPolicyEngine: getDevicesForStrategy() unknown strategy: -1 04-05 01:11:10.671 444 27623 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4 04-05 01:11:10.686 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4839ms 04-05 01:11:10.704 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4821ms 04-05 01:11:10.709 600 616 I ndroid.systemu: NativeAlloc concurrent copying GC freed 3633(270KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 7388KB/14MB, paused 144us total 186.268ms 04-05 01:11:10.725 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4800ms 04-05 01:11:10.726 444 518 W InputDispatcher: Still no focused window. Will drop the event in 4800ms 04-05 01:11:10.726 444 518 D InputDispatcher: Waiting to send key to Window{6c9fb57 u0 com.pedro.sample/com.pedro.sample.MainActivity} because there are unprocessed events that may cause focus to change 04-05 01:11:10.775 224 29396 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 01:11:10.775 224 29396 D gralloc4: got new private_handle_t instance @0xb400006f45628010 for buffer 'com.pedro.sample/com.pedro.sample.MainActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 1280, height : 720, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677510, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 01:11:10.775 224 29396 D gralloc4: plane_info[0]: offset : 0, byte_stride : 5120, alloc_width : 1280, alloc_height : 720 04-05 01:11:10.775 224 29396 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 01:11:10.798 224 29396 D gralloc4: [File] : hardware/rockchip/libgralloc/bifrost/src/hidl_common/Allocator.cpp; [Line] : 149; [Func] : allocate; 04-05 01:11:10.798 224 29396 D gralloc4: got new private_handle_t instance @0xb400006f4562a0b0 for buffer 'com.pedro.sample/com.pedro.sample.MainActivity#0'. share_fd : 8, share_attr_fd : 9, flags : 0x4, width : 1280, height : 720, req_format : 0x1, producer_usage : 0x40000000000b00, consumer_usage : 0x40000000000b00, internal_format : 0x0, stride : 0, byte_stride : 0, internalWidth : 0, internalHeight : 0, alloc_format : 0x100000001, size : 3744768, layer_count : 1, backing_store_size : 3744768, backing_store_id : 962072677511, allocating_pid : 224, ref_count : 1, yuv_info : 0 04-05 01:11:10.798 224 29396 D gralloc4: plane_info[0]: offset : 0, byte_stride : 5120, alloc_width : 1280, alloc_height : 720 04-05 01:11:10.798 224 29396 D gralloc4: plane_info[1]: offset : 0, byte_stride : 0, alloc_width : 0, alloc_height : 0 04-05 01:11:10.833 444 630 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.MainActivity} -- com.pedro.sample -- mode=0 04-05 01:11:10.910 444 27623 W ActivityManager: Unable to start service Intent { cmp=com.zkteco.edk.hardware.encrypt.service/.ZkCheckActivationService } U=0: not found 04-05 01:11:10.911 17853 17893 E ADK-TASK:ZkLoopJob.executeJobInThreadPool(L:157): JOB_CHECK_ACTIVATION execute failed, task ZkCheckActivationEndTask running failed. error code:-1 04-05 01:11:10.919 444 467 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.MainActivity} -- com.pedro.sample -- mode=0 04-05 01:11:10.923 444 467 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.MainActivity} -- com.pedro.sample -- mode=0 04-05 01:11:10.934 444 466 V WindowManager: getPackagePerformanceMode -- ComponentInfo{com.pedro.sample/com.pedro.sample.MainActivity} -- com.pedro.sample -- mode=0 04-05 01:11:10.952 20519 20576 I SurfaceManager: GL released 04-05 01:11:10.952 20519 20576 E SurfaceManager: GL already released 04-05 01:11:10.953 184 1068 E BufferQueueProducer: SurfaceView - com.pedro.sample/com.pedro.sample.CameraDemoActivity#0 disconnect: not connected (req=1) 04-05 01:11:10.953 20519 20576 W libEGL : EGLNativeWindowType 0xb4000079a5328560 disconnect failed 04-05 01:11:10.964 20519 20576 I SurfaceManager: GL released 04-05 01:11:10.964 20519 20576 E libEGL : call to OpenGL ES API with no current context (logged once per thread) 04-05 01:11:10.965 20519 20519 D gjx : surfaceDestroyed: 04-05 01:11:10.979 184 202 E BufferQueueProducer: com.pedro.sample/com.pedro.sample.CameraDemoActivity#0 disconnect: not connected (req=1) 04-05 01:11:10.979 20519 20542 W libEGL : EGLNativeWindowType 0xb4000079a51782b0 disconnect failed 04-05 01:11:11.022 20519 20519 D gjx : CameraDemoActivity onDestroy: ===========================================================================================

pedroSG94 commented 2 weeks ago

I tested using example from RTSP-Server and it is working fine. I did a branch for it: https://github.com/pedroSG94/RTSP-Server/pull/130

Test it and let me know the result. If the problem persist try with other device to discard problems with that phone

pedroSG94 commented 1 week ago

Closing as resolved here: https://github.com/pedroSG94/RTSP-Server/pull/130#issuecomment-2323431183

Use the last library version in the readme to get the fix