iMX7D : CSI MIPI configuration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX7D : CSI MIPI configuration

991 Views
dh29
Contributor IV

Linux Kernel: v4.9.11

 

I am now successfully capturing PROGRESSIVE video using a PAL camera via an ADV7820M. The image is clear and stable. According to the ADV7820M the PAL output should be at 50 fps...BUT...I am measuring 40 fps ??? [I am using gstreamer-1.0 with its fpsdisplaysink plug-in to capture the video and measure the received video's fps.] 

This difference of 40 fps instead of 50 fps lends me to think that something may not be setup correctly within CSI-MIPI of the iMX7?? The documentation for the iMX7 CSI-MIPI seems very sparse. This leads to a number of questions:

  • MIPI-CSI device tree has an entry for clock-frequency but where does this value come from and what's its purpose?
  • MIPI-CSI device tree has an entry for csis-wclk. The documentation states this enables use of the WRAP_CLK but what exactly is it and should I be enabling it?
  • iMX6 application notes talk of configuring the MIPI-CSI PHY clock rate to be within range of the sensor's differential clock (216 MHz in my case), but I can see nothing that states this for the iMX7, or any code that attempts to do this. Should the MIPI-CSI PHY clock be related to the sensor clock?
Labels (3)
0 Kudos
3 Replies

656 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi,

    Is your capture IC ADV7820M or ADV7280M?  let me assume it is ADV7280M.

    The speed of MIPI CSI-2 is up to 1.5Gbps, so hardware is no problem for capturing video stream of ADV7280M. MIPI CSI-2 Clock on CPU side is input, it means the clock is from ADV7280M.

     so I feel you don't need to check if settings in BSP is correct, and I suggest you should test it by mxc_v4l2_tvin, then meansure fps, and check if it is correct.

Have a nice day!

TIC weidong sun

0 Kudos

656 Views
dh29
Contributor IV

Hi Wigros Sun 

I have tried your suggestion of mxc_v4l2_tvin. Using the recommended YOCTO image and imx-test utility package, I have re-compiled the application to support the video devices for the iMX7. Namely /dev/video1 is my capture device and /dev/video0 is my output device.

However when running the application I get a VIDIO_DBG_G_CHIP_IDENT failed error. I have already posted a question on this but without any useful answers (see VIDIOC_DBG_G_CHIP_IDENT failed ).

I feel that mxc_v4l2_tvin is not the correct application to use with the iMX7 ??  Shouldn't I be using mx6s_v4l2_capture for the iMX7 as it doesn't have an IPU, and hence I am using the subdev framework for my video capture (ADV7280M) driver ??

I have tried mx6s_v4l2_capture (again rebuilt to target /dev/video1 for my capture device and /dev/video0 as my output device). But I get a Unsupport format in software_csc error, when outputting to /dev/video0.

Again using mx6s_v4l2_capture if I output to a file (in RAM) then the capture works, BUT the file contents indicate a frame rate of 30 fps. Also it appears to saturate one core in the iMX7 with TOP showing 50% CPU usage!!  This could explain the lower fps value?? I know that the iMX7 doesn't have an IPU, but I'm still surprised by this.

0 Kudos

656 Views
dh29
Contributor IV

Hi weidong.sun 

Thanks you for your reply. 

I am using the ADV7280M.  I have typed it incorrectly in my original post, but I can't seem to correct the typo.

The MIPI-CSI device tree has an entry for clock-frequency but there's nothing in the i.MX7 hardware manual that explains where this value comes from and what's its purpose? The default mxc_mipi_csi.c driver sets it to 166MHz. I was concerned that perhaps this value should somehow be related to my differential MIPI clock of 416MHz ???

I'll try your suggestion of using mxc_v4l2_tvin application and post back.

0 Kudos