高通相机调试命令和记录

开启相机log

adb root
adb shell setprop persist.vendor.camera.logInfoMask 0x1C080
adb shell setprop persist.vendor.camera.logVerboseMask 0x1C080
adb shell setprop persist.vendor.camera.logWarningMask 0xFFFFFFFF
adb shell setprop vendor.debug.camera.overrideLogLevels 0x1F
adb shell pkill provider*

adb shell logcat -G 256M
adb shell logcat –v threadtime -b main -b kernel -b crash > log.txt

vendor/qcom/proprietary/camx/src/utils/camxtypes.h
高通相机调试命令和记录_第1张图片


调整AE

adb root
adb shell setprop vendor.debug.camera.aelock.enable 1
adb shell setprop vendor.debug.camera.aelock.longgain 1
adb shell setprop vendor.debug.camera.aelock.safegain 1
adb shell setprop vendor.debug.camera.aelock.shortgain 1
adb shell setprop vendor.debug.camera.aelock.longexptime 120000
adb shell setprop vendor.debug.camera.aelock.safeexptime 120000
adb shell setprop vendor.debug.camera.aelock.shortexptime 120000


手动推lens

adb shell setprop vendor.debug.camera.af.manual 1
adb shell setprop vendor.debug.camera.af.ctrl.lenspos 900


开启PDAF log

adb shell setprop persist.vendor.camera.pdaf_logging 1


关闭MCTF

adb shell setprop persist.vendor.camera.enablemctf 0


开启 SOF, EOF, SOT, EOT IRQs log

adb shell “echo 0xf > /sys/kernel/debug/camera_ife/ife_csid_debug”
adb shell “echo 0xf > /sys/kernel/debug/camera_tfe/tfe_csid_debug”

hal收到数据的log
V4L_EVENT_CAM_REQ_MGR_SOF


offlinelog

生成的手机目录为:data/vendor/camera/offlinelog

开启offlineLog方法:
adb shell “echo enableAsciiLogging=1 >> vendor/etc/camera/camxoverridesettings.txt”

将offlinelog进行合并方法:一个python脚本,位于
vendor/qcom/proprietary/chi-cdk/tools/binary_log
merge_text_logs.py,通过-o参数指定输出文件目录,-d参数指定offlinelog的本地目录


Systrace的抓取

抓取脚本在安卓源码路径:external/chromium-trace/systrace.py
python systrace.py -o ~/systrace.html
python systrace.py --time=5 -o ~/systrace.html
python systrace.py --time=5 -o ~/trace.html sched gfx view wm

python systrace.py gfx input view sched am wm dalvik freq idle load sync workq power mmc disk –b 40000 –t 5 -o systrace.html
python systrace.py gfx sched am wm dalvik freq idle load sync workq power mmc disk camera hal res membus –b 40000 –t 10 -o output.html
python systrace.py gfx sched am wm dalvik freq idle load sync workq power mmc disk video audio hal res membus –b 40000 –t 10 -o output.html

sched    CPU Scheduling
freq     CPU frequency
load     CPU load
power    MSM power status
gfx      Graphics
input    Input
wm       Window Manager
am       Activity Manager
view     View
dalvik   Dalvik VM (until KitKat release

内存

adb shell dumpsys meminfo PID
adb shell pmap -x PID
adb shell cat /proc/PID/smap

ION:
1、使用情况:adb shell cat /sys/kernel/debug/dma_buf/bufinfo

2、adb shell
cd /sys/kernel/debug/dma_buf
lsof | grep dma

3、各进程ion使用:adb shell cat /sys/kernel/debug/dma_buf/dmaprocs

4、开启ion的trace log:echo 1 > /sys/kernel/debug/tracing/events/ion/enable

5、log配置:
logInfoMask=0x20
enableMemoryStats=TRUE


sof freeze调试

  1. UMD offline log and KMD log with following command
    adb shell “echo 0x3 > /sys/kernel/debug/camera_ife/ife_csid_debug”
    adb shell ‘echo 0x18 > /sys/module/cam_debug_util/parameters/debug_mdl’

  2. Please boost IFE CLK with the command to see if this issue improved:
    (1) Increase IFE CLK
    adb shell “echo ifeClockFrequencyMHz=0xffffffff >> /vendor/etc/camera/camxoverridesettings.txt”
    (2) Increase BW
    adb shell “echo ifeCamnocBandwidthMBytes=0xFFFFFFFF >> /vendor/etc/camera/camxoverridesettings.txt”
    adb shell “echo ifeExternalBandwidthMBytes=0xFFFFFFFF >> /vendor/etc/camera/camxoverridesettings.txt”"


区分效果参数

FillTuningModeData
vendor/qcom/proprietary/chi-cdk/core/chiutils/chxtils.cpp


解析symbol文件

项目中的addr2line路径:
prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin

aarch64-linux-android-addr2line -Cfe symbols/vendor/lib64/xxx.so 0000001294


调试记录

打印进程的backtrace:
adb shell “debuggerd -b `pidof [email protected]_64`”

获取camera数量:
frameworks/av/camera/CameraBase.cpp
getNumberOfCameras()

API1 过滤尺寸:
frameworks/av/services/camera/libcameraservice/api1/client2/Parameters.cpp
KEY_SUPPORTED_PREVIEW_SIZES
status_t Parameters::initialize(CameraDeviceBase *device, int deviceVersion) {

Gpu工作频率:
adb shell cat /sys/class/kgsl/kgsl-3d0/gpuclk
adb shell cat /sys/class/kgsl/kgsl-3d0/devfreq/cur_freq

Gpu最大、最小工作频率:
adb shell cat /sys/class/kgsl/kgsl-3d0/devfreq/max_freq
adb shell cat /sys/class/kgsl/kgsl-3d0/devfreq/min_freq

Gpu可用频率:
adb shell cat /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies
adb shell cat /sys/class/kgsl/kgsl-3d0/devfreq/available_frequencies

CPU当前频率:
adb shell cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq

CPU性能模式:
adb shell “echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor”

CPU调度模式:
adb shell “echo schedutil > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor”

运行时查看MCLK:
adb shell cat sys/kernel/debug/clk/gcc_camss_mclk0_clk/measure

编译相机bin文件:
python buildbins.py --yaml-file-name=buildbins_xxx.yaml

编译单独库:
make com.qti.feature2.rt com.qti.feature2.generic com.qti.feature2.gs com.qti.chi.override -j8 2>&1 | tee build.log

编译骁龙相机:
cd vendor/codeaurora/packages/apps/SnapdragonCamera
mm

修改git编辑器 和 提交模板文件
git config core.editor “vim”
git config --global commit.template ~/CommitLog

你可能感兴趣的:(相机驱动,android)