i.MX6 Solo with ADV7180 screen scrolling down in NTSC mode

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

i.MX6 Solo with ADV7180 screen scrolling down in NTSC mode

Jump to solution
5,934 Views
oliverkuo
Contributor IV

Hi,

My target board with ADV7180 connected to i.MX6 Solo CS0 and BSP is "imx-android-r13.4.1".

I test ADV7180 video in with camera app, PAL mode is good but under NTSC mode, display keep scrolling down and below message posted on the console.

"imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_5 = 0x00000001"

I enabled ioctl_enum_framesizes in adv7180.c and CameraHal get preview size through VIDIOC_ENUM_FRAMESIZES and VIDIOC_G_FMT, but adv7180.c return different size and cause buffer allocated failed.

Active size will be returned for VIDIOC_ENUM_FRAMESIZES and raw size returned for VIDIOC_G_FMT, I'm curiously the occasion of using raw or active size?

If adv7180 driver report active size all the time, camera app can display preview properly when PAL mode, but display keep scrolling down under NTSC mode.

If adv7180 report raw size, camera app can't display preview no matter PAL nor NTSC mode and below error message posted on logcat.

E/v_hwc   ( 2104): Failed in _Blit: status=-20

E/v_hwc   ( 2104): Failed in hwcCompose: status=-20

E/v_hwc   ( 2104): Failed in hwcSet: status=-20

E/v_hwc   ( 2104): hwc_set(233): Failed in set

I think active size should be applied but I can't figure out why screen keep scrolling down at NTSC mode, please share your experience.

Since no Hsync/Vsync connected between CS0 and ADV7180, maybe EAV/SAV incorrect setting for NTSC and cause vertical synchronization error?

} else if (width == 720 && (height == 525 || height == 480)) {
/* NTSC case */
/*
* Field0BlankEnd = 0x7, Field0BlankStart = 0x3,
* Field0ActiveEnd = 0x5, Field0ActiveStart = 0x1
*/
ipu_csi_write(ipu, csi, 0xD07DF, CSI_CCIR_CODE_1);
/*
* Field1BlankEnd = 0x6, Field1BlankStart = 0x2,
* Field1ActiveEnd = 0x4, Field1ActiveStart = 0
*/
ipu_csi_write(ipu, csi, 0x40596, CSI_CCIR_CODE_2);
ipu_csi_write(ipu, csi, 0xFF0000, CSI_CCIR_CODE_3);
} else {

After study EAV/SAV, the CCIR_CODE seems only reflect the different initial field of PAL and NTSC!?

Trying to make mxc_v4l2_tvin working on my platform.

Anyone can share your experience.

Oliver

Labels (3)
Tags (1)
1 Solution
1,426 Views
oliverkuo
Contributor IV

Finally, I find where the problem is and solve this abnormal symptom by myself.

I would like to share my finding to the people who're facing similar issue here.

In my case, the crucial point is the value of active_top as Jimmy mentioned, however this value only assigned to cam->crop_current.top in mxc_v4l2_s_std().

I test ADV7180 functionality by camera.apk in Android r13.4.1, but the CameraHAL layer doesn't call ioctl VIDIOC_G_STD, the initial value of cam->crop_current.top is 0 and only fit PAL standard.

I refer to TVINDevice initial procedure in Android JB4.2.2 and call ioctl VIDIOC_G_STD in CameraHAL, now I can get normal display of both PAL and NTSC CVBS input.

View solution in original post

0 Kudos
4 Replies
1,427 Views
oliverkuo
Contributor IV

Finally, I find where the problem is and solve this abnormal symptom by myself.

I would like to share my finding to the people who're facing similar issue here.

In my case, the crucial point is the value of active_top as Jimmy mentioned, however this value only assigned to cam->crop_current.top in mxc_v4l2_s_std().

I test ADV7180 functionality by camera.apk in Android r13.4.1, but the CameraHAL layer doesn't call ioctl VIDIOC_G_STD, the initial value of cam->crop_current.top is 0 and only fit PAL standard.

I refer to TVINDevice initial procedure in Android JB4.2.2 and call ioctl VIDIOC_G_STD in CameraHAL, now I can get normal display of both PAL and NTSC CVBS input.

0 Kudos
1,426 Views
gruger
Contributor III

We are facing exacly the same problem with Android R14-Beta release, but the screen is rolling up for both PAL and NTSC modes.

We have tried lots of different configurations at the ADV7180 hard_reset function and it is still not working. I am not sure about the real problem here. It could be a deinterlacing problem and/or a vertical synchronization problem. Anyways, we have been working on this for more than 3 weeks and we have not found a solution yet.

Searching through the community shows that lots of people have similar (sometimes the same) problems and there is no official solution.

We have also tried different EAV/SAV codes at the ipu_capture driver, but nothing seems to solve the problem (some changes make it even worse).

Can anyone help us on this, please?

Thank you.

0 Kudos
1,426 Views
jimmychan
NXP TechSupport
NXP TechSupport

For the screen scroll issue, in kernel file "mxc_v4l2_capture.c", you can adjust the active_top value to fix it.

static video_fmt_t video_fmts[] = {

{   /*! NTSC */

  .v4l2_id = V4L2_STD_NTSC,

  .name = "NTSC",

  .raw_width = 720,  /* SENS_FRM_WIDTH */

  .raw_height = 525,  /* SENS_FRM_HEIGHT */

  .active_width = 720,  /* ACT_FRM_WIDTH */

  .active_height = 480,  /* ACT_FRM_HEIGHT */

  .active_top = 13,

  .active_left = 0,

  },

1,426 Views
oliverkuo
Contributor IV

Hi Jimmy,

Thanks for your precious info.

But I test with various value and nothing different, even an extreme value, more than 200.

I trace active_top, it only applied on crop window position.

So I think if the main display resolution (480x272) may affect?

-Oliver

0 Kudos