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.
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.
A. H/W: imx6q(mx6dl)
B. Kernel Version: 3.0.35
C. Application: QT app.
D. Camera : CCD Sensor.
2. Circuit Diagram.
A. Camera 0 (CCD Camera sensor -> TW9900)
B. Camera 1 (CCD Camera sensor -> tw9900)
3. Kernel Setting
: Select tht IPU CSI pin to Camera1 and Camera2.
<GPR13 IOMUX Datasheet>
-> Add below setting value to "static void __init mx6_mvt_board_init(void)" Function.
- i2c_register_board_info(mxc_i2c1_board_info, ARRAY_SIZE(mxc_i2c1_board_info))
iii. camera_data_tw9900 mx6q_csi0_tw9900_io_init, mx6q_csi0_tw9900_cam_powerdown
iv. camera1_data_tw9900 mx6q_csi1_tw9900_io_init, mx6q_csi1_tw9900_cam_powerdown
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
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
E. Capture Setup for CAM1
F. Prepare output
G. Start capturing cam0
H. Start capturing cam1
I. Start camera
-> Green code is regarding the OUTPUT code. This code was ignored, so TFT-LCD has no video.
J. Save image for test
-> 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.
: 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?
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