深圳市科维通信技术有限公司论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 9559|回复: 0

高通MM-Camera架构 Debug开机第一次打开camera失败

[复制链接]

14

主题

16

帖子

68

积分

版主

Rank: 7Rank: 7Rank: 7

积分
68
发表于 2020-7-27 11:18:35 | 显示全部楼层 |阅读模式
1.  出错的 log  示例

1.1 initDefaultParameters crash
01-01 00:18:42.030 3118 3118 F DEBUG : backtrace:
01-01 00:18:42.031 3118 3118 F DEBUG : #00 pc
000a7a4e /system/lib/hw/camera.msm8953.so
(_ZN7qcamera17QCameraParameters21initDefaultParametersEv+8069)
01-01 00:18:42.031 3118 3118 F DEBUG : #01 pc
000a8545 /system/lib/hw/camera.msm8953.so
(_ZN7qcamera17QCameraParameters4initEP16cam_capability_tP16mm_camera_vtbl_tPNS_16
QCameraAdjustFPSE+372)
01-01 00:18:42.031 3118 3118 F DEBUG : #02 pc
000aefdb /system/lib/hw/camera.msm8953.so
(_ZN7qcamera21QCameraParametersIntf4initEP16cam_capability_tP16mm_camera_vtbl_tPNS
_16QCameraAdjustFPSE+30)
01-01 00:18:42.031 3118 3118 F DEBUG : #03 pc
0006f33b /system/lib/hw/camera.msm8953.so
(_ZN7qcamera25QCamera2HardwareInterface19deferredWorkRoutineEPv+1682)
01-01 00:18:42.031 3118 3118 F DEBUG : #04 pc 00046f73 /system/lib/libc.so
(_ZL15__pthread_startPv+22)
01-01 00:18:42.031 3118 3118 F DEBUG : #05 pc 00019ce9 /system/lib/libc.so
(__start_thread+6)

1.2 allocate buffer ERROR
01-30 09:38:40.692 611 2042 E QCamera : <HAL><ERROR> static int
qcamera:CameraMemory::allocOneBuffer(qcamera:CameraMemory:CameraMemInfo &,
unsigned int, size_t, bool, uint32_t): 493: ION allocation failed: Invalid argument

1.3 APP 获取的 parameter 出错
01-02 08:42:02.192 5013 5013 E AndroidRuntime: FATAL EXCEPTION: main
01-02 08:42:02.192 5013 5013 E AndroidRuntime: Process: org.codeaurora.snapcam, PID: 5013
01-02 08:42:02.192 5013 5013 E AndroidRuntime: java.lang.AssertionError: Supported FPS
ranges cannot be null.
01-02 08:42:02.192 5013 5013 E AndroidRuntime: at
android.hardware.camera2.legacy.LegacyMetadataMapper.mapControlAe(LegacyMetadataMap
per.java:411)
01-02 08:42:02.192 5013 5013 E AndroidRuntime: at
android.hardware.camera2.legacy.LegacyMetadataMapper.mapCharacteristicsFromParameters
(LegacyMetadataMapper.java:183)

1.4 Start session 过程中,没有 sensor module
01-01 21:50:02.802 732 5614 I mm-camera: <MCT >< INFO> 4534:
mct_pipeline_start_session_thread: E iface
01-01 21:50:02.813 732 5615 I mm-camera: <MCT >< INFO> 4534:
mct_pipeline_start_session_thread: E isp
01-01 21:50:02.818 732 5617 I mm-camera: <MCT >< INFO> 4534:
mct_pipeline_start_session_thread: E stats
01-01 21:50:02.824 732 5618 I mm-camera: <MCT >< INFO> 4534:
mct_pipeline_start_session_thread: E pproc
01-01 21:50:02.830 732 5619 I mm-camera: <MCT >< INFO> 4534:
mct_pipeline_start_session_thread: E imglib

