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.
已解决! 转到解答。
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.
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
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)
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
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.
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.
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.
Hi
The attached files cannot be download. it shows:
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.
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.
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
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.
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
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?