...
4 Appendix B
- Kill the Qt GUI application running on target board by executing the below commands from the serial console.
Code Block |
---|
|
$ killall -9 run_vcu.sh
$ killall -9 vcu_qt
$ killall -9 Xorg |
- To check the link status, resolution and video node of HDMI input source, run below xmedia-ctl command.
Code Block |
---|
|
$ xmedia-ctl -p -d /dev/media0 |
When HDMI source is connected to 4KP60 resolution, it shows:
Code Block |
---|
|
root@zcu106_vcu_trd:/media/card# xmedia-ctl -p -d /dev/media0
Media controller API version 4.14.0
Media device information
------------------------
driver xilinx-video
model Xilinx Video Composite Device
serial
bus info
hw revision 0x0
driver version 4.14.0
Device topology
- entity 1: vcap_hdmi output 0 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0 -----> Video node for HDMI Rx source
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-subdev0
pad0: Sink
[fmt:VYYUYY8_1X24/3840x2160 field:none]
<- "a0000000.v_hdmi_rx_ss":0 [ENABLED]
pad1: Source
[fmt:VYYUYY8_1X24/3840x2160 field:none]
-> "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-subdev1
pad0: Source
[fmt:VYYUYY8_1X24/3840x2160 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,custo]
[dv.detect:BT.656/1120 3840x2160p60 (4400x2250) stds:CEA-861 flags:CE-video] -----> Resolution and Frame-rate of HDMI Rx source
-> "a0080000.v_proc_ss":0 [ENABLED]
|
NOTE: Check resolution and frame-rate of "dv.detect" under "v_hdmi_rx_ss" node.
When HDMI source is not connected, it shows:
Code Block |
---|
|
root@zcu106_vcu_trd:/media/card# xmedia-ctl -p -d /dev/media0
Media controller API version 4.14.0
Media device information
------------------------
driver xilinx-video
model Xilinx Video Composite Device
serial
bus info
hw revision 0x0
driver version 4.14.0
Device topology
- entity 1: vcap_hdmi output 0 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0 -----> Video node for HDMI Rx source
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-subdev0
pad0: Sink
[fmt:VYYUYY8_1X24/3840x2160 field:none]
<- "a0000000.v_hdmi_rx_ss":0 [ENABLED]
pad1: Source
[fmt:VYYUYY8_1X24/3840x2160 field:none]
-> "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-subdev1
pad0: Source
[fmt:VYYUYY8_1X24/3840x2160 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,custo]
[dv.query:no-link] -----> HDMI Rx Link Status
-> "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 key on remote).
- Follow 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 |
---|
|
$ vcu_gst_app /media/card/config/input.cfg |
Below configurations needs to be set in input.cfg for HDMI-1080p60.
Code Block |
---|
|
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 |
---|
|
$ modetest -D a0070000.v_mix -s 39:3840x2160-60@AR24 -w 35:"alpha":0 |
- Run the following gst-launch-1.0 command to capture and play raw HDMI video and Audio using GStreamer pipeline.
Code Block |
---|
|
$ 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:1,1 ! queue ! audioconvert ! audioresample ! audio/x-raw, rate=48000, channels=2, format=S24_32LE ! alsasink device="hw:1,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 |
---|
|
$ 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:1,1 ! queue ! audioconvert ! audioresample ! audio/x-raw, rate=48000, channels=2, format=S24_32LE ! alsasink device="hw:1,0" |
- Run the following gst-launch-1.0 command to record HDMI video and audio using GStreamer pipeline.
Code Block |
---|
|
$ 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:1,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 |
---|
|
$ 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:1,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 |
---|
|
$ 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:1,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 |
---|
|
$ 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:1,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 |
---|
|
$ xmedia-ctl -d /dev/media0 -V "\"a0080000.v_proc_ss\":0 [fmt:RBG888_1X24/3840x2160 field:none]"
$ xmedia-ctl -d /dev/media0 -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 |
---|
|
$ xmedia-ctl -d /dev/media0 -V "\"a0080000.v_proc_ss\":0 [fmt:VYYUYY8_1X24/3840x2160 field:none]"
$ xmedia-ctl -d /dev/media0 -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.