Capturing from 2 Camera & 1 Output to TFT LCD

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

Capturing from 2 Camera & 1 Output to TFT LCD

897 Views
호영노
Contributor II

Hi All,

I'm working on 2 camera and 1 LCD output. (let's call the each camera to camera0 & camera1)

camera1's capture data should be output to TFT-LCD and if some interrupt occurred,

I want to save image file from 0 or 1 camera's capture data.

But it is very difficult..

 

for the summary : 

-> It has 2 Camera that CAM0, CAM1. And CAM1's video is always output to TFT-LCD.

-> If some interrupt was occurred(such like button input.),  I want to save to image file from CAM0 or CAM1'sCapture buffer data.

-> At this time, TFT-LCD's video should be does not stopped. 

 

Problem is 

If I try to enable the capturing for only one camera (it doen't matter of CAM0 or CAM1)  and

output to LCD, it is working well.

 

But I want to enable the capturing both camera at same time(real time) and

only CAM1 's video output to LCD. This is not working normally. 

 

 

1. Environment

   A. H/W: imx6q(mx6dl)
   B. Kernel Version: 3.0.35
   C. Application: QT app.

   D. Camera : CCD Sensor. 

 

205362_205362.pngpastedImage_1.png

 

 

 

2. Circuit Diagram.

A. Camera 0 (CCD Camera sensor -> TW9900)

205363_205363.pngpastedImage_4.png

205376_205376.pngpastedImage_5.png

 

B. Camera 1 (CCD Camera sensor -> tw9900)

205377_205377.pngpastedImage_6.png

205378_205378.pngpastedImage_7.png

 

3. Kernel Setting 

A. linux-3.0.35/arch/arm/mach-mx6/board-mx6dl_mvt.h

205379_205379.pngpastedImage_9.png

: Select tht IPU CSI pin to Camera1 and Camera2.

 

205380_205380.pngpastedImage_10.png

                                                         <GPR13 IOMUX Datasheet>

 

B. linux-3.0.35/arch/arm/mach-mx6/board-mx6q_mvt.c
-> Add below setting value to "static void __init mx6_mvt_board_init(void)" Function.

     - mx6q_add_v4l2_capture(capture_data[])
      - i2c_register_board_info(mxc_i2c1_board_info, ARRAY_SIZE(mxc_i2c1_board_info))

 

205381_205381.pngpastedImage_11.png

 

i. capture_data[]

205383_205383.pngpastedImage_16.png

ii. mxc_i2c1_board_info[]

205384_205384.pngpastedImage_20.png

 

iii. camera_data_tw9900  mx6q_csi0_tw9900_io_init, mx6q_csi0_tw9900_cam_powerdown

205385_205385.pngpastedImage_22.png

205386_205386.pngpastedImage_23.png

205387_205387.pngpastedImage_24.png

 

iv. camera1_data_tw9900  mx6q_csi1_tw9900_io_init, mx6q_csi1_tw9900_cam_powerdown

205388_205388.pngpastedImage_26.png

205389_205389.pngpastedImage_27.png

205390_205390.pngpastedImage_28.png

 

E. I did not change anything in the /linux-3.0.35/drivers/media/video/mxc/capture.

   -> I attached ipu_csi_enc.c, mxc_v4l2_capture.c, mxc_v4l2_capture.h, tw9900.c(for cam0), tw9901.c(for cam1) 

 

4. QT Application code
A. Variable

205391_205391.pngpastedImage_30.png

205392_205392.pngpastedImage_31.png

B. Capture driver open
    : fd_capture_v4l_cam1 = open(v4l_capture_dev_cam1, O_RDWR, 0);
    : fd_capture_v4l_cam0 = open(v4l_capture_dev_cam0, O_RDWR, 0);
C. Output driver open
    : fd_output_v4l = open(v4l_output_dev, O_RDWR, 0);
D. Capture setup for CAM0

205393_205393.pngpastedImage_33.png

 

E. Capture Setup for CAM1

205394_205394.pngpastedImage_35.png

 

F. Prepare output

205395_205395.pngpastedImage_37.png

 

 

G. Start capturing cam0

205396_205396.pngpastedImage_39.png

 

H. Start capturing cam1

205397_205397.pngpastedImage_41.png

 

I. Start camera

 

205398_205398.pngpastedImage_43.png

205399_205399.pngpastedImage_44.png

205400_205400.pngpastedImage_45.png

-> Green code is regarding the OUTPUT code. This code was ignored, so TFT-LCD has no video.

 

 

J. Save image for test

 

205401_205401.pngpastedImage_48.png205402_205402.pngpastedImage_49.png

-> Test function for 'Capture buffer' 's data to Image file. 

 

 


① If does not wrapping the Output stream code to "comment code", 
: I blocked IO CONTROL(it relevant with video output), so TFT-LCD has no video.
: At this time, I make an interrupt to calling the buffer2img() function to save the image file from capture_buffers_cam0 and capture_buffers_cam1's buffer data.

: I can found the 2 Camera's captured image and it looks like capturing is working normally.


② If enable the Output stream 

     : TFT-LCD has no video. 

     : If I try to execute the Application,  below error occurred continuous. 

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_9 = 0x04000000

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_9 = 0x04000000

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_9 = 0x04000000

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_9 = 0x04000000

 

 

and 

imx-ipuv3 imx-ipuv3.0: ERR:[0xe2795400]-no:0x10 "wait_for_comp_timeout" ret:0,line:2849

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_10 = 0x04000000

imx-ipuv3 imx-ipuv3.0: ERR:[0xe2795400]-no:0x20 "wait_for_comp_timeout" ret:0,line:2849

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_10 = 0x04000000

imx-ipuv3 imx-ipuv3.0: ERR:[0xe2795400]-no:0x30 "wait_for_comp_timeout" ret:0,line:2849

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_10 = 0x04000000

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_10 = 0x00000001

imx-ipuv3 imx-ipuv3.0: ERR:[0xe2795400]-no:0x40 "wait_for_comp_timeout" ret:0,line:2849

 

 

: If I try to calling the buffer2img() to save the image file from 'capture_buffers_cam0' and 'capture_buffers_cam1' 's buffer data.

: capture_buffers_cam0's Image is OK, but capture_buffers_cam1 has not Image. It just filled White.

 

 

 

 

 

How can I fix this problem? 

 

Labels (4)
1 Reply

547 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi,

      In i.mx6DL, there is only one IPU module, so if you use IPU0 CSI0 & IPU CSI1, it means only one channel can be captured at the same time. But in I.MX6Q, there are 2 IPU modules, for you applicaiton, i.mx6q should be OK.

Have a nice day!

TIC Weidong Sun

0 Kudos