2. Log  分析以及解决方法:
打开 sensor 的 log mask,抓取从系统开机的 userspace log 和 kernel log
2.1 CSID 初始化超时
Userspace log:
01-05 15:15:20.260 E/mm-camera( 601): <SENSOR><ERROR> 204: csid_open:
VIDIOC_MSM_CSID_IO_CFG failed Connection timed out
01-05 15:15:20.260 E/mm-camera( 601): <SENSOR><ERROR> 1690: port_sensor_create:
failed
01-05 15:15:20.261 E/mm-camera( 601): <SENSOR><ERROR> 6984: module_sensor_init:
failed
Kernel log:
Line 2011: 01-05 15:15:20.839 I/msm_csid_init( 0): CSID_VERSION = 0x30040003
Line 2046: 01-05 15:15:20.940 E/msm_csid_init( 0): 580 msm_csid_reset failed
尝试增加 timeout 到 500ms:
64 #define CSID_TIMEOUT msecs_to_jiffies(100)
2.2 由于系统时间更新导致的 INIT_CONFIG timeout
Userspace 的 log 可以看到,有相关的 time-service,并且 log 的 timestamp 突然改
变了。
05-24 17:24:37.558 825 1371 D mm-camera: <SENSOR>< LOW> 5972:
module_sensor_query_mod: sensor name hi553_qh
05-24 17:24:37.558 1357 1357 D QC-time-services: Daemonelta read on boot mseconds
= 767135828
05-24 17:24:37.558 1357 1357 D QC-time-services: Daemon:Final Time = 1495617878123
05-24 17:24:37.558 1357 1357 E QC-time-services: Daemon:genoff_boot_tod_init: Unable
to open alarm device
05-24 17:24:37.558 1357 1357 E QC-time-services: Daemon:genoff_boot_tod_init:
Updating system time to sec=1495617878, usec=123000
05-24 17:24:38.123 825 1371 E mm-camera: <SENSOR><ERROR> 5977:
module_sensor_query_mod: fatal: init_config event completion failed 0 (110)
针对此问题,申请 CR 2030422
2.3 由于添加多 module 的兼容,需要更久的时间做 sensor probe, 导致 INIT_CONFIG
timeout。这种情况下,查看 kernel log,无明显出错,并且 kernel log 表现出 sensor
的 probe 工作正在进行中。
Kernel log
01-01 08:01:01.208 0 0 E msm_sensor_match_id: read id: 0x0 expected id 0xd855:
01-01 08:01:01.214 0 0 E : msm_sensor_match_id chip id 0 does not match d855
01-01 08:01:01.313 0 0 E msm_sensor_match_id: read id: 0x0 expected id 0xd855:
01-01 08:01:01.318 0 0 E : msm_sensor_match_id chip id 0 does not match d855
01-01 08:01:01.404 0 0 E msm_sensor_match_id: read id: 0x0 expected id 0xd855:
01-01 08:01:01.404 0 0 E : msm_sensor_match_id chip id 0 does not match d855
01-01 08:01:01.500 0 0 E msm_sensor_match_id: hi553_qh: read id failed
01-01 08:01:01.594 0 0 E msm_sensor_match_id: hi553_qh: read id failed
01-01 08:01:01.695 0 0 E msm_sensor_match_id: hi553_qh: read id failed
01-01 08:01:01.805 0 0 E msm_sensor_match_id: read id: 0x30c8 expected id 0x30c8:
01-01 08:01:02.023 0 0 E msm_sensor_match_id: read id: 0x5025 expected id 0x5025:
在这种情况下,需要估算 camera 的 init 需要大致多长时间,然后修改
INIT_CONFIG_TIMEOUT 至需要的时长。
2.4 sensor init 需要更长的时间,导致 INIT_CONFIG timeout
Userspace log 如下:
03-28 19:59:32.376 646 1220 D mm-camera: <SENSOR>< LOW> 834: sensor_write_init_settings:
enter
03-28 19:59:32.664 646 1238 E mm-camera: <SENSOR><ERROR> 6003:
module_sensor_query_mod: fatal: init_config event completion failed 0 (110)
03-28 19:59:32.664 646 1238 E mm-camera: <MCT ><ERROR> 449:
mct_pipeline_query_modules: Query mod failed on sensor
03-28 19:59:32.664 646 1220 D mm-camera: <SENSOR>< LOW> 845: sensor_write_init_settings:
exit
参考 2.3, 延长 INIT_CONFIG_TIMEOUT 的时间
2.5 多 module 兼容时,eeprom 初始化失败
Kernel log:
[ 21.155544] msm8917-pinctrl 1000000.pinctrl: pin GPIO_26 already requested by
1b0c000.qcom,cci:qcom,eeprom@0; cannot claim for 1b0c000.qcom,cci:qcom,camera@0
It should mean such GPIO is hold by EEPROM, and do not be released.
需要添加改动:
diff --git a/drivers/media/platform/msm/camera_v2/sensor/eeprom/msm_eeprom.c
b/drivers/media/platform/msm/camera_v2/sensor/eeprom/msm_eeprom.c
index dd2f919..633f023 100755
--- a/drivers/media/platform/msm/camera_v2/sensor/eeprom/msm_eeprom.c
+++ b/drivers/media/platform/msm/camera_v2/sensor/eeprom/msm_eeprom.c
@@ -1457,7 +1457,6 @@ static int eeprom_init_config32(struct msm_eeprom_ctrl_t *e_ctrl,
if (rc < 0) {
pr_err("%s:%d memory map parse failed\n",
__func__, __LINE__);
- goto free_mem;
}
rc = msm_camera_power_down(power_info,
2.6 关于 INIT_CONFIG timeout 的其他类型的错误
a. 在 bringup 阶段,由于某些驱动问题,导致的 init 超时,如下是 actuator 的驱动初始化
超时
Line 4311: 01-01 00:19:35.323 D/mm-camera( 798): <SENSOR>< LOW> 412:
af_actuator_set_params: Enter
Line 4475: 01-01 00:19:36.280 E/mm-camera( 798): <SENSOR><ERROR> 5936:
module_sensor_query_mod: fatal: init_config event completion failed 0 (110)
Line 4962: 01-01 00:19:39.844 D/mm-camera( 798): <SENSOR>< HIGH> 1289:
module_sensor_start_session: sessionid 1
Line 5025: 01-01 00:19:39.861 D/mm-camera( 798): <SENSOR>< DBG> 524:
af_actuator_set_params: Exit
b. 默写驱动初始化失败,比如 sensor 或者 actuator,eeprom 等
比如:actuator 初始化失败:
05-20 14:00:24.680 654 29774 E mm-camera: <SENSOR><ERROR> 897:
module_sensor_actuator_init_calibrate: sensor_failure : ACTUATOR_SET_PARAMETERS failed
05-20 14:00:24.680 654 29774 E mm-camera: <SENSOR><ERROR> 274:
module_sensor_offload_init_config: module_sensor_actuator_init_calibrate failed
05-20 14:00:24.680 654 29774 E mm-camera: <SENSOR><ERROR> 330:
module_sensor_offload_init_config: failed
05-20 14:00:24.680 654 29793 E mm-camera: <SENSOR><ERROR> 5280:
module_sensor_module_process_event: fatal: init_config event completion failed -1 (0)
比如:Sensor 初始化失败:
01-01 10:23:45.915 E/mm-camera( 684): <SENSOR><ERROR> 514:
sensor_write_i2c_init_res_setting_array: failed
01-01 10:23:45.915 E/mm-camera( 684): <SENSOR><ERROR> 844: sensor_write_init_settings:
sensor_write_i2c_init_res_setting_array failed
01-01 10:23:45.915 E/mm-camera( 684): <SENSOR><ERROR> 886: sensor_init: failed
01-01 10:23:45.915 E/mm-camera( 684): <SENSOR><ERROR> 152:
module_sensor_offload_init_config: failed: SENSOR_INIT rc:-5
01-01 10:23:45.915 E/mm-camera( 684): <SENSOR><ERROR> 5993:
module_sensor_query_mod: fatal: init_config event completion failed -1 (0)
此时查看对应的 kernel log,
如果有 CCI write fail:参考 KBA-170629003211

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|深圳市科维通信技术有限公司论坛 ( 粤ICP备20056433号 )

GMT+8, 2024-3-5 06:30 , Processed in 0.054533 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表