i.mx53_Video Decoder TVP5147M1 Interface Issue on CSI1 Port -

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

i.mx53_Video Decoder TVP5147M1 Interface Issue on CSI1 Port -

3,292 Views
GopiNagaBharath
Contributor IV

Hello,

I am trying to interface the TVP5147M1 Video Decoder with i.MX53 processor through its CSI1 Interface port.

The Decoder is interfaced with 8-bit data bus, DATACLK, HSYNC & VSYNC of CSI1 Port.

The camera output is a composite VGA resolution video which is connected to TVP5147M1 Composite Video Input port.

With use of Camera test application i was trying to test the video steaming. Upon execution of test command, i am getting few errors, the log for the same is provided below.

---------------------------------------------------

Detected screen resolution is 640 x 480

main[711] #1

main[734] #2

main[738] #3

[ 70.040683] IPU:In csi_enc_enabling_tasks

[ 70.046585] In csi_enc_setup

main[745] #4

[ 70.078154] ERROR: unrecognized std! 0 (PAL=ff, NTSC=b000

main[780] #5

[ 70.151410] mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_10 = 0x00000001

[ 80.100349] ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

fd_capture_v4l : VIDIOC_DQBUF failed.

[ 80.126784] ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued

fd_capture_v4l: VIDIOC_QBUF failed

[ 90.150347] ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

fd_capture_v4l : VIDIOC_DQBUF failed.

output_buf : VIDIOC_DQBUF failed

[ 100.160234] ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued

fd_capture_v4l: VIDIOC_QBUF failed

[ 110.190351] ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

fd_capture_v4l : VIDIOC_DQBUF failed.

output_buf : VIDIOC_DQBUF failed

[ 120.198978] ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued

fd_capture_v4l: VIDIOC_QBUF failed

---------------------------------------------------------------------

The Video decoder is able to get detected during the boot up through the I2C interface which is used for configurations.

After 10 seconds of above test command execution, i am seeing a blurred back & white still image on LCD seen by the  Camera.

The LCD Display is connected on LVDS0 port of i.MX53 processor.

Has any one successfully integrated TVP5147M1 Video decoder with i.MX53?

Please let me know if i'm missing anything.

Thanks in advance!!

Regards,

Gopi

Labels (3)
17 Replies

1,419 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

I think you can reference to this link:https://community.freescale.com/thread/295157

In the kernel patch "tvin_kernel_imx.patch" of that link, there is an example for how to modify from CSI0 to CSI1 in mxc_v4l2_capture.c.

And you also need make sure what's the date format output from TVP5147, progressive or interlaced? WIth or without SAV/EAV signal in data bus?

From your tested 640x480 resolution, it seems this is a normal camera sensor format, not TV signal, if so, you'd better reference to the OV5640 driver under folder "drivers\media\video\mxc\capture".

The adv7180 driver under folder "drivers\media\video\mxc\capture" is for TV in signal which is interlanced and with SAV/EAV embeded in data bus.

1,419 Views
GopiNagaBharath
Contributor IV

Hi,

As i mentioned, we are getting a perfect still image [the first frame seen by the camera after executing the camera test].

Do you have any idea on why this could be happening?

Regards,

Gopi

0 Kudos

1,419 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Of cource, you also need make sure, the sensor output format is correct as we wanted.

0 Kudos

1,419 Views
GopiNagaBharath
Contributor IV

Thanks for your suggestions.

We have checked the VideoDecoder/sensor output formats configuration and tried by configuring as per the above mentioned. However, we are still getting the same result, the first frame being displayed on the display.

We are having the TV input (composite video) with PAL format. The TV Input from a camera to the Video Decoder (TVP5147M1) and the Decoder is connected to the CSI1 port of i.MX53.

I am having few questions based on the debug log observations, mentioned below:

-------------------------------------------------------------------------------------------------------------------------------------------------------------

root@freescale /unit_tests$ ./mxc_v4l2_tvin.out -ot 0 -ol 10 -ow 720 -oh 525 -m 2 //We have noticed that this unit-test is giving error, shown below.

TV decoder chip is tvp5147m1_decoder

ERROR: v4l2 capture: width or height too small.

VIDIOC_S_FMT failedmxc_v4l_close: release resource

Setup v4l capture failed.

root@freescale /unit_tests$ ./mxc_v4l2_tvin.out -ot 0 -ol 10 -ow 720 -oh 625 -m 2 //We have tried the same by changing the size, but still same error.

TV decoder chip is tvp5147m1_decoder

ERROR: v4l2 capture: width or height too small.

VIDIOC_S_FMT failedmxc_v4l_close: release resource

Setup v4l capture failed.

root@freescale /unit_tests$ dmesg -c //dmesg log

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_ifparm

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_fmt_cap

   Returning size of 720x625

tvp5147m1 2-005c: In tvp5147m1:ioctl_init

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_fmt_cap

tvp5147m1 2-005c: In tvp5147m1_get_std

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_parm

   type is V4L2_BUF_TYPE_VIDEO_CAPTURE

tvp5147m1 2-005c: In tvp5147m1:ioctl_s_parm

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_ifparm

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_fmt_cap

   Returning size of 720x625

ERROR: v4l2 capture: width or height too small.

mxc_v4l_close: release resource

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_ifparm

   Returning size of 720x625

tvp5147m1 2-005c: In tvp5147m1:ioctl_init

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_fmt_cap

tvp5147m1 2-005c: In tvp5147m1_get_std

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_parm

   type is V4L2_BUF_TYPE_VIDEO_CAPTURE

tvp5147m1 2-005c: In tvp5147m1:ioctl_s_parm

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_ifparm

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_fmt_cap

   Returning size of 720x625

ERROR: v4l2 capture: width or height too small.

mxc_v4l_close: release resource

root@freescale /unit_tests$

root@freescale /unit_tests$ camera_testapp &      //Starting the camera test application to test the video streaming

root@freescale /unit_tests$

-------------------------------------------------

PRODUCT_NAME       : e-CAMNT_MX53x

SVN_REVISION       : 397

SVN_DATE           : 2012-02-10

SVN_TIME           : 17:37:22

-------------------------------------------------

Detected screen resolution is 640 x 480

main[711] #1

main[734] #2

main[738] #3

IPU:In csi_enc_enabling_tasks

In csi_enc_setup

main[745] #4

main[780] #5

mxc_ipu mxc_ipu: warning: disable ipu dma channel 0 during its busy state

IPU:In csi_enc_enabling_tasks

In csi_enc_setup

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_5 = 0x00000001          // We are getting this error for the IPU. these are coming repeatedly.

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_10 = 0x00000001

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0          // Also the error for the VIDIOC_DQBUF, these are coming repeatedly.

fd_capture_v4l : VIDIOC_DQBUF failed.

ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued

fd_capture_v4l: VIDIOC_QBUF failed

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

fd_capture_v4l : VIDIOC_DQBUF failed.

ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued

fd_capture_v4l: VIDIOC_QBUF failed

mxc_ipu mxc_ipu: Channel already disabled 10   // These are also the errors coming repeatedly. Also, we are getting this error, if we play an MP4 Video file to the Display.

mxc_ipu mxc_ipu: Channel already uninitialized 10

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_10 = 0x00000001

mxc_ipu mxc_ipu: Channel already disabled 10

mxc_ipu mxc_ipu: Channel already uninitialized 10

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_10 = 0x00000001

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

fd_capture_v4l : VIDIOC_DQBUF failed.

ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued

fd_capture_v4l: VIDIOC_QBUF failed

root@freescale /unit_tests$ ps

  PID TTY          TIME CMD

    1 ?        00:00:00 init

    2 ?        00:00:00 kthreadd

    3 ?        00:00:00 ksoftirqd/0

    4 ?        00:00:00 events/0

    5 ?        00:00:00 khelper

    8 ?        00:00:00 async/mgr

    9 ?        00:00:00 pm

   85 ?        00:00:00 usb_wakeup thre

   86 ?        00:00:00 usb_wakeup thre

  169 ?        00:00:00 sync_supers

  171 ?        00:00:00 bdi-default

  173 ?        00:00:00 kblockd/0

  183 ?        00:00:00 otg_switch/0

  189 ?        00:00:00 khubd

  233 ?        00:00:00 kmmcd

  270 ?        00:00:00 kswapd0

  313 ?        00:00:00 aio/0

  326 ?        00:00:00 crypto/0

1003 ?        00:00:00 kconservative/0

1008 ?        00:00:00 vpu_wq/0

1015 ?        00:00:00 esdhc_wq/0

1018 ?        00:00:00 esdhc_wq/0

1043 ?        00:00:00 mmcqd

1049 ?        00:00:00 scsi_eh_0

1050 ?        00:00:00 usb-storage

1099 ?        00:00:01 udevd

1809 ?        00:00:00 flush-179:0

2073 ?        00:00:00 sh

2102 ?        00:00:31 camera_testapp

2103 ?        00:00:00 v4l2q

2111 ?        00:00:00 ps

root@freescale /unit_tests$ kill 2102

root@freescale /unit_tests$

ERROR: v4l2 capture: mxc_v4l_dqueue() interrupt received

mxc_v4l_close: release resource

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_10 = 0x00000001

root@freescale /unit_tests$

root@freescale /unit_tests$ dmesg -c               // Dmesg of the entire debug messages

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_ifparm

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_fmt_cap

   Returning size of 720x625

tvp5147m1 2-005c: In tvp5147m1:ioctl_init

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_ctrl

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_fmt_cap

tvp5147m1 2-005c: In tvp5147m1_get_std

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_parm

   type is V4L2_BUF_TYPE_VIDEO_CAPTURE

tvp5147m1 2-005c: In tvp5147m1:ioctl_s_parm

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_ifparm

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_fmt_cap

   Returning size of 720x625

IPU:In csi_enc_enabling_tasks

In csi_enc_setup

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_fmt_cap

tvp5147m1 2-005c: In tvp5147m1_get_std

IPU_CONF =      0x00000760

IDMAC_CONF =    0x0000002F

IDMAC_CHA_EN1 =         0x00800001

IDMAC_CHA_EN2 =         0x00000000

IDMAC_CHA_PRI1 =        0x18800001

IDMAC_CHA_PRI2 =        0x00000000

IDMAC_BAND_EN1 =        0x00000000

IDMAC_BAND_EN2 =        0x00000000

IPU_CHA_DB_MODE_SEL0 =  0x00000001

IPU_CHA_DB_MODE_SEL1 =  0x00000000

IPU_CHA_TRB_MODE_SEL0 =         0x00800000

IPU_CHA_TRB_MODE_SEL1 =         0x00000000

DMFC_WR_CHAN =  0x00000090

DMFC_WR_CHAN_DEF =      0x202020F6

DMFC_DP_CHAN =  0x00009694

DMFC_DP_CHAN_DEF =      0x2020F6F6

DMFC_IC_CTRL =  0x00000002

IPU_FS_PROC_FLOW1 =     0x00000000

IPU_FS_PROC_FLOW2 =     0x00000000

IPU_FS_PROC_FLOW3 =     0x00000000

IPU_FS_DISP_FLOW1 =     0x00000000

mxc_ipu mxc_ipu: warning: disable ipu dma channel 0 during its busy state

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_fmt_cap

tvp5147m1 2-005c: In tvp5147m1_get_std

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_parm

   type is V4L2_BUF_TYPE_VIDEO_CAPTURE

tvp5147m1 2-005c: In tvp5147m1:ioctl_s_parm

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_ifparm

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_fmt_cap

   Returning size of 720x625

IPU:In csi_enc_enabling_tasks

In csi_enc_setup

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_5 = 0x00000001

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_10 = 0x00000001

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued

mxc_ipu mxc_ipu: Channel already disabled 10

mxc_ipu mxc_ipu: Channel already uninitialized 10

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_10 = 0x00000001

mxc_ipu mxc_ipu: Channel already disabled 10

mxc_ipu mxc_ipu: Channel already uninitialized 10

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_10 = 0x00000001

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued

ERROR: v4l2 capture: mxc_v4l_dqueue() interrupt received

mxc_v4l_close: release resource

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_10 = 0x00000001

root@freescale /unit_tests$

root@freescale /unit_tests$

tvp5147m1 2-005c: In tvp5147m1:ioctl_g_fmt_cap

-------------------------------------------------------------------------------------------------------------------------------------------------------------

I have also attached the source of the camera test application, which i hope would be helpful.

Can you please check above log and let me know what could be the reasons for the errors we are getting related to the IPU & VIDIO_DQBUF??


Regards,

Gopi

0 Kudos

1,418 Views
jonathansperry
Contributor I

ERROR: v4l2 capture: width or height too small.

You may want to investigate this error from the mxc_v4l2_tvin.out app.

0 Kudos

1,418 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

This error was caused from kernel code mxc_v4l2_capture.c, it happens because you had removed the followed codes in function mxc_v4l2_s_fmt(), you should not do such modification, as I metioned, except for the CSI1 to CSI0 modification, there should be no other code modification, you only need make sure the TVP5147 had output the correct data, and the TVP5147 driver had implemented the related ioctl as adv7180 driver:

#if 0

  /*

   * Force the capture window resolution to be crop bounds

   * for CSI MEM input mode.

   */

  if (strcmp(mxc_capture_inputs[cam->current_input].name,

      "CSI MEM") == 0) {

   f->fmt.pix.width = cam->crop_current.width;

   f->fmt.pix.height = cam->crop_current.height;

  }

#endif

0 Kudos

1,418 Views
GopiNagaBharath
Contributor IV

We have made this modifications. The Unit test is not returning the errors, however, we are still not getting the camera stream.

Also, we are still having the issues with the camera test application.

Can you please check the errors which are commented with red color in my above post?

0 Kudos

1,418 Views
Rajput1z
Contributor II

Hello Gopi,

             I am also having the same problem with camera time out error "ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0"

and i am using imx53 smd based custom board Android 2.3 and kernel-2.6.35 with Freescale R10.4 patches, and my board is having in built camera, csi0 interface , we are using camera sensor type is ov7675  , when ever i am trying to capture image it showing

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0.

and i have gone through so many threads in this community , i implemented as per the threads , but i am still having the same error, which could be area which i need to check please suggest me.

Thanks,

Rajput

0 Kudos

1,418 Views
didier1
Contributor I

Hello

We are currently working on a project based imx53 and video encoder TVP5147M1 (board e-CAMNT_MX53x).
We have seen that the status of the Texas TVP5147M1 site is "Not Recommended for New Designs."
What is the most similar to replace TVP5147M1 component?
Thank you for your information.

0 Kudos

1,418 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

If you only changed the sensor, no IPU common code or application code need be changed, the only modification is in your sensor driver. So I think there is still some issue in you sensor driver, although you can get the first frame. (For your case, the only modification in kernel mxc_v4l2_capture.c is changing default CSI0 to CSI1)

You should make sure what’s the data format on CSI data bus output from the TVP sensor, if it is pure YUV data like camera sensor, you should reference to the OV5420 to implement the sensor driver and use the “mxc_v4l2_capture” unit test to test.

And if the sensor output data is TV signal such as PAL/NTSC, on data bus there will be EAV/SAV, you should reference to the adv7180 driver and use the “mxc_v4l2_tvin” unit test application to test.

For the different data format, the sensor should report different clock mode and interface type to v4l2:

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

For normal camera sensor, pure YUV data on CSI data bus:

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

               p->u.bt656.clock_curr = ov5640_data.mclk;  //For camera sensor, it is not 0, then gated clock will be used in mxc_v4l2_capture.c

               p->if_type = V4L2_IF_TYPE_BT656;

               p->u.bt656.mode = V4L2_IF_TYPE_BT656_MODE_NOBT_8BIT;

               p->u.bt656.clock_min = OV5640_XCLK_MIN;

               p->u.bt656.clock_max = OV5640_XCLK_MAX;

               p->u.bt656.bt_sync_correct = 1;  //For camera sensor, it should be 1, it used VSYNC pin

For TV in sensor, interlanced YUV data with EAV/SAV on CSI data bus:

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

p->u.bt656.clock_curr = 0;  //For TVin sensor, it is 0, then BT656 clock mode will be used in mxc_v4l2_capture.c

               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.bt_sync_correct = 1;  //For TVin sensor, if VSYNC pin was used, it must be 1; if no external VSYNC pin, it must be 0, the CSI will get VSYNC from EAV/SAV on data bus.

0 Kudos

1,418 Views
GopiNagaBharath
Contributor IV

We have checked and made the required changes.

We are using a camera test application which is used for capturing and showing the video on the LCD Display.

Currently, we are able to get the first frame displayed on the LCD as a still image. The image is perfect and scaled to the LCD resolution.

What could be the reason for not getting the video stream??

Could you please share your email ID? I would like to share the source code of the Camera Test Application for getting it verified.

Regards,

Gopi

0 Kudos

1,419 Views
GopiNagaBharath
Contributor IV

I will check the kernel patch.

I think, the output format from the TVP5147 is interlaced. And the data bus of CSI1 is 8-bit with HSYNC and VSYNC signals.

The input to the decoder is TV In, we will check the adv7180 driver and let you know the same.

Regards,

Gopi

0 Kudos

1,419 Views
GopiNagaBharath
Contributor IV

Hi Lily,

Could you please let me know your email ID to forward the same?

Regards,

Gopi

0 Kudos

1,419 Views
lily_zhang
NXP Employee
NXP Employee

Please check the following page forhttp://www.e-consystems.com/NTSC-PAL-Video-Decoder-Board-iMX53x.asp.

TVP5147M1 has been integrated with MX53. You can see whether you can get relative source code driver from the vendor.

According to above errors, please check your IPU/V4L relative configurations such as format setting etc.

0 Kudos

1,419 Views
GopiNagaBharath
Contributor IV

Hello,

In fact, we are using the same board interfaced to our i.MX53 Custom board.

This particular board has been designed to work directly with i.MX53 QSB from FSL, which is using CSI0 of iMX53.

In our custom board, we have the CSI1 port used for interface Decoder Board, which is different from i.MX53 QSB.

We are using all the drivers, source which were supplied along with the Decoder Board (with the modifications made for the CSI Port for CSI1), however, we are still having the issues as mentioned above.

I will check on the IPU/V4L relative configurations.

Thanks,

Gopi

0 Kudos

1,419 Views
lily_zhang
NXP Employee
NXP Employee

Hello, Gopi:

If you still have the problem, you can send out the patches to us for the check.

Best Regards

Lily

0 Kudos

1,419 Views
GopiNagaBharath
Contributor IV

Hi Lily,

Could you please let me know your email ID to forward the same?

Regards,

Gopi

0 Kudos