UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer rjmoss
Observer
746 Views
Registered: ‎08-14-2018

v2018.3 VCU TRD - HDMI Video Capture Design Module - Help with GStreamer Command Line Failure unless VCU_GST_APP is run first (gst_v4l2_buffer_pool_streamon Broken Pipe)

Jump to solution

Versions:
ZCU106 Production Board
HDMI Source Used:  NVIDIA Shield TV (4K)
TRD Bundle:  rdf0428-zcu106-vcu-trd-2018-3.zip (MD5SUM: 7b704ca012ed0e0f5656eed655fa40e7)
Design Module:  https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/31916173/Zynq+UltraScale+MPSoC+VCU+TRD+2018.3+-+HDMI+Video+Capture

Attachments:

1. debug-hdmi-rx_vcu_gst_app.txt : GStreamer debug output captured during execution of vcu_gst_app with HDMI-RX input
2. debug-hdmi-rx_gstreamer_command_line.txt : GStreamer debug output captured during execution of gstreamer command line with HDMI-RX input
3. hdmi-rx_vcu-gst-app_vs_gstreamer_bufferpoolissue.docx : Highlighted comparison of Debug Logs

Issue:

The gstreamer command line for the HDMI Video Capture design module fails unless you first execute the VCU_GST_APP, which must do additional configuration that is not documented for the GStreamer command line example.

Request:

