Bootstrap

MTK相机调试adb命令

AE 开启log

adb shell setprop vendor.debug.ae.enable 9
adb shell setprop vendor.debug.drv.ccu_drv 6
adb shell setprop vendor.debug.ccuif.ccu_drv 6
adb shell setprop vendor.debug.aaa.pvlog.enable 1
adb shell setprop vendor.debug.camera.log.hal3a 1
adb shell setprop vendor.debug.mapping_mgr.enable 1
adb shell setprop debug.cam.drawid 1
adb shell setprop debug.lce.core.enable 1
adb shell setprop vendor.debug.lce.face.log.enable 1
adb shell setprop vendor.debug.dynamic_ggm.log 1
adb shell setprop vendor.debug.dynamic_lce.log 1
adb shell setprop vendor.persist.logmuch.detect false
adb shell setprop vendor.debug.ae_mgr.enable 1
adb shell setprop vendor.debug.ae.plineinfo 1
adb shell setprop vendor.drv.ccu.log.ccuaealgo 1
adb shell setprop vendor.drv.ccu.log.ccuflowae 1
adb shell setprop vendor.drv.ccu.log.reserve1 1

Dual AE log
adb shell setprop vendor.persist.logmuch.detect false
adb shell setprop vendor.debug.aaa.pvlog.enable 1
adb shell setprop vendor.debug.ae.plineinfo 1

adb shell setprop vendor.debug.drv.ccu_drv 6
adb shell setprop vendor.debug.ccuif.ccu_drv 6
adb shell setprop vendor.debug.camera.log 1

adb shell setprop vendor.debug.ae.enable 9
adb shell setprop vendor.debug.ae_mgr.enable 1

锁定AE
adb shell setprop vendor.debug.ae_mgr.enable 1
adb shell setprop vendor.debug.ae_mgr.lock 1
adb shell setprop vendor.debug.ae_mgr_ccu.enable 0

手动设定AE
adb shell setprop vendor.ae_mgr.enable 1
adb shell setprop vendor.ae_mgr.lock 1
adb shell setprop vendor.ae_mgr.preview.update 1
adb shell setprop vendor.ae_mgr_ccu.enable 0
adb shell setprop vendor.ae_mgr.shutter 80000
adb shell setprop vendor.ae_mgr.sensorgain 2048
adb shell setprop vendor.ae_mgr.ispgain 1024
adb shell setprop vendor.ae_mgr.preview.update 1

5G平台
adb shell setprop vendor.debug.ae_mgr.ISOspeed 100


AWB 开启log

adb shell setprop vendor.debug.awb_mgr.enable 1
adb shell setprop vendor.debug.awb.enable 1
adb shell setprop vendor.debug.awb_log.enable 1

锁定AWB
adb shell setprop vendor.debug.awb_mgr.enable 1
adb shell setprop vendor.debug.awb_mgr.lock 1


AF 开启log

adb shell setenforce 0
adb shell setprop vendor.debug.af_mgr.enable 4
adb shell setprop vendor.debug.af.enable 1
adb shell setprop vendor.debug.af.log.enable 1
adb shell setprop vendor.debug.pd.enable 1
adb shell setprop debug.cam.drawid 1
adb shell setprop vendor.debug.camera.dbginfo 1
adb shell setprop vendor.debug.pd.vpu.log.enable 1

手动设定AF
adb shell setprop vendor.debug.af_motor.disable 1
adb shell setprop vendor.debug.af_motor.position 200

关闭pdaf命令
adb shell setprop vendor.debug.pdflow.disable 1

6873 FullScan,进相机,touch AF 是 Full scan
adb shell setprop vendor.debug.af.enable 1
adb shell setprop vendor.debug.af.localfullscan 3
adb shell setprop vendor.debug.af.fullscan.step 1


TSF

关闭TSF
adb shell setprop vendor.debug.lsc_mgr.manual_tsf 0
adb shell setprop vendor.debug.lsc_mgr.ratio 32

关闭LSC
adb shell setprop vendor.debug.lsc_mgr.enable 0


ISP 开启log

