1 Tutorials

The below sections describe the build and run flow tutorials of the DM3 - PL SDI Video Capture and SDI Display design. For the overview, software tools and system requirements, and design files, follow the link below:

1.1 Board Setup

  1. Connect the Micro USB cable into the ZCU106 Board Micro USB port J83, and the other end into an open USB port on the host PC. This cable is used for UART over USB communication.
  2. Insert the SD card with the images copied into the SD card slot J100.
  3. Set the SW6 switches as shown in the below Figure. This configures the boot settings to boot from SD.
  4. Connect 12V Power to the ZCU106 6-Pin Molex connector.vcu_trd_17p3_fig2.png
  5. Connect one end of SDI BNC cable to HD-BNC connector (J68) on board and another end to SDI source.
  6. Connect one end of SDI BNC cable to HD-BNC connector (J10) on board and another end to SDI monitor/HDMI monitor with SDI to HDMI Converter.
  7. For USB storage device, connect USB pen drive (Optional).
  8. For SATA storage device, connect SATA data cable to SATA 3.0 port. (Optional).
  9. Set up a terminal session between a PC COM port and the serial port on the evaluation board (See the Determine which COM to use to access the USB serial port on the ZCU106 board section for more details).
  10. Switch ON SW1 to power the ZCU106 board.

Figure below shows the ZCU106 board connections for SDIRX + SDITX design.
dm3_18p1.jpg


It takes about a minute for Linux to boot. User may miss the boot sequence while the terminal session is being configured.

Determine which COM to use to access the USB serial port on the ZCU106 board.
Make sure that the ZCU106 board is powered on and a micro USB cable is connected between ZCU106 board and host PC. This ensures that the USB-to-serial bridge is enumerated by the PC host.

Open your computer's Control Panel by clicking on Start > Control Panel.

