OV5642 module does not work in IMX6UL EVK.

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

OV5642 module does not work in IMX6UL EVK.

1,672 Views
hoseokkim
Contributor I

Dear All,

 

Hello. I tested the preview function on IMX6UL EVK.

But, the camera preview didn't work. There is some error messages.

 

[Board] : IMX6UL EVK

[Camera] : OV5642 module

[Image] : Linux 4.1.15-2.0.0

 

[gst-launch command line]

$ gst-launch-1.0 imxv4l2src device=/dev/video0 ! imxv4l2sink device=/dev/video1

[Error message]

====== IMXV4L2SRC: 4.1.4 build on Apr 7 2017 10:53:43. ======
====== IMXV4L2SINK: 4.1.4 build on Apr 7 2017 10:53:43. ======
Setting pipeline to PAUSED ...
ERROR: Can't find /dev/video1.
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
timeout when wait for SOF
------------[ cut here ]------------
WARNING: CPU: 0 PID: 667 at /home/hoseok.kim/imx6ul/linux-imx/drivers/media/v4l2-core/videobuf2-core.c:1805 vb2_start_streaming+0xd8/0x154()
Modules linked in:
CPU: 0 PID: 667 Comm: imxv4l2src0:src Not tainted 4.1.15-00001-g5bc7305-dirty #8
Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[<80015d78>] (unwind_backtrace) from [<8001271c>] (show_stack+0x10/0x14)
[<8001271c>] (show_stack) from [<807ff1b0>] (dump_stack+0x84/0xc4)
[<807ff1b0>] (dump_stack) from [<80035808>] (warn_slowpath_common+0x80/0xb0)
[<80035808>] (warn_slowpath_common) from [<800358d4>] (warn_slowpath_null+0x1c/0x24)
[<800358d4>] (warn_slowpath_null) from [<8052f454>] (vb2_start_streaming+0xd8/0x154)
[<8052f454>] (vb2_start_streaming) from [<80531f24>] (vb2_internal_streamon+0x10c/0x158)
[<80531f24>] (vb2_internal_streamon) from [<8054d378>] (mx6s_vidioc_streamon+0x3c/0xb0)
[<8054d378>] (mx6s_vidioc_streamon) from [<8051f154>] (__video_do_ioctl+0x2b0/0x324)
[<8051f154>] (__video_do_ioctl) from [<8051ebd0>] (video_usercopy+0x1b8/0x480)
[<8051ebd0>] (video_usercopy) from [<8051b5c8>] (v4l2_ioctl+0x118/0x150)
[<8051b5c8>] (v4l2_ioctl) from [<800fac1c>] (do_vfs_ioctl+0x3e8/0x608)
[<800fac1c>] (do_vfs_ioctl) from [<800fae70>] (SyS_ioctl+0x34/0x5c)
[<800fae70>] (SyS_ioctl) from [<8000f480>] (ret_fast_syscall+0x0/0x3c)
---[ end trace ca25a407d9ecde2d ]---
timeout when wait for SOF
------------[ cut here ]------------
WARNING: CPU: 0 PID: 667 at /home/hoseok.kim/imx6ul/linux-imx/drivers/media/v4l2-core/videobuf2-core.c:1805 vb2_start_streaming+0xd8/0x154()
Modules linked in:
CPU: 0 PID: 667 Comm: imxv4l2src0:src Tainted: G W 4.1.15-00001-g5bc7305-dirty #8
Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[<80015d78>] (unwind_backtrace) from [<8001271c>] (show_stack+0x10/0x14)
[<8001271c>] (show_stack) from [<807ff1b0>] (dump_stack+0x84/0xc4)
[<807ff1b0>] (dump_stack) from [<80035808>] (warn_slowpath_common+0x80/0xb0)
[<80035808>] (warn_slowpath_common) from [<800358d4>] (warn_slowpath_null+0x1c/0x24)
[<800358d4>] (warn_slowpath_null) from [<8052f454>] (vb2_start_streaming+0xd8/0x154)
[<8052f454>] (vb2_start_streaming) from [<80531f24>] (vb2_internal_streamon+0x10c/0x158)
[<80531f24>] (vb2_internal_streamon) from [<8054d378>] (mx6s_vidioc_streamon+0x3c/0xb0)
[<8054d378>] (mx6s_vidioc_streamon) from [<8051f154>] (__video_do_ioctl+0x2b0/0x324)
[<8051f154>] (__video_do_ioctl) from [<8051ebd0>] (video_usercopy+0x1b8/0x480)
[<8051ebd0>] (video_usercopy) from [<8051b5c8>] (v4l2_ioctl+0x118/0x150)
[<8051b5c8>] (v4l2_ioctl) from [<800fac1c>] (do_vfs_ioctl+0x3e8/0x608)
[<800fac1c>] (do_vfs_ioctl) from [<800fae70>] (SyS_ioctl+0x34/0x5c)
[<800fae70>] (SyS_ioctl) from [<8000f480>] (ret_fast_syscall+0x0/0x3c)
---[ end trace ca25a407d9ecde2e ]---
ERROR: from element /GstPipeline:pipeline0/GstImxV4l2Src:imxv4l2src0: Internal data flow error.
Additional debug info:
../../../../gstreamer-1.8.1/libs/gst/base/gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstImxV4l2Src:imxv4l2src0:
streaming task paused, reason error (-5)
Execution ended after 0:00:05.319475959
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Please check error message and let me know how to work camera ov5642. 

