Patch to support adv7180 TVin chip for Freescale Android R10.4 BSP on iMX53 -blog archive

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Patch to support adv7180 TVin chip for Freescale Android R10.4 BSP on iMX53 -blog archive

ソリューションへジャンプ
39,174件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee

    Freescale Android BSP doesn't support TVin chips, this patch enabled the adv7180 chip for Android.

    The followed functions are supported:

    1) Android camera application can preview the tvin.
    2) De-interlace was supported in Android overlay.
    3) VDI split mode was support to preview TVin on high resolution display.
    4) Support auto-detect PAL and NTSC mode.

 

Some limitation for the patch:

-- The android camera applition doesn't support PAL/NTSC switch on the fly.
   (After switched the input signal, stop camera application and re-start it; unit test
    application "mxc_v4l2_tvin" supports the on the fly switch.)

-- For VDI split mode, only high motion was supported. When output preview
   Resolution is high than 968*1024, only high motion (-m 2) can be used.

-- Android camera applition video recording was not supported.

 

For more information, please reference to the readme file.

 

ラベル(3)
タグ(1)
1 解決策
26,890件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee

It can support both 16bits and 8bits CSI, for 16bits CSI, it was verified with adv7842 (BT1120 mode, the 16bits CSI data lines should be CSI_D_19 ~ CSI_D_12, CSI_D9 ~ CSI_D_2).

But I can't release the adv7842 driver code, because it was implemented by another customer.

元の投稿で解決策を見る

0 件の賞賛
返信
51 返答(返信)
1,350件の閲覧回数
jesselin
Contributor I

HI Qiang Li ,

  Thank you very much , I will give it a try . Thanks.

Jesse

0 件の賞賛
返信
1,350件の閲覧回数
GaoJianzhong
Contributor IV

Hi , I want to enable the adv7180 16bit mode, my board is imx53 AI.

Could you give me some ideas about this?

Thank you very much.

0 件の賞賛
返信
1,350件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee

The IMX53 AI hardware only supports 8bits CSI input from adv7180. For 16 bits CSI input, you should make sure the hardware link is correct and make adv7180 output 16bits YUV data correctly. Then the unit test application mxc_v4l2_tvin.zip can work directly.

0 件の賞賛
返信
1,350件の閲覧回数
GaoJianzhong
Contributor IV

Hi, Li Qiang

I have let the adv7180 to output 16bit (13.5MHz) data.

But I don’t know how to modify the BSP to receive 16bit data.

Can you give me some ideas about this?

The IMX53 AI Hardware seems support 16bit, but the bsp only supports the 8bit.

I modified the mxc_v4l2_capture.c file

Set

csi_param.data_width = IPU_CSI_DATA_WIDTH_16, but it is not work,

Is there other places to modify?

Thank you!

0 件の賞賛
返信
1,350件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee

If your 16bits data output from adv7180 is BT1120 format (on 16 bits data bus, the 8 MSB is always the Y and SAV/EAV, the 8 LSB is U,V,U,V ......), then you don't need modify the mxc_v4l2_capture.c, in adv7180 driver, function ioctl_g_ifparm(), you should return the followed parameters:

    p->if_type = V4L2_IF_TYPE_BT1120;

    p->u.bt1120.mode = V4L2_IF_TYPE_BT1120_MODE_BT_8BIT;

    p->u.bt1120.nobt_hs_inv = 0;

    p->u.bt1120.nobt_vs_inv = 0;

    p->u.bt1120.latch_clk_inv = 0;

    p->u.bt1120.clock_curr = 0;

    p->u.bt1120.bt_sync_correct = 0;

For V4L2_IF_TYPE_BT1120_MODE_BT_8BIT, that means each Y,U,V data is 8bits, so the IPU_CSI_DATA_WIDTH is till set to 8, not 16.

And for BT1120 16bits mode, in function adv7180_probe(), adv7180_data.pix.pixelformat should be changed from V4L2_PIX_FMT_UYVY to V4L2_PIX_FMT_YUYV.

No code modification was needed in mxc_v4l2_capture.c, my patch had already tuned that file well to support 8bits BT565 and 16bits BT1120.

1,350件の閲覧回数
GaoJianzhong
Contributor IV

Hi Li Qiang,

Thank you very much for your help!

When I compile the modified source code, I found that there is no “V4L2_IF_TYPE_BT1120“ and “bt1120” data struct in my kernel source.

My kernel is linux-2.6.35.3. Do you mean I must creat it by myself?

And, In mxc_v4l2_capture.c, there is no process of bt1120(only bt656), is that OK?

Thanks again.

0 件の賞賛
返信
1,350件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee

The default BSP doesn't support BT1120 16 bits mode, in my patch file "TVin_Patches_for_R10.4.zip", there is a kernel patch "tvin_kernel_imx.patch" added the BT1120 16bits support for mxc_v4l2_capture, please reference to it for your BSP.

0 件の賞賛
返信
1,350件の閲覧回数
GaoJianzhong
Contributor IV

Hi Li Qiang,

I reference the tvin_kernel_imx.patch and modify my kernel.

Below are my changed poits:

1. And bt1120 data struct to kernel/include/media/v4l2-init-device.h (I think this is no problem)

2. Modify the kernel/drivers/media/video/mxc/capture/mxc_v4l2_capture.c

3. Modify the kernel/drivers/mxc/ipu3/ipu_capture.c

4. Modify the kernel/driver/media/video/mxc/capture/adv7180.c (In this file, I want to let adv7180 to output 16bit data with define the ADV7180_16BIT macro)

#if 0

// This is the BSP original source code

#else

//This is modified source code

#endif

But, the mxc_v4l2_tvin is still not work now, error is

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

VIDIOC_DQBUF failed.

I attached the source codes I modified, could you please check it,

And tell me what should I do.

Thank you very much!

Best regards

0 件の賞賛
返信
1,350件の閲覧回数
GaoJianzhong
Contributor IV

Thank you!

I will try it.

0 件の賞賛
返信
1,350件の閲覧回数
JackyHuang
Contributor III

Li, I have used your patch, 

It's very good, mx53 have a great improvement in deinterlace 

Thank you, you have solved a big issue

0 件の賞賛
返信