一、 Adb 命令开 log level
为了避免log太多,还有快速定位问题,mtk平台有一些log开关。想要logcat中看到一些log,就需要打开相应的开关。所以这里整理一些log开关,相互学习,也做备忘之效
在开 Camera 各模块 log level 前,建议先关闭 selinux 权限,并确定 logD 是已经有打印的,如果没有打印可以用如下命令开启:
adb shell setenforce 0
adb shell setprop persist.vendor.mtk.camera.log_level 3
adb shell pkill camera*
(1)、打开AE开关
adb root
adb shell setenforce 0
adb shell setprop persist.vendor.mtk.camera.log_level 3
adb shell setprop vendor.debug.camera.log 1
adb shell setprop vendor.debug.hal3av3.log 263
adb shell setprop vendor.debug.3a.log 1
adb shell setprop vendor.debug.thread_raw.log 1
adb shell setprop vendor.debug.hal3a.task 1
adb shell setprop vendor.debug.hal3a.taskmgr 1
==》AE《==
adb shell setprop vendor.debug.ae_mgr.enable 1
adb shell setprop vendor.debug.aaa.pvlog.enable 1
adb shell setprop vendor.debug.aecalc.enable 9
adb shell setprop vendor.debug.camera.log.p1node 2
adb shell pkill cameraserver
adb shell pkill camerahalserver
(2)、开 MTK Camera2 APP 的 log
adb root
adb root adb shell setprop vendor.debug.mtkcam.loglevel 3
(3)、开 Camera Device HAL3 的 log
adb root
adb shell setprop debug.camera.log.CameraDevice3 2
==》dump session param in configure stage
==》log requests from framework
==》log requests from pipeline
在 Log 中搜索 tag: mtkcam-dev3
(4)、开 AppStreamMgr 的 log
adb shell setprop vendor.debug.camera.log.AppStreamMgr
X ==》X>=1, dump per-frame callback image/meta/shutter/error message
==》X>=2, dump per-frame control metadata
==》X>=3, dump per-frame result metadata
在 log 中搜索 tag: mtkcam-AppStreamMgr
会有关键 log: mtkcam-AppStreamMgr: [x-CallbackHandler::performCallback
(5)、开 Pipeline 的 log
adb root
adb shell setprop persist.vendor.debug.camera.log X
adb reboot
==》 X>=2, Log every IPipelineFrame settings
==》 X>=3, Log every IPipelineFrame settings and its PipelineContext
有关键 log: mtkcam-PipelineFrameBuilder: App image stream buffers=
(6)、开 P1Node 的 log
adb root adb shell setprop vendor.debug.camera.log.p1node 3
==》 For userdebug load
有关键 log: mtkcam-PipelineFrameBuilder: App image stream buffers=
adb root
adb shell setprop vendor.debug.camera.log.p1nodei 3
==》 For user load
有关键 log: MtkCam/P1NodeImp: [setupAction]
在 log 中搜索 tag: MtkCam/P1NodeImp
(7)、开 preview/record 时 P2S 的 log
开 P2StreamingNode 下 StreamingFeaturePipe 层以上
(包括 DispatchProcessor/StreamingProcessor)的 log:
adb root
adb shell setprop vendor.debug.mtkcam.p2.log 1
==》Open per-frame I/O buffer & cropper info
adb shell setprop vendor.debug.trace.p2.{MODULE} 1
==》Open module’s trace log, such as P2Util / StreamingProcessor
开 StreamingFeaturePipe log:
adb root adb shell setprop vendor.debug.fpipe.force.printio 1
adb shell setprop vendor.debug.tpi.s.log 1
(8)、开 Capture 时 P2C 的 log
adb root
adb shell setprop vendor.debug.camera.capture.log 3
(9)、开 JpegNode 的 log
adb root
adb shell setprop vendor.debug.camera.log.JpegNode 2
(10)、force enable MFNR,开 MFNR 相关的 log
force enable MFLL:
adb root adb shell setprop vendor.mfll.force 1
开 MFNR 相关的 log:
adb shell setprop vendor.mfll.log_level 3
adb shell pkill camerahalserver
adb shell pkill cameraserver
(11)、开 FD 的 log
FDNodeImp log enable:
adb shell setprop "vendor.debug.camera.log" 1
or
adb shell setprop "vendor.debug.camera.log.FDNode" 1
adb shell pkill camera*
FD Algo log enable:
adb root
adb shell setprop vendor.debug.camera.fd.detail.log 1
adb shell pkill camera*
(12)、BGService force enable or force disable
force enable BGService:
adb shell setprop vendor.debug.camera.bgservice.mode 1
force disable BGService:
adb shell setprop vendor.debug.camera.bgservice.mode 2
二、adb dump buffer
当遇到 Camera 画质相关的问题,MTK 一般会让客户 dump 出相关模块 input 和 output buffer,从而 根据 buffer 来定位是哪个模块出了问题
(1)dump P1Node 输出的 imgo
adb root
adb shell setenforce 0
adb shell setprop vendor.debug.camera.dump.en 1
adb shell setprop vendor.debug.feature.forceEnableIMGO 1
adb shell setprop vendor.debug.camera.dump.p1.imgo 1
Dump Path:/data/vendor/camera_dump
(2) Streaming buffer dump
P2StreamingNode I/O ( such as RRZO / display output) dump:
方法一: adb root adb shell setenforce 0
adb shell rm -rf /data/vendor/camera_dump/*
adb shell setprop vendor.debug.p2f.dump.enable 1
adb shell setprop vendor.debug.p2f.dump.mode 1
进 camera, 需要 dump 时,下 adb 命令开始
dump: adb shell setprop vendor.debug.camera.preview.dump 1
需要停止 dump 时, 再下 adb 命令:
adb shell setprop vendor.debug.camera.preview.dump 0
dump 完后,dump 出来的 buffer 都放到 /data/vendor/camera_dump 这个目录。
pull 到本地命令: adb pull /data/vendor/camera_dump
方法 1 会 dump 出很多数据
方法二: adb root adb shell setenforce 0
adb shell mkdir /data/vendor/p2_dump
adb shell setprop vendor.debug.p2f.dump.enable 1
adb shell setprop vendor.debug.p2f.dump.mode 2 --->1 表示用 camera_dump,2 表示要创建 p2_dump
adb shell setprop vendor.debug.p2f.dump.start 5 ---> P2S FrameNo >= 5 就開始 dump
adb shell setprop vendor.debug.p2f.dump.count 3 ---> 連續 dump 3 個 frame 进 camera,系统会自动 dump 出指定数量的数据
dump path:/data/vendor/p2_dump 注:方法二能指定从哪张开始 dump,同时能指定 dump 几张。
方法三: adb root adb shell setenforce 0
adb shell setprop vendor.debug.p2f.dump.enable 1
adb shell setprop vendor.debug.p2f.dump.mode 1 --->1 表示用 camera_dump,2 表示要创建 p2_dump 进 camera,
adb shell setprop vendor.debug.camera.continue.dump N --->N 代表立刻开始 dump,并连续 dump N 张 如果还想继续 dump,先执行:
adb shell setprop vendor.debug.camera.continue.dump 0 再执行:
adb shell setprop vendor.debug.camera.continue.dump N 最终 dump 完要执行:
adb shell setprop vendor.debug.camera.continue.dump 0
dump path:/data/vendor/camera_dump
注:方法三能指定 dump 几张。
TPINode dump:
adb root adb shell setenforce 0
adb shell mkdir /data/vendor/dump
adb shell setprop vendor.debug.tpi.s 1 ---> 打開 per-frame check dump prop 进 camera,需要开始 dump 时,下如下命令:
adb shell setprop vendor.debug.tpi.s.dump 1 dump 结束时,下如下命令:
adb shell setprop vendor.debug.tpi.s.dump 0
dump path:/data/vendor/dump
(3) capture buffer dump
P2ANode buffer dump:
adb root adb shell setenforce 0
adb shell setprop vendor.debug.camera.p2.dump 1
adb shell setprop vendor.debug.camera.upkraw.dump 1 --->得到 upkraw(.raw)
dump Path:data/vendor/camera_dump
Depth/bokeh/YuvNode buffer dump:
adb root adb shell setenforce 0
adb shell mkdir sdcard/capturePipe
adb shell setprop vendor.debug.camera.capture.yuv.img.dump 1
adb shell setprop vendor.debug.camera.capture.depth.img.dump 1
adb shell setprop vendor.debug.camera.capture.bokeh.img.dump 1
dump Path: sdcard/capturePipe(注意要先在 sdcard 中建立这个路径)
JpegNode buffer dump:
adb root adb shell setenforce 0
adb shell setprop vendor.debug.camera.dump.JpegNode 1
dump Path:/sdcard/DCIM/Camera/ MFNR buffer dump:
adb root adb shell setenforce 0
adb shell setprop vendor.debug.camera.mfll.dump 1
dump Path:data/vendor/camera_dump Others:
adb root adb shell setenforce 0
adb shell setprop vendor.debug.camera.img3o.dump 1
dump Path:data/vendor/camera_dump
(4) dump raw 图
adb root
adb remount
adb shell setenforce 0
adb shell rm -rf /data/vendor/camera_dump
adb shell mkdir /data/vendor/camera_dump -p
adb shell setprop vendor.debug.camera.dbginfo 1
adb shell setprop vendor.dp.dumpreg.enable 2
adb shell setprop vendor.debug.hal3av3.forcedump 1
adb shell setprop vendor.debug.aaa.perframe_prop.enable 1
adb shell setprop vendor.debug.camera.dump.p2.debuginfo 1
adb shell setprop vendor.debug.camera.copy.p1.lsc 1
adb shell setprop vendor.debug.camera.dump.lsc2 1
adb shell setprop vendor.debug.camera.SttBufQ.enable 60
adb shell setprop vendor.debug.camera.AAO.dump 1
adb shell setprop vendor.debug.camera.img3o.dump 0
adb shell setprop vendor.debug.camera.p2.dump 1
adb shell setprop vendor.debug.camera.ufo_off 1
adb shell setprop vendor.debug.camera.dump.campipe 1
adb shell setprop vendor.debug.camera.dump.JpegNode 1
adb shell setprop vendor.debug.camera.dbginfo 1
adb shell setprop vendor.debug.camera.cfg.ProcRaw 0
adb shell setprop vendor.debug.camera.raw.type 1
adb shell setprop vendor.mfll.dump.raw 1
adb shell setprop vendor.debug.camera.bss.dump 1
Dump Path:/data/vendor/camera_dump
————————————————
版权声明:本文为CSDN博主「Cam_韦」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_38328785/article/details/109221325