Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


4 Appendix B

  • Kill the Qt GUI application running on target board by executing the below commands from the serial console.
Code Block
themeMidnight
$ killall -9 run_vcu.sh
$ killall -9 vcu_qt
$ killall -9 Xorg
  • HDMI source can be locked to any resolution. Run the below command for all media nodes to print media device topology where "mediaX" represents different media nodes. In the topology, log look for the “v_hdmi_rx_ss” string to identify the HDMI input source media node.
Code Block
themeMidnight
$ xmedia-ctl -p -d /dev/mediaX

When HDMI source is connected to 1080P60 resolution, it shows:

Code Block
themeMidnight
root@zcu106_vcu_trd:/media/card# xmedia-ctl -d /dev/media1 -p
Media controller API version 4.19.0

Media device information
------------------------
driver          xilinx-video
model           Xilinx Video Composite Device
serial
bus info
hw revision     0x0
driver version  4.19.0

Device topology
- entity 1: vcap_hdmi output 0 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "a0080000.v_proc_ss":1 [ENABLED]

- entity 5: a0080000.v_proc_ss (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev6
        pad0: Sink
                [fmt:Y8_1X8/1280x720 field:none colorspace:srgb]
                <- "a0000000.v_hdmi_rx_ss":0 [ENABLED]
        pad1: Source
                [fmt:Y8_1X8/1920x1080 field:none colorspace:srgb]
                -> "vcap_hdmi output 0":0 [ENABLED]

- entity 8: a0000000.v_hdmi_rx_ss (1 pad, 1 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev7
        pad0: Source
                [fmt:VUY8_1X24/1920x1080 field:none colorspace:rec709]
                [dv.caps:BT.656/1120 min:0x0@25000000 max:4096x2160@297000000 stds:CEA-861,DMT,CVT,GTF caps:progressive,reduced-blanking,custom]
                [dv.detect:BT.656/1120 1920x1080p60 (2200x1125) stds:CEA-861 flags:CE-video]
                -> "a0080000.v_proc_ss":0 [ENABLED]

NOTE: Check resolution and frame-rate of "dv.detect" under "v_hdmi_rx_ss" node.

When the HDMI source is not connected, it shows:

Code Block
themeMidnight
root@zcu106_vcu_trd:/media/card# xmedia-ctl -d /dev/media1 -p
Media controller API version 4.19.0

Media device information
------------------------
driver          xilinx-video
model           Xilinx Video Composite Device
serial
bus info
hw revision     0x0
driver version  4.19.0

Device topology
- entity 1: vcap_hdmi output 0 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "a0080000.v_proc_ss":1 [ENABLED]

- entity 5: a0080000.v_proc_ss (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev6
        pad0: Sink
                [fmt:Y8_1X8/1280x720 field:none colorspace:srgb]
                <- "a0000000.v_hdmi_rx_ss":0 [ENABLED]
        pad1: Source
                [fmt:Y8_1X8/1920x1080 field:none colorspace:srgb]
                -> "vcap_hdmi output 0":0 [ENABLED]

- entity 8: a0000000.v_hdmi_rx_ss (1 pad, 1 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev7
        pad0: Source
                [fmt:RBG888_1X24/1280x720 field:none colorspace:srgb]
                [dv.caps:BT.656/1120 min:0x0@25000000 max:4096x2160@297000000 stds:CEA-861,DMT,CVT,GTF caps:progressive,reduced-blanking,custom]
                [dv.query:no-link]
                -> "a0080000.v_proc_ss":0 [ENABLED]


NOTE: Here "dv.query:no-link" under "v_hdmi_rx_ss" node shows HDMI-Rx source is not connected or HDMI-Rx source is not active(Try waking up the device by pressing a key on remote).

  • Follow the below steps to switch the HDMI-Rx resolution from 1080p60 to 4kp60.
    • Check current HDMI Input Source Resolution (1080p60) by following the above-mentioned steps.
    • Run vcu_gst_app for current HDMI resolution (1080p60) by executing the following command.
Code Block
themeMidnight
$ vcu_gst_app /media/card/config/input.cfg

Below configurations needs to be set in input.cfg for HDMI-1080p60.

Code Block
themeMidnight
Common Configuration    : START
Num Of Input            : 1
Output                  : HDMI
Out Type                : Display
Frame Rate              : 60
Exit

Input Configuration     : START
Input Num               : 1
Input Type              : hdmi
Raw                     : TRUE
Width                   : 1920
Height                  : 1080
Exit
    • Change Resolution of HDMI Input Source from 1080p60 to 4kp60 by following below steps.
      • Set the HDMI source resolution to 4kp60 (Home page → settings → display & Sound → Resolution → change to 4kp60).
      • Save the configuration to take place the change.
    • Verify the desired HDMI Input Source Resolution (4kp60) by following the above-mentioned steps.
  • If HDMI Tx link-up issue is observed after Linux booting, use the following command:
Code Block
themeMidnight
$ modetest -D a0070000.v_mix -s 40:3840x2160-60@AR24 -w 36:"alpha":0
  • Run the following gst-launch-1.0 command to capture and play raw HDMI video and Audio using GStreamer pipeline.
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, width=3840, height=2160, framerate=60/1, format=NV12 ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix" alsasrc device=hw:2,1 ! queue ! audioconvert ! audioresample ! audio/x-raw, rate=48000, channels=2, format=S24_32LE ! alsasink device="hw:2,0"
  • Run the following gst-launch-1.0 command to capture and play processed(capture → encode → decode → display) HDMI video and raw HDMI Audio using GStreamer pipeline.
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, width=3840, height=2160, framerate=60/1, format=NV12 ! omxh265enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false filler-data=true latency-mode=normal ! video/x-h265, profile=main ! h265parse ! omxh265dec internal-entropy-buffers=5 latency-mode=normal ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix" alsasrc device=hw:2,1 ! queue ! audioconvert ! audioresample ! audio/x-raw, rate=48000, channels=2, format=S24_32LE ! alsasink device="hw:2,0"
  • Run the following gst-launch-1.0 command to record HDMI video and audio using GStreamer pipeline.
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 num-buffers=3600 ! video/x-raw, format=NV12, width=3840, height=2160, framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false filler-data=true latency-mode=normal ! h265parse ! mux. alsasrc device=hw:2,1 num-buffers=3600 ! audio/x-raw, format=S24_32LE, rate=48000, channels=2 ! queue max-size-buffers=0 max-size-time=0 ! audioconvert ! faac ! aacparse ! queue max-size-bytes=0 ! mpegtsmux name=mux ! filesink location = "/media/usb/test.ts"

NOTE: File location should be USB-3.0 to avoid the read-write bandwidth issue.

  • Run the following gst-launch-1.0 command to play the recorded file using the GStreamer pipeline.
Code Block
themeMidnight
$ gst-launch-1.0 uridecodebin uri="file:///media/usb/test.ts" name=decode ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix" decode. ! audioconvert ! audioresample ! audio/x-raw, rate=48000, channnels=2, format=S24_32LE ! alsasink device="hw:2,0"

NOTE: File location should be USB-3.0 to avoid the read-write bandwidth issue.

  • Run the following gst-launch-1.0 command to stream-out HDMI video and audio using GStreamer pipeline.
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, format=NV12, width=3840, height=2160, framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false filler-data=true latency-mode=normal ! h265parse ! mux. alsasrc device=hw:2,1 ! audio/x-raw, format=S24_32LE, rate=48000, channels=2 ! queue max-size-buffers=0 max-size-time=0  ! audioconvert ! faac ! aacparse ! queue max-size-bytes=0 ! mpegtsmux name=mux ! rtpmp2tpay ! udpsink host=192.168.25.89 port=5004

NOTE: Here 192.168.25.89 is host/client IP address and 5004 is port no.

  • Run the following gst-launch-1.0 command to play stream-in video and audio using Gstreamer pipeline where 5004 is port no.
Code Block
themeMidnight
$ gst-launch-1.0 udpsrc port=5004 buffer-size=60000000 caps="application/x-rtp, clock-rate=90000" ! rtpjitterbuffer latency=1000 ! rtpmp2tdepay ! tsparse ! video/mpegts ! tsdemux name=demux demux. ! queue ! h265parse ! omxh265dec internal-entropy-buffers=5 latency-mode=normal ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix" demux. ! queue  max-size-bytes=0 max-size-time=0 max-size-buffers=0 ! aacparse ! faad ! audioconvert ! audioresample ! audio/x-raw, rate=48000, channnels=2, format=S24_32LE ! alsasink device="hw:2,0"

Note: Low latency stream-in pipeline cannot be launched with vcu-gst-app. Hence use below gst-launch pipelines : 

  • Run the following gst-launch-1.0 command for low-latency stream-out pipeline. Where "videoX" indicates a video node for the input source. Below pipeline is when audio input source is HDMI.[hw:2,1]
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/videoX io-mode=4 ! video/x-raw, format=NV12, width=3840, height=2160, framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=low-latency prefetch-buffer=true low-bandwidth=false filler-data=true cpb-size=1000 initial-delay=500 periodicity-idr=60 ! video/x-h265, profile=main, alignment=nal ! queue max-size-bytes=0 ! mux. alsasrc device=hw:2,1 ! audio/x-raw, format=S24_32LE, rate=48000, channels=2 ! queue max-size-buffers=0 max-size-time=0  ! audioconvert ! faac ! aacparse ! queue max-size-bytes=0 ! mpegtsmux name=mux ! rtpmp2tpay ! udpsink host=192.168.25.89 port=5004 

NOTE:Here 192.168.25.89 is host/client IP address and 5004 is port no. 

  • Run the following gst-launch-1.0 command to display low-latency stream-in on HDMI-Tx video using Gstreamer pipeline where 5004 is port no.Below pipeline is when audio sink is HDMI.[hw:2,0]
Code Block
themeMidnight
$ gst-launch-1.0 udpsrc port=5004 buffer-size=60000000 caps="application/x-rtp, clock-rate=90000" ! rtpjitterbuffer latency=1000 ! rtpmp2tdepay ! tsparse ! video/mpegts ! tsdemux name=demux demux. ! queue ! h265parse ! video/x-h265, profile=main, alignment=nal ! omxh265dec internal-entropy-buffers=5 low-latency=1 ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix" demux. ! queue  max-size-bytes=0 max-size-time=0 max-size-buffers=0 ! aacparse ! faad ! audioconvert ! audioresample ! audio/x-raw, rate=48000, channnels=2, format=S24_32LE ! alsasink device="hw:2,0" 

GST LAUNCH COMMANDS FOR MIPI video, I2S Audio: 

  • Run the following gst-launch-1.0 command to capture and play raw MIPI video and I2S Audio using GStreamer pipeline.
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 ! video/x-raw, width=3840, height=2160, framerate=60/1, format=NV12 ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix" alsasrc device=hw:0,1 ! queue ! audioconvert ! audioresample ! audio/x-raw, rate=48000, channels=2, format=S24_32LE ! alsasink device="hw:0,0"
  • Run the following gst-launch-1.0 command to capture and play processed(capture → encode → decode → display) MIPI video and raw I2S Audio using GStreamer pipeline.
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 ! video/x-raw, width=3840, height=2160, framerate=60/1, format=NV12 ! omxh265enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false filler-data=true latency-mode=normal ! video/x-h265, profile=main ! h265parse ! omxh265dec internal-entropy-buffers=5 latency-mode=normal ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix" alsasrc device=hw:0,1 ! queue ! audioconvert ! audioresample ! audio/x-raw, rate=48000, channels=2, format=S24_32LE ! alsasink device="hw:0,0"
  • Run the following gst-launch-1.0 command to record MIPI video and I2S audio using GStreamer pipeline.
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 num-buffers=3600 ! video/x-raw, format=NV12, width=3840, height=2160, framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false filler-data=true latency-mode=normal ! h265parse ! mux. alsasrc device=hw:0,1 num-buffers=3600 ! audio/x-raw, format=S24_32LE, rate=48000, channels=2 ! queue max-size-buffers=0 max-size-time=0 ! audioconvert ! faac ! aacparse ! queue max-size-bytes=0 ! mpegtsmux name=mux ! filesink location = "/media/usb/test.ts"

NOTE: File location should be USB-3.0 to avoid the read-write bandwidth issue.

  • Run the following gst-launch-1.0 command to play the recorded file using the GStreamer pipeline.
Code Block
themeMidnight
$ gst-launch-1.0 uridecodebin uri="file:///media/usb/test.ts" name=decode ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix" decode. ! audioconvert ! audioresample ! audio/x-raw, rate=48000, channnels=2, format=S24_32LE ! alsasink device="hw:0,0"

NOTE: File location should be USB-3.0 to avoid the read-write bandwidth issue.

  • Run the following gst-launch-1.0 command to stream-out MIPI video and I2S audio using GStreamer pipeline.
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 ! video/x-raw, format=NV12, width=3840, height=2160, framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false filler-data=true latency-mode=normal ! h265parse ! mux. alsasrc device=hw:0,1 ! audio/x-raw, format=S24_32LE, rate=48000, channels=2 ! queue max-size-buffers=0 max-size-time=0  ! audioconvert ! faac ! aacparse ! queue max-size-bytes=0 ! mpegtsmux name=mux ! rtpmp2tpay ! udpsink host=192.168.25.89 port=5004

NOTE: Here 192.168.25.89 is host/client IP address and 5004 is port no.

  • Run the following gst-launch-1.0 command to play stream-in video and audio using Gstreamer pipeline where 5004 is port no.
Code Block
themeMidnight
$ gst-launch-1.0 udpsrc port=5004 buffer-size=60000000 caps="application/x-rtp, clock-rate=90000" ! rtpjitterbuffer latency=1000 ! rtpmp2tdepay ! tsparse ! video/mpegts ! tsdemux name=demux demux. ! queue ! h265parse ! omxh265dec internal-entropy-buffers=5 latency-mode=normal ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix" demux. ! queue  max-size-bytes=0 max-size-time=0 max-size-buffers=0 ! aacparse ! faad ! audioconvert ! audioresample ! audio/x-raw, rate=48000, channnels=2, format=S24_32LE ! alsasink device="hw:0,0"

Note: Low latency stream-in pipeline cannot be launched with vcu-gst-app. Hence use below gst-launch pipelines : 

  • Run the following gst-launch-1.0 command for low-latency stream-out pipeline. Where "videoX" indicates a video node for the input source. Below pipeline is when audio input source is I2s.[hw:0,1]
Code Block
themeMidnight
$ gst-launch-1.0 v4l2src device=/dev/videoX io-mode=4 ! video/x-raw, format=NV12, width=3840, height=2160, framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=low-latency prefetch-buffer=true low-bandwidth=false filler-data=true cpb-size=1000 initial-delay=500 periodicity-idr=60 ! video/x-h265, profile=main, alignment=nal ! queue max-size-bytes=0 ! mux. alsasrc device=hw:0,1 ! audio/x-raw, format=S24_32LE, rate=48000, channels=2 ! queue max-size-buffers=0 max-size-time=0  ! audioconvert ! faac ! aacparse ! queue max-size-bytes=0 ! mpegtsmux name=mux ! rtpmp2tpay ! udpsink host=192.168.25.89 port=5004 

NOTE:Here 192.168.25.89 is host/client IP address and 5004 is port no. 

  • Run the following gst-launch-1.0 command to display low-latency stream-in on HDMI-Tx video using Gstreamer pipeline where 5004 is port no.Below pipeline is when audio sink is I2s.[hw:0,0]
Code Block
themeMidnight
$ gst-launch-1.0 udpsrc port=5004 buffer-size=60000000 caps="application/x-rtp, clock-rate=90000" ! rtpjitterbuffer latency=1000 ! rtpmp2tdepay ! tsparse ! video/mpegts ! tsdemux name=demux demux. ! queue ! h265parse ! video/x-h265, profile=main, alignment=nal ! omxh265dec internal-entropy-buffers=5 low-latency=1 ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix" demux. ! queue  max-size-bytes=0 max-size-time=0 max-size-buffers=0 ! aacparse ! faad ! audioconvert ! audioresample ! audio/x-raw, rate=48000, channnels=2, format=S24_32LE ! alsasink device="hw:0,0" 


Notes for gst-launch-1.0 commands:

  • Make sure HDMI-Rx media pipeline is configured for 4kp60 resolution and source/sink have the same colour format. Run below xmedia-ctl commands to set resolution and format of HDMI scaler node.

When HDMI Input Source is NVIDIA SHIELD

Code Block
themeMidnight
$ xmedia-ctl -d /dev/media1 -V "\"a0080000.v_proc_ss\":0  [fmt:RBG888_1X24/3840x2160 field:none]"
$ xmedia-ctl -d /dev/media1 -V "\"a0080000.v_proc_ss\":1  [fmt:VYYUYY8_1X24/3840x2160 field:none]"

NOTE: Make sure NVIDIA SHIELD is configured for 4kp resolution and RGB888 colour format.

When HDMI Input Source is ABOX

Code Block
themeMidnight
$ xmedia-ctl -d /dev/media1 -V "\"a0080000.v_proc_ss\":0  [fmt:VYYUYY8_1X24/3840x2160 field:none]"
$ xmedia-ctl -d /dev/media1 -V "\"a0080000.v_proc_ss\":1  [fmt:VYYUYY8_1X24/3840x2160 field:none]"

NOTE: Make sure ABOX is configured for 4kp resolution and VYYUYY8 colour format.

...