1. Help identify how to properly initialize buffer pool with GStreamer Command Line (so you don't have to run VCU_GST_APP) in order to build HDMI-RX command line examples with the TRD.

How to Replicate on the ZCU106 with the HDMI Video Capture Design Module pre-built images:

A. Failing Example with the GStreamer Command Line

Make sure you're executing these instructions from a clean power-up.

# Configure the V4L2 device output (which will match the expected format for the VCU encoder)
root@zcu106_vcu_trd:~# v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840,height=2160,pixelformat='NV12'

# Configure the scaler input to match the input format of the incoming HDMI Stream
root@zcu106_vcu_trd:~# xmedia-ctl -d /dev/media0 -V '"a0080000.v_proc_ss":0 [fmt:RGB888_1X24/3840x2160]'

# Configure the scaler output to match the V4L2 device output (NV12 is VYYUYY8_1X24)
root@zcu106_vcu_trd:~# xmedia-ctl -d /dev/media0 -V '"a0080000.v_proc_ss":1 [fmt:VYYUYY8_1X24/3840x2160]'

# Execute the GStreamer Command Line Example from the Wiki
root@zcu106_vcu_trd:~# GST_DEBUG=v4l2*:5,v4l2bufferpool:7,vgst*:5,*omx*:5 gst-launch-1.0 -v v4l2src device=/dev/video0 io-mode=4 ! \
video/x-raw, format=NV12, width=3840, height=2160, framerate=60/1 ! \
omxh264enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=10000 num-slices=8 control-rate=constant \
prefetch-buffer=true low-bandwidth=false filler-data=true latency-mode=normal ! \
queue ! mpegtsmux alignment=7 name=mux ! filesink location="/media/usb/hdmi-rx_debug_stream.ts"

# Resulting debug output captures the failure

v4l2bufferpool gstv4l2bufferpool.c:979:gst_v4l2_buffer_pool_flush_stop:<v4l2src0:pool:src> stop flushing
v4l2bufferpool gstv4l2bufferpool.c:641:gst_v4l2_buffer_pool_streamon:<v4l2src0:pool:src> error with STREAMON 32 (Broken pipe)
omxvideoenc gstomxvideoenc.c:3754:gst_omx_video_enc_sink_event:<omxh264enc-omxh264enc0> Upstream allocated 5 buffers
v4l2bufferpool gstv4l2bufferpool.c:1336:gst_v4l2_buffer_pool_acquire_buffer:<v4l2src0:pool:src> acquire
v4l2bufferpool gstv4l2bufferpool.c:1054:gst_v4l2_buffer_pool_poll:<v4l2src0:pool:src> polling device
v4l2bufferpool gstv4l2bufferpool.c:1091:gst_v4l2_buffer_pool_poll:<v4l2src0> error: poll error 1: Broken pipe (32)
v4l2bufferpool gstv4l2bufferpool.c:1308:gst_v4l2_buffer_pool_dqbuf:<v4l2src0:pool:src> poll error error
v4l2src gstv4l2src.c:1105:gst_v4l2src_create:<v4l2src0> error: Failed to allocate a buffer
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not read from resource.
omxvideoenc gstomxvideoenc.c:3316:gst_omx_video_enc_drain:<omxh264enc-omxh264enc0> Draining component
Additional debug info:
../../../git/sys/v4l2/gstv4l2bufferpool.c(1091): gst_v4l2_buffer_pool_poll (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
poll error 1: Broken pipe (32)
omxvideoenc gstomxvideoenc.c:3321:gst_omx_video_enc_drain:<omxh264enc-omxh264enc0> Component not started yet

B. Working Example with the VCU_GST_APP executed first

Make sure you're executing these instructions from a clean power-up.

# Configure the V4L2 device output (which will match the expected format for the VCU encoder)
root@zcu106_vcu_trd:~# v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840,height=2160,pixelformat='NV12'

# Configure the scaler input to match the input format of the incoming HDMI Stream
root@zcu106_vcu_trd:~# xmedia-ctl -d /dev/media0 -V '"a0080000.v_proc_ss":0 [fmt:RGB888_1X24/3840x2160]'

# Configure the scaler output to match the V4L2 device output (NV12 is VYYUYY8_1X24)
root@zcu106_vcu_trd:~# xmedia-ctl -d /dev/media0 -V '"a0080000.v_proc_ss":1 [fmt:VYYUYY8_1X24/3840x2160]'

# Execute the VCU_GST_APP
root@zcu106_vcu_trd:~# GST_DEBUG=v4l2*:5,v4l2bufferpool:7,vgst*:5,*omx*:5 /media/card/bin/vcu_gst_app /media/card/config/4kp60/Record/Single_4kp60_AVC_LOW.cfg

NOW STOP the video recording, and re-run the GStreamer command line to initiate a capture with GStreamer

Make sure you're executing these instructions after a successful VCU_GST_APP run

# Execute the GStreamer Command Line Example from the Wiki
root@zcu106_vcu_trd:~# GST_DEBUG=v4l2*:5,v4l2bufferpool:7,vgst*:5,*omx*:5 gst-launch-1.0 -v v4l2src device=/dev/video0 io-mode=4 ! \
video/x-raw, format=NV12, width=3840, height=2160, framerate=60/1 ! \
omxh264enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=10000 num-slices=8 control-rate=constant \
prefetch-buffer=true low-bandwidth=false filler-data=true latency-mode=normal ! \
queue ! mpegtsmux alignment=7 name=mux ! filesink location="/media/usb/hdmi-rx_debug_stream.ts"

The GStreamer Pipeline works properly if executed after the VCU_GST_APP

Thanks,

Jason

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
624 Views
Registered: ‎04-12-2017

Re: v2018.3 VCU TRD - HDMI Video Capture Design Module - Help with GStreamer Command Line Failure unless VCU_GST_APP is run first (gst_v4l2_buffer_pool_streamon Broken Pipe)

Jump to solution

Hello @rjmoss 

I have two questions for you to move forward on this

1. what is the HDMI source are you using in this case?

2. What is the output of xmedia-ctl -p -d /dev/media0   ?

 

Please note before calling the Gst-launch tool you should chose one out of the following media-ctl pipeline and edit it for your resolution to set up the video pipeline.

media-ctl.PNG

Let me know if it helps.

Thank you

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
3 Replies
Moderator
Moderator
653 Views
Registered: ‎04-12-2017

Re: v2018.3 VCU TRD - HDMI Video Capture Design Module - Help with GStreamer Command Line Failure unless VCU_GST_APP is run first (gst_v4l2_buffer_pool_streamon Broken Pipe)

Jump to solution

Hello @rjmoss 

I am reproducing this issue on my side.

Spare me some time to get back to you.

Thank You

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Moderator
Moderator
625 Views
Registered: ‎04-12-2017

Re: v2018.3 VCU TRD - HDMI Video Capture Design Module - Help with GStreamer Command Line Failure unless VCU_GST_APP is run first (gst_v4l2_buffer_pool_streamon Broken Pipe)

Jump to solution

Hello @rjmoss 

I have two questions for you to move forward on this

1. what is the HDMI source are you using in this case?

2. What is the output of xmedia-ctl -p -d /dev/media0   ?

 

Please note before calling the Gst-launch tool you should chose one out of the following media-ctl pipeline and edit it for your resolution to set up the video pipeline.

media-ctl.PNG

Let me know if it helps.

Thank you

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
Observer rjmoss
Observer
562 Views
Registered: ‎08-14-2018

Re: v2018.3 VCU TRD - HDMI Video Capture Design Module - Help with GStreamer Command Line Failure unless VCU_GST_APP is run first (gst_v4l2_buffer_pool_streamon Broken Pipe)

Jump to solution

In case anyone else encounters this, there were two issues with the media device configuration:

  1. Media sub-device configuration was missing the "field:none" parameter
  2. the format for the Sink pad of the scaler was incorrect - this should have been RBG888_1X24, but instead was RGB888_1X24