adb root
adb shell setenforce 0
adb shell setprop persist.vendor.mtk.camera.log_level 3
adb shell setprop vendor.debug.aaa.pvlog.enable 1
adb shell setprop vendor.debug.camera.log 1
adb shell setprop debug.camera.log 1
adb shell setprop vendor.debug.camera.log 1
adb shell setprop vendor.debug.hal3av3.log 263
adb shell setprop debug.camera.log.hal3a 3
adb shell setprop vendor.debug.3a.log 1
adb shell setprop debug.camera.log 3
adb shell setprop debug.hal3a.task 1
adb shell setprop vendor.debug.hal3a.taskmgr 1
adb shell setprop vendor.debug.paramctrl.enable 1
adb shell setprop vendor.debug.isp_debug.enable 1
adb shell setprop vendor.debug.isp_tuning_mgr.enable 499
adb shell setprop vendor.debug.aaa.perframe_prop.enable 1
adb shell setprop vendor.debug.isp_mgr.enable 1
adb shell setprop vendor.debug.mapping_mgr.enable 3
adb shell setprop debug.idxcache.log 1
adb shell setprop vendor.debug.camera.log.p1node 2
adb shell pkill camer*

关闭ISP参数
adb shell setprop vendor.isp.lce.disable 1

adb shell setprop vendor.isp.ccm_r1.disable 1
adb shell setprop vendor.isp.ccm_d1.disable 1


Hal3a 开启log

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 511
adb shell setprop vendor.debug.3a.log 1
adb shell setprop vendor.debug.resultpool.log 1
adb shell setprop vendor.debug.statistic_buf.enable 1
adb shell setprop vendor.debug.thread_raw.log 1
adb shell setprop vendor.debug.idxcache.log 1
adb shell setprop vendor.debug.hal3a.taskmgr 1
adb shell setprop vendor.debug.aao_mgr.enable 1
adb shell setprop vendor.debug.aaa.pvlog.enable 1
adb shell pkill camera*


Flashlight 校准

Android P 校正闪光灯命令:
adb shell setprop vendor.flash_calibration 1
adb shell setprop vendor.flash_quick_calibration_2 1


User版本

user版本开启root权限(待验证)
adb shell setprop service.adb.root 1

user版本打开camera LOGD命令:
adb root
adb shell setprop persist.vendor.mtk.camera.log_level 3
adb shell pkill camera*


APP相关

看APK包名
adb shell dumpsys window

meta dump数据
adb shell dumpsys media.camera -v 2 > meta.info.txt
adb shell cat /proc/driver/camera_info >info.txt

开启mobilelog
adb shell am start -n com.mediatek.mtklogger/com.mediatek.mtklogger.MainActivity

开启debuglogger
adb shell am start -n com.debug.loggerui/.MainActivity

开启EngineerMode
adb shell am start -n com.mediatek.engineermode/.EngineerMode


切换摄像头

adb shell pkill camera*
adb shell setprop mtk.camera.app.keycode.enable 1
adb shell setprop mtk.camera.switch.camera.debug 1
adb shell setprop mtk.camera.switch.id.debug back-1
adb shell am start -a android.media.action.STILL_IMAGE_CAMERA
adb shell input keyevent KEYCODE_C

Vertical blanking计算方式:
(framelength - grabwindow_height) *33ms /framelength > 1ms


CTS测试命令

sudo PATH="$PATH" ./cts-tradefed

run cts -m CtsCameraTestCases -t android.hardware.camera2.cts.MultiViewTest#testDualCameraPreview -s s670jkppppppppppp01 -a arm64-v8a --skip-preconditions
run cts -m CtsAppTestCases -t android.app.cts.SystemFeaturesTest#testCameraFeatures -a arm64-v8a --skip-preconditions


解锁

Android P + kernel-4.9 or after
download preloader with verified boot disabled which location is the same as scatter file. preloader__SBOOT_DIS.bin

  1. boot to Home Screen
  2. go to setting -> system -> Developer options -> OEM unlocking
  3. adb reboot bootloader
  4. fastboot flashing unlock
  5. press volume up key
  6. fastboot reboot
  7. adb root
  8. adb disable-verity
  9. adb reboot
  10. adb root
  11. adb remount

