当前位置:   article > 正文

CAMX 驱动基本调试手段

camx

6154b69189bffed82582afbc75310e5d.gif

和你一起终身学习,这里是程序员Android

经典好文推荐,通过阅读本文,您将收获以下知识点:

一、高通相关网址
二、高通平台调试手段

一、高通相关网址

  • Createpoint:
    https://createpoint.qti.qualcomm.com(可下载文档,Release Note,Case,文档,工具等等)

  • Chipcode:
    https://chipcode.qti.qualcomm.com(下载私有代码)

  • 开源代码:
    https://www.codeaurora.org/xwiki/bin/QAEP/release(下载开源代码)

  • Case:
    https://support-qualcomm.force.com/(高通Case)

  • 高通网站 image 转换工具:
    https://cap.qti.qualcomm.com/default.aspx++

二、高通平台调试手段

调试平台信息:【SDM845/670】

以下为参考用例,具体请以 sdm845_caf\vendor\qcom\proprietary\camx\src\core\camxsettings.xml 为准!!!

Camx Log信息相关

  • AF相关LOG控制

  1. 例: setprop persist.vendor.camera.logInfoMask 0x8000000 //AF info level log
  2.    setprop persist.vendor.camera.logVerboseMask 0x8000000 //AF verbose level log
  3.    adb shell "echo logInfoMask=0x8000000 >> /vendor/etc/camera/camxoverridesettings.txt"
  4.    adb shell "echo logVerboseMask=0x8000000 >> /vendor/etc/camera/camxoverridesettings.txt"
  5. Mask值对应如下:(1 << 27)=0x8000000 即对应AF模块
  6. // The group tag for a given debug print message
  7. typedef UINT32 CamxLogGroup;
  8. static const CamxLogGroup CamxLogGroupNone = (1 << 0); ///< Generic group
  9. static const CamxLogGroup CamxLogGroupSensor = (1 << 1); ///< Sensor
  10. static const CamxLogGroup CamxLogGroupIFace = (1 << 2); ///< IFace
  11. static const CamxLogGroup CamxLogGroupISP = (1 << 3); ///< ISP
  12. static const CamxLogGroup CamxLogGroupPProc = (1 << 4); ///< Post Processor
  13. static const CamxLogGroup CamxLogGroupImgLib = (1 << 5); ///< Image Lib
  14. static const CamxLogGroup CamxLogGroupCPP = (1 << 6); ///< CPP
  15. static const CamxLogGroup CamxLogGroupHAL = (1 << 7); ///< HAL
  16. static const CamxLogGroup CamxLogGroupJPEG = (1 << 8); ///< JPEG
  17. static const CamxLogGroup CamxLogGroupStats = (1 << 9); ///< Stats
  18. static const CamxLogGroup CamxLogGroupCSL = (1 << 10); ///< CSL
  19. static const CamxLogGroup CamxLogGroupApp = (1 << 11); ///< Application
  20. static const CamxLogGroup CamxLogGroupUtils = (1 << 12); ///< Utilities
  21. static const CamxLogGroup CamxLogGroupSync = (1 << 13); ///< Sync
  22. static const CamxLogGroup CamxLogGroupMemSpy = (1 << 14); ///< MemSpy
  23. static const CamxLogGroup CamxLogGroupAssert = (1 << 15); ///< Asserts
  24. static const CamxLogGroup CamxLogGroupCore = (1 << 16); ///< Core
  25. static const CamxLogGroup CamxLogGroupHWL = (1 << 17); ///< HWL
  26. static const CamxLogGroup CamxLogGroupChi = (1 << 18); ///< CHI
  27. static const CamxLogGroup CamxLogGroupDRQ = (1 << 19); ///< DRQ
  28. static const CamxLogGroup CamxLogGroupFD = (1 << 20); ///< FD
  29. static const CamxLogGroup CamxLogGroupIQMod = (1 << 21); ///< IQ module
  30. static const CamxLogGroup CamxLogGroupLRME = (1 << 22); ///< LRME
  31. static const CamxLogGroup CamxLogGroupNCS = (1 << 23); ///< NCS
  32. static const CamxLogGroup CamxLogGroupMeta = (1 << 24); ///< Metadata
  33. static const CamxLogGroup CamxLogGroupAEC = (1 << 25); ///< AEC //0x2000000
  34. static const CamxLogGroup CamxLogGroupAWB = (1 << 26); ///< AWB //0x4000000
  35. 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

