iMX8QXP OV5647_mipi problem. Help please

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

iMX8QXP OV5647_mipi problem. Help please

3,201 Views
draven
Contributor III

Hi I have iMX8QXP kit and I want to get stream from ov5647 camera.

DISTRO = fsl-imx-wayland.

My ov5647 camera's pin connected to :

MIPI_CSI0_ACM_MCLK_OUT         MIPI_CSI0_MCLK_OUT           ALT0

MIPI_CSI0_CKN                                        MIPI_CSI0_CLK_N                   ALT0
MIPI_CSI0_CKP                                        MIPI_CSI0_CLK_P                    ALT0
MIPI_CSI0_DN0                                        MIPI_CSI0_DATA0_N                ALT0
MIPI_CSI0_DN1                                        MIPI_CSI0_DATA1_N                ALT0
MIPI_CSI0_DN2                                        MIPI_CSI0_DATA2_N                ALT0

MIPI_CSI0_DN3                                        MIPI_CSI0_DATA3_N                ALT0
MIPI_CSI0_DP0                                        MIPI_CSI0_DATA0_P                ALT0
MIPI_CSI0_DP1                                        MIPI_CSI0_DATA1_P                ALT0
MIPI_CSI0_DP2                                         MIPI_CSI0_DATA2_P               ALT0
MIPI_CSI0_DP3                                         MIPI_CSI0_DATA3_P               ALT0

But I2C pins not connected. Is it problem? Can I get datas from camera without init via i2c?

So I can't find these pins (with pad signal names) in ./include/dt-bindings/pinctrl/pads-imx8qxp.h and if I write these pins pad format I get error instead of write MIPI_CSI0_ACM_MCLK_OUT. I think this pins dedicated and I can't mux. I can use directly without change scfw.

So my dts file about mipi csi camera : 

-------------------------------------------------------------------------------------------------------------------

&iomuxc {
imx8qxp-mek {
pinctrl_mipi_csi0: mipicsi0grp{
fsl,pins = <
SC_P_MIPI_CSI0_MCLK_OUT_MIPI_CSI0_ACM_MCLK_OUT 0xC0000041
SC_P_MIPI_CSI0_GPIO0_01_LSIO_GPIO3_IO07 0xC0000041
SC_P_MIPI_CSI0_GPIO0_00_LSIO_GPIO3_IO08 0xC0000041
>;
};

pinctrl_parallel_csi: parallelcsigrp {
fsl,pins = <
SC_P_CSI_D00_CI_PI_D02 0xC0000041
SC_P_CSI_D01_CI_PI_D03 0xC0000041
SC_P_CSI_D02_CI_PI_D04 0xC0000041
SC_P_CSI_D03_CI_PI_D05 0xC0000041
SC_P_CSI_D04_CI_PI_D06 0xC0000041
SC_P_CSI_D05_CI_PI_D07 0xC0000041
SC_P_CSI_D06_CI_PI_D08 0xC0000041
SC_P_CSI_D07_CI_PI_D09 0xC0000041

SC_P_CSI_MCLK_CI_PI_MCLK 0xC0000041
SC_P_CSI_PCLK_CI_PI_PCLK 0xC0000041
SC_P_CSI_HSYNC_CI_PI_HSYNC 0xC0000041
SC_P_CSI_VSYNC_CI_PI_VSYNC 0xC0000041
SC_P_CSI_EN_LSIO_GPIO3_IO02 0xC0000041
SC_P_CSI_RESET_LSIO_GPIO3_IO03 0xC0000041
>;
};
};
};

&isi_0 {
interface = <6 0 2>; /* INPUT: 6-PARALLEL CSI */
parallel_csi;
status = "okay";
};

&cameradev {
parallel_csi;
status = "okay";
};

&parallel_csi {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
port@0 {
reg = <0>;
parallel_csi_ep: endpoint {
remote-endpoint = <&ov5647_ep>;
};
};
};

&isi_2 {
interface = <2 0 2>;
status = "okay";
};

&isi_1 {
status = "disabled";
};

&isi_3 {
status = "disabled";
};

&isi_4 {
status = "disabled";
};

&isi_5 {
status = "disabled";
};

&isi_6 {
status = "disabled";
};

&isi_7 {
status = "disabled";
};