Note that the Start button is typically located in the lower left corner of the screen. Occasionally, it is in the upper left corner.
  1. Click Device Manager to open the Device Manager window. Note: You may be asked to confirm opening the Device Manager. If so, click YES.
  2. Expand Ports (COM & LPT).
  3. Locate the Silicon Labs Quad CP210x USB to UART Bridge: Interface 0 (COM#).
  4. Note down the COM Port number for further steps.vcu_trd_17p3_fig4.png
  5. Close the Device Manager by clicking the red X in the upper right corner of the window.

Launch any Terminal application like Tera term to view the serial messages
  1. Launch Tera Term and open the COM port that is associated to Silicon Labs Quad CP210x USB to UART Bridge: Interface 0 of the USB-to-serial bridge.
  2. Set the COM port to 115200 Baud rate, 8, none, 1 –Set COM port.
  3. Power ON the board which has SD card. It boots Linux on board.

1.2 Build Flow


The following tutorials assume that the $TRD_HOME environment variable is set as given below.
% export TRD_HOME=</path/to/downloaded/zipfile>/rdf0428-zcu106-vcu-trd-2018-1

NOTE: It is recommended to follow the build steps in sequence.

1.2.1 Hardware Design

Refer to the Vivado Design Suite User Guide: Using the Vivado IDE, UG893, for setting up Vivado environment.

On Linux:
  1. Open a Linux terminal
  2. Change directory to $TRD_HOME/pl
  3. Run the following command in Vivado shell to create the Vivado IPI project and invoke the GUI for SDIRX + VCU + SDITX hardware design.

% vivado -source scripts/sdirxtx_proj.tcl
After executing the script, the vivado IPI block design comes up as shown:

dm3_v1_18p1.png



  • Click on “generate bitstream”.

Note: If the user gets any pop-up with “No implementation Results available”. Click “Yes”. Then, if any pop-up comes up with “Launch runs”, Click "OK”.

The design is implemented and a pop-up window comes up saying “Open Implemented Design”. Click "OK".

vcu_trd_17p3_fig7.png


After opening implemented design, the window looks as shown in the below figure.
Note: The actual results might graphically look different than the image shown

vcu_trd_17p3_fig8.png

  • Go to File > Export > Export Hardware

vcu_trd_17p3_fig9.png


  • In the Export Hardware Platform for SDK window select "Include bitstream" and click "OK".

vcu_trd_17p3_fig10.png

The HDF is created at $TRD_HOME/pl/sdirxtx/sdirxtx.sdk/sdirxtx_top.hdf

1.2.2 VCU PetaLinux BSP

This tutorial shows how to build the Linux image and boot image using the PetaLinux build tool.
PetaLinux Installation: Refer to the PetaLinux Tools Documentation (UG1144) for installation.
% source <path/to/petalinux-installer>/Petalinux-v2018.1/petalinux-v2018.1-final/settings.sh
% echo $PETALINUX
Post PetaLinux installation $PETALINUX environment variable should be set.
  • Configure and build the PetaLinux project for SDIRx VCU SDITx design.
% cd $TRD_HOME/apu/vcu_petalinux_bsp
% petalinux-create -t project -s xilinx-sdirx-vcu-sditx-trd-zcu106-zu7-v2018.1-final.bsp
% cd xilinx-sdirx-vcu-sditx-trd-zcu106-zu7-v2018.1-final
% petalinux-config --get-hw-description=$TRD_HOME/pl/pre-built/sdirx_vcu_sditx
% petalinux-build
NOTE:
  • If Vivado project is modified, then user is expected to configure the bsp with the modified hdf file and build.
% petalinux-config --get-hw-description=$TRD_HOME/pl/sdirxtx/sdirxtx.sdk
% petalinux-build
  • Build SDK components
% petalinux-build --sdk
% petalinux-package --sysroot
  • Create a boot image (BOOT.BIN) including FSBL, ATF, bitstream, and u-boot.
% cd images/linux
% petalinux-package --boot --fsbl zynqmp_fsbl.elf --u-boot u-boot.elf --pmufw pmufw.elf --fpga system.bit
  • Copy the generated boot image and Linux image to the SD card directory. Replace rev-x with board revision
% cp BOOT.BIN image.ub $TRD_HOME/images/sdirx-vcu-sditx/

1.2.3 VCU APM library

This tutorial shows how to build the VCU APM library.

NOTE: SYSROOT needs to be pre-configured before building VCU libraries.

% source <compiled petalinux bsp path>/images/linux/sdk/environment-setup-aarch64-xilinx-linux
  • Open the SDK workspace using the Xilinx SDK tool.
% cd $TRD_HOME/apu
% xsdk -workspace . &
  • From the menu bar, select File -> Import.., then select General -> Existing Projects into Workspace. Click Next.
vcu_trd_17p3_fig11.png

  • Browse to the $TRD_HOME/apu directory. Select “Deselect All” and then select vcu_apm_lib project. Click Finish.

vcu_trd_17p3_fig12.png


  • Right-click the vcu_apm_lib project and select 'Build Project'
vcu_trd_17p3_fig13.png


1.2.4 VCU Video library

This tutorial shows how to build the VCU video library.
  • From the menu bar, select File -> Import…, then select General -> Existing Projects into Workspace. Click Next.
  • Browse to the $TRD_HOME/apu directory. Select “Deselect All” and select vcu_video_lib project. Click Finish.
vcu_trd_17p3_fig14.png


  • Right-click the vcu_video_lib project and select 'Build Project'

1.2.5 VCU GST library

This tutorial shows how to build the VCU GST library.
  • From the menu bar, select File -> Import…, then select General -> Existing Projects into Workspace. Click Next.
  • Browse to the $TRD_HOME/apu directory. Select “Deselect All” and select vcu_gst_lib project. Click Finish.

vcu_trd_17p3_fig15.png


  • Right-click the vcu_gst_lib project and select 'Build Project'

1.2.6 VCU GST APP

This tutorial shows how to build the VCU GST APP.
  • From the menu bar, select File -> Import…, then select General -> Existing Projects into Workspace. Click Next.
  • Browse to the $TRD_HOME/apu directory. Select “Deselect All” and select vcu_gst_app project. Click Finish.

vcu_trd_18p1_fig15_1.png


  • Right-click the vcu_gst_app project and select 'Build Project'

1.3 Run Flow

vcu_SD_card_formatter_18p1.JPG


  • Copy all the files from the $TRD_HOME/images/sdirx-vcu-sditx/ to SD card directory to a FAT32 formatted SD card.
  • Power on the board; make sure INIT_B, done and all power rail LEDs are lit green.
  • After ~30 seconds, the display will turn on and the application will start automatically, targeting the max supported resolution of the monitor (3840x2160).
% source /media/card/autostart.sh

If you see the blue screen , Goto GStreaemer Application(vcu_gst_app) Section
Otherwise
1.killall -9 modetest
2.launch the modetest by running source /media/card/autostart.sh from command line

For 1080p60 monitor, replace modetest command in /media/card/autostart.sh with the below command.
modetest -M xlnx -s 36:1920x1080-60@YUYV  -w 36:sdi_mode:2 -w 36:sdi_data_stream:2 -w 36:is_frac:0 &

NOTE: The SD card file system is mounted at /media/card. Optional storage medium SATA and USB are mounted at /media/sata and /media/usb respectively.

1.3.1 GStreamer Application (vcu_gst_app)

The vcu_gst_app is a command line multi-threaded Linux application that uses the vcu_gst_lib interface similar to vcu_qt. The command line application requires an input configuration file (input.cfg) to be provided in plain text. Refer to the Appendix A - Input Configuration File (input.cfg) for the file format and description.

Before execution of vcu_gst_app, we need to check the SDI-Rx link status. Refer 4. On how to check the SDI Link Status
  • Execution of the application is shown below:
%vcu_gst_app <path and file input.cfg>

configuration files(input.cfg) for various Resolutions are placed in the following directory structure in /media/card/

config
├── 1080p60
│   ├── Display
│   ├── Record
│   └── Stream
├── 4kp30
│   ├── Display
│   ├── Record
│   └── Stream
├── 4kp60
│   ├── Display
│   ├── Record
│   └── Stream
└── input.cfg

Ex: 4kp60 HEVC_HIGH Pipeline execution
%vcu_gst_app /media/card/config/4kp60/Display/Single_4kp60_HEVC_HIGH.cfg

  • To measure the latency of the pipeline, run the below command, latency data will be huge so, better to dump to a file.
% GST_DEBUG="GST_TRACER:7" GST_TRACERS="latency;scheduletime"  vcu_gst_app <path and file input.cfg >& dump_log.txt



2 Other Information


2.1 Supported Features

Table below provides the supported encoder feature in this release.
Encoder Format
Command Line
Single Stream
HEVC 4kp60
x
AVC 4kp60
x
HEVC 4kp30

AVC 4kp30

HEVC 1080p

AVC 1080p


√ - Supported
x – Not supported
NA – Not applicable


3 Appendix A - Input Configuration File (input.cfg)

The example configuration files are stored at /media/card/config/ folder.

Common Configuration:
It is the starting point of common configuration.

Num of Input:
Provide the number of input. this is always 1 for this design.

Output:
Select the video interface.
Options: SDI


Out Type:
Options: display, record and stream

Display Rate:
Pipeline frame rate.
Options: 30 FPS or 60 FPS for each stream.


Exit:
It indicates to the application that the configuration is over.

Input Configuration:
It is the starting point of input configuration.

Input Num:
Starting Nth input configuration.
Options: 1

Input Type:
Input source type.
Options: SDI

Uri:
File path. Applicable for file playback only. File path should be appended by “file:/”
Options: file:/media/usb/abc.mp4

Raw:
To tell pipeline is processed or pass-through.
Options: True, False

Width:
The width of the live source.
Options: 3840, 1920

Height:
The height of the live source.
Options: 2160, 1080

Exit:
It indicates to the application that the configuration is over.

Encoder Configuration:
It is the starting point of encoder configuration.

Encoder Num:
Starting Nth encoder configuration.
Options: 1.

Encoder Name:
Name of the encoder.
Options: AVC, HEVC

Profile:
Name of the profile.
Options: baseline, main or high for AVC. Main for HEVC.

Rate Control:
Rate control options.
Options: CBR, VBR, and low-latency.

Filler Data:
Filler Data NAL units for CBR rate control.
Options: True, False

QP:
QP control mode used by the VCU encoder.
Options: Uniform or Auto

L2 Cache:
Enable or Disable L2Cache buffer in encoding process.
Options: True, False

Latency Mode:
Encoder latency mode.
Options: normal, sub_frame

Low Bandwidth:
If enabled, decrease the vertical search range used for P-frame motion estimation to reduce the bandwidth.
Options: True, False

Gop Mode:
Group of Pictures mode.
Options: Basic, low_delay_p, low_delay_b

Bitrate:
Target bitrate in Kbps
Options: 1-60000

B Frames:
Number of B-frames between two consecutive P-frames
Options: 0-4

Slice:
The number of slices produced for each frame. Each slice contains one or more complete macroblock/CTU row(s). Slices are distributed over the frame as regularly as possible. If slice-size is defined as well more slices may be produced to fit the slice-size requirement

Options:
4-22 4kp resolution with HEVC codec
4-32 4kp resolution with AVC codec
4-32 1080p resolution with HEVC codec
4-32 1080p resolution with AVC codec

GoP Length:
The distance between two consecutive I frames
Options: 1-1000

Format:
The format of input data.
Options: NV12

Preset:
Options: HEVC_HIGH, HEVC_MEDIUM, HEVC_LOW, AVC_HIGH, AVC_MEDIUM, AVC_LOW, Custom

Exit
It indicates to the application that the configuration is over.

Record Configuration:
It is the starting point of record configuration.

Record Num:
Starting Nth record configuration.
Options: 1.

Out File Name:
Record file path.
Options: /media/usb/abc.mp4

Duration:
Duration in minutes.
Options: 1-3

Exit
It indicates to the application that the configuration is over.

Streaming Configuration:
It is the starting point of streaming configuration.

Streaming Num:
Starting Nth Streaming configuration.
Options: 1.

Host IP:
The host to send the packets to
Options: 192.168.25.89 or Windows PC IP.

Port:
The port to send the packets to
Options: 5004,5008,5012 and 5016.


Exit
It indicates to the application that the configuration is over.

Trace Configuration:
It is the starting point of trace configuration.

FPS Info:
To display fps info on the console.
Options: True, False


APM Info:
To display APM counter number on the console.
Options: True, False

Pipeline Info:
To display pipeline info on console.
Options: True, False

Exit
It indicates to the application that the configuration is over.


4 SDI Link Status

  • Run the below command to check SDI link status and output format of the SDI input source.
$ media-ctl -d /dev/media0 -p
 
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_sdi output 0 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "80000000.smpte_uhdsdi_rx_ss":0 [ENABLED]
 
- entity 5: 80000000.smpte_uhdsdi_rx_ss (1 pad, 1 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        pad0: Source
                [fmt:UYVY8_1X16/3840x2160 field:none]  ->Output format and resolution
                -> "vcap_sdi output 0":0 [ENABLED]
 

If SDI-Rx link has issue, it appears as below.
$ media-ctl -d /dev/media0 -p
 
root@zcu106_vcu_trd:/media/card# media-ctl -d /dev/media0  -p
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_sdi output 0 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "80000000.smpte_uhdsdi_rx_ss":0 [ENABLED]
 
- entity 5: 80000000.smpte_uhdsdi_rx_ss (1 pad, 1 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        pad0: Source
                -> "vcap_sdi output 0":0 [ENABLED]