Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
415 changes: 415 additions & 0 deletions tests/validation/mtl_engine/application_base.py

Large diffs are not rendered by default.

101 changes: 101 additions & 0 deletions tests/validation/mtl_engine/config/app_mappings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Application name mappings and format conversion utilities

# Map framework names to executable names
APP_NAME_MAP = {"rxtxapp": "RxTxApp", "ffmpeg": "ffmpeg", "gstreamer": "gst-launch-1.0"}

# Format conversion mappings
FFMPEG_FORMAT_MAP = {
"YUV422PLANAR10LE": "yuv422p10le",
"YUV422PLANAR8": "yuv422p",
"YUV420PLANAR8": "yuv420p",
"YUV420PLANAR10LE": "yuv420p10le",
"RGB24": "rgb24",
"RGBA": "rgba",
"YUV422RFC4175PG2BE10": "yuv422p10le", # RFC4175 to planar 10-bit LE
}

SESSION_TYPE_MAP = {
"ffmpeg": {
"st20p": "mtl_st20p",
"st22p": "mtl_st22p",
"st30p": "mtl_st30p",
"video": "rawvideo",
"audio": "pcm_s24le",
},
"gstreamer": {
"st20p": "mtl_st20p",
"st22p": "mtl_st22p",
"st30p": "mtl_st30p",
"video": "mtl_video",
"audio": "mtl_audio",
},
}

FRAMERATE_TO_VIDEO_FORMAT_MAP = {
"p60": "i1080p60",
"p59": "i1080p59",
"p50": "i1080p50",
"p30": "i1080p30",
"p29": "i1080p29",
"p25": "i1080p25",
"p24": "i1080p24",
"p23": "i1080p23",
}

# Default network configuration values
DEFAULT_NETWORK_CONFIG = {
"nic_port": "0000:31:01.0",
"unicast_tx_ip": "192.168.17.101",
"unicast_rx_ip": "192.168.17.102",
"multicast_tx_ip": "192.168.17.101",
"multicast_rx_ip": "192.168.17.102",
"multicast_destination_ip": "239.168.48.9",
"default_config_file": "config.json",
}

# Default port configuration by session type
DEFAULT_PORT_CONFIG = {
"st20p_port": 20000,
"st22p_port": 20000,
"st30p_port": 30000,
"video_port": 20000,
"audio_port": 30000,
"ancillary_port": 40000,
"fastmetadata_port": 40000,
}

# Default payload type configuration by session type
DEFAULT_PAYLOAD_TYPE_CONFIG = {
"st20p_payload_type": 112,
"st22p_payload_type": 114,
"st30p_payload_type": 111,
"video_payload_type": 112,
"audio_payload_type": 111,
"ancillary_payload_type": 113,
"fastmetadata_payload_type": 115,
}

# Default ST22p-specific configuration
DEFAULT_ST22P_CONFIG = {
"framerate": "p25",
"pack_type": "codestream",
"codec": "JPEG-XS",
"quality": "speed",
"codec_threads": 2,
}

# Default FFmpeg configuration
DEFAULT_FFMPEG_CONFIG = {
"default_pixel_format": "yuv422p10le",
"default_session_type": "mtl_st20p",
}

# Default GStreamer configuration
DEFAULT_GSTREAMER_CONFIG = {"default_session_type": "mtl_st20p"}

# DSA (Data Streaming Accelerator) device configuration
# Maps NUMA node to DSA device PCI addresses
DSA_DEVICES = {
"numa0": "0000:6a:01.0",
"numa1": "0000:e7:01.0",
}
143 changes: 143 additions & 0 deletions tests/validation/mtl_engine/config/param_mappings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Parameter mappings for different applications
# Maps universal parameter names to application-specific names

# RxTxApp parameter mapping
RXTXAPP_PARAM_MAP = {
# Network parameters
"source_ip": "ip",
"destination_ip": "dip",
"multicast_ip": "ip",
"port": "start_port",
"nic_port": "name",
# Video parameters
"width": "width",
"height": "height",
"framerate": "fps",
"interlaced": "interlaced",
"transport_format": "transport_format",
# Audio parameters
"audio_format": "audio_format",
"audio_channels": "audio_channel",
"audio_sampling": "audio_sampling",
"audio_ptime": "audio_ptime",
# Streaming parameters
"payload_type": "payload_type",
"replicas": "replicas",
"pacing": "pacing",
"packing": "packing",
"device": "device",
"codec": "codec",
"quality": "quality",
"codec_threads": "codec_thread_count",
# File I/O
"input_file": "st20p_url", # for input files
"output_file": "st20p_url", # for output files (RX)
"url": "video_url", # for video files
# Flags
"enable_rtcp": "enable_rtcp",
"measure_latency": "measure_latency",
"display": "display",
# RxTxApp specific command-line parameters
"config_file": "--config_file",
"enable_ptp": "--ptp",
"lcores": "--lcores",
"test_time": "--test_time",
"dma_dev": "--dma_dev",
"log_level": "--log_level",
"log_file": "--log_file",
"arp_timeout_s": "--arp_timeout_s",
"allow_across_numa_core": "--allow_across_numa_core",
"no_multicast": "--no_multicast",
"rx_separate_lcore": "--rx_separate_lcore",
"rx_mix_lcore": "--rx_mix_lcore",
"runtime_session": "--runtime_session",
"rx_timing_parser": "--rx_timing_parser",
"pcapng_dump": "--pcapng_dump",
"rx_video_file_frames": "--rx_video_file_frames",
"framebuffer_count": "--rx_video_fb_cnt",
"promiscuous": "--promiscuous",
"cni_thread": "--cni_thread",
"sch_session_quota": "--sch_session_quota",
"p_tx_dst_mac": "--p_tx_dst_mac",
"r_tx_dst_mac": "--r_tx_dst_mac",
"nb_tx_desc": "--nb_tx_desc",
"nb_rx_desc": "--nb_rx_desc",
"tasklet_time": "--tasklet_time",
"tsc": "--tsc",
"pacing_way": "--pacing_way",
"shaping": "--shaping",
"vrx": "--vrx",
"ts_first_pkt": "--ts_first_pkt",
"ts_delta_us": "--ts_delta_us",
"mono_pool": "--mono_pool",
"tasklet_thread": "--tasklet_thread",
"tasklet_sleep": "--tasklet_sleep",
"tasklet_sleep_us": "--tasklet_sleep_us",
"app_bind_lcore": "--app_bind_lcore",
"rxtx_simd_512": "--rxtx_simd_512",
"rss_mode": "--rss_mode",
"tx_no_chain": "--tx_no_chain",
"multi_src_port": "--multi_src_port",
"audio_fifo_size": "--audio_fifo_size",
"dhcp": "--dhcp",
"virtio_user": "--virtio_user",
"phc2sys": "--phc2sys",
"ptp_sync_sys": "--ptp_sync_sys",
"rss_sch_nb": "--rss_sch_nb",
"log_time_ms": "--log_time_ms",
"rx_audio_dump_time_s": "--rx_audio_dump_time_s",
"dedicated_sys_lcore": "--dedicated_sys_lcore",
"bind_numa": "--bind_numa",
"force_numa": "--force_numa",
}

# FFmpeg parameter mapping
# Maps universal params to FFmpeg MTL plugin flags.
# Width & height both map to -video_size; command builders coalesce them into WxH format.
# Framerate maps to -fps (distinct from input rawvideo's -framerate).
FFMPEG_PARAM_MAP = {
# Network parameters
"source_ip": "-p_sip",
"destination_ip": "-p_tx_ip", # TX unicast destination
"multicast_ip": "-p_rx_ip", # RX multicast group
"port": "-udp_port",
"nic_port": "-p_port",
# Video parameters (width/height combined externally)
"width": "-video_size",
"height": "-video_size",
"framerate": "-fps",
"pixel_format": "-pix_fmt",
# Streaming parameters
"payload_type": "-payload_type",
"session_type": "-f", # Converted via SESSION_TYPE_MAP
# File I/O
"input_file": "-i",
"output_file": "", # Output appears last (no explicit flag)
}

# GStreamer parameter mapping
# Maps universal params to MTL GStreamer element properties.
# Set as name=value pairs in the pipeline.
GSTREAMER_PARAM_MAP = {
# Network parameters
"source_ip": "dev-ip", # Interface IP
"destination_ip": "ip", # Destination (unicast) IP
"port": "udp-port", # UDP port
"nic_port": "dev-port", # NIC device/PCI identifier
# Video parameters / caps
"width": "width",
"height": "height",
"framerate": "framerate",
"pixel_format": "format",
# Audio parameters
"audio_format": "audio-format",
"audio_channels": "channel",
"audio_sampling": "sampling",
# Streaming parameters
"payload_type": "payload-type",
"queues": "queues", # Currently legacy / advanced usage
"framebuffer_count": "framebuff-cnt",
# File I/O (filesrc/filesink)
"input_file": "location",
"output_file": "location",
}
110 changes: 110 additions & 0 deletions tests/validation/mtl_engine/config/universal_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Universal parameter definitions for all media applications
# This serves as the common interface for RxTxApp, FFmpeg, and GStreamer

