TVP5150 on IMX6Q

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

TVP5150 on IMX6Q

Jump to solution
5,692 Views
donghuage
Contributor I

Hi

I try to modify tvp5150.c for i.mx6 board.The input is PAL video source.

The serial port print the message as follow.

TVP5150 io_init

tvp5150_probe:tvp5150 probe i2c address is 0x5D

TVP5150 Chip version = 0x04

   type is 2 (expect 2)

   num ioctls is 13

In MVC: mxc_v4l2_master_attach

   slave.name = tvp5150

   master.name = mxc_v4l2_cap1

sdata->csi = 0

cam->csi = 1

tvp5150  mxc_v4l2_master_attach: csi doesn't match

In MVC: mxc_v4l2_master_attach

   slave.name = tvp5150

   master.name = mxc_v4l2_cap0

sdata->csi = 0

cam->csi = 0

tvp5150  mxc_v4l2_master_attach: csi does match

tvp5150  mxc_v4l2_master_attach  type is 2

PAL video source.

tvp5150  mxc_v4l2_master_attach  attach___attach___attach

tvp5150  v4l2_int_device_register succeed.

mxc_v4l2_output mxc_v4l2_output.0: V4L2 device registered as video16

mxc_v4l2_output mxc_v4l2_output.0: V4L2 device registered as video17

When I execute the test command ./mxc_v4l2_tvin.out   -ow 720 -oh 480 -ol 10 -ot 20 -f YU12 in linux.

It occurs the errors as follow and can't display  on screen.

root@freescale /unit_tests$

< 160 -oh 160 -ot 20 -ol 20 -r 0 -t 50 -d 0 -fg -fr 30                      

start_________start_________start_________start_________start_________start_________start

tvp5150 mxc_v4l_open  type is 2 (expect 2)

end___________end___________end___________end___________end___________end___________end

PAL video source.

success________success_________success_________success_________success_________success_________success

tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

TV decoder chip is tvp5150tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

PAL video source.

tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

In mxc_v4l2_s_std ff

tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

PAL video source.

imx-ipuv3 imx-ipuv3.0: Unsupported CCIR656 interlaced video mode

tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

VIDIOC_G_FMT failed

tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

driver=mxc_vout, card=DISP3 FG, bmxc_v4l2_output mxc_v4l2_output.0: Enable deinterlace BT.

us=, version=0x00000000, capabilities=0x04000002

fmt RGB565: fourcc = 0x50424752

fmt BGR24: fourcc = 0x33524742

fmt RGB24: fourcc = 0x33424752

fmt RGB32: fourcc = 0x34424752

fmt BGR32: foutvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

rcc = 0x34524742

fmt NV12: fourctvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

c = 0x3231564e

fmt UYVY: fourcc tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

= 0x59565955

fmt YUYV: fourcc = tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

0x56595559

fmt YUV422 planar: fotvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

urcc = 0x50323234

fmt YUV444: fotvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

urcc = 0x34343459

fmt YUV420: fotvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

urcc = 0x32315559

fmt TILED NV12PAL video source.

P: fourcc = 0x50564e54

fmt TILEDtvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

NV12F: fourcc = 0x46564e54

fmt YUV444 planar: fourcc = 0x50343434

start time = 330 s, 691641 us

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

VIDIOC_DQBUF failed.

tvp5150   do_ioctl___do_ioctl___do_ioctl___do_ioctl

tvp5150   close___close___close___close

root@freescale /unit_tests$

The  ioctl_g_ifparm as follow:

static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p)

{

  dev_dbg(&tvp5150_data.i2c_client->dev, "In tvp5150:ioctl_g_ifparm\n");

  if (s == NULL) {

  pr_err("   ERROR!! no slave device set!\n");

  return -1;

  }

  /* Initialize structure to 0s then set any non-0 values. */

  memset(p, 0, sizeof(*p));

  p->if_type = V4L2_IF_TYPE_BT656; /* This is the only possibility. */

  p->u.bt656.mode = V4L2_IF_TYPE_BT656_MODE_NOBT_8BIT;

  p->u.bt656.nobt_hs_inv = 1;

  p->u.bt656.bt_sync_correct = 1;

  /* TVP5150 has a dedicated clock so no clock settings needed. */

  return 0;

}

Who can help to fix the problem?

Thanks.

0 Kudos
1 Solution
1,203 Views
kamillulko
Contributor III

Looks like your driver has several setup problems, first of all this one:

Unsupported CCIR656 interlaced video mode

Means your tvp5150 driver does not respond with proper format caps inside its ioctl_g_fmt_cap. Since you are using PAL signal you have to fill v4l2_format structure in that ioctl with proper format (720x625 in your case, refer to ipu_capture.c). This is most likely sole reason of your problem. Also double check your platform code (are csi and ipu fields filled properly for your physical connection to TVP5150 from mx6, did you set up pads correctly?). Make sure TVP5150 is sending out bt656 data and not raw 4:2:2.

View solution in original post

0 Kudos
3 Replies
1,204 Views
kamillulko
Contributor III

Looks like your driver has several setup problems, first of all this one:

Unsupported CCIR656 interlaced video mode

Means your tvp5150 driver does not respond with proper format caps inside its ioctl_g_fmt_cap. Since you are using PAL signal you have to fill v4l2_format structure in that ioctl with proper format (720x625 in your case, refer to ipu_capture.c). This is most likely sole reason of your problem. Also double check your platform code (are csi and ipu fields filled properly for your physical connection to TVP5150 from mx6, did you set up pads correctly?). Make sure TVP5150 is sending out bt656 data and not raw 4:2:2.

0 Kudos
1,203 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

The TVin function was verified with adv7180 on L3.0.35_4.0.0 BSP, so for your TVP5150, you should make sure the output from this tvin chip is BT656 PAL or NTSC, included EAV/SAV data on data bus. Then no code modification was needed in other IPU driver code.

By the way, your "ioctl_g_ifparm" setting is OK, please also make sure in the sensor probe function, such as adv7180_probe, there is the followed code:

      adv7180_data.sen.pix.pixelformat = V4L2_PIX_FMT_UYVY;  /* YUV422 */

      adv7180_data.sen.pix.priv = 1;  /* 1 is used to indicate TV in */

      adv7180_data.sen.on = true;

For the test application, you can just run as followed:

./mxc_v4l2_tvin.out -ow 720 -oh 480 -ot 10 -ol 10

1,203 Views
donghuage
Contributor I

Thanks, Li. I haved checked my tvp5150.c file again,there is no problem. 

I use the linux kernel is the kenel_imx of   i.MX 6 Android R13.4.1,does the kernel support the adv7180,shall I get the newest kernel of i.mx6?

0 Kudos