android camera debug

本文深入解析了Android设备上的摄像头服务工作原理,通过dumpsys命令获取摄像头设备信息,展示了摄像头服务的内部状态,包括活动的客户端、设备映射及摄像头设备的数量。此外,还详细分析了摄像头服务与系统其他组件之间的交互过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  • adb shell dumpsys media.camera > camera.dump
    dump 的摘取部分信息如下

== Service global info: ==

Number of camera devices: 2
Number of normal camera devices: 2
    Device 0 maps to "0"
    Device 1 maps to "1"
Active Camera Clients:

  ----
  - pid 1731 at 2020-04-12 19:26:50 -----
  Cmd line: /system/bin/cameraserver
 
  "cameraserver" sysTid=1731
 
  "HwBinder:1731_2" sysTid=1831
    #00 pc 00019d3c  /system/lib/libc.so (syscall+28)
    #01 pc 0001d067  /system/lib/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+86)
    #02 pc 00063df3  /system/lib/libc.so (NonPI::MutexLockWithTimeout(pthread_mutex_internal_t*, bool, timespec const*)+154)
    #03 pc 000ba90d  /system/lib/libcameraservice.so (android::Camera3Device::clearStreamingRequest(long long*)+52)
    #04 pc 000b0f5b  /system/lib/libcameraservice.so (android::CameraDeviceClient::detachDevice()+94)
    #05 pc 0008962f  /system/lib/libcameraservice.so (android::Camera2ClientBase<android::CameraDeviceClientBase>::disconnect()+90)
    #06 pc 0007a787  /system/lib/libcameraservice.so (android::CameraService::onDeviceStatusChanged(android::String8 const&, android::hardware::camera::common::V1_0::CameraDeviceStatus)+574)
    #07 pc 0008c127  /system/lib/libcameraservice.so (android::CameraProviderManager::removeProvider(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)+450)
    #08 pc 0008d8a5  /system/lib/libcameraservice.so (_ZTv0_n16_N7android21CameraProviderManager12ProviderInfo11serviceDiedEyRKNS_2wpINS_4hidl4base4V1_05IBaseEEE+12)
    #09 pc 0001beed  /system/lib/libhidltransport.so (android::hardware::hidl_binder_death_recipient::binderDied(android::wp<android::hardware::IBinder> const&)+68)
    #10 pc 0000da51  /system/lib/libhwbinder.so (android::hardware::BpHwBinder::reportOneDeath(android::hardware::BpHwBinder::Obituary const&)+80)
    #11 pc 0000d9e7  /system/lib/libhwbinder.so (android::hardware::BpHwBinder::sendObituary()+178)
    #12 pc 000163ab  /system/lib/libhwbinder.so (android::hardware::IPCThreadState::executeCommand(int)+1506)
    #13 pc 0000f0c9  /system/lib/libhwbinder.so (android::hardware::IPCThreadState::getAndExecuteCommand()+128)
    #14 pc 0000f2df  /system/lib/libhwbinder.so (android::hardware::IPCThreadState::joinThreadPool(bool)+186)
    #15 pc 000153c9  /system/lib/libhwbinder.so (android::hardware::PoolThread::threadLoop()+12)
    #16 pc 0000c08b  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166)
    #17 pc 000632e5  /system/lib/libc.so (__pthread_start(void*)+22)
    #18 pc 0001de79  /system/lib/libc.so (__start_thread+24)
  
  "Binder:1731_1" sysTid=1933
    #00 pc 000537ec  /system/lib/libc.so (__ioctl+8)
    #01 pc 00021a03  /system/lib/libc.so (ioctl+30)
    #02 pc 0003d3f5  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+204)
    #03 pc 0003d53f  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+10)
    #04 pc 0003dabf  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38)
    #05 pc 000543ad  /system/lib/libbinder.so (android::PoolThread::threadLoop()+12)
    #06 pc 0000c08b  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166)
    #07 pc 000632e5  /system/lib/libc.so (__pthread_start(void*)+22)
    #08 pc 0001de79  /system/lib/libc.so (__start_thread+24)
  
  "Binder:1731_2" sysTid=1935
    #00 pc 000537ec  /system/lib/libc.so (__ioctl+8)
    #01 pc 00021a03  /system/lib/libc.so (ioctl+30)
    #02 pc 0003d3f5  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+204)
    #03 pc 0003d53f  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+10)
    #04 pc 0003dabf  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38)
    #05 pc 000543ad  /system/lib/libbinder.so (android::PoolThread::threadLoop()+12)
    #06 pc 0000c08b  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166)
    #07 pc 000632e5  /system/lib/libc.so (__pthread_start(void*)+22)
    #08 pc 0001de79  /system/lib/libc.so (__start_thread+24)
  
  "Binder:1731_3" sysTid=2148
    #00 pc 000537ec  /system/lib/libc.so (__ioctl+8)
    #01 pc 00021a03  /system/lib/libc.so (ioctl+30)
    #02 pc 0003d3f5  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+204)
    #03 pc 0003d53f  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+10)
    #04 pc 0003dabf  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38)
    #05 pc 000543ad  /system/lib/libbinder.so (android::PoolThread::threadLoop()+12)
    #06 pc 0000c08b  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166)
    #07 pc 000632e5  /system/lib/libc.so (__pthread_start(void*)+22)
    #08 pc 0001de79  /system/lib/libc.so (__start_thread+24)
  
  "Binder:1731_4" sysTid=2649
    #00 pc 000537ec  /system/lib/libc.so (__ioctl+8)
    #01 pc 00021a03  /system/lib/libc.so (ioctl+30)
    #02 pc 0003d3f5  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+204)
    #03 pc 0003d53f  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+10)
    #04 pc 0003dabf  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38)
    #05 pc 000543ad  /system/lib/libbinder.so (android::PoolThread::threadLoop()+12)
    #06 pc 0000c08b  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166)
    #07 pc 000632e5  /system/lib/libc.so (__pthread_start(void*)+22)
    #08 pc 0001de79  /system/lib/libc.so (__start_thread+24)
  
  "C3Dev-13-Status" sysTid=3189
    #00 pc 00019d40  /system/lib/libc.so (syscall+32)
    #01 pc 0001d067  /system/lib/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+86)
    #02 pc 00062aa3  /system/lib/libc.so (pthread_cond_timedwait+82)
    #03 pc 000cfd03  /system/lib/libcameraservice.so (android::camera3::StatusTracker::threadLoop()+646)
    #04 pc 0000c107  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+290)
    #05 pc 000632e5  /system/lib/libc.so (__pthread_start(void*)+22)
    #06 pc 0001de79  /system/lib/libc.so (__start_thread+24)
  
  "C3Dev-13-ReqQue" sysTid=3190
    #00 pc 00019d40  /system/lib/libc.so (syscall+32)
    #01 pc 0001d067  /system/lib/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+86)
    #02 pc 00062aa3  /system/lib/libc.so (pthread_cond_timedwait+82)
    #03 pc 000c9a55  /system/lib/libcameraservice.so (android::camera3::Camera3Stream::getBuffer(camera3_stream_buffer*, std::__1::vector<unsigned int, std::__1::allocator<unsigned int>> const&)+236)
    #04 pc 000c4a79  /system/lib/libcameraservice.so (android::Camera3Device::RequestThread::prepareHalRequests()+904)
    #05 pc 000c4201  /system/lib/libcameraservice.so (android::Camera3Device::RequestThread::threadLoop()+424)
    #06 pc 0000c107  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+290)
    #07 pc 000632e5  /system/lib/libc.so (__pthread_start(void*)+22)
    #08 pc 0001de79  /system/lib/libc.so (__start_thread+24)
  

CameraTraces source code

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值