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

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

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

Jump to solution
39,175 Views
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.

 

Labels (3)
Tags (1)
1 Solution
26,891 Views
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.

View solution in original post

0 Kudos
Reply
51 Replies
3,601 Views
dilip
Contributor II

Hi Li Qiang,

As per you blog, the patches will enable de-interlacing in Android ("De-interlace was supported in Android overlay"). Is there a way to support de-interlacing  in i.MX53 Linux so that we will be able to use mxc_v4l2_overlay.out to display live camera stream( Analog camera attached to ADV7180). Right now, following is the camera rendering behavior.

mxc_v4l2_tvin.out - > Works fine

mxc_v4l2_overlay.out -> Same screen is duplicated. Looks like odd and even fields are displayed separately.

Thanks,

Dilip

0 Kudos
Reply
3,601 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

In mxc_v4l2_tvin, there are followed code to tell IPU driver the interlaced field information and de-interlace motion type, but in mxc_v4l2_overlay, there is no such code, so IPU will not use de-interlace for it.

  if (g_tb)
   fmt.fmt.pix.field = V4L2_FIELD_INTERLACED_TB;
  else
   fmt.fmt.pix.field = V4L2_FIELD_INTERLACED_BT;

  ctrl.id = V4L2_CID_PRIVATE_BASE + 3;
         ctrl.value = g_motion;
         if (ioctl(fd_output_v4l, VIDIOC_S_CTRL, &ctrl) < 0)

3,602 Views
dilip
Contributor II

Hi Li Qiang,

Thanks for the reply. I tried to add the interlacing set up in mxc_v4l2_overlay.c as below, but it doesn't work

fmt.type = V4L2_BUF_TYPE_VIDEO_OVERLAY;

fmt.fmt.win.w.top=  g_display_top ;

fmt.fmt.win.w.left= g_display_left;

fmt.fmt.win.w.width=g_display_width;

fmt.fmt.win.w.height=g_display_height;

fmt.fmt.pix.field = V4L2_FIELD_INTERLACED_BT;

I tried the patches you have uploaded with android build and the Android camera app is able to show the live camera feed properly. So, can you please calify my following queries?

1. What is the difference between android camera app doing  preview on overlay plane vs mxc_v4l2_overlay.out? Does android framework does software deinterlacing?

2. Is there any technical limitation to do deinterlacing when doing direct preview and output to SDC foreground overlay plane which mxc_v4l2_overlay.out does?

thanks,

Dilip

0 Kudos
Reply
3,602 Views
sanjeevsharma
Contributor IV

Hi All,

I would like to support this functionality on Imx6Q on Android where Adv7180 is connected via CSI0.would these change will be applicable to imx6 Q too ?


0 Kudos
Reply
3,602 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

It can't be used in iMX6 BSP, because iMX6 Android BSP hasn't use the IPU overlay, it used GPU.

0 Kudos
Reply
3,602 Views
sanjeevsharma
Contributor IV

Thanks Qiang but AFAIK Free-scale added support of TV-in in ICS branch too and attaching patch for your reference(Please review) and i can found change in libcamera directory too where I can leverage this functionality and libcamera2 is introduced in Jellybeans and right now I don't have plan to move to jelly beans however want to add support of adv7180 in ICS only.

Let me know your suggestion/comment.

0 Kudos
Reply
3,602 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

iMX6 BSP is different with iMX53 Android BSP, it doesn't used IPU lib, it doesn't used overlay lib, so you should not reference to this patch for iMX6 TVin support. This iMX53 patch is based on IPU lib and overlayer.

0 Kudos
Reply
3,602 Views
sanjeevsharma
Contributor IV

Thanks for your comment but the patch I attached in my last comment is from jb4.2.2_1.0.0-ga release which is Android release and i am not talking here imx53 patch.So would like to know your suggestion regarding the change which provide Tv-In support on Android framework.For Kernel support of adv7180 I will refer i.MX 6Quad BSP L3.0.35_4.0.0 GA release candidate.I have sabre-auto board with adv7180 chip on it so need to add this support in Android ICS version I have been using.