Dump Raw

P70 & before
adb root
adb shell setenforce 0
adb shell setprop persist.vendor.dp.dumpreg.check 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.ufo_off 1
adb shell setprop vendor.debug.camera.p2.dump 1
adb shell setprop vendor.debug.camera.dump.JpegNode 1
adb shell setprop vendor.debug.camera.haljpeg 1
adb shell setprop vendor.debug.camera.dbginfo 1
adb shell setprop vendor.debug.camera.cfg.ProcRaw 1
adb shell setprop vendor.debug.camera.raw.type 1

P70 Q
adb root
adb shell setenforce 0
adb shell setprop persist.vendor.dp.dumpreg.check 1
adb shell setprop persist.vendor.dp.dumpreg.check 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 6
adb shell setprop vendor.debug.camera.AAO.dump 1
adb shell setprop vendor.debug.camera.img3o.dump 0
adb shell setprop vendor.debug.camera.ufo_off 1
adb shell setprop vendor.debug.camera.p2.dump 1
adb shell setprop vendor.debug.camera.dump.JpegNode 1
adb shell setprop vendor.debug.camera.haljpeg 1
adb shell setprop vendor.debug.camera.dbginfo 1
adb shell setprop vendor.debug.camera.cfg.ProcRaw 1
adb shell setprop vendor.debug.camera.raw.type 1
adb shell setprop vendor.debug.camera.dump.campipe 1
adb shell setprop vendor.debug.camera.mfnr.yuv.dump 1
adb shell setprop vendor.debug.camera.bss.dump 1

P90
adb root
adb shell setenforce 0
adb shell mkdir -p /data/vendor/camera_dump
adb shell setprop vendor.debug.camera.SttBufQ.enable 60
adb shell setprop persist.vendor.dp.dumpreg.check 1
adb shell setprop vendor.isp.faceinfo.dump 1
adb shell setprop vendor.debug.camera.ufo_off 1
adb shell setprop vendor.debug.camera.p2.dump 1
adb shell setprop vendor.debug.camera.p2.dump.filter 3
adb shell setprop vendor.debug.camera.dump.JpegNode 1
adb shell setprop vendor.debug.camera.copy.p1.lsc 1
adb shell setprop vendor.debug.hal3av3.forcedump 1
adb shell setprop vendor.debug.camera.dump.p2.debuginfo 1
adb shell setprop mediatek.mfll.dump.raw 1
adb shell setprop vendor.dp.dumpreg.enable 2
adb shell setprop vendor.isp.ynr_tbl.dump 1
adb shell setprop vendor.debug.camera.dump.lsc2 1
adb shell setprop vendor.debug.camera.dump.cap.tsfo 1
adb shell setprop vendor.debug.camera.AAO.dump 1
adb shell setprop vendor.debug.camera.bss.dump 1
adb shell setprop vendor.isp.dce_tbl.dump 1
adb shell setprop vendor.isp.ltm_tbl.dump 1
adb shell setprop vendor.debug.camera.dbginfo 1
adb shell setprop vendor.debug.camera.threshold_4Cell 99

