ADV7180 driver and gstreamer on i.MX515EVK

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

ADV7180 driver and gstreamer on i.MX515EVK

5,929 Views
VincentChou1z
Contributor III

Hi!  All,

 

We wired the ADV7180 EVK to the CSI interface on i.MX515 EVK and try to port the ADV7180 driver into both Linux and Android on the board.  When we linked the ADV7180 driver and it does capture data into memory buffer.  However, when we run gstreamer to test the video buffer, we came across the following error. 

====================

In MVC:mxc_streamon
NV12
mxc_ipu mxc_ipu: IDMAC20's EBA0 is not 8-byte aligned
mxc_ipu mxc_ipu: IDMAC20's EBA1 is not 8-byte aligned
Pipeline is live and does not need PREROLL ...
In MVC:mxc_v4l_ioctlPLAYING ...

New clock: GstSystemClock
In MVC: mxc_v4l_do_ioctl c0445611
   case VIDIOC_DQBUF
In MVC:mxc_v4l_dqueue
ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

====================

 

Does anyone have any experience to fix the gstreamer problem?

 

Vincent

Labels (1)
Tags (2)
17 Replies

2,141 Views
jaro123
Contributor I

Oh I found it. Jump wires was not good idea how to connect the camera. Flat cable with pcb fixed my problem.

In this case you can see errors in D-PHY and CSI2 (ERR1,2) registers.

With MIPI CSI2 2-lanes - wrong connected lanes:

  [ov5640_init_mode] mipi_csi2_dphy_status:0x200

  [ov5640_init_mode] mipi_csi2_get_error1:0x10000010

Correct - both lanes connected:

  [ov5640_init_mode] mipi_csi2_dphy_status:0x300

  [ov5640_init_mode] mipi_csi2_get_error1:0x10

Jan

0 Kudos

2,141 Views
jaro123
Contributor I

bump

0 Kudos

2,141 Views
yuhaibin
Contributor I

Do you find the solution for the program?

0 Kudos

2,141 Views
Rajput1z
Contributor II

Hi Chou ,

   i am also getting this  error

YUV420
mxc_ipu mxc_ipu: IDMAC20's EBA0 is not 8-byte aligned
mxc_ipu mxc_ipu: IDMAC20's EBA1 is not 8-byte aligned

  can u plz help me..

Vincent Chou said:

Hi! Daiane,

 

I searched on the net and discovered that a few people came across the same error!  They obtained the same message:

Error: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

Do you have any idea why we get this error?

 

Vincent

2,141 Views
RobetAyala
Contributor I

Hello Vincent,

 

I also have the same error of "ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0".  Can you tell me it you where able to figure out what this error was and how you resolved it. 

 

Best Regards,

Robert

0 Kudos

2,141 Views
RobetAyala
Contributor I

Hello,

 

I am having a problem communicating to the ADV7180.  When i run insmod adv7180_tvin.ko, i do not see it returning a probed statement.  Currently i am using the I.MX51 eval kit with an ADV7180LFEBZ eval board.  I have connected the AD7180 to CSI1 port D10-D17, HSYNC, VSYNC, and PIXCLK.  I have also connected it to the I2C1 port on J14. 

 

Any ideals why I dont see a probe?

 

Robert

0 Kudos

2,141 Views
JohnyHsu
Contributor I


Dear Daiane,

I've a project using imx.51 with video-in functional.

Would you help to provide how to connected to ADV7180 chipset?

We using a 8 bits data bus to connect to imx.51 CSI1 interface.

But CSI1 interface bus from D8 to D19.

How to connect to these data bus pins?

Connected to imx.51 from D8 to D15 (8 bits) or D12 to D19 (8 bits)?

We need your best help & experience for us.

Thanks a lot~


Daiane Angolini said:

Sorry, ofcourse page is lost. I pasted the wrong link!

 

http://imxcommunity.org/profiles/blogs/tv-in-demo-for-ard-a-simple-...

My blog post with some unit-test command lines.

 

Now it should open. 

 

For color conversion you should take a look on imx5x_IPU_LIB_UG.pdf 

 

You can find such file inside package:

https://www.freescale.com/webapp/Download?colCode=IMX51_ER1011_LINU...

 

 

0 Kudos

2,141 Views
EricTsai
Contributor I

Thanks for feedback.

