mtk camera log
android P 需修改
/vendor/mediatek/proprietary/external/aee/config_external/init.aee.customer.vendor.rc里添加
on init
setprop ro.vendor.aee.enforcing no(注意修改此属性后, 无法通过CTS 安全测试项, 在正式发布版本时, 需要恢复默认设置,把此行修改去掉)
setprop persist.vendor.aeev.core.dump enable
setprop persist.vendor.aeev.core.direct enable
setprop persist.vendor.mtk.aee.mode 3
setprop persist.vendor.mtk.aeev.mode 3
打开camera log
adb shell setprop vendor.debug.camera.log 1
adb shell
ps -ef | grep camera
kill * //camerahalserver
setprop vendor.debug.camera.log.sim3a 2//打开cam0对应的3A的log
setprop persist.vendor.mtk.camera.log_level 3 //设置成logd
kill /*camerahalserver*/
AEE log抓取:
/vendor/etc/init/hw/init.aee.rc添加以下配置
setprop ro.vendor.aee.enforcing no
setprop persist.vendor.aeev.core.dump enable
setprop persist.vendor.aeev.core.direct enable
setprop persist.vendor.mtk.aee.mode 3
setprop persist.vendor.mtk.aeev.mode 3
重启,然后打开mtklogger抓取log就可以
getprop | grep aee看设置是否生效
data/aee_exp下面是不是有DB产生,DB是用GAT解析
从上倒下,整个流的:
MtkCam|Hal3Av3|Surface|Camera3|CameraSDK|CameraService|CameraManagerGlobal|Camera2ClientBase|CAM_CUS_MSDK|ae_mgr|awb_mgr|af_mgr_v3|gma_mgr|lce_mgr|lce_core|lsc_mgr_dft|AppStreamMgr|onConfigureStreamsLocked|HwTransHelper|SensorSettingPolicy|P1NodeImp|processCaptureRequest_3_4|ppl_context|pipeline|MWFrameRequest|rrz_in_w|rrz_crop_x|P1HwSettingPolicy|StreamInfo|parseSensorParamsSetting|printQParams
Android log:
Cam::1 Cam::0 , 0和 1表示摄像头id 0或者1,这个关键字可以看到p1每一帧的接收和处理
Kernel log:关键字ISP_BH_Workqueue可以看到每一帧的接收
Lsc log: 03-17 11:28:22.118 3815 3848 D lsc_mgr_dft: [getSensorResolution] SensorMode(0), full_0(2592,1944) crop1(0,0,2592,1944) resize(2592,1944) crop2(0,0,2592,1944) final size(2592,1944)
P1node的log:
04-17 14:01:03.226 22896 23068 I rss_hal : [CreateInstance] MtkCam/P1NodeImp sensorIdx 1
04-17 14:01:03.226 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] mp3A->config +++
04-17 14:01:03.226 22896 24471 I MtkCam/P1NodeImp: [createAction] [Cam::1 R0 S0 E0 D0 O0 #0] [P1::REQ][Num Q:1 M:0 F:-1 R:-1 @0][Type:2 Out:x185 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] [META ze:-1 ci:-1 rt:-1 tn:-1 qc:-1 fi:-1 fr:-1] [New-Dummy][2]
04-17 14:01:03.226 22896 24471 I MtkCam/P1NodeImp: [setupAction] [Cam::1 R1 S0 E1 D0 O0 #0] [P1::ENQ][Num Q:1 M:1 F:-1 R:-1 @0][Type:2 Out:x185 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] [Exp:0ns] [MetaCtrl][SCALER_CROP(0)][SENSOR_CROP(0)][RESIZER_SET(0)][RRZ][0](x0)(Buf)(640x480)(S:1200:576000 P:0x9000000 V:0x7c6d807000 F:0x2205)(Crop)(0,0-2720x2040)(640x480) [LCS][2](x0)(Buf)(352x352)(S:704:247808 P:0x8b00000 V:0x7c7d93d000 F:0x2401)(Crop)(0,0-352x352)(352x352) [IMG][7](x1)(Buf)(2720x1)(S:3400:3400 P:0x8000000 V:0x7c7faf2000 F:0x2201)(Crop)(0,0-2720x1)(2720x1) [RSS][8](x0)(Buf)(288x512)(S:288:147456 P:0x8c00000 V:0x7c7e15f000 F:0x2400)(Crop)(0,0-288x512)(288x512) [LMV](P:0xc800100 V:0x7c7fe90100)
04-17 14:01:03.226 22896 24471 I MtkCam/P1NodeImp: [threadLoop] [Cam::1] wait ready + (0-0)
04-17 14:01:03.235 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] mp3A->config ---
04-17 14:01:03.235 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] mpISP->config +++
04-17 14:01:03.235 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] mpISP->config ---
04-17 14:01:03.235 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] mp3A->start +++
04-17 14:01:03.240 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] mp3A->start ---
04-17 14:01:03.240 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] mpISP->start +++
04-17 14:01:03.240 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] mpISP->start ---
04-17 14:01:03.241 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] mpCamIO->start +++
04-17 14:01:03.242 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] mpCamIO->start ---
04-17 14:01:03.242 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] mpConnectLMV->enableSensor +++
04-17 14:01:03.242 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] mpConnectLMV->enableSensor ---
04-17 14:01:03.242 22896 23068 I MtkCam/P1NodeImp: [hardwareOps_start] [Cam::1] End - Cam::1 Sensor(2720x2040)(27370000ns) Raw(1,0x2)-Proc(2720x2040)-Pure(2720x2040) Bin(2720x2040) BinEn=0 TG(0:0) DTwin(1@0)=0 LSM(1) QLV(2) Ratio(6) SensorCfg(i:1 2720x2040 s:0 b:0 c:1, h:0 f:30 t:0 d:0) ConfigPort[5]:(0x1f) InitParam[R:0 B:10 D:1 Nd:0 Ul:0 Pb:1 Dt:0 Iq:2 F(DataPattern:x0 OffBin:x0 SensorNum:x0 RAW:x0)]
04-17 14:01:03.242 22896 24471 I MtkCam/P1NodeImp: [threadLoop] [Cam::1] wait ready - (0-0)
04-17 14:01:03.242 22896 23068 D MtkCam/P1NodeImp: [config] [Cam::1] API -
04-17 14:01:03.253 22896 24441 I MtkCam/P1NodeImp: [setRequest] [Cam::0 R21 S21 E20 D18 O17 #0] [P1::SET][Num Q:21 M:21 F:19 R:19 @0][Type:1 Out:x10 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] Num[21] Ctrl[1]=[ 21 ]
04-17 14:01:03.253 22896 22911 I MtkCam/P1NodeImp: [queue] [Cam::0 R21 S21 E20 D18 O17 #1] [P1::REQ][Num Q:22 M:0 F:20 R:20 @0][Type:1 Out:x10 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] [META ze:0 ci:1 rt:1 tn:-1 qc:-1 fi:-1 fr:-1] [New-Request][0] IOmap-Img[1]=<0_I[0]{}_O[1]{0x100000001}>-Meta[1]=<0_I[2]{0x80000000,0x10000000d}_O[2]{0x10000000f,0x100000015}> CfgStream-Img[OutIMG:0x100000001(1)]-Meta[InAPP:0x80000000(1),InHAL:0x10000000d(1),OutAPP:0x100000015(1),OutHAL:0x10000000f(1)] | [PreSet][Key:22] Num(0) Dummy(0) MetaCnt[APP:61,HAL:6] | [Rev:0] depth(1) burst(1) Que[1]
04-17 14:01:03.253 22896 24434 I MtkCam/P1NodeImp: [releaseAction] [Cam::0 R21 S21 E20 D18 O17 #1] [P1::DEQ][Num Q:18 M:18 F:16 R:16 @20][Type:1 Out:x10 Rec:x0 Raw:1 Cap:0 Exe:3 Flush:x0] job(0/1) IMG(proc) T-ns(EXP: 33333000)(Src:0)(SOF: m_83955824064000 b_83955824064000)(SS: 83955790731000) C(SensorTs:83955790731000) [MetaInAPP_0](0x80000000)<N:x0><U:xc> [MetaInHAL_1](0x10000000d)<N:x0><U:xc> [MetaOutAPP_2](0x100000015)<W:x2><U:xc> [MetaOutHAL_3](0x10000000f)<W:x2><U:xc> [ImgOutIMG_4](0x100000001)<W:x2><U:xc> [MetaCnt] In(61,6) Out(64,14) Aaa(61,8) Aaa-Isp(61,8) [ApplyRelease] [Last-Frame-Num(15_14:01:03.220212@24434) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ... ]
04-17 14:01:03.253 22896 24435 I MtkCam/P1NodeImp: [releaseFrame] [Cam::0 R21 S21 E20 D18 O18 #1] [P1::OUT][Num Q:18 M:18 F:16 R:16 @20][Type:1 Out:x10 Rec:x0 Raw:1 Cap:0 Exe:3 Flush:x0] [Release-0] [DispatchFrame] [Last-Frame-Num(15_14:01:03.220547@24435) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ... ]
04-17 14:01:03.255 22896 24441 I MtkCam/P1NodeImp: [setupAction] [Cam::0 R21 S21 E21 D18 O18 #1] [P1::ENQ][Num Q:21 M:21 F:19 R:19 @23][Type:1 Out:x10 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] [Exp:33333000ns] [MetaCtrl][SCALER_CROP(1) (0,0_960x1280) ][SENSOR_CROP(0)][RESIZER_SET(0)][IMG][4](x1)(Buf)(480x640)(S:600:384000 P:0xf900000 V:0x7c6c059000 F:0x2201)(Crop)(0,0-480x640)(480x640)
04-17 14:01:03.259 22896 23068 I MtkCam/P1NodeImp: [setNodeCallBack] [Cam::1] PipelineNodeCallBack=0x7c691a8800
04-17 14:01:03.267 22896 23068 I MtkCam/P1NodeImp: [queue] [Cam::1 R1 S0 E1 D0 O0 #1] [P1::REQ][Num Q:2 M:0 F:0 R:0 @0][Type:1 Out:x185 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] [META ze:0 ci:1 rt:-1 tn:-1 qc:-1 fi:-1 fr:-1] [New-Request][0] IOmap-Img[1]=<0_I[0]{}_O[3]{0x100000002,0x100000003,0x100000004}>-Meta[1]=<0_I[2]{0x80000000,0x10000000d}_O[2]{0x10000000f,0x100000015}> CfgStream-Img[OutIMG:0x100000001(0),OutRRZ:0x100000002(1),OutLCS:0x100000003(1),OutRSS:0x100000004(1)]-Meta[InAPP:0x80000000(1),InHAL:0x10000000d(1),OutAPP:0x100000015(1),OutHAL:0x10000000f(1)] | [Rev:0] depth(1) burst(1) Que[1]
04-17 14:01:03.268 22896 23068 I MtkCam/P1NodeImp: [setRequest] [Cam::1 R2 S2 E1 D0 O0 #0] [P1::SET][Num Q:2 M:2 F:0 R:0 @0][Type:1 Out:x185 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] Num[2] Ctrl[1]=[ 2 ]
04-17 14:01:03.273 22896 23068 I MtkCam/P1NodeImp: [queue] [Cam::1 R2 S2 E1 D0 O0 #1] [P1::REQ][Num Q:3 M:0 F:1 R:1 @0][Type:1 Out:x185 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] [META ze:0 ci:1 rt:-1 tn:-1 qc:-1 fi:-1 fr:-1] [New-Request][0] IOmap-Img[1]=<0_I[0]{}_O[3]{0x100000002,0x100000003,0x100000004}>-Meta[1]=<0_I[2]{0x80000000,0x10000000d}_O[2]{0x10000000f,0x100000015}> CfgStream-Img[OutIMG:0x100000001(0),OutRRZ:0x100000002(1),OutLCS:0x100000003(1),OutRSS:0x100000004(1)]-Meta[InAPP:0x80000000(1),InHAL:0x10000000d(1),OutAPP:0x100000015(1),OutHAL:0x10000000f(1)] | [PreSet][Key:3] Num(0) Dummy(0) MetaCnt[APP:63,HAL:9] | [Rev:0] depth(1) burst(1) Que[1]
04-17 14:01:03.278 22896 24471 I MtkCam/P1NodeImp: [onReturnFrame] [Cam::1] need flush act [Num Q:1 M:1 F:-1 R:-1 @0][Type:2 Out:x185 Rec:x0 Raw:1 Cap:0 Exe:3 Flush:x10]
04-17 14:01:03.278 22896 24471 I MtkCam/P1NodeImp: [releaseAction] [Cam::1 R2 S2 E1 D1 O1 #1] [P1::DEQ][Num Q:1 M:1 F:-1 R:-1 @0][Type:2 Out:x185 Rec:x0 Raw:1 Cap:0 Exe:3 Flush:x0] job(0/1) IMG(pure) RRZ0(0-0-2720x2040)(0-0-0x0)(640x480) T-ns(EXP: 0)(Src:1)(SOF: m_83955851099000 b_83955851099000)(SS: 83955851099000) [MetaCnt] In(-1,-1) Out(-1,-1) Aaa(-1,-1) Aaa-Isp(-1,-1) [InternalReturn]
04-17 14:01:03.286 22896 24459 I MtkCam/P1NodeImp: [setupAction] [Cam::1 R2 S2 E2 D1 O1 #1] [P1::ENQ][Num Q:2 M:2 F:0 R:0 @2][Type:1 Out:x185 Rec:x0 Raw:1 Cap:0 Exe:1 Flush:x0] [Exp:30004000ns] [MetaCtrl][SCALER_CROP(1) (0,0_3264x2448) ][SENSOR_CROP(1) (2,2_2716x2036) ][RESIZER_SET(0)][RRZ][0](x0)(Buf)(640x480)(S:1200:576000 P:0x9200000 V:0x7c6b2ad000 F:0x2205)(Crop)(2,2-2716x2036)(640x480) [LCS][2](x0)(Buf)(352x352)(S:704:247808 P:0x9100000 V:0x7c7cea7000 F:0x2401)(Crop)(0,0-352x352)(352x352) [IMG][7](x1)(Buf)(2720x1)(S:3400:3400 P:0x8000000 V:0x7c7faf2000 F:0x2201)(Crop)(0,0-2720x1)(2720x1) [RSS][8](x0)(Buf)(288x512)(S:288:147456 P:0xb000000 V:0x7c7e074000 F:0x2400)(Crop)(0,0-288x512)(288x512) [LMV](P:0xc800200 V:0x7c7fe90200)
Adb获取camera信息的命令: dumpsys media.camera
Mtk抓图的命令:
抓pure raw方法
adb root
adb remount
adb shell setenforce 0
adb shell mkdir /data/vendor/camera_dump/ -p
for imgo:
adb shell setprop vendor.debug.camera.cfg.ProcRaw 1
adb shell setprop vendor.debug.camera.raw.type 1
adb shell setprop vendor.debug.camera.ufo_off 1
adb shell setprop vendor.debug.camera.dump.en 1
adb shell setprop vendor.debug.camera.dump.p1.imgo 1
进camera,
adb shell setprop vendor.debug.camera.dump.en 0 //停止抓图
dump完后,dump出来的buffer都放在 /data/vendor/camera_dump 这个目录下了pull到本地
或者
adb root
adb shell setprop vendor.debug.camera.dump.en 1
adb shell setprop vendor.debug.camera.dump.p1.imgo 1
adb shell stop camerahalserver
adb shell start camerahalserver
抓preview图的方法
adb root
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时,先按home键退出camera,再下adb命令:
adb shell setprop vendor.debug.camera.preview.dump 0
dump完后,dump出来的buffer都放在 /data/vendor/camera_dump 这个目录下了
pull到本地:
adb pull /data/vendor/camera_dump <本地路径>
开log D 方法:
adb root
adb shell setenforce 0
adb shell logcat -G 200M
adb shell setprop persist.vendor.mtk.camera.log_level 3
adb shell setprop persist.vendor.debug.camera.log 3
adb shell setprop vendor.debug.camera.log 3
adb shell setprop vendor.debug.camera.capture.log 3
adb shell setprop vendor.debug.mtkcam.p2.log 3
adb shell pkill cameraserver
adb shell pkill camerahalserver
adb shell pkill camera
App下发request的log关键字:
AppRequest:
人脸识别打开log方法:
adb shell setprop vendor.debug.aaa.pvlog.enable 1
adb shell setprop vendor.debug.ae_mgr.enable 1
adb shell setprop persist.vendor.mtk.camera.log_level 4
adb shell setprop "vendor.debug.camera.log.FDNode" 1
adb shell kill camerahalserver
收到的帧数:
06-23 12:27:55.278 3267 3433 D SeninfDrv: [debug]SENINF1_PkCnt(0x1), SENINF2_PkCnt(0x1), SENINF3_PkCnt(0x0), SENINF5_PkCnt(0x1)
Camera的数据流简要介绍
说明:
1) TG(Timing Generate):从sensor获取数据,并送给ISP处理.
2) Platform Data Processor: 包括平台在后端对图像数据进行resize、rotate、flip、format convert等处理.它可以同时有两个buffer输出.
当normal preview时,port1输出给display,port2输出给face detection或者app preview callback
当normal capture时,port1输出大图给jpeg encoder,port2输出小图给回显和thumbnail encode.
如何确定底层跑的是否是HAL3,
可以通过抓取进camera的mobile log中的main log确认:
log中会打印:MtkCam/Cam3Device,且搜索device_version会打印device_version:0x302