iMX6DQ TP2854 MIPI CSI2 720P HD-TVI camera surround view solution for Linux BSP

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

iMX6DQ TP2854 MIPI CSI2 720P HD-TVI camera surround view solution for Linux BSP

No ratings

iMX6DQ TP2854 MIPI CSI2 720P HD-TVI camera surround view solution for Linux BSP

iMX6DQ TP2854 MIPI CSI2 720P HD-TVI camera surround view solution for Linux BSP.

 

205692_205692.jpgIMG_20171205_172552_HDR.jpg


For iMX6DQ, there are two IPUs, so they can support up to 4 cameras at the same time. But the default BSP can only support up to two cameras at the same time.

The attached patch can make the BSP support up to 4 cameras based on 3.14.52 GA 1.1.0 BSP and 4.1.15 GA1.2.0 BSP.


The 4 cameras can be:
- 1xCSI, 3xMIPI
- 2xCSI, 2xMIPI
- 4xMIPI

For 4xMIPI case, the four cameras should be combined on the single MIPI CSI2 interface, and each camera data should be transfered on a mipi virtual channel.


In this patch, we given the example driver for Techpoint TP2854, it was verified working on iMX6DQ SabreAuto board. The input to TP2854 is four 720P30 HD-TVI cameras.

 

The MIPI CSI2 720P digital camera surround view solution can be found at: iMX6DQ MAX9286 MIPI CSI2 720P camera surround view solution for Linux BSP

 

The kernel patches:
0001-IPU-update-IPU-capture-driver-to-support-up-to-four-.patch
     Updated IPU common code to support up to four cameras.

 

0002-Remove-the-page-size-align-requirement-for-v4l2-capt.patch
     With this patch, the mxc_v4l2_tvin test application can use overlay framebuffer as V4l2 capture buffer directly.

 

0003-Add-TP2854-support-on-SabreAuto-board-which-can-supp.patch
     TP2854 driver.

 

How to builld the kernel with TP2854 support:

      make imx_v7_defconfig

      make menuconfig (In this command, you should select the TP2854 driver:

            Device Drivers  --->
                  <*> Multimedia support  --->
                        [*]   V4L platform devices  --->
                              <*>   MXC Video For Linux Video Capture
                                      MXC Camera/V4L2 PRP Features support  --->
                                          <*>Techpoint tp2854 HD CVBS Input support
                                          <*>mxc VADC support
                                          <*>Select Overlay Rounting (Queue ipu device for overlay library)
                                          <*>Pre-processor Encoder library
                                          <*>IPU CSI Encoder library)

      make zImage
      make dtbs

 

The built out image file:
      arch/arm/boot/dts/imx6q-sabreauto.dtb
      arch/arm/boot/zImage


"mxc_v4l2_tvin_3.14.52.zip" is the test application, test command to capture the four cameras and render on 1080P HDMI display:

/mxc_v4l2_tvin.out -ol 0 -ot 0 -ow 960 -oh 540 -d 1 -x 0 -g2d &
/mxc_v4l2_tvin.out -ol 960 -ot 0 -ow 960 -oh 540 -d 1 -x 1 -g2d &
/mxc_v4l2_tvin.out -ol 0 -ot 540 -ow 960 -oh 540 -d 1 -x 2 -g2d &
/mxc_v4l2_tvin.out -ol 960 -ot 540 -ow 960 -oh 540 -d 1 -x 3 -g2d &


Details for TP2854, please contact with Techpoint.

[2019-04-04] Update

Add application to preview + encode at the same time:

   /mxc_vpu_test.out -E "-x 0 -o /enc.h264 -w 1280 -h 720 -L 0 -T 0 -W 512 -H 384 -c 5000 -f 2"

The camera input data go through CSI->MEM path, and IDMAC 0/1 will convert data from YUV422 ro NV12 for VPU encoder, no resize. Another modification in the mxc_vpu_test, it use different thread to encode and preview.

Attachments
Comments

Dear Qiang,

   我按照你提供的步骤打上了这个patch,现在遇到一个问题:

  运行mxc_v4l2_tvin.out,图像在第三和第四象限时,显示正常,

但是第一和第二象限不能显示,命令行报如下错误退出,即-ol 是0时不能显示,

请帮忙看一下,谢谢。