ChiOverride 设置

(1)开关ZSL

  1. vendor.debug.camera.overrideDisableZSL
  2. adb shell "echo overrideDisableZSL=1 >> /vendor/etc/camera/camxoverridesettings.txt"

(2)开关MFNR

  1. vendor.debug.camera.overrideEnableMFNR
  2. adb shell "echo overrideEnableMFNR=1 >> /vendor/etc/camera/camxoverridesettings.txt"

(3)强制选择一个usecase

  1. vendor.debug.camera.overrideForceUsecaseId
  2. adb shell "echo overrideForceUsecaseId=8 >> /vendor/etc/camera/camxoverridesettings.txt”

(4)强制选择一个sensor mode

  1. vendor.debug.camera.overrideForceSensorMode
  2. adb shell "echo overrideForceSensorMode=1 >> /vendor/etc/camera/camxoverridesettings.txt"

(5)启用GPU Node Rotation Usecase

  1. vendor.debug.camera.overrideGPURotationUsecase
  2. adb shell "echo overrideGPURotationUsecase=1 >> /vendor/etc/camera/camxoverridesettings.txt"

(6)强制使用不带3A的HFR Usecase

  1. vendor.debug.camera.overrideHFRNo3AUseCase
  2. adb shell "echo overrideHFRNo3AUseCase=1 >> /vendor/etc/camera/camxoverridesettings.txt"

(7)允许使用AdvancedCameraUsecase

  1. vendor.debug.camera.overrideUseAdvancedUsecase
  2. adb shell "echo overrideUseAdvancedUsecase=0 >> /vendor/etc/camera/camxoverridesettings.txt"

(8)开启 EIS V2/V3

  1. vendor.debug.camera.eisv2enable
  2. adb shell "echo EISV2Enable=1 >> /vendor/etc/camera/camxoverridesettings.txt"
  3. vendor.debug.camera.eisv3enable
  4. adb shell "echo EISV3Enable=1 >> /vendor/etc/camera/camxoverridesettings.txt"

(9) EIS V2/V3 Margin

  1. vendor.debug.camera.eisv2margin
  2. adb shell "echo EISV2Margin=0.4 >> /vendor/etc/camera/camxoverridesettings.txt"
  3. vendor.debug.camera.eisv3margin
  4. adb shell "echo EISV3Margin=0.4 >> /vendor/etc/camera/camxoverridesettings.txt"

(10)EIS V2/V3 Frame Delay

  1. vendor.debug.camera.eisv2framedelay
  2. adb shell "echo EISV2FrameDelay=1 >> /vendor/etc/camera/camxoverridesettings.txt"
  3. vendor.debug.camera.eisv3framedelay
  4. adb shell "echo EISV3FrameDelay=1 >> /vendor/etc/camera/camxoverridesettings.txt"

(11)Number of PCRs before stream on

  1. vendor.debug.camera.numPCRsBeforeStreamOn
  2. adb shell "echo numPCRsBeforeStreamOn=1 >> /vendor/etc/camera/camxoverridesettings.txt"

(12)图像 Buffer Count Override (初始化期间分配的图像buffer计数,默认值8)

  1. vendor.debug.camera.overrideImageBufferCount
  2. 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】

  1. vendor.debug.camera.statsProcessingSkipCount
  2. adb shell "echo statsProcessingSkipFactor=2 >> /vendor/etc/camera/camxoverridesettings.txt

