IMX412 driver troubleshooting

Hi @kimbo,

could you elaborate on test pattern? Do you mean that there’s a special I2C register?

Image on 750 MHz looks virtually identical to the other frequencies besides ones lower than 300 MHz which do look substantially worse. What distortions do you get when you try to use incorrect pixel rate and/or settle_count? Do they look similar to mine (every row of the image is incrementally shifted)? I suspect there’s still a problem that needs to be solved before adjusting pixel_rate.

I can hook up the scope but I doubt that I will be able to get anything useful as our scope is caped to 200MHz and MIPI signal uses much higher frequencies as far as I know.

I’ve wrote to the vendor and requested documentation of I2C registers in hopes that there’s just a slight incompatibility in registers/values that’s holding me back.

Hi @xilsqyyx,

Yes, that is what I mean. There should be an i2c register for setting up a testpattern.

To answer your other question, I have seen similar distortions in cameras, per this post:Image from MIPI Camera Missing Data You can see in this thread images that are similar to yours and I have seen similar issues with the IMX-412 camera module that I have as well.

The IMX-412 sensor we have came with a driver and most of the i2c registers are unknown to us. Most of the registers are unreadable and return 0x00. I think it would be good to get the vendor feedback and maybe they can help you set the registers to the values needed.

Thanks,
Kim

Hi @kimbo,

Just a quick observation, I’ve decided to try hard-coded values of settle_cnt and none of the values I’ve tried alters distortion I experience, thus it seems likely that the main problem is not in settle_cnt.

Another observation - playing with data_lanes parameter in dts changes image, I’ve tried to use 2 data lanes instead of 4 and image doesn’t wrap around as much (thought still slanted). I will try to change indices, maybe it will help.

It seems that slanting was due excess data in 4056x3040 resolution, don’t know where it comes from and don’t know how to fix it yet. I was lucky to guess which registers corresponded to width and height of the image, so I set those to 3840 and 2160 respectively. Image is not slanted anymore, thought now it appears to be cropped.

What we got with 3840x2160, 750MHz, settle_cnt=18, csi frequency 267MHz and 2 data lanes

That is good progress @xilsqyyx! Hopefully the vendor can get back to you with documentation for the sensor. I wonder if the i2c register is set to 2 mipi data lanes or did you find where to change that register from 4 to 2?
Thanks,
Kim

Hi @kimbo,

Vendor got back to us, but according to the documentation we were given, number of mipi data lanes is not something that can be modified. There’s no I2C register responsible for number of mipi data lanes, just fields in a ROM describing possible configurations, so I’m led to believe that the same as data lane frequency is handled by qcom_camss, number of data lanes is handled by hardware itself. Thus I’m not even sure that entries in dts regarding number of data lanes even mean something because it seems to work regardless, I think that getting good image had nothing to do with mipi data lane number (though I haven’t experimented much, I might be wrong).