I am using i.mx6q SD board to get two camera(ov5640 and ov3640) work at the same time.
It is no need to display the image on display, i just want to get the camera datas in memory and
save them to local files.
To confirm is it support two camera at the same time, I do the follow things:
1. Put the OV5640 camera image on display with mxc_v4l2_overlay.
2. then capture the OV3640 data to local file with use mxc_vpu_test
But i got following error when i do second step:
imx-ipuv3.0: handler already installed on irq 0
So i checked the drivers,and found that there is only CSI_MEM(which is CSI_MEM0),
I think that if want use two cameras at the same time,
It is need to add a CSI_MEM1 to let second camera data use CSI_MEM1 channel to memory.
Am i right? and is there any ideas to save two camera data to memory at same time?
Thanks a lot for you feedback.
I hadn't a chance to check but seems that the cameras VDD are connected together and the source is not being able to provide current enough, causing a flickering (I'm just supposing). If possible, could you check if cameras VDD have some kind of ripple when playing both cameras at the same time? I'll also try to check it on my board.
BTW, how are you planning to capture 4 cameras at the same time? Will you use 4 MIPI cameras?
I'm not too concerned with the flickering as it appears to be a function of the board schematic/layout rather than the utilization of the SOC. That said, next time I've got both cameras running (probably in the next day or two) I'll grab a scope capture for you.
As for our upcoming design, we will have between 1 and 4 cameras connected via parallel (from PAL decoder) and from MIPI (from FPD Link III de-serializer) feeding into an FPGA where we'll be muxing the data into MIPI with 4 virtual channels to the IMX6's MIPI port.
Currently I've been able to change the OV5640's virtual channel and the corresponding code in the MXC V4L2 & MIPI drivers, but it seems I'm missing some bit of setup in the capture chain: Everything looks fine when I leave the OV5640 (and related drivers) at the default VC/CSI/IPU, but using VC 2 and 3 result in a randomly-tiled, false-color image. If you've seen this before (I assume I'm missing an obvious step somewhere in the code), let me know, otherwise I'll eventually track it down ;-)
I was able to get the OV5640 MIPI and OV7725 working individually on our custom i.Mx6Q board. But the problem is, both a camera not working at the same time on different display (LCD and HDMI).
I got some IPU related issues.
At that time I tried your patch. But I got some other issue like, imx-ipuv3 imx-ipuv3.0: handler already installed on irq 0
What can i do further ?
Thanks in Advance.
If you see at the ipu_csi_enc.c you'll see that for both cameras the driver is using the same irq and DMA channel and for that reason it is complaining when you try to use both cameras at the same time. What i did is assign the irq and channel depending on the camera so you don't have a resource conflict.
You can take a look at the patch a posted above. It is for kernel version 3.0.35-4.0.0, if you are using a different version then you'll need to modify it but it should work.
Unfortunately with current drivers it's not possible to process on ipu 2 signals coming from 2 different CSIs (although the processor is capable to do it).
You can use at the same time 2 mxc_v4l2_capture.out instances to caputure. One using csi->prp_enc->mem and other using csi->mem:
./mxc_v4l2_capture.out -i 1 -d /dev/video1 test.aaa & ./mxc_v4l2_capture.out -d /dev/video0 test.bbb
This way you will record the 2 video files at the same time.
Is it possible to capture 2 simultaneous 1280x720p stream from two cameras on i.MX6Q?
My goal is simultaneous capture from two camera at 1280x720p resolution and perform H.264 encoding and stream.
Appreciate your earliest response.
I know this thread is closed but i'm still having the same results even with your recommendation. I used gstreamer to capture video from both cameras at the same time (using a Sabre-SDP), thhis is the pipeline i used:
gst-launch -e mfw_v4lsrc input=0 ! 'video/x-raw-yuv,width=176,height=144' ! vpuenc codec=6 ! matroskamux ! filesink location=test0.mkv mfw_v4lsrc device=/dev/video1 input=1 ! vpuenc codec=6 ! matroskamux ! filesink location=test1.mkv
As you can see in the attached videos, test0.mkv has an annoying interference. This is exactly the same results i get by using the patch i mentioned previously. Is this an analog issue or is a conflict with DMA channels?. I don't think it has to be with the memory because with the method that you suggested both cameras are using totally different channels and by applying the patch the DMA channel is assigned depending on the CSI.
Any advice wold be appreciated!!
You just need to copy the "drivers/media/video/mxc/capture/ipu_csi_enc.c", name it to ipu_csi_enc1.c.
And modify the ipu_csi_enc.c 's csi to use csi0,
modify the ipu_csi_enc1.c 's csi to use csi1.
And add some processes of ipu_csi_enc1.c and Makefile.
In tha application, you can use ioctl "VIDIOC_S_INPUT" with 1 & 2 to control which camera you use.
I attached the file i modified, you can referenc them.
It may be not all the files needs to modify, i 'm not sure whi !ch file i modified.