5G
adb root
adb shell setenforce 0
adb shell mkdir -p /data/vendor/camera_dump
adb shell setprop vendor.debug.p2s.dsdn.mode 0
adb shell mrdump_tool output-set none
adb shell setprop vendor.mfll.force 1
adb shell setprop vendor.mfll.log_level 3
adb shell “kill $(pidof cameraserver)”
adb shell “kill $(pidof camerahalserver)”
adb shell setprop vendor.mfll.dump.sim 1
adb shell setprop vendor.mfll.dump.mixer.out 1
adb shell setprop vendor.debug.camera.p2.dump 1
adb shell setprop vendor.debug.camera.img3o.dump 1
adb shell setprop vendor.debug.camera.dump.JpegNode 1
adb shell setprop persist.vendor.dp.dumpreg.check 1
adb shell setprop vendor.debug.camera.SttBufQ.enable 60
adb shell setprop vendor.debug.camera.ufo_off 1
adb shell setprop vendor.debug.camera.p2.dump 1
adb shell setprop vendor.debug.camera.dump.campipe 1
adb shell setprop vendor.debug.camera.dump.p2 1
adb shell setprop vendor.debug.camera.dump.p2.ext.img3o 1
adb shell setprop vendor.debug.camera.img3o.dump 1
adb shell setprop vendor.debug.camera.copy.p1.lsc 1
adb shell setprop vendor.debug.hal3av3.forcedump 1
adb shell setprop vendor.debug.aaa.perframe_prop.enable 1
adb shell setprop mtk.camera.app.keycode.enable 1
adb shell setprop vendor.dp.dumpreg.enable 2
adb shell setprop vendor.debug.camera.dump.p2.debuginfo 1
adb shell setprop vendor.debug.camera.dump.lsc2 1
adb shell setprop vendor.debug.camera.AAO.dump 1
adb shell setprop vendor.flash_bin_en 1
adb shell setprop vendor.flash_pf_bmp_en 1
adb shell setprop vendor.flash_dump.enable 1
adb shell setprop vendor.isp.ynr_tbl.dump 1
adb shell setprop vendor.isp.ltm_tbl.dump 1
adb shell setprop vendor.isp.dce_tbl.dump 1
adb shell setprop vendor.isp.faceinfo.dump 1
adb shell setprop vendor.isp.ynr_map.dump 1
adb shell setprop vendor.debug.camera.msnr.ndd.l1 1
adb shell setprop vendor.debug.camera.msnr.ndd.l2 1
adb shell setprop vendor.debug.camera.bss.dump 1
adb shell setprop vendor.isp.lcesho_tbl.dump 1
adb shell setprop vendor.mfll.dump.mixer 1
adb shell setprop vendor.debug.camera.dump.p2 1
adb shell setprop vendor.debug.isp.dumpcq.enable 1
adb shell setprop vendor.imgsys.bittruedump.enable 2
adb shell setprop vendor.debug.camera.dump.mfb.tuning 1
adb shell setprop vendor.debug.camera.dump.mss.tuning 1
adb shell setprop vendor.msf.debug.bittruedump.enable 1
adb shell setprop vendor.mss.debug.bittruedump.enable 1
adb shell setprop vendor.debug.camera.dump.swmsf 1
adb shell setprop vendor.debug.camera.dump.msyuv 1
adb shell setprop vendor.debug.camera.dump.mfbtbl 1
adb shell setprop vendor.debug.camera.dbginfo 1
adb shell “kill $(pidof camerahalserver)”
adb shell “kill $(pidof cameraserver)”
adb shell pkill camera*


字符串转换脚本

#!/bin/bash 

if [ $# != 2 ]  
then
	echo -e "\033[1m\033[32m参数数量不正确, cgword 目标字符 替换字符\033[0m"
	exit
fi

sed -i s/$1/$2/g $(grep  $1 -lr .)

for i in `find . -name "*$1*"`
do 
	name=$(echo $i | sed s/$1/$2/g)
	mv $i ${name}
done

bigsrc=$(echo $1 | tr '[a-z]' '[A-Z]')
bigtar=$(echo $2 | tr '[a-z]' '[A-Z]')
sed -i s/$bigsrc/$bigtar/g $(grep  $bigsrc -lr .)

PDAF线性度检查脚本

#!/bin/bash

if [ $# == 0 ]  # 如果参数为0 提示以下信息并退出
then
    echo -e "\033[32m缺少参数\033[0m"
    exit
fi

inf=$1
marco=$2
step=$3

echo "Inf:$inf, Marco:$marco, step:$step"

adb shell setprop vendor.debug.af_motor.disable 1

sleep 1

adb shell am start -a android.media.action.STILL_IMAGE_CAMERA

sleep 3

for ((i=0; i<10; i++))
do
	if [ $i != 9 ]
	then
		temp=$(($inf + $i * $step))
	else
		temp=$marco
	fi
	
	echo "Move To DAC $temp"
	adb shell setprop vendor.debug.af_motor.position $temp
	sleep 2
done

adb shell input keyevent 4
;