&i2c0_csi0 {
clock-frequency = <100000>;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
ov5647_mipi: ov5647_mipi@36 {
compatible = "ovti,ov5647_mipi";
reg = <0x36>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mipi_csi0>;
clocks = <&clk IMX8QXP_24MHZ>;
clock-names = "csi_mclk";
csi_id = <0>;
pwn-gpios = <&gpio3 7 GPIO_ACTIVE_LOW>;
rst-gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
mclk = <24000000>;
mclk_source = <0>;
mipi_csi;
status = "okay";
port {
ov5647_mipi_ep: endpoint {
remote-endpoint = <&mipi_csi0_ep>;
};
};
};

/delete-node/max9286_mipi@6A;
};

&mipi_csi_0 {
/delete-property/virtual-channel;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
mipi_csi0_ep: endpoint {
remote-endpoint = <&ov5647_mipi_ep>;
data-lanes = <1 2>;
};
};
};
&i2c0_cm40 {
#address-cells = <1>;
#size-cells = <0>;
ov5647: ov5647@36 {
compatible = "ovti,ov5647";
reg = <0x36>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_parallel_csi>;
clocks = <&clk IMX8QXP_PARALLEL_CSI_MISC0_CLK>;
clock-names = "csi_mclk";
pwn-gpios = <&gpio3 2 GPIO_ACTIVE_LOW>;
rst-gpios = <&gpio3 3 GPIO_ACTIVE_HIGH>;
csi_id = <0>;
mclk = <24000000>;
mclk_source = <0>;
status = "okay";
port {
ov5647_ep: endpoint {
remote-endpoint = <&parallel_csi_ep>;
};
};
};
};

-------------------------------------------------------------------------

Then I open ov5647_mipi support via make menuconfig : 

make menuconfig > Device Drivers > Multimedia Support > V4L platform devices > MXC Camera/V4L2 RPR Features Support > Omnivision ov5647 camera support using mipi > (*).  I add y to here.

Than I boot, there is no new video in /dev. (with or without ov5647 driver not change video size. There are video12 and video13)

And I change Omnivision ov5647 camera support using mipi to m (build module) and I insmod ov5647_camera_mipi.ko

module loaded and strace like that : 

----------------------------------------------------------------------------------------------------------------------------------------------------------

