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,170 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,886 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
21,939 Views
liyihong
Contributor I

@ Qiang Li - Mpu Se is any new patches  for  imx6Q with  adv7180 tvin ,we have  found  that image  quality  is better when  we use  the mxc-v4l2-tvin to display the camera full screen (1280 *720)  than use  libcamera2  . I found  that  the tvin program VIDIOC_S_FMT  set  the fmt  UYVY  and libcamera2  set  NV12,  is  that  make it different? thanks.

0 Kudos
Reply
21,939 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Default camera HAL doesn’t support VDI, you can search “Android VDI” in community, there is also some patches for iMX6 by someone else.

Best Regards

发件人: liyihong

发送时间: 2018年3月23日 14:32

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

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

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%7Ca91cf449804b4099df7908d59087bbe9%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636573835010458153&sdata=F1%2FQHjNK5OCc4TdhfVgyKZ1SVDtvM7ZRDrQ8WWfvZRY%3D&reserved=0>

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

reply from li yihong<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.nxp.com%2Fpeople%2Fliyihong%3Fet%3Dwatches.email.thread&data=02%7C01%7Cqiang.li%40nxp.com%7Ca91cf449804b4099df7908d59087bbe9%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636573835010458153&sdata=aOeIbdUj1neInpJUsol2bWCXi0jUdptblZmDy1Q168Y%3D&reserved=0> in i.MX Community - View the full discussion<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.nxp.com%2Fmessage%2F998739%3FcommentID%3D998739%26et%3Dwatches.email.thread%23comment-998739&data=02%7C01%7Cqiang.li%40nxp.com%7Ca91cf449804b4099df7908d59087bbe9%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636573835010458153&sdata=qjywudUu1KsZC7GhW6y5ZfZrNJz%2B6qMDpE8XkKUQs4A%3D&reserved=0>

0 Kudos
Reply
21,939 Views
liyihong
Contributor I

thank you for your reply , I have try all the patches in the community ,but the image quality is not good (the client is not satisfied) , maybe the libcamera2  hal is not good for vdi ,I find another method like this Android GStreamer Audio Video Playback Optimization | RidgeRun  ,some one is porting GStreamer into android to improve the image quality (use GPU for VDI ?) ,I have try to build gstreamer following the link ,but I can not run the program successfully. Does NXP porting this to android ? how can I run it successfully?

0 Kudos
Reply
21,939 Views
liyihong
Contributor I

is  any patches  for  i.mx6 ?  we  use  i.mx6  

0 Kudos
Reply
21,939 Views
wilsonchen
Contributor III

hi,qiang

i use the imx6 board ,now i can use the adv7180 ,it's suceed. now i want to use the second tv in chip , and i want to use the adv7280-m, it will use the mipi cs-2.

i found the adv7280 driver in drivers/media/video/mxc/capture/adv7280_mipi_tvin.c .

but i found the adv7280_mipi_tvin.c not complete.it only have the init code,but not have the v4l2 and mipi code.

the adv7280 was used in the sabreauto board ,so i think FSL must have the adv7280 driver ,and the driver is the complete one (have the v4l2 and mipi control code).

Can you share  the driver code?

thanks

0 Kudos
Reply
21,939 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi wilson, Freesale doesn't have verified work adv7280 mipi driver, the adv7280_mipi_tvin.c is just a unfinishnd pre-code driver, finally we don't have the hardware to implement the driver.

For MIPI TVin and  mutil camera support on iMX6 BSP, you can reference to this link:

iMX6DQ ISL79985 MIPI CSI2 CVBS camera surround view solution for Linux BSP

0 Kudos
Reply
21,939 Views
wilsonchen
Contributor III

hi qiang,

we use adv7280 in android4.4.2 , adv7180 is ok.

the ISL79985 can't buy. this chip are not sold. No supply.

and it is used in linux OS.

FSL have the plan to test the adv7280-m?

珠海鼎芯科技有限公司

姓名:陈德东

电话:13750082857

QQ: 365492116

邮箱:wilson.chen@d-chip.com

公司网址:www.d-chip.com

公司地址:珠海市唐家湾镇哈工大(经济港)研发楼2层B203

