各位:
目前我使用了adv7181d (格式:BT1120)和nextchip(N4)这两个IC
adv7180配置如下:
v4l2_cap_0 {
compatible = "fsl,imx6q-v4l2-capture";
ipu_id = <0>;
csi_id = <0>;
mclk_source = <0>;
status = "okay";
};
adv7180: adv7180@21 {
compatible = "adv,adv7180";
reg = <0x21>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ipu1_2>;
clocks = <&clks IMX6QDL_CLK_CKO>;
clock-names = "csi_mclk";
pwn-gpios = <&gpio1 4 0>;
reset-gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
ipu_id = <0>;
csi_id = <0>;
mclk = <24000000>;
mclk_source = <0>;
cvbs = <1>;
};
nextchip(N4)本身可以接四个摄像头,但是我仅使用了 的的其中两路,分辨率是720p,然后配置如下:
mipi-csi2-channel@2 {
ipu_id = <1>;
csi_id = <0>;
v_channel = <2>;
status = "okay";
};
mipi-csi2-channel@3 {
ipu_id = <1>;
csi_id = <1>;
v_channel = <3>;
status = "okay";
};
----------------------------------------------------------------------
v4l2_cap_1 {
compatible = "fsl,imx6q-v4l2-capture";
ipu_id = <1>;
csi_id = <0>;
mclk_source = <0>;
status = "okay";
};
v4l2_cap_2 {
compatible = "fsl,imx6q-v4l2-capture";
ipu_id = <1>;
csi_id = <1>;
mclk_source = <0>;
status = "okay";
};
目前三个摄像头都可以采到图像,但是 ipu_id = <1>; csi_id = <1>;这一路的摄像头采集到的图像会闪动,看起来就像是图像断层,我用mxc-v4l2-tvin去打开不会闪
mxc-v4l2-tvin -ol 0 -ot 0 -ow 1280 -oh 800 -d 1 -x 2
我调通了HAL层,我们应用给我写了一个demo去分别打开每个video,当打开video2( ipu_id = <1>; csi_id = <1>;)的时候就出现闪动的情况,Android同时打开两个图像,都会闪动,目前不知道从哪里分析,可否提供一点思路,谢谢!
只有Android才会闪!
谢谢!
大家好:
如视频中所示,一直闪屏的是因为格式不对造成的,做了如下修改就好了
// v4l2 does not support enum format, now hard code here.
- sensorFormats[index] = v4l2_fourcc('Y', 'U', 'Y', 'V');
+ sensorFormats[index] = v4l2_fourcc('Y', 'U', 'Y', 'V');
availFormats[index++] = v4l2_fourcc('Y', 'U', 'Y', 'V');
- sensorFormats[index] = v4l2_fourcc('N', 'V', '1', '2');
- availFormats[index++] = v4l2_fourcc('N', 'V', '1', '2');
- mSensorFormatCount =
- changeSensorFormats(sensorFormats, mSensorFormats, index);
+ mSensorFormatCount = changeSensorFormats(sensorFormats, mSensorFormats, index);
if (mSensorFormatCount == 0) {
ALOGE("%s no sensor format enum", __func__);
close(fd);
return BAD_VALUE;
}
- availFormats[index++] = v4l2_fourcc('B', 'L', 'O', 'B');
- availFormats[index++] = v4l2_fourcc('R', 'A', 'W', 'S');
- //availFormats[2] = v4l2_fourcc('Y', 'U', 'Y', 'V');
+ availFormats[index++] = v4l2_fourcc('N', 'V', '1', '2');
但是现在出现了另一个问题,同时打开并显示两个摄像头(720p),内核会不断打印如下log:
imx-ipuv3 2800000.ipu: IPU Warning - IPU_INT_STAT_10 = 0x00080000
摄像头工作一段时间后,内核持续快速打印如下log
imx-ipuv3 2800000.ipu: IPU Warning - IPU_INT_STAT_10 = 0x00080000
imx-ipuv3 2800000.ipu: IPU Warning - IPU_INT_STAT_5 = 0x00800000
其中会夹有下面的log
mxc_sdc_fb mxc_sdc_fb.0: timeout when waiting for flip irq
此时 logcat -v time会持续有如下打印:
01-01 10:51:25.050 140 140 W imx6.gralloc: FBIOPAN_DISPLAY failed: Connection timed out
01-01 10:51:25.560 140 140 W imx6.gralloc: FBIOPAN_DISPLAY failed: Connection timed out
当我只打开一个摄像头显示的时候不会出现以上log,当两个同时打开,每次打印imx-ipuv3 2800000.ipu: IPU Warning - IPU_INT_STAT_10 = 0x00080000 ,画面就会闪动一下,当如下日志持续打印,就出现了黑屏
imx-ipuv3 2800000.ipu: IPU Warning - IPU_INT_STAT_10 = 0x00080000
imx-ipuv3 2800000.ipu: IPU Warning - IPU_INT_STAT_5 = 0x00800000
我的Android版本是:android_M6.0.1_2.1.0
请问,如果要同时打开显示两个720p的摄像头图像,是否有相关的patch要打,我该怎么规避以上问题,谢谢!
how many cameras do you use? two 720P or three? refer to your waning message, it seems the cpu is high loading for your case
Hi, Joan Xie
Thank you for your reply.
I used two 720P cameras . How can I be sure that the cpu loading is too high,Because it is normal to open it with mxc-v4l2-tvin,For example:
mxc-v4l2-tvin -ol 0 -ot 0 -ow 640 -oh 800 -d 1 -x 1 -g2d &
mxc-v4l2-tvin -ol 640 -ot 0 -ow 640 -oh 800 -d 1 -x 2 -g2d &
And open cameras by mxc-v4l2-tvin,There is no similar printing information:
imx-ipuv3 2800000.ipu: IPU Warning - IPU_INT_STAT_10 = 0x00080000
Do you think it may be the gpu problem?I hope you can give me more help.
Thank you !
if you use mxc_v4l2_tvin to open dual camera, no waning message, right? if you use TVIN, should use mxc_v4l2_tvin application, and try to connect your two camera to different IPU.
Hi ,Joan Xie
Thank you for your reply.
I have configured my camera with different ipu
mipi-csi2-channel@2 {
ipu_id = <1>;
csi_id = <0>;
v_channel = <2>;
status = "okay";
};
mipi-csi2-channel@3 {
ipu_id = <1>;
csi_id = <1>;
v_channel = <3>;
status = "okay";
};
In order to avoid the influence of ipu on the camera. The configuration of another SD camera(adv718d) used in the project is as follows:
adv7180: adv7180@21 {
compatible = "adv,adv7180";
reg = <0x21>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ipu1_2>;
clocks = <&clks IMX6QDL_CLK_CKO>;
clock-names = "csi_mclk";
pwn-gpios = <&gpio1 4 0>;
reset-gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
ipu_id = <0>;
csi_id = <0>;
mclk = <24000000>;
mclk_source = <0>;
cvbs = <1>;
};
If my two camera is already configured with different IPUs, then when I open the two cameras, is it not to open the different IPUs?
Tvin is mentioned because there is no warning message when tvin is used to open both cameras at the same time. Can this phenomenon explain that the cpu load is not too high?
I look forward to your reply again !
mxc_v4l2_tvin.out is for de-interlacing application, if you don't use this, when you open adv7180, should get two picture, one is top and another is bottom, you also can refer to the patch for MIPI CSI2 720P HD-TVI camera surround view solution.