Which framebuffer option that you imply need to config it?

 

We've traced the code, the test program will use 'CSI->MEM' from "ipu_csi_enc.c" which registered a ipu irq "IPU_IRG_CSI0_OUT_EOF" with callback function map to a callback function in mxc_v4l2_capture.c.

Somehow the ipu irq never to be signaled  and never got to get data to queue.

We are figuring out where and why irq go wrong.

0 Kudos

2,141 Views
Cyanica
Contributor I

Hi,

 

I experienced the same symptoms when I disabled framebuffer support within the kernel config. 

 

All the best.

 

Richard

0 Kudos

2,141 Views
daiane_angolini
NXP Employee
NXP Employee

Sorry, ofcourse page is lost. I pasted the wrong link!

 

http://imxcommunity.org/profiles/blogs/tv-in-demo-for-ard-a-simple-how-to

My blog post with some unit-test command lines.

 

Now it should open. 

 

For color conversion you should take a look on imx5x_IPU_LIB_UG.pdf 

 

You can find such file inside package:

https://www.freescale.com/webapp/Download?colCode=IMX51_ER1011_LINUXDOCS_BUNDLE&location=null&fpsp=1...

0 Kudos

2,141 Views
VincentChou1z
Contributor III

Hi! Daiane,

We tried the link but the page is lost.  Could you check the link for us again?  Thanks!

Vincent

0 Kudos

2,141 Views
VincentChou1z
Contributor III

Thanks for your suggestion!  We shall review the unit test code as quick as possible. 

 

We also suspect the error is caused by the format incompatibility issue.  When we activate the analog video input and save the data in IPU buffer in ADV7180 driver, we save it in YUV422 format.  If we want to play the data in IPU buffer to convert to RGB format and put it in the frame buffer, is there a sequence we should follow to achieve that?

 

Vincent

0 Kudos

2,141 Views
VincentChou1z
Contributor III

Hi! Daiane,

 

I searched on the net and discovered that a few people came across the same error!  They obtained the same message:

Error: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

Do you have any idea why we get this error?

 

Vincent

0 Kudos

2,141 Views
EricTsai
Contributor I

After reconfiguration to :

-STD_NTSC

-8bit colour in CSI_SENS_CONF and csi_param.data_width = IPU_CSI_DATA_WIDTH_8

-pixelformat = V4L2_PIX_FMT_UYVY

-cvbs=1

 

It can QBUF and look like playing.

But It stopped in dqueue time out below: (Not sure if this is interrupt problem)