root@imx6qdlsolo:~# ./mxc_v4l2_tvin.out -ol 0 -ot 0 -ow 960 -oh 540 -d 1 -x 0 -g
tp2854_mipi: sensor number = 4.
mxc_mipi_csi2 21dc000.mipi_csi: mipi_csi2_reset: mipi_lane_bps = 594 Mbps
mxc_mipi_csi2 21dc000.mipi_csi: mipi_csi2_reset: value = 0x2e.
ERROR: unrecognized std! 0 (PAL=ff, NTSC=b000
g_in_width = 1280, g_in_height = 720.
fb_fix.id = DISP3 FG.
fb: smem_start = 0x73500000, smem_len = 0xbdd800.
fb: frame buffer size = 0x3f4800 bytes.
fb: g_screen_info.xres = 1920, g_screen_info.yres = 1080.
fb: g_display_left = 0.
fb: g_display_top = 0.
fb: g_display_width = 960.
fb: g_display_height = 540.
start time = 1449239872 s, 237469 us
ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
VIDIOC_DQBUF failed.

@你好,LiQiang,

 我们的板单个摄像头运行时,4个象限能分别正常显示摄像头图像,但是用下面的脚本同时运行4个进程的时候,只能显示出第四象限的画面,请帮忙分析原因,谢谢!

./mxc_v4l2_tvin.out -ol 0 -ot 0 -ow 960 -oh 540 -d 1 -x 0 &
sleep 10
./mxc_v4l2_tvin.out -ol 960 -ot 0 -ow 960 -oh 540 -d 1 -x 1 &
sleep 10
./mxc_v4l2_tvin.out -ol 0 -ot 540 -ow 960 -oh 540 -d 1 -x 2 &
sleep 10
./mxc_v4l2_tvin.out -ol 960 -ot 540 -ow 960 -oh 540 -d 1 -x 3 &

另外,如果我用-g2d 的方式运行的话,画面是乱的,如下图,可能的原因是什么?

QQ图片20180303154802.jpg

不带-g2d是用V4l2_outputrender的,V4l2_output是独占一个framebuffer的,所以只能显示一个camera。“-g2d 的方式”没有见过你的问题,可能是你把数据格式设置错了,比如抓到buffer里面的是UYVY的数据,但是用G2D的时候,你却告诉它是RGB565的数据,那么结果显示出来的图像就是错误的。

不带-g2d是用V4l2_output来render的,V4l2_output是独占一个framebuffer的,所以只能显示一个camera。“用-g2d 的方式”没有见过你的问题,可能是你把数据格式设置错了,比如抓到buffer里面的是UYVY的数据,但是用G2D的时候,你却告诉它是RGB565的数据,那么结果显示出来的图像就是错误的。

Best Regards

发件人: guobugao

发送时间: 2018年3月5日 10:18

收件人: Qiang Li - Mpu Se <qiang.li@nxp.com>

主题: Re: - iMX6DQ TP2854 MIPI CSI2 720P HD-TVI camera surround view solution for Linux BSP

NXP Community <https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.freescale.com%2Fresources%2Fstatics%2F1000%2F35400-NXP-Community-Email-banner-600x75.jpg&data=02%7C01%7Cqiang.li%40nxp.com%7Cb1134b4316374cb2c42308d5823f4fd7%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636558130790664664&sdata=GdK1X0kU0c78%2B01%2Btf18miIianAUMSZQK%2BLDKhrtSQ0%3D&reserved=0>

iMX6DQ TP2854 MIPI CSI2 720P HD-TVI camera surround view solution for Linux BSP

new comment by guo bugao<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.nxp.com%2Fpeople%2Fguobugao%3Fet%3Dwatches.email.document_comment&data=02%7C01%7Cqiang.li%40nxp.com%7Cb1134b4316374cb2c42308d5823f4fd7%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636558130790664664&sdata=IZ%2FMIsmr1jyTEe425dZLcRVpbyCes5GpWmZ4%2Fb3ZU7Q%3D&reserved=0> View all comments on this document<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-335803%3FcommentID%3D51516%26et%3Dwatches.email.document_comment%23comment-51516&data=02%7C01%7Cqiang.li%40nxp.com%7Cb1134b4316374cb2c42308d5823f4fd7%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636558130790664664&sdata=%2FQ2D%2FSqPLaxzw8rZd8pY46kCEaH1lwHWVGiBol2c8c4%3D&reserved=0>

Hi,Li

我将这个patch移到3.0.35内核,CSI0+IPU0和CSI0+IPU1通道可以打开显示,但是CSI1+IPU0和CSI1+IPU1两个通道不能显示,提示错误:

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
VIDIOC_DQBUF failed.

只有上面这个错误,没有提示其它错误,请问这可能是什么原因?

你的问题解决了吗?

maybe you can check the register IOMUX_GPR1, both MIPI_IPU2_MUX and MIPI_IPU1_MUX should be 0.

Another reason, I think you haven't identifide the CSI ID in driver.

1、IMUXC_GPR1的19,20位已经配置成为0,而且IPU0+CSI1这个通道跟这个寄存器无关,现在我是两个CSI1的通道有问题。下面是从机器中读到的该寄存器值:
0x020E0004: 48440005

2、在驱动中已经注册CSI

·kernel_imx/arch/arm/mach-mx6/board-mx6q_sabresd.c中

static struct fsl_mxc_capture_platform_data capture_data[] = {
{
.csi = 0,
.ipu = 0,
.mclk_source = 0,
.is_mipi = 1,
}, {
.csi = 0,
.ipu = 1,
.mclk_source = 0,
.is_mipi = 1,
},{
.csi = 1,
.ipu = 0,
.mclk_source = 0,
.is_mipi = 1,
},{
.csi = 1,
.ipu = 1,
.mclk_source = 0,
.is_mipi = 1,
},
};

imx6q_add_v4l2_capture(0, &capture_data[0]);
imx6q_add_v4l2_capture(1, &capture_data[1]);
imx6q_add_v4l2_capture(2, &capture_data[2]);
imx6q_add_v4l2_capture(3, &capture_data[3]);

tp2854_mipi.c中

tp2854_data[0].ipu_id = 0;
tp2854_data[0].csi = 0;
tp2854_data[0].v_channel = 0;

tp2854_data[1].ipu_id = 0;
tp2854_data[1].csi = 1;
tp2854_data[1].v_channel = 1;

tp2854_data[2].ipu_id = 1;
tp2854_data[2].csi = 0;
tp2854_data[2].v_channel = 2;

tp2854_data[3].ipu_id = 1;
tp2854_data[3].csi = 1;
tp2854_data[3].v_channel = 3;

v4l2_int_device_register(&tp2854_int_device[0]);
v4l2_int_device_register(&tp2854_int_device[1]);
v4l2_int_device_register(&tp2854_int_device[2]);
retval = v4l2_int_device_register(&tp2854_int_device[3]);

在机器中可以看到4个video capture设备

./dev/video3
./dev/video2
./dev/video1
./dev/video0

请问这有没有问题?下一步该如何排查?

hi,您好,请问你的问题解决了吗?我也遇到了相同的问题,加上g2d就会出现花屏。非常感谢

hi qiang

        我用G2D的方式显示的情况下,画面有割裂的情况出现,用V4l2_output方式没有这个现象,目前我们需要采用G2D的方式,这个可能是什么原因引起的呢123.png

G2D方式是用单BUFFER的形式完成的,可能显示的时候同时往BUFFER里写数据,引起了这个现象,更改为双buffer后没有这个问题

你好!请问你的问题解决了吗?是什么原因造成的,我也碰到同样的问题

Hi, Li

      我尝试使用csi-ic-mem通道来输出缩放后的相机图片,以便以后将这4张图拼成一张1080P的画面输出,但是当我把mxc_v4l2_tvin.out中的g_input设为0之后,同时打开4个相机就会出现以下错误:

imx-ipuv3 2800000.ipu: handler already installed on irq 20
Error registering rot irq

      我试着在ipu_prp_enc.c的prp_enc_enabling_tasks函数中添加了ipu_clear_irq(cam->ipu, IPU_IRQ_PRP_ENC_OUT_EOF);但是仍然会报上述错误。请问在这个patch之上可以使4个相机通过csi-ic-mem通道输出吗?我是用的bsp版本是L3.14.52.

CSI->IC的硬件通路,同时只能支持一路camera,所以你要收到memory以后,再把他们画到一个buffer里面,然后编码。

Qiang Li,

我在用imx6d6a+NVP6324实现AHD 3D环视,目前应用功能都已经完成,但是现在产品有一个问题一直没有找到解决方法,您帮忙看看有没有什么建议?

当我3D 环视应用程序在运行时,如果我在系统后台去拷贝文件,或读磁盘文件时会出现文件部分内容出错的问题,于是我在编译kernal时使能了Memory Debug,发现当我们的应用程序在运行后,系统偶尔会打印如下错误,您是否碰到过类似问题,有什么建议?谢谢了!

[ 21.724140] pagealloc: memory corruption
[ 21.728506] 9aa00800: 7e 21 7f 1d 7f 1f 7f 20 80 1d 80 22 80 1d 81 1f ~!..... ..."....
[ 21.736543] 9aa00810: 80 1f 81 1f 80 1f 80 1f 7e 1f 80 1f 7e 1f 80 1e ........~...~...
[ 21.744607] 9aa00820: 7e 20 80 20 7e 1e 80 1f 7f 1d 80 20 80 1f 80 1e ~ . ~...... ....
[ 21.752663] 9aa00830: 80 22 80 1e 7f 20 80 1f 7e 1d 80 20 7e 1e 7f 1e ."... ..~.. ~...
[ 21.760726] 9aa00840: 7d 20 7f 1e 7d 1f 7f 1f 7e 1d 7f 20 7e 21 7e 1f } ..}...~.. ~!~.
[ 21.768782] 9aa00850: 80 1e 7e 21 80 1c 7f 20 80 1f 80 1d 80 22 80 1e ..~!... ....."..
[ 21.776813] 9aa00860: 80 22 80 1e 80 1e 80 20 80 1e 80 1f 7e 1e 80 20 ."..... ....~..
[ 21.784862] 9aa00870: 7f 21 80 1e 80 1e 80 20 81 20 80 1e 80 21 80 1f .!..... . ...!..
[ 21.792917] 9aa00880: 7e 1f 80 22 7e 1c 80 21 80 21 7f 1e 83 21 7e 1f ~.."~..!.!...!~.
[ 21.800966] 9aa00890: 86 20 7d 1f 8a 20 7b 26 8d 2b 7a 30 8f 37 78 41 . }.. {&.+z0.7xA
[ 21.809016] 9aa008a0: 8e 48 78 50 8a 51 79 51 85 54 79 4e 80 51 7a 37 .HxP.QyQ.TyN.Qz7
[ 21.817106] 9aa008b0: 7f 26 7b 2a 7e 22 7d 20 80 21 7f 20 80 22 7f 20 .&{*~"} .!. .".
[ 21.825125] 9aa008c0: 80 22 7e 20 7f 20 7e 23 7e 23 7e 22 7e 25 7f 24 ."~ . ~#~#~"~%.$
[ 21.833168] 9aa008d0: 7e 24 7f 24 7f 25 7f 21 80 27 7f 23 81 23 80 26 ~$.$.%.!.'.#.#.&
[ 21.841208] 9aa008e0: 80 25 80 27 80 26 80 25 80 27 80 26 80 27 80 27 .%.'.&.%.'.&.'.'
[ 21.849249] 9aa008f0: 80 25 80 28 80 29 80 26 80 28 80 28 80 27 80 25 .%.(.).&.(.(.'.%
[ 21.857287] 9aa00900: 80 29 80 25 80 27 80 26 7e 28 80 27 80 23 7f 2a .).%.'.&~(.'.#.*
[ 21.865294] 9aa00910: 80 27 7f 26 81 29 80 29 81 29 80 28 81 2a 81 2a .'.&.).).).(.*.*
[ 21.873337] 9aa00920: 81 2a 82 28 81 2b 82 2b 81 28 82 2a 81 2c 81 2c .*.(.+.+.(.*.,.,
[ 21.881373] 9aa00930: 81 2c 80 2a 81 2d 7e 2c 81 2a 7e 2d 81 2b 7f 2d .,.*.-~,.*~-.+.-
[ 21.889407] 9aa00940: 80 2b 80 2c 80 2b 81 2b 81 2d 81 2c 81 2b 81 2d .+.,.+.+.-.,.+.-
[ 21.897442] 9aa00950: 80 2b 81 2d 80 2c 81 30 80 2a 81 2e 80 30 80 2a .+.-.,.0.*...0.*
[ 21.905448] 9aa00960: 80 30 81 2c 80 2e 81 2f 80 2d 81 30 80 2e 80 2d .0.,.../.-.0...-
[ 21.913481] 9aa00970: 80 30 80 2e 80 2f 80 2f 80 2f 80 2f 80 2f 80 2e .0.../././././..
[ 21.921514] 9aa00980: 80 30 7f 31 81 2e 7f 31 82 2f 80 2f 81 31 80 30 .0.1...1././.1.0
[ 21.929549] 9aa00990: 81 34 80 30 80 2f 81 34 80 30 81 2f 80 31 80 31 .4.0./.4.0./.1.1
[ 21.937588] 9aa009a0: 81 30 80 33 81 32 80 30 81 32 80 33 81 31 80 32 .0.3.2.0.2.3.1.2
[ 21.945597] 9aa009b0: 81 30 80 31 80 2d 80 31 80 34 80 2d 80 34 80 30 .0.1.-.1.4.-.4.0
[ 21.953631] 9aa009c0: 80 33 80 33 81 32 80 34 81 33 80 35 80 32 81 36 .3.3.2.4.3.5.2.6
[ 21.961667] 9aa009d0: 80 31 81 34 80 34 81 32 80 33 81 32 80 34 80 33 .1.4.4.2.3.2.4.3
[ 21.969701] 9aa009e0: 7f 34 80 32 7e 37 80 33 7f 33 80 37 80 35 80 34 .4.2~7.3.3.7.5.4
[ 21.977740] 9aa009f0: 80 36 80 36 80 36 80 35 80 38 80 38 80 38 7f 39 .6.6.6.5.8.8.8.9
[ 21.985746] 9aa00a00: 80 36 7f 39 80 38 7f 38 80 36 7f 38 80 39 7f 35 .6.9.8.8.6.8.9.5
[ 21.993781] 9aa00a10: 80 3a 7f 38 80 38 80 3a 81 3a 80 37 80 3a 81 35 .:.8.8.:.:.7.:.5
[ 22.001817] 9aa00a20: 82 37 80 3b 80 37 7f 3a 7e 3b 7e 32 7c 48 7e 2c .7.;.7.:~;~2|H~,
[ 22.009856] 9aa00a30: 7c 2f 82 5b 7d 82 86 72 7c 75 88 a0 7b ab 87 ac |/.[}..r|u..{...
[ 22.017900] 9aa00a40: 78 ab 86 aa 77 ab 85 aa 76 a8 85 ab 78 ac 85 ab x...w...v...x...
[ 22.025907] 9aa00a50: 78 a8 86 a8 78 ac 85 ac 78 ac 85 ac 79 a9 84 ae x...x...x...y...
[ 22.033942] 9aa00a60: 78 a9 83 a6 76 b0 7e af 76 9d 7a 7e 78 88 7a 36 x...v.~.v.z~x.z6
[ 22.041977] 9aa00a70: 7c 41 7c 64 80 59 7e 62 83 67 80 69 83 64 7f 6a |A|d.Y~b.g.i.d.j
[ 22.050013] 9aa00a80: 83 6c 7d 6c 83 6b 7c 6c 83 69 7b 6c 82 6c 7b 6c .l}l.k|l.i{l.l{l
[ 22.058050] 9aa00a90: 82 6a 7b 6d 82 6d 7d 71 81 70 7e 73 81 6e 7e 67 .j{m.m}q.p~s.n~g
[ 22.066057] 9aa00aa0: 80 72 7e 65 80 6d 7e 7a 81 7a 7e 78 83 7c 7f 6f .r~e.m~z.z~x.|.o
[ 22.074092] 9aa00ab0: 83 72 7f 76 83 75 80 73 81 74 80 78 81 74 7f 6d .r.v.u.s.t.x.t.m
[ 22.082128] 9aa00ac0: 81 77 80 79 80 74 80 76 7f 77 80 6f 7f 6d 80 73 .w.y.t.v.w.o.m.s
[ 22.090164] 9aa00ad0: 80 75 7f 78 81 7a 7f 7b 82 7c 7f 7b 81 78 7f 70 .u.x.z.{.|.{.x.p
[ 22.098199] 9aa00ae0: 81 71 7f 74 80 70 7f 73 80 74 7f 75 80 79 80 78 .q.t.p.s.t.u.y.x
[ 22.106206] 9aa00af0: 7e 78 80 75 7e 6d 81 76 7d 77 81 66 7d 74 80 72 ~x.u~m.v}w.f}t.r
[ 22.114239] 9aa00b00: 7d 66 80 72 7e 73 80 73 7f 72 80 74 80 72 80 77 }f.r~s.s.r.t.r.w
[ 22.122274] 9aa00b10: 81 74 81 71 81 75 81 72 81 73 81 71 80 73 81 72 .t.q.u.r.s.q.s.r
[ 22.130308] 9aa00b20: 7e 70 80 6f 7e 70 80 6a 7f 69 80 6e 81 74 80 71 ~p.o~p.j.i.n.t.q
[ 22.138342] 9aa00b30: 81 6b 80 72 80 6f 80 70 80 6e 80 6e 80 72 80 73 .k.r.o.p.n.n.r.s
[ 22.146348] 9aa00b40: 81 73 81 72 81 70 81 72 80 70 80 70 80 75 81 78 .s.r.p.r.p.p.u.x
[ 22.154381] 9aa00b50: 7e 78 81 79 80 6b 81 6e 7f 71 80 71 7e 6f 80 6d ~x.y.k.n.q.q~o.m
[ 22.162421] 9aa00b60: 7e 6a 81 6c 7e 71 81 75 7f 71 81 6d 80 6d 80 65 ~j.l~q.u.q.m.m.e
[ 22.170472] 9aa00b70: 80 70 80 6b 80 6d 80 6f 80 67 80 69 80 6d 80 71 .p.k.m.o.g.i.m.q
[ 22.178502] 9aa00b80: 7f 70 80 71 7f 6f 81 71 80 71 81 71 81 72 81 6b .p.q.o.q.q.q.r.k
[ 22.186509] 9aa00b90: 81 67 80 6b 81 6d 7e 6e 80 6d 7e 6c 80 6f 80 70 .g.k.m~n.m~l.o.p
[ 22.194561] 9aa00ba0: 80 71 82 6f 7f 71 81 6f 7e 73 81 70 7e 69 81 70 .q.o.q.o~s.p~i.p
[ 22.202583] 9aa00bb0: 7e 75 81 74 7f 6a 80 6f 80 6d 80 6f 80 6f 80 6d ~u.t.j.o.m.o.o.m
[ 22.210631] 9aa00bc0: 80 6e 80 6a 80 68 80 6e 80 6f 81 6f 81 6f 81 6f .n.j.h.n.o.o.o.o
[ 22.218655] 9aa00bd0: 81 70 81 68 7f 71 80 6f 7e 71 81 71 7e 6e 82 7d .p.h.q.o~q.q~n.}
[ 22.226662] 9aa00be0: 81 74 80 72 82 67 7f 5e 81 68 7f 6e 80 6b 80 6c .t.r.g.^.h.n.k.l

[ 22.236527] 9aa00bf0: 7e 6e 80 73 7e 6f 80 6d 7f 6e 80 6f 80 70 80 6b ~n.s~o.m.n.o.p.k
[ 22.244704] 9aa00c00: 7e 67 80 6b 7e 6a 81 6d 7e 71 81 68 7e 63 81 74 ~g.k~j.m~q.h~c.t

[ 22.255338] 9aa00c10: 7e 70 82 75 7f 7b 82 73 80 66 81 6c 7f 5d 80 6d ~p.u.{.s.f.l.].m
[ 22.263525] 9aa00c20: 7d 6e 81 6e 7e 6c 80 6e 7f 6e 80 6d 80 6d 80 6d }n.n~l.n.n.m.m.m
[ 22.271566] 9aa00c30: 80 6c 80 68 7f 6d 80 69 7e 6f 81 6c 7d 6d 82 6d .l.h.m.i~o.l}m.m
[ 22.279605] 9aa00c40: 7e 6e 82 6e 7d 74 83 74 7e 6e 83 6b 7e 69 82 6d ~n.n}t.t~n.k~i.m
[ 22.287641] 9aa00c50: 7e 6f 81 6c 7e 72 80 6d 7f 67 80 6d 81 68 80 6f ~o.l~r.m.g.m.h.o
[ 22.295664] 9aa00c60: 7f 63 80 64 7e 68 80 6b 7e 6c 81 6d 7e 6b 81 6d .c.d~h.k~l.m~k.m
[ 22.303686] 9aa00c70: 7e 6e 81 6d 7d 71 81 6a 7d 6b 81 78 7f 5f 81 6d ~n.m}q.j}k.x._.m
[ 22.311720] 9aa00c80: 7e 67 7e 70 7d 73 7f 7d 7e 7c 80 6d 7f 69 81 6e ~g~p}s.}~|.m.i.n
[ 22.319757] 9aa00c90: 80 6d 81 6e 81 71 80 74 81 74 80 74 82 71 80 6d .m.n.q.t.t.t.q.m
[ 22.327796] 9aa00ca0: 80 59 81 5f 7e 6c 82 72 7d 74 84 6e 7e 66 84 67 .Y._~l.r}t.n~f.g
[ 22.335816] 9aa00cb0: 80 6b 83 6d 80 6c 82 68 80 6b 81 72 7e 6f 80 55 .k.m.l.h.k.r~o.U
[ 22.343838] 9aa00cc0: 7e 6f 80 6a 80 6c 80 6d 81 6d 7f 80 82 81 7f 67 ~o.j.l.m.m.....g
[ 22.351876] 9aa00cd0: 82 6b 7f 6f 82 6b 7f 6c 82 6c 7f 6a 82 66 80 68 .k.o.k.l.l.j.f.h
[ 22.359910] 9aa00ce0: 82 67 80 71 81 6c 80 6b 81 6b 80 6e 80 69 7f 65 .g.q.l.k.k.n.i.e
[ 22.367945] 9aa00cf0: 80 65 80 5a 81 70 80 69 81 69 80 6c 81 6b 7f 6b .e.Z.p.i.i.l.k.k
[ 22.375966] 9aa00d00: 81 6b 7f 64 81 67 7e 66 82 68 7e 67 82 68 80 67 .k.d.g~f.h~g.h.g
[ 22.383995] 9aa00d10: 81 63 80 6a 81 68 80 65 81 64 80 65 81 64 80 63 .c.j.h.e.d.e.d.c
[ 22.392037] 9aa00d20: 80 62 80 60 7e 62 82 47 7a 4b 83 5f 77 77 85 6f .b.`~b.GzK._ww.o
[ 22.400073] 9aa00d30: 75 74 89 77 75 77 8e 5a 76 6d 91 7d 78 49 8e 99 ut.wuw.Zvm.}xI..
[ 22.408109] 9aa00d40: 7a cb 87 9d 7a 46 82 42 7b 68 80 69 7e 66 80 6a z...zF.B{h.i~f.j
[ 22.416128] 9aa00d50: 80 65 81 6c 81 6c 81 6e 81 6f 81 6f 80 6d 80 6f .e.l.l.n.o.o.m.o
[ 22.424148] 9aa00d60: 7f 6f 80 6e 7e 71 80 70 7e 74 80 75 80 7b 80 77 .o.n~q.p~t.u.{.w
[ 22.432188] 9aa00d70: 81 79 81 7a 80 7a 81 7a 80 7a 81 7b 80 7b 81 7b .y.z.z.z.z.{.{.{
[ 22.440224] 9aa00d80: 80 7b 81 7b 80 7b 81 7b 80 79 81 7b 80 7c 80 7b .{.{.{.{.y.{.|.{
[ 22.448259] 9aa00d90: 80 7f 80 79 80 7d 80 7b 80 7d 81 7b 7e 7c 81 7d ...y.}.{.}.{~|.}
[ 22.456280] 9aa00da0: 7e 7d 80 7f 7e 80 80 7d 80 82 80 80 80 7c 80 81 ~}..~..}.....|..
[ 22.464299] 9aa00db0: 7e 7e 81 7f 7e 7e 82 7f 7d 80 82 7f 7c 7e 83 79 ~~..~~..}...|~.y
[ 22.472340] 9aa00dc0: 7e 78 80 72 80 6c 81 66 80 70 82 6b 7f 61 82 53 ~x.r.l.f.p.k.a.S
[ 22.480376] 9aa00dd0: 7e 40 82 38 7c 24 82 26 7a 23 82 25 7a 23 83 30 ~@.8|$.&z#.%z#.0
[ 22.488410] 9aa00de0: 7c 34 83 37 7f 36 81 3a 81 3b 80 38 81 3e 81 40 |4.7.6.:.;.8.>.@
[ 22.496430] 9aa00df0: 80 3d 80 44 7e 48 80 45 7e 49 80 46 7f 48 80 48 .=.D~H.E~I.F.H.H
[ 22.504449] 9aa00e00: 80 4c 81 48 80 46 81 48 80 49 81 48 80 4a 81 4a .L.H.F.H.I.H.J.J
[ 22.512484] 9aa00e10: 80 48 80 4d 81 49 80 49 81 44 80 48 81 4a 80 4a .H.M.I.I.D.H.J.J
[ 22.520517] 9aa00e20: 80 45 80 49 80 49 80 47 80 49 80 47 80 49 80 4a .E.I.I.G.I.G.I.J
[ 22.528550] 9aa00e30: 80 45 80 49 80 4a 80 48 80 4d 80 49 80 4a 80 4d .E.I.J.H.M.I.J.M
[ 22.536571] 9aa00e40: 81 4a 80 48 81 49 80 48 81 4b 81 4f 81 3d 82 36 .J.H.I.H.K.O.=.6
[ 22.544590] 9aa00e50: 80 24 82 3d 80 73 81 8b 7e 95 82 97 7e 91 84 91 .$.=.s..~...~...
[ 22.552632] 9aa00e60: 7e 90 85 8b 7c 77 85 77 7a aa 85 b7 79 be 84 b5 ~...|w.wz...y...
[ 22.560667] 9aa00e70: 79 a9 83 b9 7a b9 83 a5 7c 89 83 88 7d 95 83 90 y...z...|...}...
[ 22.568703] 9aa00e80: 7e 90 83 91 7e 94 84 90 7d 92 84 93 7d 93 83 91 ~...~...}...}...
[ 22.576724] 9aa00e90: 7d 97 82 8f 7d 7c 82 7b 7c 9a 83 b5 7a bf 84 c7 }...}|.{|...z...
[ 22.584747] 9aa00ea0: 78 bb 85 b7 76 a4 87 9e 76 9f 88 bc 75 b7 87 b5 x...v...v...u...
[ 22.592787] 9aa00eb0: 75 c4 86 c0 76 be 85 a8 76 b5 85 bd 76 bd 86 ba u...v...v...v...
[ 22.600821] 9aa00ec0: 76 a9 87 ae 76 b5 88 b5 77 b2 88 b6 76 b2 88 b3 v...v...w...v...
[ 22.608855] 9aa00ed0: 76 b7 88 ae 75 ac 87 b6 75 af 86 b6 76 b8 85 b2 v...u...u...v...
[ 22.616876] 9aa00ee0: 76 b8 86 ba 76 b5 86 b3 77 b2 86 b0 78 b4 86 af v...v...w...x...
[ 22.624897] 9aa00ef0: 78 b0 87 ad 76 a9 88 b0 74 ac 88 ad 74 b3 87 b0 x...v...t...t...
[ 22.632936] 9aa00f00: 75 b6 86 b8 76 b8 86 b5 76 af 86 a9 77 ac 85 ac u...v...v...w...
[ 22.640970] 9aa00f10: 78 af 85 b0 78 aa 86 ad 76 af 86 aa 75 ac 85 a0 x...x...v...u...
[ 22.649005] 9aa00f20: 78 ab 87 aa 79 ac 87 b0 78 aa 87 a9 78 a6 87 a5 x...y...x...x...
[ 22.657025] 9aa00f30: 78 ac 87 aa 78 a5 87 a2 78 a5 86 aa 76 ac 85 ad x...x...x...v...
[ 22.665045] 9aa00f40: 77 ab 85 ad 78 b0 85 af 7a b0 85 aa 7a aa 85 a1 w...x...z...z...
[ 22.673084] 9aa00f50: 7a ab 85 ab 78 a8 86 b6 78 b0 85 ad 78 aa 85 9f z...x...x...x...
[ 22.681119] 9aa00f60: 78 a9 85 a8 77 a8 85 a8 76 a4 85 a2 75 a4 86 a8 x...w...v...u...
[ 22.689153] 9aa00f70: 75 ab 86 a9 76 a4 87 ad 78 b2 85 af 78 b4 85 ae u...v...x...x...
[ 22.697188] 9aa00f80: 78 ad 84 a9 77 a2 84 9c 76 9e 84 a9 76 a7 85 b2 x...w...v...v...
[ 22.705194] 9aa00f90: 76 ab 85 ae 78 ad 85 b1 78 b1 83 af 79 b2 82 ab v...x...x...y...
[ 22.713226] 9aa00fa0: 79 a4 81 a8 79 a8 82 aa 79 ae 84 b0 79 b2 84 ac y...y...y...y...
[ 22.721265] 9aa00fb0: 79 a6 84 a1 79 ab 84 a5 78 af 84 b1 78 b3 84 b1 y...y...x...x...
[ 22.729303] 9aa00fc0: 78 ac 83 ae 77 ac 85 ad 76 ac 87 a9 74 a9 87 a7 x...w...v...t...
[ 22.737340] 9aa00fd0: 74 a0 86 9c 74 a3 85 a5 74 a9 86 a7 74 a8 86 ad t...t...t...t...
[ 22.745346] 9aa00fe0: 76 a8 86 a7 75 a8 85 a0 75 a8 85 ae 75 ab 85 ae v...u...u...u...
[ 22.753383] 9aa00ff0: 76 ad 85 a7 77 97 84 9b 78 9e 83 a5 79 ac 83 ad v...w...x...y...
[ 22.761422] CPU: 0 PID: 312 Comm: bvapp Not tainted 3.14.52AVM3D-CORE-AHD-720p25 V0.04+gdb1bcba #210
[ 22.770626] [<80015764>] (unwind_backtrace) from [<80011b08>] (show_stack+0x10/0x14)
[ 22.778407] [<80011b08>] (show_stack) from [<80529e9c>] (dump_stack+0x8c/0xc4)
[ 22.785645] [<80529e9c>] (dump_stack) from [<800bd0d4>] (kernel_map_pages+0x268/0x27c)
[ 22.793608] [<800bd0d4>] (kernel_map_pages) from [<8008d7b0>] (get_page_from_freelist+0x430/0x77c)
[ 22.802612] [<8008d7b0>] (get_page_from_freelist) from [<8008de2c>] (__alloc_pages_nodemask+0x138/0x980)
[ 22.812147] [<8008de2c>] (__alloc_pages_nodemask) from [<800910f4>] (__do_page_cache_readahead+0x104/0x248)
[ 22.821913] [<800910f4>] (__do_page_cache_readahead) from [<80087cc4>] (generic_file_aio_read+0x5c4/0x6f4)
[ 22.831610] [<80087cc4>] (generic_file_aio_read) from [<800c62a0>] (do_sync_read+0x80/0xa8)
[ 22.840001] [<800c62a0>] (do_sync_read) from [<800c695c>] (vfs_read+0x94/0x13c)
[ 22.847348] [<800c695c>] (vfs_read) from [<800c6ff4>] (SyS_read+0x44/0x9c)
[ 22.854250] [<800c6ff4>] (SyS_read) from [<8000e3a0>] (ret_fast_syscall+0x0/0x38)

我用的系统版本是L3.14.52,系统内存DDR3-512MB。

你好!我们现在项目也遇到图像割裂这种问题,请问您是怎么解决的呢?谢谢!

G2D方式是用单BUFFER的形式完成的,可能显示的时候同时往BUFFER里写数据,引起了这个现象,更改为双buffer后没有这个问题

image001(04-01-16-57-28).jpgQiang_FSL

Hi Qiang Li,

       我这边调试的时候遇到一个新问题,在preview+encoder264两路720P30CAM的时候,画面会不稳定,画面偶尔会撕裂和闪烁一下。

       测试环境:方案跟本帖的一致,CAM分别接TP2854的VIN1和VIN2,分别对应I.MX6q的IPU0的两个通道或者两个IPU的第一个通道。软件方面用了gstreamer和直接用IMX的库都有这个现象存在。   

       问题现象: 两个通道都会有闪烁撕裂的现象,两个通道出现这种不良的时机是彼此独立的,并非同时出现。我这边还尝试过将两路视频分别分配到IMX6q的两个IPU,闪烁的次数有减少,但是还是没法彻底杜绝。请问可能是什么问题导致的?

屏幕上的撕裂一般都是因为render的时候没有用多buffer模式,mxc_v4l2_tvin参考代码都是直接画到当前frambuffer里面去的,要避免撕裂,需要用PAN display方式操作,4个camera render到当前不显示的framebuffer里面,全部画完后,调用PAN DISPLAY显示出去。

我2ch4lanes模式的时候(配置TP2854端),两路视频即使是同个IPU端处理,也不会有撕裂的问题。用4ch4lanes的配置的时候,在preview四路720P30摄像头的时候,只要开了一路编码(对其中一路摄像头进行录像),都会出现撕裂的问题;因为录像文件在电脑上播放也能看到撕裂,所以问题的源头会不会就是IPU处理那一块有不当的地方?

我参考iMX6DQ MAX9286 MIPI CSI2 720P camera surround view solution for Linux BSP这个帖有提到说变更CSI->MEM的优先级ipu_idmac_write(ipu,0x1880000FL,IDMA_CHA_PRI(0)),尝试之后发现并没什么效果。

出现撕裂的时候在终端也没看到相关warning信息提示。

我联系过techpoint的技术支持,他们的说法是应用层对接的问题,但具体原因还得我们这边自己去排查,但我现在没有其他头绪了,请问有哪些地方我还能去尝试优化的吗?

Hi mark lee ,

I had added a preview+record reference application, you can try it.

你们的tp2854评估板是在那边购买的?

Hi yq ya

Please contact with Techpoint for the TP2854.

Is there an .sdcard image I can download to test this board with TP2854? Or a bitbake recipe that do so?

Dear Qiang,

   我按照你提供的步骤打上了这个patch,现在遇到一个问题

   Our combination is imx6qpsabreauto + TP2854

  Below is the test application running result

  Can give us some advise or clue ?

/home/root/mxc/mxc_v4l2_tvin.out -ol 0 -ot 0 -ow 960 -oh 540 -d 1 -x 0 -g2d &

root@imx6qpsabreauto:~/mxc# tp2854_mipi: sensor number = 4.
mxc_mipi_csi2 21dc000.mipi_csi: mipi_csi2_reset: mipi_lane_bps = 594 Mbps
mxc_mipi_csi2 21dc000.mipi_csi: mipi_csi2_reset: value = 0x2e.
mipi csi2 can not receive sensor clk! MIPI_CSI_PHY_STATE = 0x200.
ERROR: unrecognized std! 0 (PAL=ff, NTSC=b000
g_in_width = 1280, g_in_height = 720.
fb_fix.id = DISP3 FG.
fb: smem_start = 0x73400000, smem_len = 0xbdd800.
fb: frame buffer size = 0x3f4800 bytes.
fb: g_screen_info.xres = 1920, g_screen_info.yres = 1080.
fb: g_display_left = 0.
fb: g_display_top = 0.
fb: g_display_width = 960.
fb: g_display_height = 540.
start time = 1571631167 s, 438405 us
ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
VIDIOC_DQBUF failed.

"mipi csi2 can not receive sensor clk! MIPI_CSI_PHY_STATE = 0x200" this means MIPI signal can't be identified. The 594Mbps setting is based on 297MHz MIPI clock frequency for 4x 1280*720@30fps cameras.

"mxc_v4l_dqueue timeout " this means there is no valid frame received.

Dear Qiang

 我们的板单个摄像头运行时,4个象限能分别显示摄像头图像

camera : TVI 1280x720 (colorful)

/home/root/mxc/mxc_v4l2_tvin.out -ol 0 -ot 0 -ow 960 -oh 540 -d 1 -x 0 -g2d &
/home/root/mxc/mxc_v4l2_tvin.out -ol 960 -ot 0 -ow 960 -oh 540 -d 1 -x 1 -g2d &
/home/root/mxc/mxc_v4l2_tvin.out -ol 0 -ot 540 -ow 960 -oh 540 -d 1 -x 2 -g2d &
/home/root/mxc/mxc_v4l2_tvin.out -ol 960 -ot 540 -ow 960 -oh 540 -d 1 -x 3 -g2d &

but HDMI display color is B/W(black and white), and size is not full of the whole HDMI display.

Can give us some advise or clue ?

Does TP2854 set not correctly right or  imx6qpsabreauto evaluation board need to modify something else ?

S__69582850.jpg

That means there are CVBS signal issue, I think you should check the camera to TP2854 connections.

Hi HUNG JUI HONG.

I am having a iMX6qp sabreauto board and TP2854 board. I am trying to add those patch files to linux bsp 4.14.98 but not success.

HDMI displays the green and white. and the sceens splits to four parts when I only read a camera

How did you fix those patch files for iMX6qp sabreauto?

Please help me to fix it.

snapshot-10.jpg

I too have issues with tearing and what looks to be random sync loss with the TP2854 when using 720p30 camera inputs.   While Inputs 0 & 2 seem mostly fine, Inputs 1 & 3 are very effected.   There are no kernel messages, nor do there seem to be issues with CPU load.

I have attempted to use both the I.MX6Q and I.MX6QP, but both are effected the same.   This seemed odd given the graphics enhancements of the QP.

I have implemented the priority change suggested above with no improvement and have contacted TechPoint.   While they have been very helpful on settings for different camera configurations, they have suggested that this problem is likely to do with IPU configuration.

I am interested to know if there are any additional suggestions for correcting this random loss of sync..

Thank you in advance for your help!!

Maybe you can dump the MIPI CSI2 error registers (MIPI_CSI_ERR1 and MIPI_CSI_ERR2) to check if there are errors on MIPI interface.

If there is error in IPU CSI side, kernel will print error log, such as "IPU_STAT: .........".

Dear Qiang,

I'm putting tp2854 on imx8mm, but imx8mm doesn't have a virtual channel.
I am writing driver for tp2854 based on ov5645_mipi_v2 for kernel 4.14.98. Because imx8mm does not have a virtual channel, I will write an additional module to read the raw data from tp2854 and then divide it into driver nodes. Is this possible? and the response time is slower than using imx6?

Thank you

Thank you for your quick reply.

I have confirmed that neither MIPI_CSI_ERR1 nor MIPI_CSI_ERR2 contain any there are no Kernel Messages to the console nor through DMESG.

Just to confirm, I have implemented the patches provided against kernel version 4.1.15 and have 4 virtual channels split between the 2 IPU's.   The First Channel on each IPU has nearly perfect video (very occasional tearing), but the Second Channel on each IPU has severe tearing / sync loss.

Please let me know if there are other suggestions..

I believe I may have found a contributor to the issue.

By adjusting the IPU QOS (GPR6 & 7), I am able to remove the tearing, screen jitter, and loss of sync.

It is strange that I was not seeing Kernel IPU Warnings, but by through experimentation I found that increasing the ID00 Write QOS, I was able to remove these artifacts.   My prior settings were 0x22772222 for both GPR6 & 7, but I found I needed to change it to 0x22772227 to get repeatedly good results.

I do have a question now:   How can I properly determine what functions AXI ID00 through AXI ID11 (I feel this is ID0 - 3, but is documented as 00 - 11) support to make sure my settings are correct and do not effect other functions?  

Also, I have read that the mmdc tool can help me to validate my settings, but I must be doing it wrong because when I run this tool with different settings, I am not seeing any change in the results.

Again, thank you in advance for your support!!

Another thing can be tried is in file ipu_common.c, the default code hasn't set all CSI->MEM channel to high priority.:

/* Set sync refresh channels and CSI->mem channel as high priority */
-ipu_idmac_write(ipu, 0x18800003L, IDMAC_CHA_PRI(0));

+ipu_idmac_write(ipu, 0x1880000FL, IDMAC_CHA_PRI(0));

For iMX8MM, all virtual channel's data will be forwarded to internal CSI port, but they should use the same MIPI CSI2 Data Type. Using software to split the cameras, I think the performance will be poor.

这个max9286的驱动是否支持linux4.1.15,现在这个加载进去有问题。

Version history
Last update:
‎12-10-2017 10:57 PM
Updated by: