TW6865 PCI Interface on Nitrogen6_Max

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

TW6865 PCI Interface on Nitrogen6_Max

2,331 Views
tengri
Contributor IV

Hi All,

I am trying to get our custom TW6865 capture card running on above platform. This is intended to run on kernel 4.1.15.1 with Ubuntu Xenial, and the mainline driver tw686x loaded. I've verified the hardware connection, can see pci link up and the device registration during the boot. Here is my kernel log :

[Bash] TW6865 - Pastebin.com 

In lsmod and lspci, I can see the driver loading and detection of the capture card respectively :

#lspci

00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01)
01:00.0 Multimedia video controller: Intersil Techwell Device 6869 (rev 01)
#lsmod
tc358743_h2c_bridge    49152  0
ipu_fg_overlay_sdc     16384  1 mxc_v4l2_capture
egalax_ts              16384  0
v4l2_int_device        16384  4 ov5642_camera,ov5640_camera_mipi_int,tc358743_h2c_bridge,mxc_v4l2_capture
ft5x06_ts              16384  0
tw686x                 28672  2
videobuf2_vmalloc      16384  1 tw686x
videobuf2_memops       16384  1 videobuf2_vmalloc
galcore               225280  10
gpio_keys              20480  0
To get the dma buffer allocated, I had to pass coherent_pool = 64M as a boot arg too. With aid of v4l2-ctl, the driver information and even composite signal can be correctly identified (v4l2-ctl -d /dev/video0 --all detects the cvbs signal wrt the input channel) :
Video input : 0 (Composite0: ok)
But the video device does not seem to give any video outputs, to the following gst commands, I only see a black imxeglvivsink window. But no pipeline errors shown in the terminal :
gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=720,height=480,pixelformat=UYVY ! imxipuvideotransform ! imxeglvivsink

gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=720,height=480,pixelformat=UYVY ! queue ! pngenc ! multifilesink location="/home/ubuntu/Pissu/frame%d.png"

The pipeline message can be seen here :

[Bash] pipeline_message - Pastebin.com 

Tried with imxv4l2videosrc too, but no luck ! Is there any additional insight/direction that I can try? 

Thanks in Advance

Tags (3)
0 Kudos
9 Replies

1,234 Views
igorpadykov
NXP Employee
NXP Employee

Hi Anuradha

for low level debug/testing one can try unit tests, imx-test/..mxc_v4l2_test

www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-test-5.7.tar.gz

please also check attached Linux Manual Chapter 9
Video for Linux Two (V4L2) Driver, sect.9.6 Unit Test

For gstreamer-imx one can post on meta-fsl-arm mailing list, so that someone

familiar with it could try to assist you.
https://lists.yoctoproject.org/listinfo/meta-freescale

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,233 Views
tengri
Contributor IV

gary_bisson‌, can you also give us an insight to this, specifically can you confirm that the gstreamer-1.0 does not need an additional patch to support dma_allocation ? I use this driver on one of the BD's ubuntu prebuilt images. 

Thanks

0 Kudos

1,233 Views
gary_bisson
Senior Contributor III

Hi,

No GStreamer doesn't need another patch and works well for us. However note that you can't use the regular v4l2src but instead need to use the imx version:

$ gst-launch-1.0 imxv4l2videosrc device=/dev/video0 ! imxeglvivsink

In order to change the resolution, you need to pass a imx-capture-mode parameter.

Regards,

Gary

0 Kudos

1,234 Views
tengri
Contributor IV

Hello Gary,

I think this imxv4l2videosrc doesn't work on Ubuntu prebuilt images. I rebuilt the gstreamer with all required plugins. Now it seems like imxv4l2videosrc is usable (after that, v4l2src cannot be used any longer in a gst pipeline), but the eglvivsink window turns Green and crashes the system. Can you give me some hints to get this work !

Atleast the capturing works before building gstreamer ! But only with v4l2src and the capturing speed is too slow !

Thanks

0 Kudos

1,234 Views
gary_bisson
Senior Contributor III

Hi,

No the imxv4l2videosrc has been tested with ov5640 cameras using our prebuilt images and is known to work.

As for your issue, I'm sorry but I won't be able to help you further since you use a custom device we don't have. I think you've reached a point where you can debug both the driver and the plugin if needed.

Regards,

Gary

0 Kudos

1,234 Views
tengri
Contributor IV

Hi thanks for your confirmation Gary..... ! 

0 Kudos

1,234 Views
tengri
Contributor IV

Hi Gary, got the issue resolved by disabling the pci interrupts from the kernel. But the pipeline only seems to work with v4l2src, not imxv4l2videosrc (With this I am getting the same error as shown above). That's why I came to think whether gstreamer would require an additional patch. Moreover with eglvivsink, video capturing is pretty slow. 

0 Kudos

1,234 Views
tengri
Contributor IV

Further adding to the observations, 

By using newer kernel and tw686x driver (latest changes on Jan 13) :

linux-imx6/drivers/media/pci/tw686x at boundary-imx_4.1.15_2.0.0_ga · boundarydevices/linux-imx6 · G... 

above error disappeared for imx-capture-mode =0, but leaving a black vivsink window. For other formats, same error pops up. In any occasion, the video is not visible !    

0 Kudos

1,234 Views
tengri
Contributor IV

Further digging to this, by adding debug codes to pipeline, following error messages observed :

> With imxv4l2videosrc as the source
Setting pipeline to PAUSED ...
0:00:00.485079247 4148 0x2131f00 ERROR imxv4l2videosrc v4l2src.c:217:gst_imx_v4l2src_capture_setup:<imxv4l2videosrc0> VIDIOC_ENUM_FRAMESIZES failed: Inappropriate ioctl for device
0:00:00.485479242 4148 0x2131f00 ERROR imxv4l2videosrc v4l2src.c:284:gst_imx_v4l2src_start:<imxv4l2videosrc0> capture_setup failed
0:00:00.485666240 4148 0x2131f00 WARN basesrc gstbasesrc.c:3354:gst_base_src_start:<imxv4l2videosrc0> error: Failed to start
0:00:00.486115234 4148 0x2131f00 WARN basesrc gstbasesrc.c:3725:gst_base_src_activate_push:<imxv4l2videosrc0> Failed to start in push mode
0:00:00.486303232 4148 0x2131f00 WARN GST_PADS gstpad.c:1104:gst_pad_set_active:<imxv4l2videosrc0:src> Failed to activate pad
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
Additional debug info:
gstbasesrc.c(3354): gst_base_src_start (): /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0:
Failed to start
Setting pipeline to NULL ...
Freeing pipeline ...

> With v4l2src as the source

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.988085604 2825 0x20069b0 WARN v4l2bufferpool gstv4l2bufferpool.c:748:gst_v4l2_buffer_pool_start:<v4l2src0:pool:src> Uncertain or not enough buffers, enabling copy threshold

In this case only the black window appears !

Just asking to confirm, is following patch already added to the gstreamer on prebuilt image (20160802-nitrogen-4.1.15_1.2.0_ga-xenial-en_US-mate_armhf) or patching no longer required ? Im using following pipelines  :

$ gst-launch-1.0 imxv4l2videosrc device=/dev/video0 ! video/x-raw,width=720,height=480,pixelformat=UYVY ! imxipuvideotransform ! imxeglvivsink

$ gst-launch-1.0 imxv4l2videosrc imx-capture-mode=0 device=/dev/video0 ! imxipuvideotransform ! imxeglvivsink

0 Kudos