获取raw和metadata用于ISP调试

(1) Enable Dump

  1. adb shell setprop persist.vendor.camera.imageDumpMask 6  ->No dumps = 0x0
  2.                                   ->All output ports for IFE = 0x1
  3.                                   ->All output ports for IPE = 0x2
  4.                                   ->All output ports for BPS = 0x4
  5. adb shell setprop persist.vendor.camera.offlineImageDumpOnly 1
  6. adb shell setprop persist.vendor.camera.reprocessDump 1
  7. adb shell setprop persist.vendor.camera.autoImageDump 1
  8. adb shell setprop persist.vendor.camera.autoImageDumpIPEoutputPortMask 0x100
  9. <Help>
  10. Output port mask for IPE:
  11. IPEOutputPortDisplay = 0x100;
  12. IPEOutputPortVideo = 0x200;
  13. IPEOutputPortFullRef = 0x400;
  14. IPEOutputPortDS4Ref = 0x800;
  15. IPEOutputPortDS16Ref = 0x1000;
  16. IPEOutputPortDS64Ref = 0x2000;
  17. ALLports = 0x3F00
  18. </Help>
  19. adb shell setprop persist.vendor.camera.autoImageDumpIPEInstanceMask 12
  20. <Help>
  21. IPEInstanceName0 = 0x1;
  22. IPEInstanceName1 = 0x2;
  23. IPEInstanceName2 = 0x4;
  24. IPEInstanceName3 = 0x8;
  25. IPEInstanceName4 = 0x10;
  26. IPEInstanceName5 = 0x20;
  27. IPEInstanceName6 = 0x40;
  28. IPEInstanceName7 = 0x80;
  29. IPEInstanceName8 = 0x100;
  30. IPEInstanceName9 = 0x200;
  31. IPEInstanceName10 = 0x400;
  32. IPEInstanceName11 = 0x800;
  33. IPEInstanceName12 = 0x1000;
  34. IPEInstanceName13 = 0x2000;
  35. IPEInstanceName14 = 0x4000;
  36. IPEInstanceName15 = 0x8000;
  37. IPEInstanceName16 = 0x10000;
  38. IPEInstanceName17 = 0x20000;
  39. IPEInstanceName18 = 0x40000;
  40. IPEInstanceName19 = 0x80000;
  41. IPEInstanceName20 = 0x100000;
  42. IPEInstanceName21 = 0x200000;
  43. AllInstances = 0xFFFFFFFF
  44. </Help>
  45. adb shell setprop persist.vendor.camera.autoImageDumpIFEoutputPortMask 0x100
  46. <Help>
  47. Output port mask:
  48. IFE:
  49. IFEOutputPortFull = 0x1;
  50. IFEOutputPortDS4 = 0x2;
  51. IFEOutputPortDS16 = 0x4;
  52. IFEOutputPortCAMIFRaw = 0x8;
  53. IFEOutputPortLSCRaw = 0x10;
  54. IFEOutputPortGTMRaw = 0x20;
  55. IFEOutputPortFD = 0x40;
  56. IFEOutputPortPDAF = 0x80;
  57. IFEOutputPortRDI0 = 0x100;
  58. IFEOutputPortRDI1 = 0x200;
  59. IFEOutputPortRDI2 = 0x400;
  60. IFEOutputPortRDI3 = 0x800;
  61. IFEOutputPortStatsRS = 0x1000;
  62. IFEOutputPortStatsCS = 0x2000;
  63. IFEOutputPortStatsIHIST = 0x8000;
  64. IFEOutputPortStatsBHIST = 0x10000;
  65. IFEOutputPortStatsHDRBE = 0x20000;
  66. IFEOutputPortStatsHDRBHIST = 0x40000;
  67. IFEOutputPortStatsTLBG = 0x80000;
  68. IFEOutputPortStatsBF = 0x100000;
  69. IFEOutputPortStatsAWBBG = 0x200000;
  70. IFEOutputPortDisplayFull = 0x400000;
  71. IFEOutputPortDisplayDS4 = 0x800000;
  72. IFEOutputPortDisplayDS16 = 0x1000000;
  73. IFEOutputPortStatsDualPD = 0x2000000;
  74. ALLports = 0x3FFBFFF
  75. AllPixelOutput = 0x1C00047
  76. AllRawOutput = 0xFB8
  77. AllRDIOutput = 0xF00
  78. AllStatsOutput = 0x3FB000
  79. </Help>
  80. adb shell setprop persist.vendor.camera.autoImageDumpIFEInstanceMask 0x7
  81. <Help>
  82. Instance mask:
  83. IFE:
  84. IFEInstanceName0 = 0x1;
  85. IFEInstanceName1 = 0x2;
  86. IFEInstanceName2 = 0x4;
  87. AllInstances = 0x7
  88. </Help>

  1. adb shell "echo autoImageDumpMask=6>>/vendor/etc/camera/camxoverridesettings.txt"
  2. adb shell "echo offlineImageDumpOnly=TRUE>>/vendor/etc/camera/camxoverridesettings.txt"
  3. adb shell "echo reprocessDump=TRUE >>/vendor/etc/camera/camxoverridesettings.txt"
  4. adb shell "echo autoImageDump=TRUE>>/vendor/etc/camera/camxoverridesettings.txt"
  5. ...

