高通相關網址:Createpoint: https://createpoint.qti.qualcomm.com(可下載文檔,Release Note等)
Chipcode: https://chipcode.qti.qualcomm.com(下載私有代碼)
開源代碼: https://www.codeaurora.org/xwiki/bin/QAEP/release(下載開源代碼)
Case和文檔: https://support.cdmatech.com(Case,文檔,工具等)
shell
高通網站 image 轉換工具:https://cap.qti.qualcomm.com/default.aspx
ide
調試平臺信息:【SDM845/670】 工具
如下爲參考用例,具體請以 sdm845_caf\vendor\qcom\proprietary\camx\src\core\camxsettings.xml 爲準!!!
網站
1.LOG信息相關:spa
--AF相關LOG控制--
例: setprop persist.vendor.camera.logInfoMask 0x8000000 //AF info level log setprop persist.vendor.camera.logVerboseMask 0x8000000 //AF verbose level log
adb shell "echo logInfoMask=0x8000000 >> /vendor/etc/camera/camxoverridesettings.txt" adb shell "echo logVerboseMask=0x8000000 >> /vendor/etc/camera/camxoverridesettings.txt"
Mask值對應以下:(1 << 27)=0x8000000 即對應AF模塊
// The group tag for a given debug print message typedef UINT32 CamxLogGroup; static const CamxLogGroup CamxLogGroupNone = (1 << 0); ///< Generic group static const CamxLogGroup CamxLogGroupSensor = (1 << 1); ///< Sensor static const CamxLogGroup CamxLogGroupIFace = (1 << 2); ///< IFace static const CamxLogGroup CamxLogGroupISP = (1 << 3); ///< ISP static const CamxLogGroup CamxLogGroupPProc = (1 << 4); ///< Post Processor static const CamxLogGroup CamxLogGroupImgLib = (1 << 5); ///< Image Lib static const CamxLogGroup CamxLogGroupCPP = (1 << 6); ///< CPP static const CamxLogGroup CamxLogGroupHAL = (1 << 7); ///< HAL static const CamxLogGroup CamxLogGroupJPEG = (1 << 8); ///< JPEG static const CamxLogGroup CamxLogGroupStats = (1 << 9); ///< Stats static const CamxLogGroup CamxLogGroupCSL = (1 << 10); ///< CSL static const CamxLogGroup CamxLogGroupApp = (1 << 11); ///< Application static const CamxLogGroup CamxLogGroupUtils = (1 << 12); ///< Utilities static const CamxLogGroup CamxLogGroupSync = (1 << 13); ///< Sync static const CamxLogGroup CamxLogGroupMemSpy = (1 << 14); ///< MemSpy static const CamxLogGroup CamxLogGroupAssert = (1 << 15); ///< Asserts static const CamxLogGroup CamxLogGroupCore = (1 << 16); ///< Core static const CamxLogGroup CamxLogGroupHWL = (1 << 17); ///< HWL static const CamxLogGroup CamxLogGroupChi = (1 << 18); ///< CHI static const CamxLogGroup CamxLogGroupDRQ = (1 << 19); ///< DRQ static const CamxLogGroup CamxLogGroupFD = (1 << 20); ///< FD static const CamxLogGroup CamxLogGroupIQMod = (1 << 21); ///< IQ module static const CamxLogGroup CamxLogGroupLRME = (1 << 22); ///< LRME static const CamxLogGroup CamxLogGroupNCS = (1 << 23); ///< NCS static const CamxLogGroup CamxLogGroupMeta = (1 << 24); ///< Metadata static const CamxLogGroup CamxLogGroupAEC = (1 << 25); ///< AEC //0x2000000 static const CamxLogGroup CamxLogGroupAWB = (1 << 26); ///< AWB //0x4000000 static const CamxLogGroup CamxLogGroupAF = (1 << 27); ///< AF //0x8000000
--禁用深度焦點指示--
setprop persist.vendor.camera.af.depthfocus 1
disableFocusIndication=1
--關閉 PDAF--
setprop persist.vendor.camera.disablePDAF 1
disablePDAF=1
--開啓PDLib log--
setprop persist.camera.pdaf_logging 1
--開啓PDAF performance log--
setprop persist.camera.pdaf_profiling 1
--開啓 AF debug log--
setprop persist.camera.stats.af.debug 5
setprop persist.camera.stats.haf.debug 5
--設置 fullsweep 模式--
afFullsweep=0 //fullsweep off
afFullsweep=1 //far to near
afFullsweep=2 //near to far
afFullsweep=3 //both
--Dump EEPROM 保存OTP數據至 /data/misc/camera/ --
dumpSensorEEPROMData=1
--3A調試 exif信息--
debugDataSizeAEC=6000
debugDataSizeAWB=550000
debugDataSizeAF=70000
--CHI Override log--
persist.vendor.camera.logInfoMask 0x40080 //default:0x0
persist.vendor.camera.logVerboseMask 0x40000 //default:0x0
vendor.debug.camera.overrideLogLevels 0x1F //default:1
<Help>Bitmask of log levels, bit 0 - error, bit 1 - warning, bit 2 - info, bit 3 - debug</Help>
--Assert--
persist.vendor.camera.assertMask
assertMask=0x2
--Warning log--
persist.vendor.camera.logWarningMask
logWarningMask=0x2
--Info log--
persist.vendor.camera.logInfoMask
logInfoMask=0x2
--Perf Info log--
persist.vendor.camera.logPerfInfoMask
logPerfInfoMask=0x2
--Verbose Info log--
persist.vendor.camera.logVerboseMask
logVerboseMask=0x2
--Entry/Exit log--
persist.vendor.camera.logEntryExitMask
logEntryExitMask=0x2
--DRQ Log--
persist.vendor.camera.logDRQEnable
logDRQEnable=TRUE
--System Log Enable--
persist.vendor.camera.systemLogEnable
systemLogEnable=FALSE
--Log filename--
persist.vendor.camera.debugLogFilename
debugLogFilename=cameralog
--Trace group--
persist.vendor.camera.traceGroupsEnable
traceGroupsEnable=0x2
--Enable FPS Logs--
persist.vendor.camera.enableFPSLog
enableFPSLog=TRUE
2.ChiOverride 設置 debug
(1)開關ZSL
調試
vendor.debug.camera.overrideDisableZSL adb shell "echo overrideDisableZSL=1 >> /vendor/etc/camera/camxoverridesettings.txt"
(2)開關MFNR
code
vendor.debug.camera.overrideEnableMFNR adb shell "echo overrideEnableMFNR=1 >> /vendor/etc/camera/camxoverridesettings.txt"
(3)強制選擇一個usecaseorm
vendor.debug.camera.overrideForceUsecaseId adb shell "echo overrideForceUsecaseId=8 >> /vendor/etc/camera/camxoverridesettings.txt」
(4)強制選擇一個sensor mode視頻
vendor.debug.camera.overrideForceSensorMode adb shell "echo overrideForceSensorMode=1 >> /vendor/etc/camera/camxoverridesettings.txt"
(5)啓用GPU Node Rotation Usecase
vendor.debug.camera.overrideGPURotationUsecase adb shell "echo overrideGPURotationUsecase=1 >> /vendor/etc/camera/camxoverridesettings.txt"
(6)強制使用不帶3A的HFR Usecase
vendor.debug.camera.overrideHFRNo3AUseCase adb shell "echo overrideHFRNo3AUseCase=1 >> /vendor/etc/camera/camxoverridesettings.txt"
(7)容許使用AdvancedCameraUsecase
vendor.debug.camera.overrideUseAdvancedUsecase adb shell "echo overrideUseAdvancedUsecase=0 >> /vendor/etc/camera/camxoverridesettings.txt"
(8)開啓 EIS V2/V3
vendor.debug.camera.eisv2enable adb shell "echo EISV2Enable=1 >> /vendor/etc/camera/camxoverridesettings.txt"
vendor.debug.camera.eisv3enable adb shell "echo EISV3Enable=1 >> /vendor/etc/camera/camxoverridesettings.txt"
(9) EIS V2/V3 Margin
vendor.debug.camera.eisv2margin adb shell "echo EISV2Margin=0.4 >> /vendor/etc/camera/camxoverridesettings.txt"
vendor.debug.camera.eisv3margin
adb shell "echo EISV3Margin=0.4 >> /vendor/etc/camera/camxoverridesettings.txt"
(10)EIS V2/V3 Frame Delay
vendor.debug.camera.eisv2framedelay adb shell "echo EISV2FrameDelay=1 >> /vendor/etc/camera/camxoverridesettings.txt"
vendor.debug.camera.eisv3framedelay
adb shell "echo EISV3FrameDelay=1 >> /vendor/etc/camera/camxoverridesettings.txt"
(11)Number of PCRs before stream on
vendor.debug.camera.numPCRsBeforeStreamOn adb shell "echo numPCRsBeforeStreamOn=1 >> /vendor/etc/camera/camxoverridesettings.txt"
(12)圖像 Buffer Count Override (初始化期間分配的圖像buffer計數,默認值8)
vendor.debug.camera.overrideImageBufferCount adb shell "echo overrideImageBufferCount=7 >> /vendor/etc/camera/camxoverridesettings.txt"
(13)Stats Frame Skipping 【0: invalid. <default 1: No Skip.> 2: skip 1 frame. 3: skip 2 frames】
vendor.debug.camera.statsProcessingSkipCount adb shell "echo statsProcessingSkipFactor=2 >> /vendor/etc/camera/camxoverridesettings.txt
3.獲取raw 和 metadata 用於ISP調試
(1) Enable Dump
adb shell setprop persist.vendor.camera.imageDumpMask 6 ->No dumps = 0x0
->All output ports for IFE = 0x1
->All output ports for IPE = 0x2
->All output ports for BPS = 0x4
adb shell setprop persist.vendor.camera.offlineImageDumpOnly 1 adb shell setprop persist.vendor.camera.reprocessDump 1 adb shell setprop persist.vendor.camera.autoImageDump 1
adb shell setprop persist.vendor.camera.autoImageDumpIPEoutputPortMask 0x100
<Help>
Output port mask for IPE:
IPEOutputPortDisplay = 0x100;
IPEOutputPortVideo = 0x200;
IPEOutputPortFullRef = 0x400;
IPEOutputPortDS4Ref = 0x800;
IPEOutputPortDS16Ref = 0x1000;
IPEOutputPortDS64Ref = 0x2000;
ALLports = 0x3F00
</Help>
adb shell setprop persist.vendor.camera.autoImageDumpIPEInstanceMask 12
<Help>
IPEInstanceName0 = 0x1;
IPEInstanceName1 = 0x2;
IPEInstanceName2 = 0x4;
IPEInstanceName3 = 0x8;
IPEInstanceName4 = 0x10;
IPEInstanceName5 = 0x20;
IPEInstanceName6 = 0x40;
IPEInstanceName7 = 0x80;
IPEInstanceName8 = 0x100;
IPEInstanceName9 = 0x200;
IPEInstanceName10 = 0x400;
IPEInstanceName11 = 0x800;
IPEInstanceName12 = 0x1000;
IPEInstanceName13 = 0x2000;
IPEInstanceName14 = 0x4000;
IPEInstanceName15 = 0x8000;
IPEInstanceName16 = 0x10000;
IPEInstanceName17 = 0x20000;
IPEInstanceName18 = 0x40000;
IPEInstanceName19 = 0x80000;
IPEInstanceName20 = 0x100000;
IPEInstanceName21 = 0x200000;
AllInstances = 0xFFFFFFFF
</Help>
adb shell setprop persist.vendor.camera.autoImageDumpIFEoutputPortMask 0x100
<Help>
Output port mask:
IFE:
IFEOutputPortFull = 0x1;
IFEOutputPortDS4 = 0x2;
IFEOutputPortDS16 = 0x4;
IFEOutputPortCAMIFRaw = 0x8;
IFEOutputPortLSCRaw = 0x10;
IFEOutputPortGTMRaw = 0x20;
IFEOutputPortFD = 0x40;
IFEOutputPortPDAF = 0x80;
IFEOutputPortRDI0 = 0x100;
IFEOutputPortRDI1 = 0x200;
IFEOutputPortRDI2 = 0x400;
IFEOutputPortRDI3 = 0x800;
IFEOutputPortStatsRS = 0x1000;
IFEOutputPortStatsCS = 0x2000;
IFEOutputPortStatsIHIST = 0x8000;
IFEOutputPortStatsBHIST = 0x10000;
IFEOutputPortStatsHDRBE = 0x20000;
IFEOutputPortStatsHDRBHIST = 0x40000;
IFEOutputPortStatsTLBG = 0x80000;
IFEOutputPortStatsBF = 0x100000;
IFEOutputPortStatsAWBBG = 0x200000;
IFEOutputPortDisplayFull = 0x400000;
IFEOutputPortDisplayDS4 = 0x800000;
IFEOutputPortDisplayDS16 = 0x1000000;
IFEOutputPortStatsDualPD = 0x2000000;
ALLports = 0x3FFBFFF
AllPixelOutput = 0x1C00047
AllRawOutput = 0xFB8
AllRDIOutput = 0xF00
AllStatsOutput = 0x3FB000
</Help>
adb shell setprop persist.vendor.camera.autoImageDumpIFEInstanceMask 0x7
<Help>
Instance mask:
IFE:
IFEInstanceName0 = 0x1;
IFEInstanceName1 = 0x2;
IFEInstanceName2 = 0x4;
AllInstances = 0x7
</Help>
或
adb shell "echo autoImageDumpMask=6>>/vendor/etc/camera/camxoverridesettings.txt" adb shell "echo offlineImageDumpOnly=TRUE>>/vendor/etc/camera/camxoverridesettings.txt" adb shell "echo reprocessDump=TRUE >>/vendor/etc/camera/camxoverridesettings.txt" adb shell "echo autoImageDump=TRUE>>/vendor/etc/camera/camxoverridesettings.txt"
...
生成路徑:data/misc/camera/ 或 data/vendor/camera/
使用Chromatix 工具查看:
① *.RAWMIPI → rename to *.RAW, *.YUV420NV21 → Rename to *.YUV
② RAW → BPP 10, pack: mipi pattern: RGGB
YUV → BPP 8, Sub-sample: Ycbcr420, Format: Semi-Planar
開啓dump後預覽會比較卡,能夠修改dump部分代碼(/src/utils/camximagedump.cpp b/src/utils/camximagedump.cpp),過濾特定格式緩解卡頓:
#include "camximagedump.h" #include "camximagebuffer.h" #include "camximageformatutils.h" #include <cutils/properties.h> CAMX_NAMESPACE_BEGIN @@ -99,6 +100,28 @@ VOID ImageDump::Dump( OsUtils::SNPrintF(suffix, sizeof(suffix), "ERROR"); break; } +// add format mask + char value[100] = "\0"; + static int nFirstTime = 1; + static int nDumpMask = 0; + if(nFirstTime) + { + property_get("persist.camera.dump.formatmask", value, "0"); + nFirstTime = 0; + nDumpMask=atoi(value); + } + if(nDumpMask > 0) + { + if(static_cast<INT32>(pDumpInfo->pFormat->format) != nDumpMask) + { + CAMX_LOG_ERROR(CamxLogGroupUtils, "stop dump format: %d, only dump format: %d\n", pDumpInfo->pFormat->format, nDumpMask); + return; + } + } + +//
而後能夠參考 「camxformats.h」中的掩碼定義dump指定的圖像格式:
adb shell setprop persist.camera.dump.formatmask 15 // dump YUV420NV12TP10
(2)將 TP10 轉換成 YUV 10bit 格式
dump到大量TP10格式的YUV文件後,模擬器不能直接支持TP10格式,須要使用Chromatix 7將其轉換爲Yuv420_10bit的格式,轉換步驟以下:
1.打開chromatix 7並打開您的項目。
2.選擇視頻場景( video Scenario)。
3.打開TF界面,檢查寬度和高度。TF界面中顯示的寬度和高度應與文件名中的寬度和高度徹底相同。(xxxx[WW]_[HH]xxxx.YUV420NV12TP10)若是不相同,請先更正。
3.1 你須要關閉Chromatix7. 而後進入Chromatix7 工程目錄。
3.2 打開並修改 sensorData.txt 中的寬和高。(C7project\Scenario.Default\Sensor.0\Usecase.Video\sensorData.txt,路徑取決於您使用的場景)
3.3 修改如下兩行並保存,而後再執行第3步。
2036, /* raw image width */ 1144, /* raw image height */
4. 點擊 「TP10 to Planar」 並選擇重命名的yuv文件,您只須要選擇xxx_0.yuv,工具就能夠找到剩餘的文件,而後選擇輸出文件夾。
5. 等幾秒鐘,您就能夠獲得輸出名如 xxx_pln_0.YUV, xxx_pln_1.YUV … 的文件,全部的tp10文件都被轉換了。
(3) Get Meta
步驟: ① 設備開啓meta
② 拍照得到jpeg
③ 經過C7獲取meta (QualcommSpectraSim280.exe - metaparsetest.jpg -》 C7\Simulator\Spectra280\)
adb shell "echo tuningDumpDataSizeIFE=5000 >> /vendor/etc/camera/camxoverridesettings.txt"
adb shell "echo tuningDumpDataSizeBPS=20000 >> /vendor/etc/camera/camxoverridesettings.txt"
adb shell "echo tuningDumpDataSizeIPE=150000 >> /vendor/etc/camera/camxoverridesettings.txt
-end-