UNIVERSAL_PARAMS = {
# Network parameters
"source_ip": None, # Source IP address (interface IP)
"destination_ip": None, # Destination IP address (session IP)
"multicast_ip": None, # Multicast group IP
"port": 20000, # UDP port number
"nic_port": None, # Network interface/port name
"nic_port_list": None, # List of network interfaces/ports
"tx_nic_port": None, # Override NIC port for TX direction
"rx_nic_port": None, # Override NIC port for RX direction
# Video parameters
"width": 1920, # Video width in pixels
"height": 1080, # Video height in pixels
"framerate": "p60", # Frame rate (p25, p30, p50, p60, etc.)
"interlaced": False, # Progressive (False) or Interlaced (True)
"pixel_format": "YUV422PLANAR10LE", # Pixel format for TX input and RX output
"transport_format": "YUV_422_10bit", # Transport format for streaming
# Audio parameters
"audio_format": "PCM24", # Audio format
"audio_channels": ["U02"], # Audio channel configuration
"audio_sampling": "96kHz", # Audio sampling rate
"audio_ptime": "1", # Audio packet time
# ST41 (Fast Metadata) parameters
"fastmetadata_data_item_type": 1234567, # Data Item Type for ST41
"fastmetadata_k_bit": 0, # K-bit value for ST41
"fastmetadata_fps": "p59", # Frame rate for ST41
"type_mode": "frame", # Type mode for ST41: "rtp" or "frame"
# Streaming parameters
"payload_type": 112, # RTP payload type
"session_type": "st20p", # Session type (st20p, st22p, st30p, video, audio, etc.)
"direction": None, # Direction: tx, rx, or None (both for RxTxApp)
"replicas": 1, # Number of session replicas
"framebuffer_count": None, # Frame buffer count (RX video: rx_video_fb_cnt)
# Quality and encoding parameters
"pacing": "gap", # Pacing mode (gap, auto, etc.)
"packing": "BPM", # Packing mode
"device": "AUTO", # Device selection
"codec": "JPEG-XS", # Codec for compressed formats
"quality": "speed", # Quality setting
"codec_threads": 2, # Number of codec threads
# File I/O parameters
"input_file": None, # Input file path
"output_file": None, # Output file path
# Test configuration
"test_mode": "multicast", # Test mode (unicast, multicast, kernel)
"test_time": 30, # Test duration in seconds
"enable_rtcp": False, # Enable RTCP
"measure_latency": False, # Enable latency measurement
"display": False, # Enable display output
"enable_ptp": False, # Enable PTP synchronization
"virtio_user": False, # Enable virtio-user mode
# RxTxApp specific parameters
"config_file": None, # JSON config file path
"lcores": None, # DPDK lcore list (e.g., "28,29,30,31")
"dma_dev": None, # DMA device list (e.g., "DMA1,DMA2,DMA3")
"log_level": None, # Log level (debug, info, notice, warning, error)
"log_file": None, # Log file path
"arp_timeout_s": None, # ARP timeout in seconds (default: 60)
"allow_across_numa_core": False, # Allow cores across NUMA nodes
"no_multicast": False, # Disable multicast join message
"rx_separate_lcore": False, # RX video on dedicated lcores
"rx_mix_lcore": False, # Allow TX/RX video on same core
"runtime_session": False, # Start instance before creating sessions
"rx_timing_parser": False, # Enable timing check for video RX streams
"pcapng_dump": None, # Dump n packets to pcapng files
"rx_video_file_frames": None, # Dump received video frames to yuv file
"promiscuous": False, # Enable RX promiscuous mode
"cni_thread": False, # Use dedicated thread for CNI messages
"sch_session_quota": None, # Max sessions count per lcore
"p_tx_dst_mac": None, # Destination MAC for primary port
"r_tx_dst_mac": None, # Destination MAC for redundant port
"nb_tx_desc": None, # Number of TX descriptors per queue
"nb_rx_desc": None, # Number of RX descriptors per queue
"tasklet_time": False, # Enable tasklet running time stats
"tsc": False, # Force TSC pacing
"pacing_way": None, # Pacing way (auto, rl, tsc, tsc_narrow, ptp, tsn)
"shaping": None, # ST21 shaping type (narrow, wide)
"vrx": None, # ST21 vrx value
"ts_first_pkt": False, # Set RTP timestamp at first packet egress
"ts_delta_us": None, # RTP timestamp delta in microseconds
"mono_pool": False, # Use mono pool for all queues
"tasklet_thread": False, # Run tasklet under thread
"tasklet_sleep": False, # Enable sleep if tasklets report done
"tasklet_sleep_us": None, # Sleep microseconds value
"app_bind_lcore": False, # Run app thread on pinned lcore
"rxtx_simd_512": False, # Enable DPDK SIMD 512 path
"rss_mode": None, # RSS mode (l3_l4, l3, none)
"tx_no_chain": False, # Use memcopy instead of mbuf chain
"multi_src_port": False, # Use multiple source ports for ST20 TX
"audio_fifo_size": None, # Audio FIFO size
"dhcp": False, # Enable DHCP for all ports
"phc2sys": False, # Enable built-in phc2sys function
"ptp_sync_sys": False, # Enable PTP to system time sync
"rss_sch_nb": None, # Number of schedulers for RSS dispatch
"log_time_ms": False, # Enable ms accuracy log printer
"rx_audio_dump_time_s": None, # Dump audio frames for n seconds
"dedicated_sys_lcore": False, # Run MTL system tasks on dedicated lcore
"bind_numa": False, # Bind all MTL threads to NIC NUMA
"force_numa": None, # Force NIC port NUMA ID
# Execution control defaults
"sleep_interval": 4, # Delay between starting TX and RX
"tx_first": True, # Whether to start TX side before RX
"timeout_grace": 10, # Extra seconds for process timeout
"process_timeout_buffer": 90, # Buffer added to test_time for run() timeout
"pattern_duration": 30, # Duration for generated test patterns
"default_framerate_numeric": 60, # Fallback numeric framerate
}
Loading
Loading