Qcom平台 Camera 之开启调试 log
????????本文是針對Android5.1、8.1、9.0版本的camera調試,log相關的配置做一個記錄。如有錯誤,請交流指正。
調試 打開 kernel?cam log
用于觀察上電時序,match_id 匹配ID,CCI讀寫。
Camera 打開關鍵的 kernel log (以8953平臺為例)
路徑:
? kernel/msm-4.9/drivers/media/platform/msm/camera_v2/sensor/io/msm_camera_dt_util.c
? kernel/msm-4.9/drivers/media/platform/msm/camera_v2/sensor/msm_sensor.c
? kernel/msm-4.9/drivers/media/platform/msm/camera_v2/sensor/msm_sensor_driver.c
? kernel/msm-4.9/drivers/media/platform/msm/camera_v2/sensor/msm_sensor_init.c
代碼如:
? -#define CDBG(fmt, args...) pr_debug(fmt, ##args)
? +#define CDBG(fmt, args...) pr_err(fmt, ##args) ?// ?提高log打印等級
查看 可以使能的上層 cam module
路徑:
vendor\qcom\proprietary\mm-camera\mm-camera2\includes\camera_dbg.h
代碼如:
? typedef enum {
? ? CAM_NO_MODULE,
? ? CAM_MCT_MODULE,
? ? CAM_SENSOR_MODULE,
? ? CAM_IFACE_MODULE,
? ? CAM_ISP_MODULE,
? ? CAM_PPROC_MODULE,
? ? CAM_IMGLIB_MODULE,
? ? CAM_CPP_MODULE,
? ? CAM_HAL_MODULE,
? ? CAM_JPEG_MODULE,
? ? CAM_C2D_MODULE,
? ? CAM_STATS_MODULE,
? ? CAM_STATS_AF_MODULE,
? ? CAM_STATS_AEC_MODULE,
? ? CAM_STATS_AWB_MODULE,
? ? CAM_STATS_ASD_MODULE,
? ? CAM_STATS_AFD_MODULE,
? ? CAM_STATS_Q3A_MODULE,
? ? CAM_STATS_IS_MODULE,
? ? CAM_STATS_HAF_MODULE,
? ? CAM_STATS_CAF_SCAN_MODULE,
? ? CAM_SHIM_LAYER,
? ? CAM_LAST_MODULE
? } cam_modules_t;
查看 當前使能的上層 cam log
adb指令:
adb shell getprop | grep "camera"
adb shell getprop | find "camera" // android5.1 用 find
查看 當前使能的上層 cam log 的等級
路徑:
? vendor\qcom\proprietary\mm-camera\mm-camera2\log_debug\android\camera_dbg.c
代碼如:
框架定義了如下6個 log 級別, INFO 級別不可控,是一定會打印的。
?/* string representation for logging level */
? static const char *cam_dbg_level_to_str[] = {
? ? ? ?"", ? ? ? ?/* CAM_GLBL_DBG_NONE ?*/
? ? ? ?"<ERROR>", /* CAM_GLBL_DBG_ERR ? */
? ? ? ?"< WARN>", /* CAM_GLBL_DBG_WARN ?*/
? ? ? ?"< HIGH>", /* CAM_GLBL_DBG_HIGH ?*/
? ? ? ?"< ?DBG>", /* CAM_GLBL_DBG_DEBUG */
? ? ? ?"< ?LOW>", /* CAM_GLBL_DBG_LOW ? */
? ? ? ?"< INFO>" ?/* CAM_GLBL_DBG_INFO ?*/
? ? };
? /* values that persist.vendor.camera.global.debug can be set to */
? /* all camera modules need to map their internal debug levels to this range */
? typedef enum {
? ? CAM_GLBL_DBG_NONE ?= 0,
? ? CAM_GLBL_DBG_ERR ? = 1,
? ? CAM_GLBL_DBG_WARN ?= 2,
? ? CAM_GLBL_DBG_HIGH ?= 3,
? ? CAM_GLBL_DBG_DEBUG = 4,
? ? CAM_GLBL_DBG_LOW ? = 5,
? ? CAM_GLBL_DBG_INFO ?= 6
? } cam_global_debug_level_t;
調試 使能 HAL cam log
開機狀態,用這些命令設置之后就生效了,重啟依舊有效,刷機后設置消失
adb shell setprop persist.camera.hal.debug.mask 536870915 // Android 8.0
或者?
// HAL-3 ?Android9.0
adb shell setprop persist.vendor.camera.hal.debug 3
調試 抓取 cam 上層 log
這個抓log不會停,會一直抓。
adb logcat –v time –b main –b system > ?log.log?
調試 設置 cam module log?
全局debug log 等級配置 ?
persist.camera.global.debug
?數值:0-5 // [-- 數字越小等級越高 --]
?功能: 設置不同的數值,將打印對應級別的log。
該屬性是總的log級別開關。
?注意: 若子模塊的log級別小于該屬性設置值,則以該屬性為準;
若子模塊的log?級別大于該屬性設置值,則以子模塊設置的log級別為準。
?代碼如:
adb shell setprop persist.camera.global.debug 5
或者(android5/8 和android9.0 之間的屬性設置會差一個“vendor”)
adb shell setprop persist.vendor.camera.global.debug 5
調試 設置 cam module log Android8.0
? // android 8 開啟 camera logcat 等級
? adb shell setprop persist.camera.sensor.debug 3
? adb shell getprop persist.camera.sensor.debug // 查看當前等級
!!! 常用的 camera debug 屬性
? // 參考鏈接: https://blog.csdn.net/liaochaoyun/article/details/89671195
? // 可能實際代碼有出入 具體請參考實際代碼設置
? // 以 android 8.1 為例 參考以下路徑
? // QCameraParameters.cpp ?8909_APP_O\hardware\qcom\camera\QCamera2\HAL
全局debug log 屬性
?1. adb shell setprop persist.vendor.camera.sensor.debug 3
?2. adb shell setprop persist.vendor.camera.global.debug 3
ISP LOG
?3. adb shell setprop persist.camera.ISP.debug.mask 3
查看 cam module log 等級定義
路徑:
camera_dbg.h ? vendor\qcom\proprietary\mm-camera\mm-camera2\includes
代碼如:
? typedef enum {
? ? CAM_NO_MODULE,
? ? CAM_MCT_MODULE,
? ? CAM_SENSOR_MODULE,
? ? CAM_IFACE_MODULE,
? ? CAM_ISP_MODULE,
? ? CAM_PPROC_MODULE,
? ? CAM_IMGLIB_MODULE,
? ? CAM_CPP_MODULE,
? ? CAM_HAL_MODULE,
? ? CAM_JPEG_MODULE,
? ? CAM_C2D_MODULE,
? ? CAM_STATS_MODULE,
? ? CAM_STATS_AF_MODULE,
? ? CAM_STATS_AEC_MODULE,
? ? CAM_STATS_AWB_MODULE,
? ? CAM_STATS_ASD_MODULE,
? ? CAM_STATS_AFD_MODULE,
? ? CAM_STATS_Q3A_MODULE,
? ? CAM_STATS_IS_MODULE,
? ? CAM_STATS_HAF_MODULE,
? ? CAM_STATS_CAF_SCAN_MODULE,
? ? CAM_SHIM_LAYER,
? ? CAM_LAST_MODULE
? } cam_modules_t;
? 設置各模塊 LOG 等級,數字越小等級越高
? /* values that persist.vendor.camera.global.debug can be set to */?
? /* all camera modules need to map their internal debug levels to this range */
? typedef enum {
? ? CAM_GLBL_DBG_NONE ?= 0,
? ? CAM_GLBL_DBG_ERR ? = 1,
? ? CAM_GLBL_DBG_WARN ?= 2,
? ? CAM_GLBL_DBG_HIGH ?= 3,
? ? CAM_GLBL_DBG_DEBUG = 4,
? ? CAM_GLBL_DBG_LOW ? = 5,
? ? CAM_GLBL_DBG_INFO ?= 6
? } cam_global_debug_level_t;
實測
?adb shell setprop persist.camera.global.debug x // 設置log等級
?adb shell getprop persist.camera.global.debug ?// 查看log等級
查看 cam module log 關鍵字
LOG-keyword // 關鍵字
1. 打開相機
? CAM_PhotoModule: onCameraOpened
2. 獲取到的camera配置信息
? sensor_get_resolution_info: sensor info: name:
3. 幀凍結錯誤
mm-camera: <MCT><ERROR> 98: mct_bus_sof_thread_run: FATAL Session 1: SOF Freeze! Sending error message
mm-camera: <MCT >< INFO> 133: mct_bus_sof_thread_run: Sending HW_ERROR from MCT on session =1
mm-camera: <MCT ><ERROR> 817: mct_controller_send_cb: FATAL: Sending HW_Error
Camera ?: Error 100
4.幀凍結錯誤-關鍵字
I QCamera : <HAL><INFO> start_preview: 394: [KPI Perf]: X ret = 0 ?
月影憧憧?煙火幾重?燭花兒紅
總結
以上是生活随笔為你收集整理的Qcom平台 Camera 之开启调试 log的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Matlab求常微分方程组的数值解
- 下一篇: POL8901 LVDS转MIPI DS