AnsweredAssumed Answered

OV5640 on i.mx7 can't capture high resolution picture/video

Question asked by Richard Hu on Sep 29, 2017
Latest reply on Mar 6, 2018 by Hanseung Lee

Hello, guys:

 

When I test the OV5640 camera on i.mx7, it always hangs when it captures the picture with the resolution higher than 640x480.

 

The test image is based on Yocto Jethro that NXP provides. The kernel is linux imx  4.1.15_2.0.0_ga which is also from NXP.

 

The test command to capture 1920x1080 picture is as below:

# GST_DEBUG=2,*imx*:9 gst-launch-1.0 imxv4l2src device=/dev/video1 num_buffers=1 ! video/x-raw,format=YUY2,width=1920,height=1080,framerate=30/1
 ! jpegenc quality=100 idct-method=2 ! filesink location=test.jpg

 

The log of gst-lauch is as below, and it hangs on the last line of log:

0:00:01.797284750   861  0x1146000 INFO                 imxv4l2 gstimxv4l2.c:902:gst_imx_v4l2capture_config_usb_camera: capture mode 3: 1920x1080
0:00:02.481041750   861  0x1146000 INFO                 imxv4l2 gstimxv4l2.c:914:gst_imx_v4l2capture_config_usb_camera: frame format: YUYV
0:00:02.481155625   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1563:gst_imx_v4l2_set_buffer_count: requeset for (6) buffers.
0:00:02.504577125   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1606:gst_imx_v4l2_allocate_buffer: Allocated v4l2buffer(0x1153298), type(1), memblk(0x11565ac), paddr((nil)), size(4147200).
0:00:02.504891375   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1638:gst_imx_v4l2_allocate_buffer: Allocated v4l2buffer(0x1153298), type(1), index(0), memblk(0x11565ac), vaddr(0x74f0b000), paddr(0xae100000), size(4147200).
0:00:02.505212375   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1606:gst_imx_v4l2_allocate_buffer: Allocated v4l2buffer(0x11532e8), type(1), memblk(0x115665c), paddr(0x3f5000), size(4147200).
0:00:02.505393375   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1638:gst_imx_v4l2_allocate_buffer: Allocated v4l2buffer(0x11532e8), type(1), index(1), memblk(0x115665c), vaddr(0x74b16000), paddr(0xae500000), size(4147200).
0:00:02.505492625   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1606:gst_imx_v4l2_allocate_buffer: Allocated v4l2buffer(0x1153338), type(1), memblk(0x115670c), paddr(0x7ea000), size(4147200).
0:00:02.505659500   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1638:gst_imx_v4l2_allocate_buffer: Allocated v4l2buffer(0x1153338), type(1), index(2), memblk(0x115670c), vaddr(0x74721000), paddr(0xaed00000), size(4147200).
0:00:02.505756125   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1606:gst_imx_v4l2_allocate_buffer: Allocated v4l2buffer(0x1153388), type(1), memblk(0x11567bc), paddr(0xbdf000), size(4147200).
0:00:02.505920750   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1638:gst_imx_v4l2_allocate_buffer: Allocated v4l2buffer(0x1153388), type(1), index(3), memblk(0x11567bc), vaddr(0x7432c000), paddr(0xaf100000), size(4147200).
0:00:02.506017500   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1606:gst_imx_v4l2_allocate_buffer: Allocated v4l2buffer(0x11533d8), type(1), memblk(0x75d018ac), paddr(0xfd4000), size(4147200).
0:00:02.506182500   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1638:gst_imx_v4l2_allocate_buffer: Allocated v4l2buffer(0x11533d8), type(1), index(4), memblk(0x75d018ac), vaddr(0x73f37000), paddr(0xaf500000), size(4147200).
0:00:02.506278375   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1606:gst_imx_v4l2_allocate_buffer: Allocated v4l2buffer(0x1153428), type(1), memblk(0x75d0195c), paddr(0x13c9000), size(4147200).
0:00:02.506445625   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1638:gst_imx_v4l2_allocate_buffer: Allocated v4l2buffer(0x1153428), type(1), index(5), memblk(0x75d0195c), vaddr(0x73b42000), paddr(0xaf900000), size(4147200).
0:00:02.506587500   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1835:gst_imx_v4l2_queue_gstbuffer: queue gstbuffer(0x75d14850).
0:00:02.506645625   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1748:gst_imx_v4l2_queue_v4l2memblk: queue v4lbuffer memblk (0x11565ac), paddr(0xae100000), index(0), flags(0).
0:00:02.506709500   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1769:gst_imx_v4l2_queue_v4l2memblk: streamon count (2), queue count (0)
0:00:02.506769250   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1835:gst_imx_v4l2_queue_gstbuffer: queue gstbuffer(0x75d148f0).
0:00:02.506817625   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1748:gst_imx_v4l2_queue_v4l2memblk: queue v4lbuffer memblk (0x115665c), paddr(0xae500000), index(1), flags(0).
0:00:02.506879625   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1769:gst_imx_v4l2_queue_v4l2memblk: streamon count (2), queue count (1)
0:00:02.861754875   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1789:gst_imx_v4l2_queue_v4l2memblk: V4L2 device is STREAMON.
0:00:02.861885125   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1835:gst_imx_v4l2_queue_gstbuffer: queue gstbuffer(0x75d14990).
0:00:02.861951250   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1748:gst_imx_v4l2_queue_v4l2memblk: queue v4lbuffer memblk (0x115670c), paddr(0xaed00000), index(2), flags(0).
0:00:02.862041875   861  0x1146000 DEBUG                imxv4l2 gstimxv4l2.c:1800:gst_imx_v4l2_queue_v4l2memblk: queued (3)   ----------> hangs here.

 

I'm not sure if this issue results from gstreamer plugin "imxv4l2src" or camera capture driver "mx6s_capture.c", "ov5640_mipi.c".   (I suspect more on "mx6s_capture.c".)

 

I have tried to capture 1920x1080 picture on i.mx6, and it works fine.
As I know the capture driver for i.mx6 and i.mx7 is different.(Because i.mx6 is with IPU, and i.mx7 only has PXP)

 

Do you have any ideas or suggestions how i fix this problem?

BR,

 

Richard

Outcomes