IMX6 CSI Capture does not work

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

IMX6 CSI Capture does not work

1,875 Views
swendt
Contributor II

I have a HW with TC358743 HDMI Decoder connected to MIPI-CSI interface and a TVP5150AM connected as 8-Bit parallel device to CSI1. I am running NXP kernel 4.1.15.

I2C setup etc. all works well, also registration in V4L2 etc but if try to capture the stream of either device, the camera_callback function is never called and no buffers are queued, e.g. using gstreamer or v4l2grab.

I can see that there is activity both on MIPI-CSI and on CSI1 as soon as I start streaming but camera_callback s never called.

Please find my device tree file and my kernel config attached.

Is there any way to further debug the IPU why there is no callback executed ?

# v4l2grab  -o test.jpg -W 640 -H 480  -d /dev/video1

In MVC: mxc_v4l_open
   device name is Mxc Camera
End of mxc_v4l_open: v2f pix widthxheight 288 x 352
End of mxc_v4l_open: crop_bounds widthxheight 720 x 525
End of mxc_v4l_open: crop_defrect widthxheight 720 x 525
End of mxc_v4l_open: crop_current widthxheight 720 x 525
On Open: Input to ipu size is 720 x 525
INIT Test Generator
Selecting video route: route input=0, output=0 => tvp5150 input=0, opmode=0
Set video std register to 0.
Selecting video route: route input=0, output=0 => tvp5150 input=0, opmode=0
Set video std register to 0.
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80685600
   case VIDIOC_QUERYCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80685600
   case VIDIOC_QUERYCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5604
   case VIDIOC_G_FMT
In MVC: mxc_v4l2_g_fmt type=1
   type is V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_g_fmt: v2f pix widthxheight 288 x 352
End of mxc_v4l2_g_fmt: crop_bounds widthxheight 720 x 525
End of mxc_v4l2_g_fmt: crop_defrect widthxheight 720 x 525
End of mxc_v4l2_g_fmt: crop_current widthxheight 720 x 525
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5615
   case VIDIOC_G_PARM
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0405602
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c02c564a
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c02c564a
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0405602
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80685600
   case VIDIOC_QUERYCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80045626
   case VIDIOC_G_INPUT
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c050561a
   case VIDIOC_ENUMINPUT
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445624
   case default or not supported:-1069263324 - 0xC0445624
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80685600
   case VIDIOC_QUERYCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c02c563a
   case VIDIOC_CROPCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 4014563c
   case VIDIOC_S_CROP
   Cropping Input to ipu size 720 x 525
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5640
   case VIDIOC_S_FMT
In MVC: mxc_v4l2_s_fmt
   type=V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_s_fmt: v2f pix widthxheight 640 x 480
End of mxc_v4l2_s_fmt: crop_bounds widthxheight 720 x 525
End of mxc_v4l2_s_fmt: crop_defrect widthxheight 720 x 525
End of mxc_v4l2_s_fmt: crop_current widthxheight 720 x 525
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5605
   case VIDIOC_S_FMT
In MVC: mxc_v4l2_s_fmt
   type=V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_s_fmt: v2f pix widthxheight 640 x 480
End of mxc_v4l2_s_fmt: crop_bounds widthxheight 720 x 525
End of mxc_v4l2_s_fmt: crop_defrect widthxheight 720 x 525
End of mxc_v4l2_s_fmt: crop_current widthxheight 720 x 525
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5615
   case VIDIOC_G_PARM
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5616
   case VIDIOC_S_PARM
In mxc_v4l2_s_param
   Current capabilities are 1001
   Current capturemode is 0  change to 0
   Current framerate is 30  change to 30
ioctl_s_parm TVP5150_OUTPUT_CONTROL_CHIP_ENABLE
   clock_curr=mclk=0
   g_fmt_cap returns widthxheight of input as 720 x 525
INIT Test Generator
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0145608
   case VIDIOC_REQBUFS
In MVC:mxc_streamoff
MVC: In mxc_free_frame_buf
In MVC:mxc_allocate_frame_buf - size=614400
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x72500, start=0x76b55000, end=0x76beb000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x72600, start=0x76abf000, end=0x76b55000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 40045612
   case VIDIOC_STREAMON
In MVC:mxc_streamon
UYVY
In MVC:mxc_poll
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445611
   case VIDIOC_DQBUF
In MVC:mxc_poll
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445611
   case VIDIOC_DQBUF
In MVC:mxc_poll
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445611
   case VIDIOC_DQBUF
In MVC:mxc_poll
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445611
   case VIDIOC_DQBUF
In MVC:mxc_poll
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445611
   case VIDIOC_DQBUF
In MVC:mxc_poll
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445611
   case VIDIOC_DQBUF
In MVC:mxc_poll
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445611
   case VIDIOC_DQBUF
In MVC:mxc_poll

