高通相机bringup guide

程序员Android

共 6107字,需浏览 13分钟

 · 2023-03-11

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

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

一、相机Sensor 点亮相关的文件
二、Sensor 驱动文件详解

一、相机Sensor 点亮相关的文件

1.1 Sensor 驱动XML以及CPP文件
  • Sensor 文件路径:

vendor\qcom\proprietary\chi-cdk\oem\sensor\sensor_name
这颗Sensor 目录里面会有Sensor厂商提供或者别的项目copy过来成熟的 sensor.cpp 、 sensor.xml 、Android.mk文件

   比如:
vendor\qcom\proprietary\chi-cdk\oem\sensor\imx586
vendor\qcom\proprietary\chi-cdk\oem\sensor\imx586\imx586.cpp
vendor\qcom\proprietary\chi-cdk\oem\sensor\imx586\imx586.xml
vendor\qcom\proprietary\chi-cdk\oem\sensor\imx586\Android.mk
  • sensor*.xml 编译生成bin文件

bin文件编译脚本命令参考如下:
./buildbins_.py --yaml-file-name buildbins_.yaml
buildbins_.yaml 文件中需要把对应的senesor.xml 以及module.xml 添加上
执行py脚本后会生成com.qti.sensor*.bin文件

  • sensor*.cpp 编译生成so 文件

so可以按正常的编译库文件编译

1.2 Module 配置XML文件

Module 配置文件路径:
\vendor\qcom\proprietary\chi-cdk\oem\module
比如:
\vendor\qcom\proprietary\chi-cdk\oem\module\imx586_module.xml

1.3 dtsi 设备树文件

dtsi 设备树文件路径如下:
\kernel\msm-4.19\arch\arm64\boot\dts\vendor\camera
比如target_name-camera-sensor-platform.dtsi
需要编译dtboimage 编译生成dtbo.img ,
另外需要编译bootimge 生成 boot.img, 使用fastboot flash dtbo dtbo.img 刷入手机中(需要跟bootimage一起刷入)

二、Sensor 驱动文件详解

2.1 sensor*.xml 文件详解

sensor*.xml 会包含
power settings,resolution, initialization settings, and exposure settings等
vendor\qcom\proprietary\chi-cdk\api\sensor\camxsensordriver.xsd 可以查看这个xml的详细内容

<sensorDriverData>
<slaveInfo>
<sensorName>s5_rear</sensorName>
<slaveAddress>0x5a</slaveAddress>
<sensorId> 0x38e1</sensorId>
<i2cFrequencyMode>FAST</i2cFrequencyMode>
//上下电顺序相反
<powerUpSequence> </powerUpSequence>
<powerDownSequence> </powerDownSequence>
</slaveInfo>
<resolutionInfo>
<sensorVersion>0</sensorVersion>
<!-- Res 0 8160*6144 10fps --> 第一个必须Full 全尺寸size
<resolutionData>
<streamInfo>
<streamConfiguration>
// 50M Full Size
<frameDimension>
<xStart>0</xStart>
<yStart>0</yStart>
<width>8160</width>
<height>6144</height>
</frameDimension>
</streamConfiguration>
</streamInfo>
<!--Line length pixel clock of frame
Typically this value is the active width + blanking width -->

<lineLengthPixelClock>8688</lineLengthPixelClock>
<!--Frame length lines of frame
Typically this value is the active height + blanking height -->

<frameLengthLines>6400</frameLengthLines>
<!--Output pixel clock -->
<outputPixelClock>556800000</outputPixelClock>
// 帧率fps = outputPixelClock/(frameLengthLines*lineLengthPixelClock)
// 10fps =556800000/(6400*8688)=10.013
<!--Maximum frame rate -->
<frameRate>10.07</frameRate>

<regSetting> </regSetting>
<!--Crop information for the frame -->
<cropInfo>
<left>0</left>
<right>0</right>
<top>0</top>
<bottom>0</bottom>
</cropInfo>
<!--List of features / capabilities supported by sensor -->
<capability>QUADCFA</capability>
<RemosaicTypeInfo>SWRemosaic</RemosaicTypeInfo>
<ADCReadoutTime>-6</ADCReadoutTime>
</resolutionData>

<!-- Res 1 4080*3072 30fps 4:3 -->
<resolutionData>
<frameDimension>
<xStart>0</xStart>
<yStart>0</yStart>
<width>4080</width>
<height>3072</height>
</frameDimension>
</resolutionData>

<!-- Res 2 4080*2296 30fps -->
<resolutionData>
<frameDimension>
<xStart>0</xStart>
<yStart>388</yStart>
<width>4080</width>
<height>2296</height>
</frameDimension>
</resolutionData>

<!-- Res 3 4080*3072 24fps -->
<resolutionData>
<frameDimension>
<xStart>0</xStart>
<yStart>0</yStart>
<width>4080</width>
<height>3072</height>
</frameDimension>
</resolutionInfo>
<exposureControlInfo></exposureControlInfo>
<streamOnSettings> </streamOnSettings>
<streamOffSettings> </streamOffSettings>
<masterSettings></masterSettings>
<initSettings></initSettings>
<resolutionData>
</sensorDriverData>
2.2 module.xml 文件详解

module.xml主要用来存储camera一些特殊信息,比如 lens镜头,mountangles挂载角度,actuator马达,OIS光学防抖,Flash 闪光灯等

<cameraModuleData>
<moduleGroup>
<moduleConfiguration description="Module configuration">
<cameraId>0</cameraId>
<!--Name of the module integrator -->
<moduleName>sunny</moduleName>
<sensorName>s5_rear</sensorName>
<actuatorName> </actuatorName>
<oisName></oisName>
<eepromName> </eepromName>
<flashName> </flashName>
<pdafName> </pdafName>
<!--Chromatix name is used to used to open binary.
Binary name is of the form sensor_model_chromatix.bin -->

<chromatixName>s5_rear</chromatixName>
<position>REAR</position>
<!--Mount Angle -->
<mountAngle>0</mountAngle>
<!--CSI Information -->
<CSIInfo description="CSI Information">
<laneAssign>0x3210</laneAssign>
<isComboMode>0</isComboMode>
</CSIInfo>
<!--Lens information -->
<lensInfo description="Lens Information">
<!--Focal length of the lens in millimeters. -->
<focalLength>4.05</focalLength>
<maxYawDegree>180</maxYawDegree>
</lensInfo>
</moduleConfiguration>
</moduleGroup>
</cameraModuleData>
2.3 dtsi 设备树文件详解

Camera客制化DTSI 参考文档目录
kernel\msm-4.19\Documentation\devicetree\bindings\media\camera
主要配置camera电源LDO, camera IIC通讯配置,根据硬件原理图配置出相应的电压给camera,包括AVDD,DVDD, 和IOVDD

参考文档:

80-p9301-97_p_camera_sensor_driver_bring-up_guide.pdf

友情推荐:

Android 开发干货集锦

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

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

浏览 102
点赞
评论
收藏
分享

手机扫一扫分享

举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

举报