生成路径:++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),过滤特定格式缓解卡顿:

  1. #include "camximagedump.h"
  2. #include "camximagebuffer.h"
  3. #include "camximageformatutils.h"
  4. #include <cutils/properties.h>
  5. CAMX_NAMESPACE_BEGIN
  6. @@ -99,6 +100,28 @@ VOID ImageDump::Dump(
  7. OsUtils::SNPrintF(suffix, sizeof(suffix), "ERROR");
  8. break;
  9. }
  10. +// add format mask
  11. + char value[100] = "\0";
  12. + static int nFirstTime = 1; + static int nDumpMask = 0;
  13. + if(nFirstTime)
  14. + {
  15. +   property_get("persist.camera.dump.formatmask", value, "0");
  16. +   nFirstTime = 0;
  17. +   nDumpMask=atoi(value);
  18. + }
  19. + if(nDumpMask > 0)
  20. + {
  21. +  if(static_cast<INT32>(pDumpInfo->pFormat->format) != nDumpMask)
  22. +  {
  23. +    CAMX_LOG_ERROR(CamxLogGroupUtils, "stop dump format: %d, only dump format: %d\n", pDumpInfo->pFormat->format, nDumpMask);
  24. +    return;
  25. +  }
  26. + }
  27. +
  28. +//

然后可以参考 “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步。

  1. 2036, /* raw image width */
  2. 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\)

  1. adb shell "echo tuningDumpDataSizeIFE=5000 >> /vendor/etc/camera/camxoverridesettings.txt"
  2. adb shell "echo tuningDumpDataSizeBPS=20000 >> /vendor/etc/camera/camxoverridesettings.txt"
  3. adb shell "echo tuningDumpDataSizeIPE=150000 >> /vendor/etc/camera/camxoverridesettings.txt

来源: 影像技术栈
文章作者: Abalone
文章链接: https://camerastacker.com/2023/031240432.html

参考文献:

【腾讯文档】Camera学习知识库
https://docs.qq.com/doc/DSWZ6dUlNemtUWndv

至此,本篇已结束。转载网络的文章,小编觉得很优秀,欢迎点击阅读原文,支持原创作者,如有侵权,恳请联系小编删除,欢迎您的建议与指正。同时期待您的关注,感谢您的阅读,谢谢!

435d311d7573ee90e3af6a7b7206d48d.jpeg

点击阅读原文,为大佬点赞!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/596315
推荐阅读
相关标签
  

闽ICP备14008679号