execve("/sbin/insmod", ["insmod", "ov5647_camera_mipi.ko"], 0xfffff1387b58 /* 19 vars */) = 0
brk(NULL) = 0x1b168000
faccessat(AT_FDCWD, "/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=43413, ...}) = 0
mmap(NULL, 43413, PROT_READ, MAP_PRIVATE, 3, 0) = 0xffff8ba94000
close(3) = 0
openat(AT_FDCWD, "/lib/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\300$\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=88392, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffff8ba92000
mmap(NULL, 151928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffff8ba4c000
mprotect(0xffff8ba61000, 61440, PROT_NONE) = 0
mmap(0xffff8ba70000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0xffff8ba70000
close(3) = 0
openat(AT_FDCWD, "/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\260C\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1405888, ...}) = 0
mmap(NULL, 1477872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffff8b8e3000
mprotect(0xffff8ba33000, 65536, PROT_NONE) = 0
mmap(0xffff8ba43000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x150000) = 0xffff8ba43000
mmap(0xffff8ba49000, 11504, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffff8ba49000
close(3) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffff8b8e1000
mprotect(0xffff8ba43000, 12288, PROT_READ) = 0
mprotect(0xffff8ba70000, 4096, PROT_READ) = 0
mprotect(0x42f000, 4096, PROT_READ) = 0
mprotect(0xffff8baa1000, 4096, PROT_READ) = 0
munmap(0xffff8ba94000, 43413) = 0
brk(NULL) = 0x1b168000
brk(0x1b189000) = 0x1b189000
uname({sysname="Linux", nodename="imx8qxpmek", ...}) = 0
openat(AT_FDCWD, "/lib/modules/4.19.35-1.1.0+g0f9917c56d59/modules.softdep", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/proc/cmdline", O_RDONLY|O_CLOEXEC) = 3
read(3, "root=/dev/mmcblk1p2 ro rootwait "..., 4095) = 88
read(3, "", 4007) = 0
close(3) = 0
newfstatat(AT_FDCWD, ".", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/ov5647_camera_mipi.ko", {st_mode=S_IFREG|0644, st_size=28736, ...}, 0) = 0
openat(AT_FDCWD, "/home/ov5647_camera_mipi.ko", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177E", 2) = 2
lseek(3, 0, SEEK_SET) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=28736, ...}) = 0
mmap(NULL, 28736, PROT_READ, MAP_PRIVATE, 3, 0) = 0xffff8ba97000
finit_module(3, "", 0) = 0
munmap(0xffff8ba97000, 28736) = 0
close(3) = 0
exit_group(0) = ?
+++ exited with 0 +++

 -----------------------------------------------------------------------------------------------------------------------------------------------------------

and I tried video12 and video13 to open camera via lvds with these commands : 

----------------------------------------------

Command : 

gst-launch-1.0 -v videotestsrc pattern=ball \    ! video/x-raw,width=320,height=240 \    ! videoconvert \    ! tee \    ! v4l2sink device=/dev/video12

Output : 

root@imx8qxpmek:/home# gst-launch-1.0 -v videotestsrc pattern=ball \
> ! video/x-raw,width=320,height=240 \
> ! videoconvert \
> ! tee \
> ! v4l2sink device=/dev/video12
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video12' is not a output device.
Additional debug info:
../../../git/sys/v4l2/v4l2_calls.c(687): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Capabilities: 0x4204000
Setting pipeline to NULL ...
Freeing pipeline ...

root@imx8qxpmek:/home#

----------------------------------------------------

Command : 

gst-launch-1.0 -v videotestsrc pattern=ball \    ! video/x-raw,width=320,height=240 \    ! videoconvert \    ! tee \    ! v4l2sink device=/dev/video12

Output : 

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mod1
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace1
/GstPipeline:pipeline0/GstTee:tee0.GstTeePad:src_0: caps = video/x-raw, format=(string)NV12, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string1
/GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(1
/GstPipeline:pipeline0/GstTee:tee0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)pro1
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, interlac1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mo1
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

^Chandling interrupt.  -------------------------------------> CTRL + C
Interrupt: Stopping pipeline ...
Execution ended after 0:01:03.000609625
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

-------------------------------

command : 

gst-launch-1.0 -e glvideomixer name=mix background=3 sink_0::xpos=192 sink_0::ypos=0 sink_0::width=640 sink_0::height=480 sink_0::zorder=1 ! "video/x-raw,width=1024,height=768" ! glimagesink rotate-method=horizontal-flip v4l2src device=/dev/video13 ! video/x-raw,width=640,height=480 ! mix.sink_0 &

output : 

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayWayland\)\ gldisplaywayland0";
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../../../../git/libs/gst/base/gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...

---------------------

command : 

gst-launch-1.0 -e glvideomixer name=mix background=3 sink_0::xpos=192 sink_0::ypos=0 sink_0::width=640 sink_0::height=480 sink_0::zorder=1 ! "video/x-raw,width=1024,height=768" ! glimagesink rotate-method=horizontal-flip v4l2src device=/dev/video12 ! video/x-raw,width=640,height=480 ! mix.sink_0 &

Output : 

Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayWayland\)\ gldisplaywayland0";
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video12' is not a capture device.
Additional debug info:
../../../git/sys/v4l2/v4l2_calls.c(679): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x4204000
Setting pipeline to NULL ...
Freeing pipeline ...

Help please. I am waiting your suggestion. 

Edit 1 : 

I change dts file like that :

&iomuxc {
imx8qxp-mek {
pinctrl_mipi_csi0: mipicsi0grp{
fsl,pins = <
SC_P_MIPI_CSI0_MCLK_OUT_MIPI_CSI0_ACM_MCLK_OUT 0xC0000041
SC_P_MIPI_CSI0_GPIO0_01_LSIO_GPIO3_IO07 0xC0000041
SC_P_MIPI_CSI0_GPIO0_00_LSIO_GPIO3_IO08 0xC0000041
>;
};

pinctrl_parallel_csi: parallelcsigrp {
fsl,pins = <
SC_P_CSI_D00_CI_PI_D02 0xC0000041
SC_P_CSI_D01_CI_PI_D03 0xC0000041
SC_P_CSI_D02_CI_PI_D04 0xC0000041
SC_P_CSI_D03_CI_PI_D05 0xC0000041
SC_P_CSI_D04_CI_PI_D06 0xC0000041
SC_P_CSI_D05_CI_PI_D07 0xC0000041
SC_P_CSI_D06_CI_PI_D08 0xC0000041
SC_P_CSI_D07_CI_PI_D09 0xC0000041

SC_P_CSI_MCLK_CI_PI_MCLK 0xC0000041
SC_P_CSI_PCLK_CI_PI_PCLK 0xC0000041
SC_P_CSI_HSYNC_CI_PI_HSYNC 0xC0000041
SC_P_CSI_VSYNC_CI_PI_VSYNC 0xC0000041
SC_P_CSI_EN_LSIO_GPIO3_IO02 0xC0000041
SC_P_CSI_RESET_LSIO_GPIO3_IO03 0xC0000041
>;
};
};
};

&isi_0 {
interface = <6 0 2>; /* INPUT: 6-PARALLEL CSI */
parallel_csi;
status = "disable";
};

&cameradev {
mipi_csi_0;
status = "okay";
};

&parallel_csi {
#address-cells = <1>;
#size-cells = <0>;
status = "disable";
port@0 {
reg = <0>;
parallel_csi_ep: endpoint {
remote-endpoint = <&ov5647_ep>;
};
};
};

&isi_2 {
interface = <2 0 2>;
status = "okay";
};

&isi_1 {
status = "disabled";
};

&isi_3 {
status = "disabled";
};

&isi_4 {
status = "disabled";
};

&isi_5 {
status = "disabled";
};

&isi_6 {
status = "disabled";
};

&isi_7 {
status = "disabled";
};

&i2c0_csi0 {
clock-frequency = <100000>;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
ov5647_mipi: ov5647_mipi@36 {
compatible = "ovti,ov5647_mipi";
reg = <0x36>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mipi_csi0>;
clocks = <&clk IMX8QXP_24MHZ>;
clock-names = "csi_mclk";
csi_id = <0>;
pwn-gpios = <&gpio3 7 GPIO_ACTIVE_LOW>;
rst-gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
mclk = <24000000>;
mclk_source = <0>;
mipi_csi;
status = "okay";
port {
ov5647_mipi_ep: endpoint {
remote-endpoint = <&mipi_csi0_ep>;
};
};
};

/delete-node/max9286_mipi@6A;
};

&mipi_csi_0 {
virtual-channel;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
mipi_csi0_ep: endpoint {
remote-endpoint = <&ov5647_mipi_ep>;
data-lanes = <1 2>;
};
};
};
&i2c0_cm40 {
#address-cells = <1>;
#size-cells = <0>;
ov5647: ov5647@36 {
compatible = "ovti,ov5647";
reg = <0x36>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_parallel_csi>;
clocks = <&clk IMX8QXP_PARALLEL_CSI_MISC0_CLK>;
clock-names = "csi_mclk";
pwn-gpios = <&gpio3 2 GPIO_ACTIVE_LOW>;
rst-gpios = <&gpio3 3 GPIO_ACTIVE_HIGH>;
csi_id = <0>;
mclk = <24000000>;
mclk_source = <0>;
status = "disabled";
port {
ov5647_ep: endpoint {
remote-endpoint = <&parallel_csi_ep>;
};
};
};
};


now I seems modules : root@imx8qxpmek:/# find -name "ov5647" ./sys/bus/i2c/drivers/ov5647_mipi ./sys/firmware/devicetree/base/i2c@37230000/ov5647@36 ./sys/firmware/devicetree/base/i2c@58226000/ov5647_mipi@36 ./sys/module/ov5647_camera_mipi

and when ls /dev there is two /dev/video now. (video0 and video1).

Why there is two video channel now?

Also there is an error about my dts file. What is that :

root@imx8qxpmek:/# dmesg | grep ov5

[ 3.667601] ov5647_mipi 16-0036: Error applying setting, reverse things back [ 3.674673] ov5647_mipi: probe of 16-0036 failed with error -22

I am waiting for some help.

---------------------------------------------------------------------------------------------------------------------------------------------------------------

Edit 2 : 

I deleted

SC_P_MIPI_CSI0_GPIO0_01_LSIO_GPIO3_IO07 0xC0000041

SC_P_MIPI_CSI0_GPIO0_00_LSIO_GPIO3_IO08 0xC0000041

 
from dts file. (I think there was pin conflict)

root@imx8qxpmek:/# dmesg | grep ov5
[ 3.641815] ov5647_mipi 16-0036: 16-0036 supply DOVDD not found, using dummy regulator
[ 3.649866] ov5647_mipi 16-0036: Linked as a consumer to regulator.0
[ 3.656255] ov5647_mipi 16-0036: 16-0036 supply DVDD not found, using dummy regulator
[ 3.664175] ov5647_mipi 16-0036: 16-0036 supply AVDD not found, using dummy regulator
[ 4.751720] ov5647_read_reg:write reg error:reg=300a
[ 4.756696] camera ov5647_mipi is not found
root@imx8qxpmek:/#

Also I try video0, video1 and video12 with this command :

root@imx8qxpmek:/# gst-launch-1.0 v4l2src device=/dev/video12 glimagesink
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayWayland\)\ gldisplaywayland0";
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video12' is not a capture device.
Additional debug info:
../../../git/sys/v4l2/v4l2_calls.c(679): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x4204000
Setting pipeline to NULL ...
Freeing pipeline ...


But video13 different :

root@imx8qxpmek:/# gst-launch-1.0 v4l2src device=/dev/video13 glimagesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayWayland\)\ gldisplaywayland0";
Caught SIGSEGV
Setting pipeline to PLAYING ...
New clock: GstSystemClock
#0 0x0000ffffbce2a1a0 in __GI___poll (fds=0x13944c50, nfds=2,
#1 0x0000ffffbcf4b22c in ?? () from /usr/lib/libglib-2.0.so.0
#2 0x0000ffffbcf4b640 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#3 0x0000ffffbd0da5bc in gst_bus_poll () from /usr/lib/libgstreamer-1.0.so.0
#4 0x0000000000404828 in ?? ()
#5 0x00000000004036a8 in ?? ()
#6 0x0000ffffbcd89264 in __libc_start_main (main=0x4032c0, argc=4,
#7 0x0000000000403d44 in ?? ()
Spinning. Please run 'gdb gst-launch-1.0 4434' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

Now again I am waiting for some help!!

Tags (4)
2 Replies

2,806 Views
draven
Contributor III

Hi igor,

Thanks for your reply.

I added what you said.

My dts file : 

&isi_0 {
status = "okay";
interface = <2 0 2>;
};

&isi_1 {
status = "disabled";
};

&isi_2 {
status = "disabled";
};

&isi_3 {
status = "disabled";
};

&i2c0_csi0 {
clock-frequency = <100000>;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
ov5640_mipi: ov5640_mipi@3c {
DOVDD-supply = <&reg_mba8qx_3v3>;
AVDD-supply = <&reg_mba8qx_3v3>;
DVDD-supply = <&reg_mba8qx_1v8>;
compatible = "ovti,ov5640_mipi_v3";
reg = <0x3c>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mipi_csi0>;
clocks = <&clk IMX8QXP_CLK_DUMMY>;
clock-names = "csi_mclk";
csi_id = <0>;
pwn-gpios = <&gpio3 7 GPIO_ACTIVE_LOW>;
rst-gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
mclk = <24000000>;
mclk_source = <0>;
mipi_csi;
status = "okay";
port {
ov5640_mipi_ep: endpoint {
remote-endpoint = <&mipi_csi0_ep>;
};
};
};

max9286_mipi@6A {
status = "disabled";
};
};

&mipi_csi_0 {
/delete-property/virtual-channel;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
mipi_csi0_ep: endpoint {
remote-endpoint = <&ov5640_mipi_ep>;
data-lanes = <0 1>;
};
};
};

root@imx8qxpmek:~# dmesg | grep video
[ 0.366901] videodev: Linux video capture interface: v2.00
[ 4.072382] mx8-img-md: Registered mxc_isi.0.capture as /dev/video0
[ 4.122837] mxc-jpeg 58400000.jpegdec: decoder device registered as /dev/video2 (81,5)
[ 4.133990] mxc-jpeg 58450000.jpegenc: encoder device registered as /dev/video3 (81,6)
root@imx8qxpmek:~# dmesg | grep ov
[ 0.000000] Movable zone start for each node
[ 0.185263] cpuidle: using governor menu
[ 3.669154] ov5640_probe camera start to init
[ 3.673585] ov5640_set_clk_rate 645
[ 3.677089] ov5640_regulator_enable 547
[ 3.681027] ov5640_mipi_v3 16-003c: Linked as a consumer to regulator.3
[ 3.687725] ov5640_mipi_v3 16-003c: Linked as a consumer to regulator.4
[ 3.696465] ov5640_probe camera initializing
[ 3.703548] ov5640_config_init 699
[ 3.706959] ov5640_download_firmware 669
[ 4.066558] ov5640_probe camera mipi ov5640, is found
[ 4.084676] mx8-img-md: Registered sensor subdevice: ov5640_mipi_v3 16-003c (1)
[ 4.105093] mx8-img-md: created link [ov5640_mipi_v3 16-003c] => [mxc-mipi-csi2.0]
[ 6.762722] to_ov5640 467
[ 6.766080] ov5640_s_power 786
[ 6.778431] to_ov5640 467
[ 6.782468] ov5640_s_power 786
-------------------------------------
root@imx8qxpmek:~# ls /dev

v4l

v4l-subdev0

v4l-subdev1

v4l-subdev2

video0
video1
video12
video13
video2
video3

root@imx8qxpmek:~#

I delete all things which about I2C. Also I attachted here. Please look.

I convert driver to yes from module. And it seems start correctly.

But I can't get image and show from LVDS panel. 

Also I attach my gstreamer test.

Now I am not sure mipi-cs2 ov5647 camera is working or not. How can I test (show LVDS)? And which gstreamer code I should use?

My last output from gstream and process stuck last function and wait there.

root@imx8qxpmek:~# gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,wd
dth=640,height=480,framerate=30/1 ! queue ! v4l2h264enc ! queue ! v4l2h264dec !g
glimagesink

[ 245.076426] to_ov5640 467

[ 245.079056] ov5640_s_power 786

[ 245.087782] to_ov5640 467

[ 245.090559] ov5640_s_power 786

Setting pipeline to PAUSED ...

[ 245.314080] to_ov5640 467

[ 245.316755] ov5640_s_power 786

Pipel[i n e2 4i5s. 3l2i1v6e9 0a]n do vd5o6e4s0 _nenotu m_neferda mPeRsEiRzOeLsL3

G[o t 2c45on.t3e2x9t4 3f5r]o om ve5l6e4m0e_netnu 'ms_ifnrka'm:e ignstte.rgvlall

ay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayWayland\)\ gldisplayw;

Set[t i n2g4 5p.i3p4e5l7i7n3e] toov 5P6L40AY_eINnGu m_..f.r
a
meintervals 1122

New[ c 2lo4c5k.:3 5G2s9t1S4y]s toevm5C6l4o0c_ke
n
um_framesizes 1093

/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, widt9

/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw9

/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, width=(9

/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, width=(9

/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-ra9

/GstPipeline:pipeline0/v4l2h264enc:v4l2h264enc0.GstPad:src: caps = video/x-h264t
i
on)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorime9

/[G st2P4i6p.e1l3i1n0e9:1]pi poevl5i6n4e00_g/G_sptaQrume u8e0:9q
u
eue1.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alig9

/GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = video/x-h264, stream9

/GstPipeline:pipeline0/v4l2h264dec:v4l2h264dec0.GstPad:sink: caps = video/x-h269

Redistribute latency...

/GstPipeline:pipeline0/v4l2h264enc:v4l2h264enc0.GstPad:sink: caps = video/x-raw9

[ 246.242487] to_ov5640 467

[ 246.245149] ov5640_s_parm 858

[ 246.263484] ov5640_find_datafmt 513

[ 246.267028] to_ov5640 467

[ 246.269721] ov5640_set_fmt 1018

[ 246.272892] to_ov5640_frame_rate 474

[ 246.276490] try_to_find_resolution 972

[ 246.280265] init_device 766

[ 246.283054] ov5640_config_init 699

[ 246.286476] ov5640_download_firmware 669

[ 246.660175] ov5640_change_mode 727

[ 246.663586] to_ov5640_frame_rate 474

[ 246.667212] ov5640_download_firmware 669

[ 246.688174] to_ov5640 467

[ 246.690795] ov5640_get_fmt 1051

[ 246.693978] find_hs_configure 494

[ 246.702372] bypass csc

[ 246.704741] input fmt YUV4

[ 246.707448] output fmt NV12

[ 247.044213] ov5640_s_stream 914

[ 247.047366] to_ov5640 467

[ 247.156926] to_ov5640 467

[ 247.159555] ov5640_get_fmt 1051

[ 247.162718] find_hs_configure 494

0 Kudos
Reply

2,806 Views
igorpadykov
NXP Employee
NXP Employee

Hi berat

one can look at mipi-csi ov5640 example

fsl-imx8qxp-mek-mipi-ov5640.dts\freescale\dts\boot\arm64\arch - linux-imx - i.MX Linux kernel 

driver description in sect.6.1.2 Omnivision Camera attached Linux Manual.

If not using i2c, one can try to remove i2c initialization in driver

ov5640_mipi_v3.c\imx8\platform\media\drivers - linux-imx - i.MX Linux kernel 

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