Project

General

Profile

Camera driver development

Added by Nathan Olson 14 days ago

Do you have any resources to help with camera driver development? I've found Qualcomm's "Linux Build Guide", "Linux Camera Guide", and "Linux Camera Guide - Addendum". I'm now working on building the camera and sensor files from source.

In your chicdk-kt_1.0.qcom.bbappend file in your Yocto layer, there is a reference to CriticalLink changes and the nonexistent webpage https://redmine.syr.criticallink.com/redmine/projects/mitysom_qcs6490/wiki/Camera_Notes .

Can you tell me what version of meta-qcom-extras you used for your changes, and what the changes are? Any other info would be appreciated as well.


Replies (5)

RE: Camera driver development - Added by Noah Zins 9 days ago

Hi Nathan,

We used the r1.0_00095.0 release of Qualcomm_Linux.SPF.1.0|AP|Standard|OEM|NM_QIMPSDK for our firmware development. It contains the r1.0_00376 release of QCM6490.LE.1.0 where the meta-qcom-extras layer resides. These versions correspond with QC Linux 1.5.
Note that there is a limitation with QC Linux 1.5 that does not allow simultaneous streaming from more than 3 cameras, so we're migrating to a newer version in an upcoming SDK.

I have found the Linux Camera Guide - Addendum to be the most helpful document by far.

Sorry for the confusion about that link, it is only available internally. I am currently writing up a publicly available instruction document for this process. I hope to have it published tomorrow.

--

In short, you need to modify two recipes. I found using devtool (per the Camera Guide - Addendum) to be helpful.

devtool modify chicdk-kt

  • Copy the existing cmk_ov9282_cam*.xml file at \${CAMX_CHICDK_PATH}/oem/qcom/module to add additional module XMLs with unique cameraId values.
  • Add cmake files that correspond to these new XMLs at \${CAMX_CHICDK_PATH}/oem/qcom/buildbins/build/linuxembedded/binary_yupik/
  • Modify ${CAMX_CHICDK_PATH}/oem/qcom/multicamera/chimcxcameraconfig/configs/kodiak/kodiak_dc.xml to match my desired configuration, and removed all other XMLs in this directory.
    Note in kodiak_dc.xml the slotId property must match the cameraId property from the module XML file. The cameraId value is the CSI interface number.
  • Build and install chicdk-kt ipk according to the Addendum.

--

For the device tree:
devtool modify cameradtb

  • open mitysom-qc6490-devkit-camera-sensor.dtsi
  • Copy an existing node for the ov9281, qcom,cam-sensorX
    • X needs to match cameraId from the Module XML.
  • If the new camera is going to connect to CSI0 or CSI1, paste the new node under &cam_cci0, if its CSI2-4, then it goes under &cam_cci1
  • Update cell-index to match X from above.
  • Update csiphy-sd-index to match CSIx number the camera will be connected to.
  • Update csi-master:
    • CSI0 and CSI2 use csi-master = <0>
    • CSI1, CSI3, and CSI4 use csi-master = <1>

Let me know if you have further questions about camera development, I will update this post when I've published an official page for this process.

Thanks,
Noah

RE: Camera driver development - Added by Noah Zins 7 days ago

Hi Nathan,

It is posted here: https://support.criticallink.com/redmine/projects/mitysom_qc6490/wiki/Camera_Config

Please don't hesitate to reach out if you have further questions!

Thanks,
Noah

RE: Camera driver development - Added by Nathan Olson 3 days ago

Thanks, Noah.

I'm trying to bring up a new sensor, and no luck so far. To simplify things, I've removed all camera modules except mine, and removed all multicamera configs except mine, which has a single camera at cameraId 0, slot 0, CSI0. It does not find the camera , and I don't see any traffic on CSI0's I2C.

Attached are my patches and the resulting verbose cam-server log (except for the sensor driver xml, which I can share privately if needed). Any ideas where to look for the problem?

Here's some things I notice in the log:
  • Sensors 0-12 are "probed", although there is only one camera in the camera config and only one camera in the device tree.
  • in ProbeSensor(), some sensors are "unsupported" and some "time out". Which of these sensors is my sensor, and which of theses error messages apply?
  • The correct multicamera config "kodiak_lab308_spc_v1.xml" is selected.
  • 'Can't build "RearPhysicalCam0_LogicalImpl". Failed to find slotId 0'. 0 is the correct slotId.
  • 'ImageSensorModuleData() module0 : cameraId 0 chromatix name lab308_tc358746': This seems promising.

RE: Camera driver development - Added by Noah Zins 2 days ago

Hi Nathan,

I too have noticed the probing of sensors 0-12, I have not looked into it but we see this same behavior. I expect your sensor to be 0.

If your sensor XML has the correct I2C address, I2C speed, sensor ID, and sensor ID register address in the sensor XML then I think you should see a successful probe on the I2C lines, and a successful probe message from ProbeSensor().
Can you share the XML with me?
I believe 'Can't build "RearPhysicalCam0_LogicalImpl". Failed to find slotId 0' is due to the lack of a successful I2C probe.

Why did you remove the properties cam_vio-supply, regulator-names, power-domains etc. from the DT? Do you see different behavior if you uncomment these?

Lastly, ensure you do a clean build of chicdk-kt each time with bitbake -fc cleanall chicdk-kt. I have observed weird behavior a few times in the past that was resolved with a clean build of chicdk-kt.

Thanks,
Noah

RE: Camera driver development - Added by Nathan Olson 2 days ago

I removed the power-related fields because my camera is powered by an always-on supply, and I was trying to simplify things as much as possible. I'll try adding that stuff back, in particular power-domains seems like it might be important. I'll also make sure to do a clean build.

I'll send the sensor XML in an email.

    (1-5/5)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)