# gst-launch-1.0 imxv4l2videosrc ! fakesink
Setting pipeline to PAUSED ...
In MVC: mxc_v4l_open

   device name is Mxc Camera
ioctl_g_ifparm
ioctl_g_ifparm: clock_curr=mclk=27000000
get_pixelformat: YUV 4:2:2 8-bit (56595559, 1e)
ioctl_g_fmt_cap: 640x480
End of mxc_v4l_open: v2f pix widthxheight 288 x 352
End of mxc_v4l_open: crop_bounds widthxheight 640 x 480
End of mxc_v4l_open: crop_defrect widthxheight 640 x 480
End of mxc_v4l_open: crop_current widthxheight 640 x 480
On Open: Input to ipu size is 640 x 480
INIT Test Generator
tc358743_reset: RESET
power_control: 0
power_control: 1
tc_standby: powerdown=0, power_gp=0xfffffffe
tc358743_minit: capture mode: 0 fps: 60
tc358743_init_mode rate: 0 mode: 0
tc358743_software_reset: mask: 0300 freq: 2700
mipi_reset: mipi_csi2_info:
mipi_en:       1
datatype:      30
dphy_clk:      d81d3e80
pixel_clk:     d81d3f00
mipi_csi2_base:f008a000
pdev:          d818a200
Now Using 1 lanes
tc358743_software_reset: mask: 0200 freq: 2700
get_pixelformat: YUV 4:2:2 8-bit (56595559, 1e)
set_frame_rate_mode: Set 44 regs from 80729100 for frs 0 mode 0 with width 640 height 480
Activate EDID
MIPICSI2_PHY_STATUS: 300
0  mipi csi2 dphy status 300
0  mipi csi2 err1 0
ioctl_init
ioctl_dev_init
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80685600
   case VIDIOC_QUERYCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 8008563f
   case default or not supported:-2146937281 - 0x8008563F
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80085617
   case VIDIOC_G_STD
In mxc_v4l2_g_std
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 40085618
   case VIDIOC_S_STD
