Hi, everybody. Image capture does not occur. "ioctl(fd, VIDIOC_DQBUFS, &buf)" returns -1. There are two problems. 1. The MIPI_CSI_PHY_STATE register has the value 0x200. Although the oscilloscope can be seen clocking. 2. In the mxc_v4l2_capture.c module, when calling VIDIOC_DQBUFS, "enc_counter" in the "_cam_data" structure is 0. Please help me.
Solved! Go to Solution.
Which BSP are you using? and what is the version? Is the camera driver up during the boot? if possible, please provide the boot up log for further investigation.
Thanks. The board is custom with VAR-SOM-MX6. Operating system Yocto thud-FSLC-4.14.78-mx6-v1. 0. The camera driver is enabled at boot time.
Boot up log :
[ 1277.254533] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_VERSION = 0x3130302a
[ 1277.261249] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_N_LANES = 0x1
[ 1277.267390] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_PHY_SHUTDOWNZ = 0x1
[ 1277.274009] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_DPHY_RSTZ = 0x1
[ 1277.280300] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_CSI2_RESETN = 0x1
[ 1277.286870] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_PHY_STATE = 0x200
[ 1277.293349] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_DATA_IDS_1 = 0x0
[ 1277.299758] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_DATA_IDS_2 = 0x0
[ 1277.306160] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_ERR1 = 0x0
[ 1277.312238] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_ERR2 = 0x0
[ 1277.318095] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_MASK1 = 0x0
[ 1277.324015] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_MASK2 = 0x0
[ 1277.329979] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_PHY_TST_CTRL0 = 0x0
[ 1277.336610] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_PHY_TST_CTRL1 = 0xc0c
[ 1277.343398] isl79987_mipi.c mxc_wait_mipi_csi2_ready() MIPI_CSI2_SFT_RESET = 0x0
[ 1277.349684] isl79987_mipi.c mxc_wait_mipi_csi2_ready() mipi_reg = 0x200
[ 1277.355185] isl79987_mipi.c mxc_wait_mipi_csi2_ready() 'mipi csi2 can not receive sensor clk!'
[ 1277.362667] mipi csi2 can not receive sensor clk!
[ 1277.366094] isl79987_mipi.c isl79987_update_sensor_data() 'failed check_csi2_rx_mipi_dphy'
[ 1277.373237] isl79987_update_sensor_data failed check_csi2_rx_mipi_dphy
[ 1277.378486] isl79987_mipi.c ioctl_g_std() 'failed isl79987_update_sensor_data'
[ 1277.384599] ioctl_g_std failed isl79987_update_sensor_data
[ 1277.388788] MVC: mxc_v4l2_g_std: Changing standard
[ 1277.388793] In mxc_v4l2_s_std ff
[ 1277.388797] Setting standard to PAL ff
[ 1277.388804] End of mxc_v4l2_s_std: crop_bounds widthxheight 720 x 625
[ 1277.388809] End of mxc_v4l2_s_std: crop_current widthxheight 720 x 576
[ 1277.389402] In MVC:mxc_v4l_ioctl
[ 1277.389411] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1277.393223] In MVC: mxc_v4l_do_ioctl c0cc5615
[ 1277.393229] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_G_PARM
[ 1277.398049] case VIDIOC_G_PARM
[ 1277.398055] isl79987_mipi.c ioctl_g_parm()
[ 1277.401025] isl79987_mipi.c ioctl_g_parm() V4L2_BUF_TYPE_VIDEO_CAPTURE
[ 1277.408069] In MVC:mxc_v4l_ioctl
[ 1277.408076] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1277.411882] In MVC: mxc_v4l_do_ioctl c0cc5616
[ 1277.411887] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_S_PARM
[ 1277.416770] case VIDIOC_S_PARM
[ 1277.416774] In mxc_v4l2_s_param
[ 1277.416777] isl79987_mipi.c ioctl_g_parm()
[ 1277.419747] isl79987_mipi.c ioctl_g_parm() V4L2_BUF_TYPE_VIDEO_CAPTURE
[ 1277.425185] Current capabilities are 1001
[ 1277.425190] Current capturemode is 0 change to 0
[ 1277.425194] Current framerate is 25 change to 0
[ 1277.425198] isl79987_mipi.c ioctl_s_parm()
[ 1277.428169] clock_curr=mclk=27000000
[ 1277.428175] g_fmt_cap returns widthxheight of input as 720 x 576
[ 1277.428180] End of mxc_v4l2_s_param: v2f pix widthxheight 288 x 216
[ 1277.428184] End of mxc_v4l2_s_param: crop_bounds widthxheight 720 x 576
[ 1277.428189] End of mxc_v4l2_s_param: crop_defrect widthxheight 720 x 480
[ 1277.428193] End of mxc_v4l2_s_param: crop_current widthxheight 720 x 576
[ 1277.428198] End of mxc_v4l2_s_param: v2f pixelformat:33424752 field:4
[ 1277.428202] End of mxc_v4l2_s_param: Input to ipu size is 720 x 576
[ 1277.428609] In MVC:mxc_v4l_ioctl
[ 1277.428633] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1277.432433] In MVC: mxc_v4l_do_ioctl c0145608
[ 1277.432438] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_REQBUFS
[ 1277.437372] case VIDIOC_REQBUFS
[ 1277.437376] mxc_v4l2_capture.c mxc_streamoff()
[ 1277.440692] In MVC:mxc_streamoff
[ 1277.440696] MVC: In mxc_free_frame_buf
[ 1277.440703] In MVC:mxc_allocate_frame_buf - size=186624
[ 1277.446561] In MVC:mxc_v4l_ioctl
[ 1277.446568] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1277.450381] In MVC: mxc_v4l_do_ioctl c0445609
[ 1277.450386] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QUERYBUF
[ 1277.455379] case VIDIOC_QUERYBUF
[ 1277.455386] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QUERYBUF 'buf->memory & V4L2_MEMORY_MMAP 1'
[ 1277.463419] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QUERYBUF 'buf->memory & V4L2_MEMORY_MMAP 2'
[ 1277.471443] In MVC:mxc_v4l2_buffer_status
[ 1277.471450] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QUERYBUF END
[ 1277.476977] In MVC:mxc_mmap
[ 1277.476985] pgoff=0x3c140, start=0x6a91a000, end=0x6a948000
[ 1277.477254] In MVC:mxc_v4l_ioctl
[ 1277.477260] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1277.481012] In MVC: mxc_v4l_do_ioctl c0445609
[ 1277.481016] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QUERYBUF
[ 1277.486070] case VIDIOC_QUERYBUF
[ 1277.486074] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QUERYBUF 'buf->memory & V4L2_MEMORY_MMAP 1'
[ 1277.494097] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QUERYBUF 'buf->memory & V4L2_MEMORY_MMAP 2'
[ 1277.502120] In MVC:mxc_v4l2_buffer_status
[ 1277.502127] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QUERYBUF END
[ 1277.507633] In MVC:mxc_mmap
[ 1277.507640] pgoff=0x3c180, start=0x69d92000, end=0x69dc0000
[ 1277.507823] In MVC:mxc_v4l_ioctl
[ 1277.507828] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1277.511598] In MVC: mxc_v4l_do_ioctl c0445609
[ 1277.511602] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QUERYBUF
[ 1277.516594] case VIDIOC_QUERYBUF
[ 1277.516600] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QUERYBUF 'buf->memory & V4L2_MEMORY_MMAP 1'
[ 1277.524687] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QUERYBUF 'buf->memory & V4L2_MEMORY_MMAP 2'
[ 1277.532690] In MVC:mxc_v4l2_buffer_status
[ 1277.532694] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QUERYBUF END
[ 1277.538207] In MVC:mxc_mmap
[ 1277.538215] pgoff=0x3c1c0, start=0x69d64000, end=0x69d92000
[ 1277.539100] In MVC:mxc_v4l_ioctl
[ 1277.539106] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1277.542943] In MVC: mxc_v4l_do_ioctl c044560f
[ 1277.542948] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QBUF
[ 1277.547591] case VIDIOC_QBUF
[ 1277.547937] In MVC:mxc_v4l_ioctl
[ 1277.547943] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1277.551763] In MVC: mxc_v4l_do_ioctl c044560f
[ 1277.551767] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QBUF
[ 1277.556410] case VIDIOC_QBUF
[ 1277.556765] In MVC:mxc_v4l_ioctl
[ 1277.556770] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1277.560529] In MVC: mxc_v4l_do_ioctl c044560f
[ 1277.560533] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_QBUF
[ 1277.565205] case VIDIOC_QBUF
[ 1277.565431] In MVC:mxc_v4l_ioctl
[ 1277.565437] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1277.569212] In MVC: mxc_v4l_do_ioctl c0045627
[ 1277.569216] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_S_INPUT
[ 1277.574095] case VIDIOC_S_INPUT
[ 1277.574099] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_S_INPUT 'mxc_capture_inputs[cam->current_input].status &'
[ 1277.583410] mxc_v4l2_capture.c mxc_streamoff()
[ 1277.586772] In MVC:mxc_streamoff
[ 1277.586778] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_S_INPUT 'strcmp(mxc_capture_inputs[*index].name, CSI MEM) == 0'
[ 1277.596539] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_S_INPUT 'CONFIG_MXC_IPU_CSI_ENC) || defined(CONFIG_MXC_IPU_CSI_ENC_MODULE'
[ 1277.607281] ipu_csi_enc.c csi_enc_select()
[ 1277.610163] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_S_INPUT 90
[ 1277.615322] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_S_INPUT END
[ 1277.620711] In MVC:mxc_v4l_ioctl
[ 1277.620716] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1277.624557] In MVC: mxc_v4l_do_ioctl 40045612
[ 1277.624562] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_STREAMON
[ 1277.629527] case VIDIOC_STREAMON
[ 1277.629531] mxc_v4l2_capture.c mxc_streamon()
[ 1277.632767] In MVC:mxc_streamon
[ 1277.632781] mxc_v4l2_capture.c mxc_streamon() 'cam->enc_enable'
[ 1277.637595] ipu_csi_enc.c csi_enc_enabling_tasks()
[ 1277.641173] ipu_csi_enc.c csi_enc_enabling_tasks() 'IPU:In csi_enc_enabling_tasks'
[ 1277.647547] ipu_csi_enc.c csi_enc_enabling_tasks() IPU_IRQ_CSI0_OUT_EOF
[ 1277.654747] ipu_csi_enc.c csi_enc_setup() ------------------
[ 1277.659195] ipu_csi_enc.c csi_enc_setup() 'csi_channel = CSI_MEM0'
[ 1277.664162] ipu_csi_enc.c csi_enc_setup() 'IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_SDR'
[ 1277.670829] ipu_csi_enc.c csi_enc_setup() 'params.csi_mem.interlaced = true'
[ 1277.676705] ipu_csi_enc.c csi_enc_setup() In csi_enc_setup cam->v2f.fmt.pix.field:4 params.csi_mem.interlaced:1
[ 1277.685512]
In csi_enc_setup cam->v2f.fmt.pix.field:4 params.csi_mem.interlaced:1
[ 1277.685520] ipu_csi_enc.c csi_enc_setup() IPU_PIX_FMT_RGB24
[ 1277.689878] mxc_mipi_csi2.c mipi_csi2_get_info()
[ 1277.693366] ipu_csi_enc.c csi_enc_setup() 'mipi_csi2_info'
[ 1277.697677] mxc_mipi_csi2.c mipi_csi2_get_status()
[ 1277.701341] mxc_mipi_csi2.c mipi_csi2_get_status() 2
[ 1277.705203] mxc_mipi_csi2.c mipi_csi2_get_status() 4
[ 1277.709040] mxc_mipi_csi2.c mipi_csi2_get_status() END
[ 1277.713049] ipu_csi_enc.c csi_enc_setup() 'mipi_csi2_get_status(mipi_csi2_info)'
[ 1277.719270] ipu_csi_enc.c csi_enc_setup() 'cam->ipu == ipu_get_soc(ipu_id)'
[ 1277.725030] mxc_mipi_csi2.c mipi_csi2_get_datatype()
[ 1277.728872] In csi_enc_setup interfaced:1 mipi_en:1 mipi_vc:0 mipi_id:0x1e
[ 1277.734460] ipu3/ipu_common.c ipu_init_channel() ipu->id = 0
[ 1277.738993] ipu3/ipu_common.c ipu_init_channel() channel = 268435392
[ 1277.744218] ipu3/ipu_common.c ipu_init_channel() params = -1446945356
[ 1277.749547] ipu3/ipu_common.c ipu_init_channel() init channel = 15
[ 1277.754540] ipu3/ipu_common.c ipu_init_channel() channel = 268435392
[ 1277.759765] ipu3/ipu_common.c ipu_init_channel() CSI_MEM3
[ 1277.764034] ipu3/ipu_common.c ipu_init_channel() CSI_MEM3 'params->csi_mem.interlaced'
[ 1277.770866] ipu3/ipu_common.c ipu_init_channel() CSI_MEM3 'params->csi_mem.mipi_en'
[ 1277.777410] ipu3/ipu_common.c ipu_init_channel() CSI_MEM3 END
[ 1277.782027] ipu3/ipu_common.c ipu_init_channel() END -> ERROR
[ 1277.786661] ipu3/ipu_common.c ipu_init_channel() ERROR
[ 1277.790689] ipu_csi_enc.c csi_enc_setup() 'END ERROR'
[ 1277.794546] ipu_csi_enc.c csi_enc_enabling_tasks() END err = 0
[ 1277.799104] mxc_streamon cam->v2f.fmt.pix.field:4 cam->device_type:1
[ 1277.799109] mxc_v4l2_capture.c mxc_streamon() enc_update_eba() = 2131532096
[ 1277.804942] mxc_v4l2_capture.c mxc_streamon() 'cam->enc_update_eba'
[ 1277.810079] ipu_csi_enc.c csi_enc_eba_update()
[ 1277.813306] eba 3c140000
[ 1277.813311] ipu_csi_enc.c csi_enc_eba_update()
[ 1277.816539] eba 3c180000
[ 1277.816590] mxc_v4l2_capture.c mxc_streamon() 'cam->enc_enable_csi'
[ 1277.821729] ipu_csi_enc.c csi_enc_enable_csi()
[ 1277.824981] mxc_v4l2_capture.c mxc_streamon() END
[ 1278.010826] In MVC:mxc_v4l_ioctl
[ 1278.010837] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1278.014637] In MVC: mxc_v4l_do_ioctl c0445611
[ 1278.014646] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF
[ 1278.019353] case VIDIOC_DQBUF
[ 1278.019359] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF enc_counter = 0x0
[ 1278.025700] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF file->f_flags = 0x802
[ 1278.032319] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF O_NONBLOCK = 0x800
[ 1278.038705] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF 2
[ 1278.887561] In MVC:mxc_v4l_ioctl
[ 1278.887580] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1278.891355] In MVC: mxc_v4l_do_ioctl c0445611
[ 1278.891364] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF
[ 1278.896195] case VIDIOC_DQBUF
[ 1278.896210] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF enc_counter = 0x0
[ 1278.902495] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF file->f_flags = 0x802
[ 1278.909148] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF O_NONBLOCK = 0x800
[ 1278.915527] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF 2
[ 1279.937511] In MVC:mxc_v4l_ioctl
[ 1279.937529] mxc_v4l2_capture.c mxc_v4l_do_ioctl() 0
[ 1279.941302] In MVC: mxc_v4l_do_ioctl c0445611
[ 1279.941311] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF
[ 1279.946133] case VIDIOC_DQBUF
[ 1279.946150] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF enc_counter = 0x0
[ 1279.952433] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF file->f_flags = 0x802
[ 1279.959086] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF O_NONBLOCK = 0x800
[ 1279.965463] mxc_v4l2_capture.c mxc_v4l_do_ioctl() VIDIOC_DQBUF 2
[ 1280.987557] In MVC:mxc_v4l_ioctl
Thank you very much! The video sequence appeared. But it consists of two fields.
fmt.fmt.pix.field = V4L2_FIELD_INTERLACED_BT;
ioctl(fd_output_v4l, VIDIOC_S_FMT, &fmt)
The command to output to the screen does not help.
For a camera running on a parallel interface, this command helps. How to display a normal image?