static int mxc_v4l_dqueue(cam_data *cam, struct v4l2_buffer *buf){    int retval = 0;    struct mxc_v4l_frame *frame;    unsigned long lock_flags;
    printk("In MVC:mxc_v4l_dqueue\n");
    if (!wait_event_interruptible_timeout(cam->enc_queue,                          cam->enc_counter != 0, 10 * HZ)) {        pr_err("ERROR: v4l2 capture: mxc_v4l_dqueue timeout "            "enc_counter %x\n",               cam->enc_counter);

...

...

}

 

Run logs:

root@freescale /test0913$ gst-launch mfw_v4lsrc ! mfw_v4lsink

MFW_GST_V4LSRC_PLUGIN 2.0.1 build on Sep 9 2011 18:36:08.
MFW_GST_V4LSINK_PLUGIN 2.0.1 build on Sep 9 2011 18:36:14.
Setting
In MVC: mxc_v4l_open
pipeline to PAUSED ...
device name is Mxc Camera
End of mxc_v4l_open: v2f pix widthxheight 720 x 480
End of mxc_v4l_open: crop_bounds widthxheight 720 x 625
End of mxc_v4l_open: crop_defrect widthxheight 720 x 625
End of mxc_v4l_open: crop_current widthxheight 720 x 625
On Open: Input to ipu size is 720 x 625
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5616
case VIDIOC_S_PARM
In mxc_v4l2_s_param
Current capabilities are 0
Current capturemode is 0 change to 0
Current framerate is 30 change to 30
clock_curr=mclk=0
g_fmt_cap returns widthxheight of input as 720 x 625
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5605
case VIDIOC_S_FMT
In MVC: mxc_v4l2_s_fmt
type=V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_s_fmt: v2f pix widthxheight 720 x 624
End of mxc_v4l2_s_fmt: crop_bounds widthxheight 720 x 625
End of mxc_v4l2_s_fmt: crop_defrect widthxheight 720 x 625
End of mxc_v4l2_s_fmt: crop_current widthxheight 720 x 625
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c008561c

case VIDIOC_S_CTRL
In MVC:mxc_v4l2_s_ctrl
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0145608
case VIDIOC_REQBUFS
In MVC:mxc_streamoff
MVC: In mxc_free_frame_buf
In MVC:mxc_allocate_frame_buf - size=673920
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5604
case VIDIOC_G_FMT
In MVC: mxc_v4l2_g_fmt type=1
type is V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_g_fmt: v2f pix widthxheight 720 x 624
End of mxc_v4l2_g_fmt: crop_bounds widthxheight 720 x 625
End of mxc_v4l2_g_fmt: crop_defrect widthxheight 720 x 625
End of mxc_v4l2_g_fmt: crop_current widthxheight 720 x 625
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
pgoff=0x95400, start=0x2b1c2000, end=0x2b267000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
pgoff=0x95500, start=0x2b267000, end=0x2b30c000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status

In MVC:mxc_mmap
pgoff=0x95400, start=0x2b346000, end=0x2b3eb000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 40045612
case VIDIOC_STREAMON
In MVC:mxc_streamon
Pipeline is live and does not need PREROLL ...
In MVC:mxc_v4l_ioctlPLAYING ...

New clock: GstSystemClock
In MVC: mxc_v4l_do_ioctl c0445611
case VIDIOC_DQBUF
In MVC:mxc_v4l_dqueue
ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

0 Kudos

2,141 Views
EricTsai
Contributor I

We use default camera init config except below for NTSC standard config:

 

//video/mxc/capture/mxc_v4l2_capture.c

static void init_camera_struct(cam_data *cam, struct platform_device *pdev)

{

//cam->standard.id = V4L2_STD_UNKNOWN;    

cam->standard.id = V4L2_STD_NTSC;

....

cam->v2f.fmt.pix.pixelformat = V4L2_PIX_FMT_YUV420;

...

}

0 Kudos

2,141 Views
EricTsai
Contributor I

Dear Daiane,

I'm primary engineer testing this driver.

I need to brief our HW difference.

-We hook I2C(0x21)  as well as  ADV7180 8 bit data to CSI1(D10-D17) rather than a D10-D19 OVxx camera one of original design) to CSI1(first CSI port) of i.MX515   

-We connect HSync and VSync and Pix Clock to peer of same name of pin but w/o MCLK pin.

-We don't connect power down and reset ping right now.

-We don't connect GPIO input for GPIO interrupt right now( look like we've missed this but mx51_ard.c from ltib-11_01 found only ARD_VIDEOIN_INT_B define but no config code and passing irq to driver)

-We just found default color bit of CSI_SENS_CONF is 10 bit. And trying to fix it by hard code a 8 bit one for our case.

-We use Sony CXD3142R CVBS analog camera signal to adv7180 decoder.

 

Below is our debug output:

Primary errors below:
mxc_ipu mxc_ipu: IDMAC20's EBA0 is not 8-byte aligned
mxc_ipu mxc_ipu: IDMAC20's EBA1 is not 8-byte aligned

Run logs
========

rroot@freescale /test$ insmod ipu_prp_enc.ko

root@freescale /test$ insmod ipu_prp_vf_sdc.ko

root@freescale /test$ insmod ipu_prp_vf_sdc_bg.ko

root@freescale /test$ insmod ipu_still.ko

root@freescale /test$ insmod ipu_csi_enc.ko

root@freescale /test$ insmod adv7180_tvin.ko

adv7180 probe i2c address is 0x21 Analog Device adv71B0 detected! 

adv7180  hard_reset: cvbs=1   type is 2 (expect 2)   num ioctls is 11

root@freescale /test$ insmod mxc_v4l2_capture.ko

In MVC:camera_initIn MVC: init_camera_struct

In MVC: mxc_v4l2_master_attach   slave.name = adv7180   master.name = mxc_v4l2_cap

End of mxc_v4l2_master_attach: v2f pix widthxheight 288 x 352

End of mxc_v4l2_master_attach: crop_bounds widthxheight 720 x 625

End of mxc_v4l2_master_attach: crop_defrect widthxheight 720 x 625

