CameraDeviceState I Legacy camera service transitioning to state IDLE

2024-06-13 10:18:05.817 26909-27115 CameraDeviceState                        I  Legacy camera service transitioning to state IDLE
2024-06-13 10:18:05.819 26909-27115 RequestQueue                             I  Repeating capture request set.
2024-06-13 10:18:05.826 26909-27175 LegacyRequestMapper                      W  convertRequestMetadata - control.awbRegions setting is not supported, ignoring value
2024-06-13 10:18:05.827 26909-27175 LegacyRequestMapper                      W  mapAeAndFlashMode - Ignore control.aeMode == ON_AUTO_FLASH_REDEYE;camera does not support it
2024-06-13 10:18:05.827 26909-27175 LegacyRequestMapper                      W  convertRequestToMetadata - Ignoring android.lens.focusDistance false, only 0.0f is supported
2024-06-13 10:18:05.895 26909-26909 Choreographer                            I  Skipped 39 frames!  The application may be doing too much work on its main thread.
2024-06-13 10:18:06.177 26909-27176 CameraDeviceState                        I  Legacy camera service transitioning to state CAPTURING
2024-06-13 10:18:07.265 26909-26914 art                                      I  Do full code cache collection, code=106KB, data=126KB
2024-06-13 10:18:07.270 26909-26914 art                                      I  Starting a blocking GC JitCodeCache
2024-06-13 10:18:07.270 26909-26914 art                                      I  After code cache collection, code=90KB, data=102KB
2024-06-13 10:18:08.936 26909-26914 art                                      I  Do partial code cache collection, code=91KB, data=107KB
2024-06-13 10:18:08.936 26909-26914 art                                      I  After code cache collection, code=91KB, data=107KB
2024-06-13 10:18:08.937 26909-26914 art                                      I  Increasing code cache capacity to 512KB
 

日志显示了应用程序的一系列事件和警告,涉及相机服务和主线程性能。以下是一些关键点和可能存在的问题:

  1. 相机服务状态变化

    • Legacy camera service transitioning to state IDLE 和 Legacy camera service transitioning to state CAPTURING 表明相机服务在空闲和捕获状态之间转换。
  2. 重复的捕获请求

    • Repeating capture request set. 表明相机设置了重复的捕获请求,这在进行连续拍摄时是正常的。
  3. 相机参数不支持

    • 有几条警告信息指出相机不支持某些设置:
      • control.awbRegions setting is not supported:自动白平衡区域设置不被支持。
      • Ignore control.aeMode == ON_AUTO_FLASH_REDEYE; camera does not support it:相机不支持自动曝光模式下的自动红眼闪光灯。
      • Ignoring android.lens.focusDistance false, only 0.0f is supported:镜头的焦点距离设置被忽略,只支持0.0f的值。
  4. 主线程性能问题

    • Skipped 39 frames! The application may be doing too much work on its main thread. 这是一个性能警告,表明应用在主线程上做了太多工作,导致错过了39帧的渲染。这可能导致应用程序的UI出现卡顿。
  5. ART垃圾回收

    • 有几条信息与ART运行时的垃圾回收有关,包括:
      • Do full code cache collection 和 Starting a blocking GC JitCodeCache 表示进行了完整的代码缓存回收和阻塞式的即时编译代码缓存垃圾回收。
      • 这些操作通常是为了释放内存,但也可能影响性能。
  6. 代码缓存调整

    • Increasing code cache capacity to 512KB 表明ART运行时增加了代码缓存的容量,这可能是为了提高性能。

可能存在的问题

  • 相机功能限制:应用程序尝试使用相机硬件不支持的功能,需要检查相机API的使用是否与硬件能力匹配。
  • 主线程过载:应用程序可能在主线程上执行了耗时的操作,需要优化这些操作,可能通过异步任务或使用单独的工作线程来解决。
  • 内存管理:频繁的垃圾回收可能指示内存使用或管理上的问题,需要分析内存使用情况,确保及时释放不再使用的资源。

解决步骤

  1. 检查并更新相机API的使用,确保它们与设备支持的功能一致。
  2. 优化主线程上的性能,避免长时间的UI阻塞操作。
  3. 分析内存使用情况,确保垃圾回收不会频繁发生或影响应用性能。
  4. 使用Android Profiler工具监控应用的性能和资源使用情况。
  • 25
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Sure! Here's an example of Android camera stream logs: ``` D/CameraManagerGlobal: Connecting to camera service I/CameraManager: Using legacy camera HAL. D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface I/Camera: CameraDeviceState:CAMERA_STATE_OPENING I/Camera: CameraDeviceState:CAMERA_STATE_OPENED W/Camera: CameraService::connect call from pid 1234; forcing disconnect() D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface I/Camera: CameraDeviceState:CAMERA_STATE_IDLE I/Camera: CameraDeviceState:CAMERA_STATE_PREVIEW D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface I/Camera: CameraDeviceState:CAMERA_STATE_RECORDING D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface I/Camera: CameraDeviceState:CAMERA_STATE_PREVIEW D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface I/Camera: CameraDeviceState:CAMERA_STATE_IDLE I/Camera: CameraDeviceState:CAMERA_STATE_CLOSED ``` These logs show the various states of the camera device, including connecting to the camera service, opening the camera, setting up the preview stream, and recording video. The "app passed NULL surface" messages indicate that the app did not provide a valid surface for displaying the camera preview.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值