0 Kudos
Reply
21,939 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi Wilson, I mean you can reference to that code to implement your own adv7280 mipi TVin driver.

0 Kudos
Reply
21,939 Views
isaacnickaein
Contributor III

I need to capture a video in BT1120 Interlaced 1920x1080 format on CSI parallel input of i.MX6 running linux kernel 3.10 BSP.

Can I apply this patch (with possibly minor modifications) to kernel 3.10?

0 Kudos
Reply
21,939 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

The porting should be easy, because the IPU CSI side setting is same for iMX5 and iMX6.

0 Kudos
Reply
21,939 Views
鑫王
Contributor I

hi  Qiang Li :

     thanks for you patch.

     As you said " De-interlace was supported in Android overlay".But when I use MediaRecorder in Android API to record video,it seems that the De-interlace function isn't turned on yet.From the video I recorded I can see interlaced image.

     In the UART debug,I can see the VIDIOC_S_FMT and VIDIOC_S_CTRL functions which are called in mxc_v4l2_tvin.c haven't been called from Android layer.

     Can you explain how should I use Android overlay to get the de-interlaced video??

     Expect for your answers.

0 Kudos
Reply
21,939 Views
dennydu
Contributor I

Hi,Qiang

Thanks for your patch, it is very useful for me.

And,do you make the Video-Recording successfully ?

YanTCK

2014/01/24 China

0 Kudos
Reply
21,939 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

As I mentioned in limitation, video record hasn't been supported.

0 Kudos
Reply
21,939 Views
dennydu
Contributor I

Hi,Qiang

I used a tvp5150 as a TV-IN device.

Both the preview and the TakePicture is OK(720X576).

When I switch to recording,the preview is OK,and it creates an mp4 file successfully which is attached.but the mp4 file seems abnormal.


Could you give me some suggestion ?


Thank you!


YanTCK

2014/01/24 China



0 Kudos
Reply
21,939 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

I think the record issue should be caused by UYVY format surface used in Android for this patch, the VPU enconder need YUV420 format frames.

In CameraService.cpp, maybe the surface should also be OVERLAY_FORMAT_YCbCr_420_SP format.

                if(mSensorType == CAMERA_SENSOR_TVIN) {

                    mOverlayRef = mSurface->createOverlay(w, h, OVERLAY_FORMAT_CbYCrY_422_I,

                                                      mOrientation);

                } else {

                    mOverlayRef = mSurface->createOverlay(w, h, OVERLAY_FORMAT_YCbCr_420_SP,

                                                      mOrientation);

                }

0 Kudos
Reply
21,939 Views
dennydu
Contributor I

Hi,Qiang

I think what you said above is a right direction, YUV422 -> YUV420.But,I try to modify the CameraService.cpp,it does not work. Actually,the Preview works error too.


You can see the topic below,I am puzzled how to make the Convert from YUV422 to YUV420.


Wish you give me some suggestion .


https://community.freescale.com/thread/303414



Thank you !


YanTCK

0 Kudos
Reply
21,939 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

I think you should let the Camera HAL to use NV12 surface, then tell kernel v4l2 capture driver to convert the adv7180 UYVY from to NV12 frame.

In fact for camera sensor such as OV3640, its input data is also UYVY, so I think NV12 surface can also work for adv7180, but I haven't tried it.

0 Kudos
Reply
21,939 Views
dennydu
Contributor I

Think You!

It works after I modify the surface to NV12 format.

Happy New Year ,Qiang !!!

0 Kudos
Reply
21,939 Views
gruger
Contributor III

How have you modified the ADV7180 kernel driver to output NV12 format?

Thank you!

0 Kudos
Reply
21,939 Views
dennydu
Contributor I

CAMERA_HAL_ERR_RET CameraHal :: GetCameraBaseParam(CameraParameters *pParam)

{

     //...........

       mCaptureDevice->GetDevName(mCameraSensorName);

       if(strstr(mCameraSensorName, "tvp") != NULL){

            mPreviewFormat = V4L2_PIX_FMT_NV12;

       }

     //...........

}

0 Kudos
Reply