AnsweredAssumed Answered

i.MX6 OV5647 Bayer sensor driver (ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0)

Question asked by Dave McMordie on Aug 9, 2013
Latest reply on Aug 4, 2015 by Dave McMordie

Hello,

 

I have implemented an OV5647 camera board which connects to my i.MX6 quad Wandboard.  I am having trouble getting images from the driver and need some help figuring out why.  I have reviewed about a dozen related threads on this forum, and tried to carefully implement their suggestions.

 

Here are the steps I have taken so far:

 

  1. Started with working kernel (based on John Weber's Yocto Kernel) and board which is known to work with OV5640 (YUV sensor) in this configuration.  rootfs is Linaro armhf with desktop ubuntu (so I can use VLC and other known tools for testing).
  2. Made sure that the BSP sets GPR1 19 to 0 (select MIPI CSI interface to IPU0 CSI 0), and that the camera driver is detected by I2C.
  3. Built a driver, OV5647_mipi.c, based on OV5640_mipi.c with the following changes:
    1. Replaced modes (register programming code) with code appropriate to generate a 1280x960 30 fps preview on the OV5647
    2. Changed the chip_id high and low bytes to 0x56 and 0x47 respectively
    3. Changed ov5647_data.pix.pixelformat to V4L2_PIX_FMT_SBGGR10
    4. Added code to detect this and call mipi_csi2_set_datatype with MIPI_DT_RAW10
    5. Tried steps 3, 4 with GREY and RAW10
  4. Added support for V4L2_PIX_FMT_SBGGR10 and V4L2_PIX_FMT_GREY to
    1. drivers\media\video\mxc\capture\ipu_csi_enc.c
    2. drivers\media\video\mxc\capture\mxc_v4l2_capture.c
    3. drivers\mxc\ipu3\ipu_capture.c
    4. drivers\mxc\ipu3\ipu_common.c
    5. drivers\mxc\ipu3\ipu_param_mem.h
  5. Tested
    1. Sensor is correctly detected on I2C
    2. Driver reports MIPI clock stabilized okay
    3. Driver reports data being received from sensor


I have to guess that what is going on is that the image format is not being handled correctly, but I can't tell from the tracing.


Some specific questions:


  1. How can I verify that I am talking to the correct IPU, CSI port and virtual channel?
  2. Despite the driver's claim that it is receiving data, is it possible that this is a signal integrity issue?  I have not been able to successfully probe the lanes (I see a ton of common mode noise)
  3. Are there steps I have missed to support a 10 bit Bayer sensor just as grayscale?
  4. What are the likely reasons why it is not getting frame interrupts?
  5. Help!  


The following is what I get with DEBUG tracing on in the drivers:


[ 1160.505314] End of mxc_v4l2_g_fmt: crop_current widthxheight 1280 x 960

[ 1160.505352] In MVC:mxc_v4l_ioctl

[ 1160.505360] In MVC: mxc_v4l_do_ioctl c0405602

[ 1160.505373] In MVC:mxc_v4l_ioctl

[ 1160.505380] In MVC: mxc_v4l_do_ioctl c0405602

[ 1160.505458] In MVC:mxc_v4l_ioctl

[ 1160.505465] In MVC: mxc_v4l_do_ioctl c0445624

[ 1160.505472]    case default or not supported

[ 1160.505528] In MVC:mxc_v4l_ioctl

[ 1160.505535] In MVC: mxc_v4l_do_ioctl c02c563a

[ 1160.505540]    case VIDIOC_CROPCAP

[ 1160.505547] In MVC:mxc_v4l_ioctl

[ 1160.505552] In MVC: mxc_v4l_do_ioctl 4014563c

[ 1160.505561]    case VIDIOC_S_CROP

[ 1160.505567]    Cropping Input to ipu size 1280 x 960

[ 1160.505678] In MVC:mxc_v4l_ioctl

[ 1160.505686] In MVC: mxc_v4l_do_ioctl c0145608

[ 1160.505693]    case VIDIOC_REQBUFS

[ 1160.505697] In MVC:mxc_streamoff

[ 1160.505702] MVC: In mxc_free_frame_buf

[ 1160.505709] In MVC:mxc_allocate_frame_buf - size=152064

[ 1160.508739] In MVC:mxc_v4l_ioctl

[ 1160.508746] In MVC: mxc_v4l_do_ioctl c0445609

[ 1160.508752]    case VIDIOC_QUERYBUF

[ 1160.508759] In MVC:mxc_v4l2_buffer_status

[ 1160.508904] In MVC:mxc_mmap

[ 1160.508911]    pgoff=0x184c0, start=0x45dbd000, end=0x45de3000

[ 1160.508933] In MVC:mxc_v4l_ioctl

[ 1160.508939] In MVC: mxc_v4l_do_ioctl c0445609

[ 1160.508944]    case VIDIOC_QUERYBUF

[ 1160.508949] In MVC:mxc_v4l2_buffer_status

[ 1160.508966] In MVC:mxc_mmap

[ 1160.508972]    pgoff=0x18300, start=0x46549000, end=0x4656f000

[ 1160.508987] In MVC:mxc_v4l_ioctl

[ 1160.508992] In MVC: mxc_v4l_do_ioctl c0445609

[ 1160.508997]    case VIDIOC_QUERYBUF

[ 1160.509002] In MVC:mxc_v4l2_buffer_status

[ 1160.509013] In MVC:mxc_mmap

[ 1160.509019]    pgoff=0x18340, start=0x46700000, end=0x46726000

[ 1160.509033] In MVC:mxc_v4l_ioctl

[ 1160.509039] In MVC: mxc_v4l_do_ioctl c0445609

[ 1160.509044]    case VIDIOC_QUERYBUF

[ 1160.509049] In MVC:mxc_v4l2_buffer_status

[ 1160.509058] In MVC:mxc_mmap

[ 1160.509064]    pgoff=0x19f00, start=0x467ed000, end=0x46813000

[ 1160.509085] In MVC:mxc_v4l_ioctl

[ 1160.509092] In MVC: mxc_v4l_do_ioctl c044560f

[ 1160.509097]    case VIDIOC_QBUF

[ 1160.509104] In MVC:mxc_v4l_ioctl

[ 1160.509110] In MVC: mxc_v4l_do_ioctl c044560f

[ 1160.509115]    case VIDIOC_QBUF

[ 1160.509121] In MVC:mxc_v4l_ioctl

[ 1160.509126] In MVC: mxc_v4l_do_ioctl c044560f

[ 1160.509131]    case VIDIOC_QBUF

[ 1160.509138] In MVC:mxc_v4l_ioctl

[ 1160.509143] In MVC: mxc_v4l_do_ioctl c044560f

[ 1160.509148]    case VIDIOC_QBUF

[ 1160.509154] In MVC:mxc_v4l_ioctl

[ 1160.509160] In MVC: mxc_v4l_do_ioctl 40045612

[ 1160.509166]    case VIDIOC_STREAMON

[ 1160.509170] In MVC:mxc_streamon

[ 1160.509175] IPU:In prp_enc_enabling_tasks

[ 1160.509981] In prp_enc_setup

[ 1160.509988] YUV420

[ 1160.510026] eba 184c0000

[ 1160.510033] eba 18300000

[ 1160.510230] In MVC:mxc_poll

[ 1160.510243] In MVC:mxc_v4l_ioctl

[ 1160.510250] In MVC: mxc_v4l_do_ioctl c0445611

[ 1160.510256]    case VIDIOC_DQBUF

[ 1160.510261] In MVC:mxc_v4l_dqueue

[ 1170.504999] ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

[ 1170.511966] In MVC:mxc_poll

[ 1170.511983] In MVC:mxc_v4l_ioctl

[ 1170.511991] In MVC: mxc_v4l_do_ioctl c0445611

[ 1170.511997]    case VIDIOC_DQBUF

[ 1170.512001] In MVC:mxc_v4l_dqueue

[ 1180.504959] ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

[ 1180.511757] In MVC:mxc_poll

[ 1180.511773] In MVC:mxc_v4l_ioctl

[ 1180.511783] In MVC: mxc_v4l_do_ioctl c0445611

[ 1180.511789]    case VIDIOC_DQBUF

[ 1180.511794] In MVC:mxc_v4l_dqueue

[ 1190.504954] ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

Outcomes