End of mxc_v4l2_master_attach: crop_current widthxheight 720 x 625   Video device registered: Mxc Camera #1 #1

root@freescale /test$ gst-inspect | grep mfw
mfw_deinterlacer:  mfw_deinterlacer: Mfw De-interlace
mfw_vpuencoder:  mfw_vpuencoder: Freescale: Hardware (VPU) Encoder
mfw_vpudecoder:  mfw_vpudecoder: Freescale: Hardware (VPU) Decoder
mfw_ipucsc:  mfw_ipucsc: Freescale IPU Color Space Converter
mfw_isink:  mfw_isink: Freescale: i_sink
mfw_v4lsink:  mfw_v4lsink: Freescale: V4L Sink
mfw_v4lsrc:  mfw_v4lsrc: Freescale Video Source plug-in
root@freescale /test$ gst-launch mfw_v4lsrc ! mfw_v4lsink
MFW_GST_V4LSRC_PLUGIN 2.0.1 build on Sep  9 2011 18:36:08.
MFW_GST_V4LSINK_PLUGIN 2.0.1 build on Sep  9 2011 18:36:14.
Setting
In MVC: mxc_v4l_open
pipeline to PAUSED ...
   device name is Mxc Camera
End of mxc_v4l_open: v2f pix widthxheight 288 x 352
End of mxc_v4l_open: crop_bounds widthxheight 720 x 625
End of mxc_v4l_open: crop_defrect widthxheight 720 x 625
End of mxc_v4l_open: crop_current widthxheight 720 x 625
On Open: Input to ipu size is 720 x 625
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5616
   case VIDIOC_S_PARM
In mxc_v4l2_s_param
   Current capabilities are 0
   Current capturemode is 0  change to 0
   Current framerate is 30  change to 30
   clock_curr=mclk=0
   g_fmt_cap returns widthxheight of input as 720 x 625
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5605
   case VIDIOC_S_FMT
In MVC: mxc_v4l2_s_fmt
   type=V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_s_fmt: v2f pix widthxheight 176 x 144
End of mxc_v4l2_s_fmt: crop_bounds widthxheight 720 x 625
End of mxc_v4l2_s_fmt: crop_defrect widthxheight 720 x 625
End of mxc_v4l2_s_fmt: crop_current widthxheight 720 x 625
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c008561c
   case VIDIOC_S_CTRL
In MVC:mxc_v4l2_s_ctrl
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0145608
   case VIDIOC_REQBUFS
In MVC:mxc_streamoff
MVC: In mxc_free_frame_buf
In MVC:mxc_allocate_frame_buf - size=38016
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5604
   case VIDIOC_G_FMT
In MVC: mxc_v4l2_g_fmt type=1
   type is V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_g_fmt: v2f pix widthxheight 176 x 144
End of mxc_v4l2_g_fmt: crop_bounds widthxheight 720 x 625
End of mxc_v4l2_g_fmt: crop_defrect widthxheight 720 x 625
End of mxc_v4l2_g_fmt: crop_current widthxheight 720 x 625
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x95240, start=0x2b1c2000, end=0x2b1cc000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x95250, start=0x2b1cc000, end=0x2b1d6000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x95260, start=0x2b1d6000, end=0x2b1e0000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 40045612
   case VIDIOC_STREAMON
In MVC:mxc_streamon
NV12
mxc_ipu mxc_ipu: IDMAC20's EBA0 is not 8-byte aligned
mxc_ipu mxc_ipu: IDMAC20's EBA1 is not 8-byte aligned
Pipeline is live and does not need PREROLL ...
In MVC:mxc_v4l_ioctlPLAYING ...

New clock: GstSystemClock
In MVC: mxc_v4l_do_ioctl c0445611
   case VIDIOC_DQBUF
In MVC:mxc_v4l_dqueue
ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
Caught SIGSEGV accessing address 0x18
Spinning.  Please run 'gdb gst-launch 2224' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

0 Kudos

2,141 Views
daiane_angolini
NXP Employee
NXP Employee

I don´t think it´s a "gstreamer" problem.

 

What is NV12? I mean, it´s the video camera output? Does your src pluging support this format?

 

Why you get a "is not 8-byte aligned" error? It looks like you´re trying to place a wrong format into IPU, Can you double check it?

 

Can you share your command line? You can double check your plugin capabilities.

0 Kudos