Hi,
I encounter failure when I try to use ov5640 camera on imx8mp-evk board and need guide and help.
I confirm ov5640 camera module (bought together with evk board) works on imx8mm-evk board with command: gst-launch-1.0 v4l2src device=/dev/video0 ! autovideosink with image: LF_v5.15.32-2.0.0_images_IMX8MMEVK.zip.
I only have one camera: ov5640 on hand, so I connect the camera to imx8mp-evk board J12 (CSI1 MIPI). imx8mp-evk board is downloaded with image: LF_v5.15.32-2.0.0_images_IMX8MPEVK.zip.
System detected the camera, and v4l2 devices looks ok:
$ v4l2-ctl --list-devices
():
/dev/v4l-subdev0
mxc-isi-cap (platform:32e00000.isi:cap_devic):
/dev/video3
mxc-isi-m2m (platform:32e00000.isi:m2m_devic):
/dev/video2
FSL Capture Media Device (platform:mxc-md):
/dev/media0
vsi_v4l2dec (platform:vsi_v4l2dec):
/dev/video1
vsi_v4l2enc (platform:vsi_v4l2enc):
/dev/video0
we can see the capture device presented is /dev/video3 (ov5640 using ISI, it's correct)
I try to using different tools to use ov5640 camera, looks nothing error but hang here, so I think there is no problem for start_stream IOCTL, but there is no data return to user space, so user space tool waiting there for data.
$ gst-launch-1.0 -e v4l2src device=/dev/video3 ! video/x-raw ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[ 1802.093915] bypass csc
[ 1802.096289] input fmt YUV4
[ 1802.099019] output fmt YUYV
$ /unit_tests/V4L2/mx8_v4l2_cap_drm.out -cam 8 -fmt NV12 -ow 1920 -oh 1080 -num 1 -of
init channel[3] save_file_name=3.NV12
init channel[3] v4l2_dev_name=/dev/video3 w/h=(1280,800)
open 3.NV12 success
open /dev/video3 success
planes=2 WxH@fps = 1920x1080@30
bypass csc
input fmt YUV4
output fmt NV12
channel[3] v4l_dev=0x4 start capturing
$ ls -l
-rw-r----- 1 root root 0 Oct 9 20:03 3.NV12
$ v4l2-ctl -d /dev/video3 --set-fmt-video=width=1280,height=720,pixelformat='NV12' --stream-mmap --stream-count=5
[ 981.256852] bypass csc
[ 981.259229] input fmt YUV4
[ 981.261954] output fmt NV12
When preview with gst-launch-1.0, did not see any capturing on HDMI. when save camera data with mx8_v4l2_cap_drm.out, the size of saved file is always 0. when getting camera data with v4l2-ctl, no data presented (if there is data, could see something like <<<<<<<<<<<<<<<<<<<<<<<<<< from console).
I also try to connect the camera to CSI2 and using dtb file: imx8mp-evk-basler-ov5640.dtb. in that case, the ov5640 capturing device is /dev/video2. I also try above three tools and the result is the same.
Could you help to provide the comment why it happen and how I can make ov5640 camera work on imx8mp-evk board?
Thanks.
Johnson
Solved! Go to Solution.
did you use nxp IMX8MP board and prebuilt images, right? it seems the board detect ov5640 already, and I tested this on my board successfully, I couldn't reproduce this on my side. did you have other camera module to test J13 port?
attach the log of ov5640 working on imx8mp-evk CSI1 (J13)
$ setenv fdtfile imx8mp-evk-basler-ov5640.dtb;boot
$ dmesg | grep ov5640
ov5640 2-003c: supply DOVDD not found, using dummy regulator
ov5640 2-003c: supply AVDD not found, using dummy regulator
ov5640 2-003c: supply DVDD not found, using dummy regulator
mx8-img-md: Registered sensor subdevice: ov5640 2-003c (1)
mx8-img-md: created link [ov5640 2-003c] => [mxc-mipi-csi2.1]
mx8-img-md: Registered sensor subdevice: ov5640 2-003c (1)
mx8-img-md: created link [ov5640 2-003c] => [mxc-mipi-csi2.1]
$ dmesg | grep mx8-img-md
mx8-img-md: Registered mxc_isi.1.capture as /dev/video2
mx8-img-md: Registered sensor subdevice: ov5640 2-003c (1)
mx8-img-md: created link [mxc_isi.1] => [mxc_isi.1.capture]
mx8-img-md: created link [mxc-mipi-csi2.1] => [mxc_isi.1]
mx8-img-md: created link [ov5640 2-003c] => [mxc-mipi-csi2.1]
mx8-img-md: Registered mxc_isi.1.capture as /dev/video2
mx8-img-md: Registered sensor subdevice: ov5640 2-003c (1)
mx8-img-md: created link [mxc_isi.1] => [mxc_isi.1.capture]
mx8-img-md: created link [mxc-mipi-csi2.1] => [mxc_isi.1]
mx8-img-md: created link [ov5640 2-003c] => [mxc-mipi-csi2.1]
$ gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-raw ! queue ! waylandsink
enter isp_mi_stop
mxc-mipi-csi2.0: mipi_csis_imx8mp_phy_reset, No remote pad found!
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstWaylandSink:waylandsink0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
bypass csc
input fmt YUV4
output fmt YUYV
Redistribute latency...
^C handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:03.168273375
Setting pipeline to NULL ...
Total showed frames (50), playing for (0:00:03.168278750), fps (15.781).
Freeing pipeline ...
did you use nxp IMX8MP board and prebuilt images, right? it seems the board detect ov5640 already, and I tested this on my board successfully, I couldn't reproduce this on my side. did you have other camera module to test J13 port?
Hi,
OK, thanks for the support.
Today we reconnet the camera with the camera module board, and tested well.
Best regards.
Johnson