Advantech VEGA-3311 Quick Start Manual

Advantech VEGA-3311 Quick Start Manual

4k hevc broadcast video encoding / decoding card

Advertisement

Quick Links

4K HEVC Broadcast Video
Encoding / Decoding Card
Author
Leo Tsao (Software), Jay Chi (Hardware)
Status
Version 1.3.1
Document ID
VEGA-3311-QSM-003
History
Version
1.3.1
1.1.1
1.0.0
Approved by
Copyright@2016, Advantech Co., Ltd., All Right reserved.
VEGA-3311
Quick Start Manual
Date
Handled by
2018.11.27
Holland Huang
2018.05.18
Holland Huang
Kevin Chien
2017.01.24
(Product Manager)
Comments
Revise the context for SDK
v1.3.1
Revise the context for SDK
v1.1.1
Initial draft
Page
1
of
56

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the VEGA-3311 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Advantech VEGA-3311

  • Page 1 Handled by Comments 1.3.1 2018.11.27 Holland Huang Revise the context for SDK v1.3.1 1.1.1 2018.05.18 Holland Huang Revise the context for SDK v1.1.1 Kevin Chien 1.0.0 2017.01.24 Initial draft (Product Manager) Approved by Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 2 Date Approved By 2017.01.24 Dick Lin (Software), Tony Tsai (Hardware) Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 3: Table Of Contents

    ................43 APTURE SAGE ASES OF MPEG APPENDIX A: UPGRADE CODEC FIRMWARE ..........44 APPENDIX B: UPGRADE FPGA RECEIVER FIRMWARE ....... 49 APPENDIX C: SWITCH SETTING AND RE-WRITE CODEC FIRMWARE ..50 Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 4 Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 5: Product Introduction

    1. Product Introduction 1.1 General Introduction VEGA-3311 enables HEVC, AVC, MPEG2 real-time 1-ch 4K Ultra HD (2160p60) and 4-ch FHD (1080p60) encode and decode. It is particularly relevant for 4K Ultra HD transmission which requires a much higher stream capacity.
  • Page 6: Installing Vega-3311

    8. Check the software has been installed correctly by running the demo and checking the output. If there is no error reported, then VEGA-3311 is now ready for performing video encoding task. Note that only one board per system is supported in the current early access driver.
  • Page 7: Software Installation

    (can be ignored for VEGA-3311) vega3311_fpga_x64 software package for VEGA-3311 FPGA ffmpeg directory tree: Directory/Subdirectory name Remarks ffmpeg ffmpeg_source A working copy of ffmpeg v3.4.1 with Advantech patch vega_bqb_avc libvegabqbavc AVC encoder source vega_bqb_hevc libvegabqbhevc HEVC source vega3311_ff_capture libvega3311-capture source advantech_v1_3_1.patch The patch file for original ffmpeg source.
  • Page 8 SDI output (not available in v1.3.1) vega3311_display_api VEGA transmission API library for SDI output (not available in v1.3.1) vega3311_transmit_api VEGA transmission API library tools fpga_fw FPGA firmware vega3311_fpgautil FPGA utility tool Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 9: Install Drivers And Applications For Host

    $ dmesg snip m30smb(-1):<2>fmb_hw_memmap(111):BAR Config : 32bit-config m30smb(-1):<2>fmb_hw_pci_probe(1916):DMA mask : 64bit m30smb(0):<2>fmb_hw_pci_probe(1988):interrupt Handler Registration m30smb(0):<2>fmb_hw_pci_probe(1992):PCIe fmb device now attached to m30smb m30smb(0):<2>fmb_hw_pci_probe(1994): major : 242 minor snip Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 10 /usr/local/bin vega_bqb_sysctl Sample application /usr/local/lib libvega_bqb_sysctl.a System control API static library /usr/local/lib libvega_bqb_ sysctl.so System control API library /usr/local/include/ VEGA_BQB_decoder.h Video decoder header file libvega_bqb_api /usr/local/include/ VEGA_BQB_system.h System control header file libvega_bqb_api Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 11: Install Driver And Application For Fpga Receiver

    0000:03:00.0: Major 243 Minor 0 assigned vega3311_fpga 0000:03:00.0: Added device to the sys file system vega3311_fpga 0000:03:00.0: VEGA3311 FPGA BAR0 mapped to 0xffffc90003000000 vega3311_fpga 0000:03:00.0: VEGA3311 FPGA BAR2 mapped to 0xffffc90004800000 Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 12 0000:03:00.0: Translation src base low = 0xf0000000 vega3311_fpga 0000:03:00.0: Translation src base high = 0x0 vega3311_fpga 0000:03:00.0: Translation dst base low = 0x44a00000 vega3311_stc_proc_add_entry minor 0 vega3311_stc_proc_add_entry 0: try to create directory vega3311 snip Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 13 VEGA capture types definition ga_capture_api /usr/local/include/libve VEGA3311_cap_types.h VEGA capture header file ga_capture_api /usr/local/include/libve vega3311_fpga_drv.h FPGA user mode driver header file ga_capture_api /usr/local/include/libve VEGA3311_transmit.h VEGA transmission types definition ga_transmit_api /usr/local/include/libve VEGA3311_trans_types.h VEGA transmission header file ga_transmit_api Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 14: Compile And Install Ffmpeg

    The ffmpeg_source folder in software package is a working copy of ffmpeg version 3.4.1 that has applied Advantech patch, the compilation and installation method are the same as original ffmpeg usage. Follow the steps to install vega_bqb_avc, vega_bqb_hevc library and ffmpeg program.
  • Page 15 $ sudo make install Make and install ffmpeg. $ cd ffmpeg/ffmpeg_source $ PATH="/usr/local/bin:$PATH" PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" $ ./configure --enable-shared --enable-libvegabqbavc --enable-libvegabqbhevc --enable-libvega3311-capture --enable-nonfree $ make $ sudo make install Load the plug-in libraries. $ sudo ldconfig Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 16: Sample Application

    YUV4:2:0 8bit (NV12 format, refer to Figure 1) YUV4:2:2 8bit (NV16 format, refer to Figure 1) YUV4:2:0 10bit(P010 format with packed data, refer to Figure 2) YUV4:2:2 10bit(P210 format with packed data, refer to Figure 2) Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 17 Figure 1: YUV 8bit format Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 18 Figure 2: YUV 10bit format Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 19 | ES 19 | HEVC | 1920x1080 | 60 | 420 | IB | Y | ES interlace 20 | HEVC | 1920x1080 | 60 | 422 | IB | Y | ES Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 20 Ave VBR : 0 kbps Min VBR : 0 kbps PTS mode : AUTO Output Format : ES Weighted Pred. : Bi-direction M30_DEV_SET_ENCODER_MAIN_STATE:state=2 encode_mode=0 M30_DEV_SET_ENCODER_MAIN_STATE:state=3 encode_mode=1 M30_DEV_CHANGE_EH_ID_STATE: state=2 id_bits=0x1 |:56 fps Snip Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 21 $ ffplay -vf "scale=1920:1080" es_0_0_xxxxxx.265 The encoder can be reset when the application run into fatal error status, run the same application with reset option as below to reset encoder. $ vega_bqb_venc reset Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 22: Sdi Based Encode

    34 | AVC | 1920x1080 | 59.94 | 420 | P010 | IPB | Y | ES 35 | AVC | 1920x1080 | 24 | 420 | IP | Y | ES Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 23 M30_DEV_SET_ENCODER_MAIN_STATE:state=2 encode_mode=0 M30_DEV_SET_ENCODER_MAIN_STATE:state=3 encode_mode=1 M30_DEV_CHANGE_EH_ID_STATE: state=2 id_bits=0x1 Video capture start. Encode picture: Input. |: 59 fps (Press "q" key) M30_DEV_CHANGE_EH_ID_STATE: state=3 id_bits=0x1 M30_DEV_CHANGE_EH_ID_STATE: state=1 id_bits=0x1 M30_DEV_SET_ENCODER_MAIN_STATE:state=2 encode_mode=0 stop device:0 channel:0 complete! Ouput: vif_0_0_xxxxxx.265! Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 24: Decode Application

    VID = 8176 4.3.1 Decoded Video Data Format The decode application inputs the Video Stream data through PCIe, and decodes it to Video RAW data as Y/CbCr separation V210 format. 10-bit: 8-bit: Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 25: Execution Of Decode

    ID | Codec | Resolution | Input Format | Output path | Output format -------------------------------------------------------------------- 0 | HEVC | 3840x2160 | TS | VIF | VRAW 1 | HEVC | 3840x2160 | TS | PCIE | VRAW Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 26 7 | AVC | 3840x2160 | TS | PCIE | (T.B.D) 8 | AVC | 1920x1080 | TS | PCIE | VRAW -------------------------------------------------------------------- 9 | Exit Enter Case ID [0 .. 8] : Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 27: Capture Configuration Application

    Usage: vega3311_cap_config <device id> <channel id(0~3)> [options] Options: -input_mode 1ch_qfhd 4ch_fhd -input_source hdmi 10g_eth 12g_sdi -sub_img_fmt quad -image_format nv12 nv16 yv12 yv16 yuy2 -audio_layout mono stereo quad quad_side 5p0_side 5p1_side pass_through -ancd_post_vanc Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 28 Group2 channel1 presense: 1 Group2 channel2 presense: 1 Group2 channel3 presense: 1 Group2 channel4 presense: 1 Group3 sample rate: 48k Group3 channel1 presense: 1 Group3 channel2 presense: 1 Group3 channel3 presense: 1 Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 29 Group4 channel3 presense: 1 Group4 channel4 presense: 1 Audio capture is off Audio state: standby Ancillary data capture is off Ancillary data state: standby FPGA reveiver temperature: 55 Encoder temperature: 47 ============================================== Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 30: Audio Channel Layouts And Data Format

    16-bits. The following figure shows the channel map of each layout configuration. The following figure shows the block format of pass_through mode, in this mode VEGA3311 driver directly transfer the data of FPGA with header: Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 31 For pass_through mode, each audio sample size is 32-bits which format is specified in following table: Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 32: Capture Application

    Channel id: 0 Input source status: Input source: SDI Channel is locked Resolution: 1920x1080 Chroma Fmt: 422 Bit Deepth: 10 bits Frame per sec: 59.94 SDI signal: level A SDI scan type: progressive Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 33 HANC space: 0 PRE-VANC space: 0 POST-VANC space: 1 FPGA reveiver temperature: 55 Encoder temperature: 47 Video frame dropped: 0 Audio frame dropped: 0 Ancillary data frame dropped: 0 PCR(90Khz): 0x00000000015FF756 ============================================== Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 34: Video Capture Application

    Group3 channel1 presense: 1 Group3 channel2 presense: 1 Group3 channel3 presense: 1 Group3 channel4 presense: 1 Group4 sample rate: 48k Group4 channel1 presense: 1 Group4 channel2 presense: 1 Group4 channel3 presense: 1 Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 35 [chip0:ch0]v_frame_counter: 533, FPS: 60, PCR(90Khz): 0x0000000037BFAC44, FPGA: 56C, Encoder: 48C (Press "q" key followed by "enter" key) q pressed DRV DBG: [remove_av_cb_thread] try to remove video callback thread(ch0) DRV DBG: [callback_thread] video capture callback thread(ch0) exit safely Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 36: Audio Capture Application

    Device control property: Driver version: 1.1.0.11329 FPGA hardware version: Ultrascale 060 FPGA firmware version: 0.5.10 Video capture is off Video state: standby Input mode: 1 Channel UltraHD SDI sub image format: Quad Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 37 [chip0:ch0]a_frame_counter: 1139, FPS: 200, PCR(90Khz): 0x0002F91DBF, FPGA: 56C, Encoder: 48C (Press "q" key followed by "enter" key) q pressed DRV DBG: [remove_av_cb_thread] try to remove audio callback thread(ch0) DRV DBG: [callback_thread] audio capture callback thread(ch0) exit safely Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 38: Encode Usage Cases Of Ffmpeg

    -re -s:v 3840x2160 -pix_fmt yuv422p10 -i input.yuv -c:v libvegabqbhevc -vegabqbhevc-params profile=main422-10:level-idc=51:high-tier=1:amp=0:open-gop=1:gop-type=3:keyint=64:bfra mes=8:deblock=1:rate-ctrl=cbr:bitrate=32000:sar=1:device=0:channel=0:input-mode=0 -f mpegts - | ffplay - ffmpeg -re -s:v 3840x2160 -pix_fmt yuv422p10 -i input.yuv -c:v libvegabqbavc -vegabqbavc-params profile=high422:level-idc=51:open-gop=1:gop-type=2:keyint=24:bframes=2:deblock=1:rate- ctrl=cbr:bitrate=32000:sar=1:device=0:channel=0:input-mode=0 -f mpegts - | ffplay - Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 39 One input file, Multiple board, One resolution, Multiple output: ffmpeg -i input.mp4 \ -pix_fmt nv12 -c:v libvegabqbhevc -vegabqbhevc-params device=0:channel=0 -c:a copy output0.mp4 \ -pix_fmt nv12 -c:v libvegabqbhevc -vegabqbhevc-params device=1:channel=0 -c:a copy output1.mp4 \ Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 40 -i dev:0 -c:v libvegabqbhevc -vegabqbhevc-params device=0:channel=0:input-mode=1 -f mpegts output.mp4 ffmpeg -f vegabqbvif -vegabqbvif-params device=0:channel=0:input-res=3840x2160:pixel-format=yuv422p10:frame-rate=50 -i dev:0 -c:v libvegabqbavc -vegabqbavc-params device=0:channel=0:input-mode=1 -f mpegts output.mp4 1080i60 ffmpeg -f vegabqbvif -vegabqbvif-params device=0:channel=1:input-res=1920x1080:pixel-format=yuv422p10:frame-rate=60 -i dev:0 Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 41 “vega_rtp_mpegts” muxer is designed by ACL. It can support all parameters of “mpegts_enc” muxer. User can refer to FFmpeg documentation on FFmpeg website for the usage. ffmpeg -f vegabqbvif -vegabqbvif-params device=0:channel=2:input-res=1920x1080:pixel-format=yuv420p10:frame-rate=60 -i dev:0 -c:v libvegabqbavc -vegabqbavc-params device=0:channel=2:input-mode=1:bitrate=1000 -f vega_rtp_mpegts -muxrate 1100K rtp://192.168.0.1:12345 Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 42: Decode Usage Cases Of Ffmpeg

    + rawvideo file output ffmpeg -c:v libvegabqbavc -vegabqbavc-params device=0:channel=0:input-mode=0:output-path=0 -i input.ts -f rawvideo output.yuv hevc decoding + rawvideo file output ffmpeg -c:v libvegabqbhevc -vegabqbhevc-params device=0:channel=0:input-mode=0:output-path=0 -i input.ts -f rawvideo output.yuv Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 43: Capture Usage Cases Of Ffmpeg

    Play video raw data (default setting is 4k, nv12, SDI): $ ffplay -vf "scale=1920:1080" -f vega3311-video -i dev:0 Play audio raw data (default setting is stereo, 48k sample rate, SDI): $ ffplay -f vega3311-audio -i dev:0 Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 44: Appendix A: Upgrade Codec Firmware

    Appendix A: Upgrade Codec Firmware Usually VEGA-3311 is provided after flash memory is written, re-write to flash memory is possible with Normal mode for updating the firmware. In the case of upgrading all firmware reversion, re-write the system and mcpu firmware at first.
  • Page 45 [Ignored] ;UART-CH_A_ENABLE 1 [Ignored] ;UART-CH_B_ENABLE 1 [Ignored] ;UART-CH_C_ENABLE 1 [Ignored] ;UART-CH_D_ENABLE 1 [Ignored] ;UART-CH_E_ENABLE 1 [Ignored] ;UART-CH_F_ENABLE 1 [Ignored] [Ignored] ; DDR [Ignored] [Ignored] ; BOOT [Ignored] ;BOOT-GPIO_LOOP 22 1 [Ignored] ;BOOT-PASS_LED 12 1 Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 46 Writing system_fw2.bin... 100% 0.041(sec) flash program success Writing config_system.bin... 100% 1.646(sec) flash program success Writing write_flag.bin... 100% 0.041(sec) flash program success ======================================== Flash Write Start (MAIN_FW) ---------------------------------------- make main fw ---------------------------------------- success Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 47 BAR1: 0x00000000 (0x00000000) BAR2: 0xF7A00000 (0x00100000) BAR3: 0x00000000 (0x00000000) BAR4: 0x00000000 (0x00000000) BAR5: 0x00000000 (0x00000000) ---------------------------------------- start program ---------------------------------------- Writing ... 100% 55.742(sec) flash program success ---------------------------------------- stop flash function ---------------------------------------- stop success ---------------------------------------- Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 48 (WRITE _ALL) ======================================== << Need to restart the host PC >> Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 49: Appendix B: Upgrade Fpga Receiver Firmware

    [fpga0]read complete [fpga0]verify data ... [fpga0]flash data verification PASS [fpga0]firmware upgrade done ... (2) Power off the PC, then power on the PC (not reboot). VEGA-3311 is started up on new FPGA firmware. Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 50: Appendix C: Switch Setting And Re-Write Codec Firmware

    Below figure shows the position of the switch (SW5). Figure3: The SW5 on VEGA-3311 PCI-E Card VEGA-3311 support to write the binaries to HS-SPI flash memory. In the case that the flash is erased or crashed, the SW5 mode[0](bit0) should be set "ON: Maintenance mode". But, if flash memory already has been written, re-write to flash memory is possible with Normal mode for updating the firmwares (refer to appendix: Upgrage HEVC Encoder Firmware for the usage).
  • Page 51 Capabilities: [3a0 v1] Device Serial Number 00-00-00-00-00-00-00-00 Capabilities: [400 v1] Vendor Specific Information: ID=0020 Rev=3 Len=100 <?> snip Confirm the character strings "Multimedia controller: Device 50c1:0003 (rev 01)" and "LnkSta: Speed 5GT/s, Width x4". Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 52 : 0x02000000 byte sector size : 0x00010000 byte Status Register : 0x00 Volatile Config Register : 0xFB ---------------------------------------- start chip erase ---------------------------------------- ..................................................246.544(sec) flash chip erase success ---------------------------------------- start program Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 53 [Ignored] [Ignored] [Ignored] success ---------------------------------------- check mode ---------------------------------------- ch.A: maintenance mode BAR0: 0xF7B00000 (0x00002000) BAR1: 0x00000000 (0x00000000) BAR2: 0xF7A00000 (0x00100000) BAR3: 0x00000000 (0x00000000) BAR4: 0x00000000 (0x00000000) BAR5: 0x00000000 (0x00000000) ---------------------------------------- start program Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 54 BAR3: 0x00000000 (0x00000000) BAR4: 0x00000000 (0x00000000) BAR5: 0x00000000 (0x00000000) ---------------------------------------- start program ---------------------------------------- Writing main_fw.bin... 100% 9.482(sec) flash program success Writing write_flag.bin... 100% 0.041(sec) flash program success ======================================== Flash Write Start (AV_CODEC) Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 55 ---------------------------------------- start program ---------------------------------------- Writing ... 100% 55.742(sec) flash program success ---------------------------------------- stop flash function ---------------------------------------- stop success ---------------------------------------- program end (WRITE _ALL) ======================================== << Need to restart the host PC >> Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...
  • Page 56 (4) Power off the PC. Set the SW5 for Normal mode. (5) Power on the PC. VEGA-3311 is started up the normal mode which is able to run the application from PC Linux. Copyright@2016, Advantech Co., Ltd., All Right reserved. Page...

Table of Contents