In mxc_v4l2_s_std 0
ERROR: unrecognized std! 0 (PAL=ff, NTSC=b000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5604
   case VIDIOC_G_FMT
In MVC: mxc_v4l2_g_fmt type=1
   type is V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_g_fmt: v2f pix widthxheight 288 x 352
End of mxc_v4l2_g_fmt: crop_bounds widthxheight 720 x 625
End of mxc_v4l2_g_fmt: crop_defrect widthxheight 640 x 480
End of mxc_v4l2_g_fmt: crop_current widthxheight 720 x 576
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c02c564a
ioctl_enum_framesizes, mode: 0
get_pixelformat: YUV 4:2:2 8-bit (56595559, 1e)
ioctl_enum_framesizes 640:480 format: 56595559
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0045627
   case VIDIOC_S_INPUT
In MVC:mxc_streamoff
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5616
   case VIDIOC_S_PARM
In mxc_v4l2_s_param
ioctl_g_parm type: 1
ioctl_g_parm done 0
   Current capabilities are 1001
   Current capturemode is 0  change to 0
   Current framerate is 60  change to 30
ioctl_s_parm
power_control: 1
ioctl_g_ifparm
ioctl_g_ifparm: clock_curr=mclk=27000000
   clock_curr=mclk=27000000
get_pixelformat: YUV 4:2:2 8-bit (56595559, 1e)
ioctl_g_fmt_cap: 640x480
   g_fmt_cap returns widthxheight of input as 640 x 480
INIT Test Generator
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5605
   case VIDIOC_S_FMT
In MVC: mxc_v4l2_s_fmt
   type=V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_s_fmt: v2f pix widthxheight 640 x 480
End of mxc_v4l2_s_fmt: crop_bounds widthxheight 640 x 480
End of mxc_v4l2_s_fmt: crop_defrect widthxheight 640 x 480
End of mxc_v4l2_s_fmt: crop_current widthxheight 640 x 480
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5604
   case VIDIOC_G_FMT
In MVC: mxc_v4l2_g_fmt type=1
   type is V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_g_fmt: v2f pix widthxheight 640 x 480
End of mxc_v4l2_g_fmt: crop_bounds widthxheight 640 x 480
End of mxc_v4l2_g_fmt: crop_defrect widthxheight 640 x 480
End of mxc_v4l2_g_fmt: crop_current widthxheight 640 x 480
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c008561c
   case VIDIOC_S_CTRL
In MVC:mxc_v4l2_s_ctrl
   default case
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c008561c
   case VIDIOC_S_CTRL
In MVC:mxc_v4l2_s_ctrl
   default case
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c008561b
   case VIDIOC_G_CTRL
In MVC:mxc_v4l2_g_ctrl
ERROR: v4l2 capture: unsupported ioctrl!
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c008561c
   case VIDIOC_S_CTRL
In MVC:mxc_v4l2_s_ctrl
   default case
Pipeline is live and does not neeIn MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5604
   case VIDIOC_G_FMT
d PREROLL ...
In MVC: mxc_v4l2_g_fmt type=1
   type is V4L2_BUF_TYPE_VIDEO_CAPTURE
Setting pipeline to PLAYING ...End of mxc_v4l2_g_fmt: v2f pix widthxheight 640 x 480
End of mxc_v4l2_g_fmt: crop_bounds widthxheight 640 x 480

New clock: GstSystemClock
End of mxc_v4l2_g_fmt: crop_defrect widthxheight 640 x 480
End of mxc_v4l2_g_fmt: crop_current widthxheight 640 x 480
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5604
   case VIDIOC_G_FMT
In MVC: mxc_v4l2_g_fmt type=1
   type is V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_g_fmt: v2f pix widthxheight 640 x 480
End of mxc_v4l2_g_fmt: crop_bounds widthxheight 640 x 480
End of mxc_v4l2_g_fmt: crop_defrect widthxheight 640 x 480
End of mxc_v4l2_g_fmt: crop_current widthxheight 640 x 480
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0145608
   case VIDIOC_REQBUFS
In MVC:mxc_streamoff
MVC: In mxc_free_frame_buf
In MVC:mxc_allocate_frame_buf - size=614400
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x72500, start=0x75469000, end=0x754ff000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80685600
   case VIDIOC_QUERYCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x72600, start=0x7526a000, end=0x75300000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80685600
   case VIDIOC_QUERYCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x72800, start=0x751d4000, end=0x7526a000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80685600
   case VIDIOC_QUERYCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x72900, start=0x7513e000, end=0x751d4000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80685600
   case VIDIOC_QUERYCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x72b00, start=0x750a8000, end=0x7513e000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80685600
   case VIDIOC_QUERYCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x72c00, start=0x75012000, end=0x750a8000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80685600
   case VIDIOC_QUERYCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 40045612
   case VIDIOC_STREAMON
In MVC:mxc_streamon
MIPICSI2_ENABLE PIXCLK
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445611
   case VIDIOC_DQBUF
In MVC:mxc_v4l_dqueue
ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
ERROR: from element /GstPipeline:In MVC:mxc_v4l_ioctl
pipeline0/GstImxV4l2VideoSrc:imxvIn MVC: mxc_v4l_do_ioctl c008561c
4l2videosrc0: Internal data strea   case VIDIOC_S_CTRL
m error.
In MVC:mxc_v4l2_s_ctrl

gstbasesrc.c(3055): gst_base_src   default case
_loop (): /GstPipeline:pipeline0/In MVC:mxc_v4l_ioctl
GstImxV4l2VideoSrc:imxv4l2videosrIn MVC: mxc_v4l_do_ioctl c008561c
c0:
streaming stopped, reason er   case VIDIOC_S_CTRL
ror (-5)
Execution ended after 0In MVC:mxc_v4l2_s_ctrl
:00:10.376569001
Setting pipelin   default case
e to PAUSED ...
Setting pipelineIn MVC:mxc_v4l_ioctl
 to READY ...
In MVC: mxc_v4l_do_ioctl c008561b
   case VIDIOC_G_CTRL
In MVC:mxc_v4l2_g_ctrl
ERROR: v4l2 capture: unsupported ioctrl!
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 40045613
   case VIDIOC_STREAMOFF
In MVC:mxc_streamoff
In MVC:mxc_free_frames
In MVC:mxc_v4l_close
power_control: 0
tc_standby: powerdown=1, power_gp=0xfffffffe
mxc_v4l_close: release resource
MVC: In mxc_free_frame_buf
In MVC:mxc_free_frames
Setting pipeline to NULL ...
Freeing pipeline ...

Labels (3)
4 Replies

1,745 Views
swendt
Contributor II

Thanks, Igor.

Hi, actually I am using exactly this driver but as mentioned the camera_callback is never called.

Regards,

Sebastian

0 Kudos
Reply

1,745 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sebastian

one can test with mxc_v4l2_tvin.c from unit tests

http://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-test-5.4.tar.gz 

Best regards
igor

1,745 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sebastian

for TVP5151 one can look at

imx6/0061-ARM-i.MX6-tvp5150-add-tvp5150-video-decoder-support.patch at master · compulab-yokneam/imx... 

Also instead "imxv4l2videosrc" community gstreamer-imx plugin one can try

nxp imx-gst1.0-plugins described in Linux Guide found in linux documentation on

i.MX Software and Development Tools | NXP 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,745 Views
swendt
Contributor II

I have found the issue for HDMI In - I need to set regmap_update_bits(gpr, IOMUXC_GPR13, 0x3F, 0x20); so HDMI works well then.

But the TVP5151 in on CSI1 still does not work.

0 Kudos
Reply