Hello. I've modified ov5640.c and tried to use it with my camera (FPGA as a source of video stream).
I faced the trouble, when I tried to capture image from camera through gstreamer:
gst-launch-1.0 imxv4l2videosrc num-buffers=1 ! jpegenc ! filesink location=/cap1.jpeg
I had got error:
ERROR: unrecognized std! 0 (PAL=ff, NTSC=b000)
There is a part of code from mxc_v4l2_capture.c:
static int mxc_v4l2_s_std(cam_data *cam, v4l2_std_id e)
{
pr_debug("In mxc_v4l2_s_std %Lx\n", e); if (e == V4L2_STD_PAL) {
pr_debug(" Setting standard to PAL %Lx\n", V4L2_STD_PAL);
cam->standard.id = V4L2_STD_PAL;
video_index = TV_PAL;
} else if (e == V4L2_STD_NTSC) {
pr_debug(" Setting standard to NTSC %Lx\n",
V4L2_STD_NTSC);
/* Get rid of the white dot line in NTSC signal input */
cam->standard.id = V4L2_STD_NTSC;
video_index = TV_NTSC;
} else {
cam->standard.id = V4L2_STD_ALL;
video_index = TV_NOT_LOCKED;
pr_err("ERROR: unrecognized std! %Lx (PAL=%Lx, NTSC=%Lx\n",
e, V4L2_STD_PAL, V4L2_STD_NTSC);
}...
...
...
Messages log:
root@var-som-mx6:~# dmesg | grep ov5640
[ 11.094087] [ov5640] > ov5640_probe
[ 11.137421] [ov5640] > Camera ov5640 is found, v4l2_reg resp is 0
[ 11.843813] [ov5640] > ioctl_dev_exit
[ 11.846878] [ov5640] > ioctl_s_power
[ 11.849846] [ov5640] > ioctl_g_fmt_cap
[ 12.703436] [ov5640] > ioctl_g_ifparm
[ 12.706504] [ov5640] > clock_curr=mclk=24000000
[ 12.752054] [ov5640] > ioctl_g_fmt_cap
[ 12.757388] [ov5640] > ioctl_s_power
[ 12.770093] [ov5640] > ioctl_init
[ 12.772810] [ov5640] > ioctl_dev_init
[ 12.775866] [ov5640] > setting mclk to 24 MHz
[ 12.783086] [ov5640] > ioctl_s_power
[ 41.674770] [ov5640] > ioctl_g_ifparm
[ 41.677840] [ov5640] > clock_curr=mclk=24000000
[ 41.682819] [ov5640] > ioctl_g_fmt_cap
[ 41.685979] [ov5640] > ioctl_s_power
[ 41.688949] [ov5640] > ioctl_init
[ 41.692781] [ov5640] > ioctl_dev_init
[ 41.695843] [ov5640] > setting mclk to 24 MHz
[ 41.701290] [ov5640] > ioctl_s_powerroot@var-som-mx6:~# v4l2-ctl --list-devices
[ov5640] > ioctl_g_ifparm
[ov5640] > clock_curr=mclk=24000000
[ov5640] > ioctl_g_fmt_cap
[ov5640] > ioctl_s_power
[ov5640] > ioctl_init
[ov5640] > ioctl_dev_init
[ov5640] > setting mclk to 24 MHz
[ov5640] > ioctl_s_power
():[ov5640] > ioctl_g_ifparm/dev/video0
/dev/video16
/[ov5640] > clock_curr=mclk=24000000
dev/video17[ov5640] > ioctl_g_fmt_cap
[ov5640] > ioctl_s_power
[ov5640] > ioctl_init
[ov5640] > ioctl_dev_init
[ov5640] > setting mclk to 24 MHz
[ov5640] > ioctl_s_powerroot@var-som-mx6:~# gst-launch-1.0 imxv4l2videosrc num-buffers=1 ! jpegenc ! filesink location=/cap1.jpeg
esink location=/cap1.jpeg(gst-plugin-scanner:739): GStreamer- [1;33mWARNING [0m **: Failed to load plugin '/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstimxaudio.so': lib_mp3_enc_arm12_elinux.so.2: cannot open shared object file: No such file or directory
[ov5640] > ioctl_g_ifparm
[ov5640] > clock_curr=mclk=24000000
[ov5640] > ioctl_g_fmt_cap
[ov5640] > ioctl_s_power
[ov5640] > ioctl_init
[ov5640] > ioctl_dev_init
[ov5640] > setting mclk to 24 MHz
[ov5640] > ioctl_s_power
Setting pipeline to PAUSED ...[ov5640] > ioctl_g_ifparm[ov5640] > clock_curr=mclk=24000000
[ov5640] > ioctl_g_fmt_cap
[ov5640] > ioctl_s_power
[ov5640] > ioctl_init
[ov5640] > ioctl_dev_init
[ov5640] > setting mclk to 24 MHz
ERROR: unrecognized std! 0 (PAL=ff, NTSC=b000
[ov5640] > ioctl_enum_framesizes
[ov5640] > ioctl_g_parm
[ov5640] > ioctl_s_parm
[ov5640] > ioctl_g_ifparm
[ov5640] > clock_curr=mclk=24000000
[ov5640] > ioctl_g_fmt_cap
[ov5640] > ioctl_s_ctrl
[ov5640] > ioctl_s_ctrl
[ov5640] > ioctl_g_ctrl
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
alloc_contig_range: [44800, 448c6) PFNs busy
alloc_contig_range: [44800, 448c6) PFNs busy
alloc_contig_range: [44800, 448c6) PFNs busy
alloc_contig_range: [44800, 448c6) PFNs busy
alloc_contig_range: [44800, 448c6) PFNs busy
ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
ERROR: from element /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(2950): gst_base_src_loop (): /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0:
streaming stopped, reason error (-5)
Execution ended after 0:00:10.754667335
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
[ov5640] > ioctl_s_ctrl
[ov5640] > ioctl_s_ctrl
[ov5640] > ioctl_g_ctrl
[ov5640] > ioctl_s_power
Setting pipeline to NULL ...
Freeing pipeline ...root@var-som-mx6:~# du -k /cap1.jpeg
0 /cap1.jpeg
ov5640.c uses structure sensor_data (defined in mxc_v4l2_capture.h) that haven't field "standard id".
So, how I should to define that parameter and pass it from ov5640 to mxc_v4l2 and avoid that exception?
Thanks!
Solved! Go to Solution.
Ok. Configuration was right. The problem was with mxc_v4l2_capture, I've hardcoded some parameters and problems were gone.
Ok. Configuration was right. The problem was with mxc_v4l2_capture, I've hardcoded some parameters and problems were gone.
Hi Eugene
what processor used in the case, if i.MX6Q with IPU one can look at
VAR-SOM-MX6 Camera FSLC - Variscite Wiki
Example without IPU (like i.MX6SX,UL) on
https://community.nxp.com/docs/DOC-330092
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
*Note: I'm using imx6-solo
for i.MX6S suggest to recheck
VAR-SOM-MX6 Camera FSLC - Variscite Wiki
https://community.nxp.com/thread/441143
Best regards
igor
Well, my camera isn't accept clock and haven't H/V-syncs.
So there is connected only pins ATA12-DATA19 and PIX_CLK.
If I all understand right, configuration should be something like a:
&i2c3 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3_3>;
status = "okay";...
ov564x: ov564x@3c {
compatible = "ovti,ov564x";
reg = <0x3c>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ipu1_2>;
};
};
pinctrl_ipu1_2: ipu1grp-2 { // parallel camera
fsl,pins = <
MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12 0x80000000 // use default value
MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13 0x80000000 // use default value
MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14 0x80000000 // use default value
MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15 0x80000000 // use default value
MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16 0x80000000 // use default value
MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17 0x80000000 // use default value
MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18 0x80000000 // use default value
MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19 0x80000000 // use default value
MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK 0x80000000 // use default value#define PAD_CTRL_HYS_PD 0x130b0
MX6QDL_PAD_CSI0_DATA_EN__IPU1_CSI0_DATA_EN PAD_CTRL_HYS_PD // not used
MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC PAD_CTRL_HYS_PD // not used
MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC PAD_CTRL_HYS_PD // not used
>;
};
Itried to remove unused PINs (MX6QDL_PAD_CSI0_DATA_EN__IPU1_CSI0_DATA_EN, MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC, MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC). But I've the same result:
ERROR: unrecognized std! 0 (PAL=ff, NTSC=b000)
...
ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
Are there any mistakes, from your viewpoint?
(clock checkings/settings were removed from ov5640.c)
Thanks!
sure, below is difference between original and modified files.
imx6qdl-var-som.dtsi
158c158
< /*v4l2_cap_0 {
---
> v4l2_cap_0 {
164,171d163
< };*/
<
< v4l2_cap_1 {
< compatible = "fsl,imx6q-v4l2-capture";
< ipu_id = <0>;
< csi_id = <0>;
< mclk_source = <0>;
< status = "okay";
425,436d416
<
< ov564x: ov564x@3c {
< compatible = "ovti,ov564x";
< reg = <0x3c>;
< pinctrl-names = "default";
< pinctrl-0 = <&pinctrl_ipu1_2>;
< clocks = <&clks 200>;
< clock-names = "csi_mclk";
< csi_id = <0>;
< mclk = <216000000>;
< mclk_source=<0>;
< };
I didn't change pins (in accordination with manual and datasheet they are valid by default):
pinctrl_ipu1_2: ipu1grp-2 { /* parallel camera */ fsl,pins = < MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12 0x80000000 MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13 0x80000000 MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14 0x80000000 MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15 0x80000000 MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16 0x80000000 MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17 0x80000000 MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18 0x80000000 MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19 0x80000000 MX6QDL_PAD_CSI0_DATA_EN__IPU1_CSI0_DATA_EN 0x80000000 MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK 0x80000000 MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC 0x80000000 MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC 0x80000000 >; };
mach-imx6q.c
> struct regmap *gpr;
253,268c248,261
< gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
< if (!IS_ERR(gpr)) {
< if (of_machine_is_compatible("fsl,imx6q-var-dart"))
< regmap_update_bits(gpr, IOMUXC_GPR1, 1 << 20, 1 << 20);
< else if (of_machine_is_compatible("fsl,imx6q-sabresd") ||
< of_machine_is_compatible("fsl,imx6q-sabreauto") ||
< of_machine_is_compatible("fsl,imx6q-var-som"))
< regmap_update_bits(gpr, IOMUXC_GPR1, 1 << 19, 1 << 19);
< else if (of_machine_is_compatible("fsl,imx6dl-sabresd") ||
< of_machine_is_compatible("fsl,imx6dl-sabreauto") ||
< of_machine_is_compatible("fsl,imx6dl-var-som"))
< regmap_update_bits(gpr, IOMUXC_GPR13, 0x3F, 0x0C);
< }
< else {
< pr_err("%s(): failed to find fsl,imx6q-iomux-gpr regmap\n", __func__);
< }
---
> gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
> if (!IS_ERR(gpr)) {
> if (of_machine_is_compatible("fsl,imx6q-sabresd") ||
> of_machine_is_compatible("fsl,imx6q-sabreauto") ||
> of_machine_is_compatible("fsl,imx6qp-sabresd") ||
> of_machine_is_compatible("fsl,imx6qp-sabreauto"))
> regmap_update_bits(gpr, IOMUXC_GPR1, 1 << 19, 1 << 19);
> else if (of_machine_is_compatible("fsl,imx6dl-sabresd") ||
> of_machine_is_compatible("fsl,imx6dl-sabreauto"))
> regmap_update_bits(gpr, IOMUXC_GPR13, 0x3F, 0x0C);
> } else {
> pr_err("%s(): failed to find fsl,imx6q-iomux-gpr regmap\n",
> __func__);
> }
Hi, Igor.
Thank you for your reply.
Yeah, I read manuals from variscite,
http://variwiki.com/index.php?title=IMX6UL_CSI
http://variwiki.com/index.php?title=VAR-SOM-MX6_Camera_FSLC
and some chapters in i.MX_6Dual6Quad_BSP_Porting_Guide
But my question not about "Devices Tree" but about OV5640 and MXC_V4L drviers, I think.
I just tried to open your second link (How to enable i.MX6UL CSI port support BT.656 deinterlace mode and PXP preview );
however, I've got error
Unauthorized
This place or content does not exist or access to it is restricted. If you think this is a mistake, please contact your administrator or the person who directed you here.
How I can read content of that post?