Best Regards,

Hoseok.

Tags (2)
0 Kudos
3 Replies

1,080 Views
hoseokkim
Contributor I

Dear igorpadykov.

I checked "gst-inspect-1.0 imxv4l2src"

It showed the result as follows.

There is not available "Capabilities" configuration.

Please review logs and let me know how to solve it.

root@imx6ulevk:~# gst-inspect-1.0 imxv4l2src
====== IMXV4L2SRC: 4.1.4 build on Apr 7 2017 10:53:43. ======
Factory Details:
Rank primary + 1 (257)
Long-name IMX Video (video4linux2) Source
Klass Src/Video
Description Capture frames from IMX SoC video4linux2 device
Author Multimedia Team <shmmmw@freescale.com>

Plugin Details:
Name imxv4l2.imx
Description IMX SoC v4l2-based video source/sink
Filename /usr/lib/gstreamer-1.0/libgstimxv4l2plugins.so
Version 4.1.4
License LGPL
Source module imx-gst1.0-plugin
Binary package Freescle Gstreamer Multimedia Plugins
Origin URL http://www.freescale.com

GObject
+----GInitiallyUnowned
+----GstObject
+----GstElement
+----GstBaseSrc
+----GstPushSrc
+----GstImxV4l2Src

Pad Templates:
SRC template: 'src'
Availability: Always
Capabilities:
EMPTY


Element Flags:
no flags set

Element Implementation:
Has change_state() function: gst_base_src_change_state

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
SRC: 'src'
Pad Template: 'src'

Element Properties:
name : The name of the object
flags: readable, writable
String. Default: "imxv4l2src0"
parent : The parent of the object
flags: readable, writable
Object of type "GstObject"
blocksize : Size in bytes to read per buffer (-1 = default)
flags: readable, writable
Unsigned Integer. Range: 0 - 4294967295 Default: 4096
num-buffers : Number of buffers to output before sending EOS (-1 = unlimited)
flags: readable, writable
Integer. Range: -1 - 2147483647 Default: -1
typefind : Run typefind before negotiating
flags: readable, writable
Boolean. Default: false
do-timestamp : Apply current stream time to buffers
flags: readable, writable
Boolean. Default: false
device : Device location
flags: readable, writable
String. Default: "/dev/video0"
use-v4l2src-memory : Force allocate video frame buffer by V4L2 capture
flags: readable, writable
Boolean. Default: true
frame-plus : set number of addtional frames for smoothly recording
flags: readable, writable
Unsigned Integer. Range: 0 - 16 Default: 3

0 Kudos

1,080 Views
hoseokkim
Contributor I

I set kernel def config (/arch/arm/configs/imx_v7_defconfig) as followings.

CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_VIDEO_MXC_OUTPUT=y
CONFIG_VIDEO_MXC_CAPTURE=y
# CONFIG_MXC_CAMERA_OV5640 is not set
# CONFIG_MXC_CAMERA_OV5642 is not set
# CONFIG_MXC_CAMERA_OV5640_MIPI is not set
# CONFIG_MXC_TVIN_ADV7180 is not set
CONFIG_MXC_IPU_DEVICE_QUEUE_SDC=y
CONFIG_VIDEO_MXC_IPU_OUTPUT=y
CONFIG_VIDEO_MXC_PXP_V4L2=y
CONFIG_VIDEO_MXC_CSI_CAMERA=y
# CONFIG_MXC_SUBDEV_CAMERA_OV5640 is not set
CONFIG_MXC_SUBDEV_CAMERA_OV5642=y
CONFIG_MXC_VADC=y
# CONFIG_MXC_MIPI_CSI is not set
CONFIG_MXC_CAMERA_OV5647_MIPI=m
CONFIG_SOC_CAMERA=y
# CONFIG_SOC_CAMERA_PLATFORM is not set
CONFIG_VIDEO_MX3=y
CONFIG_V4L_MEM2MEM_DRIVERS=y
CONFIG_VIDEO_CODA=y
CONFIG_RADIO_SI476X=y
CONFIG_SOC_CAMERA_OV2640=y

And, I set device tree as followings.

&csi {
   status = "okay";

   port {
      csi1_ep: endpoint {
      remote-endpoint = <&ov5642_ep>;
      };
   };
};

ov5642: ov5642@3c {
compatible = "ovti,ov5642";
reg = <0x3c>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_csi1>;
clocks = <&clks IMX6UL_CLK_CSI>;
clock-names = "csi_mclk";
pwn-gpios = <&gpio_spi 6 1>;
rst-gpios = <&gpio_spi 5 0>;
csi_id = <0>;
mclk = <24000000>;
mclk_source = <0>;
status = "okay";
port {
ov5642_ep: endpoint {
remote-endpoint = <&csi1_ep>;
};
};
};


&sim2 {

    status = "disabled";

}

0 Kudos

1,080 Views
igorpadykov
NXP Employee
NXP Employee

Hi Hoseok

please check

imx6ul ov5640 capture | NXP Community 

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

0 Kudos