0 Kudos
Reply
3,613 Views
vincent_rtk
Contributor II

Hi

The attached files cannot be download. it shows:

Not Found

The item does not exist. It may have been deleted.

Could you put them back, I have some problem in running mxc_v4l2_tvin on BSP10.4

Thanks.

0 Kudos
Reply
3,613 Views
admin
Specialist II

Vincent, I'm going to look into what happened to the attached files during our move from the old site.  If I can recover them, I will post them.

Regards,

Grant

0 Kudos
Reply
3,613 Views
admin
Specialist II

Files attached.

0 Kudos
Reply
3,613 Views
stevetsai
Contributor III

Hi,

It support 16 bits CSI or 8 bits CSI? Thanks. I am looking for 16 bits CSI driver.

0 Kudos
Reply
26,892 Views
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 Kudos
Reply
3,613 Views
jesselin
Contributor I

Hi Li Qiang,

   i using imx6-dl , would like to support ADV7180 in 16bits BT1120 , the hardware connect is CSI_D_19 ~ CSI_D_4. Is it okay for 16bits supporting?


Jesse

0 Kudos
Reply
3,613 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi Jesse, your hardware connection is wrong, for BT1120, you should use CSI_D_19 ~ CSI_D_12 and CSI_D_9 ~ CSI_D_2. The iMX6 BT1120 patch can be found at the link: https://community.freescale.com/thread/314211


0 Kudos
Reply
3,613 Views
jesselin
Contributor I

Hi Li Qiang,

  please see attached file , is there any chance software modified to support "YCbCr6" . if yes ,could you kindly give me some hint?


Jesse

0 Kudos
Reply
3,613 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

If your sensor can output 16bits YCbCr data with VSYNC and HSYNC mode (not the BT1120 mode), you can use CSI_D_19 ~ CSI_D_4. In this mode, the CSI capture is 16bits generic data mode, the patch can be found at link: https://community.freescale.com/docs/DOC-97981.

0 Kudos
Reply
3,608 Views
bret
Contributor I

Hi Li Qiang:

I and jesse are a team.

I try the patch - https://community.freescale.com/docs/DOC-97981.

and I change setting:

drivers/media/video/mxc/capture/mxc_v4l2_capture.c

csi_param.clk_mode = IPU_CSI_CLK_MODE_GATED_CLK;

csi_param.data_width = IPU_CSI_DATA_WIDTH_16;

drivers/media/video/mxc/capture/adv7180.c

adv7180_data.sen.pix.pixelformat = V4L2_PIX_FMT_SGRBG8;

But the preview image is not normal. Is there other places should be modified?

Beat Regard

Bret

20141127_194315.jpg

0 Kudos
Reply
3,602 Views
huang_dexiang
Contributor II

Hi Liu,

We got the same problems as yours'. Have you fixed your problem ?

0 Kudos
Reply
3,602 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

For RGB565 input, it was not supported in Android camera HAL, you need reference to this patch and added the support in HAL, this patch had given the example to add UYVY support.

0 Kudos
Reply
3,602 Views
huang_dexiang
Contributor II

Hi Li Qiang,

In fact we do not use Android in our application.

In our application, we  use RGB565 input to MX6Q CSI, The output of RGB565 signals come from MX51.

We want to preview the image on the MX6Q LVDS.

I modified the code as the thread "How to Support RGB565 Gated Mode Input to i.MX6 CSI"

and used overlay example in the imx-test pacages to test.

But we ound that the preview image is not normal. Its really greenish preview image  and there are 4 frames not 1 frame. (and rolling)

It look like the image that bret post in this thread.


Can you give me some tips to fix this problem?

20150417_095145.jpg

0 Kudos
Reply