Skip to main content

Camera Media Route Configuration

Introduction

In devices using interfaces like MIPI or GMSL, configuring media routes is necessary to define the data flow between subdevices, including sensors, CSI receivers, and ISPs, within the media pipeline.

A media route defines how video or image data travels through these entities — specifying which source pad connects to which destination pad. Without a proper route setup, the device driver may not activate the pipeline correctly, and image streaming or capture could fail.


media-ctl to YAML Conversion Guide

This section explains how to convert traditional media-ctl route configuration commands into a YAML file format.
The YAML format provides a structured and human-readable way to define media routing configurations, making it easier to manage and setup across multiple devices with our SDK.

For more YAML file examples, see the Routes YAML

media-ctl command Overview

media-ctl is a command-line utility used to configure and inspect media controller devices in Linux.

Typical commands look like this:

media-ctl -R "'crossbar' [2/0 -> 5/0 [1]]"
media-ctl -l "'tevs 1-0048':0 -> 'csidev-4ad30000.csi':0 [1]"

The -R option sets internal routes between pads of entities within a device.
The -l option sets links between different entities in the media graph.

YAML Format Overview

The YAML format separates internal Routes and external MediaLinks into two distinct sections:

Routes:
- device: "crossbar"
links:
- {src: "2/0", dst: "5/0", enable: 1}
MediaLinks:
- {src: "tevs 1-0048:0", dst: "csidev-4ad30000.csi:0", enable: 1}
  • Fields Explanation
    FieldDecription
    deviceEntity name of the media device
    linksLists the routing paths, similar to those defined in media-ctl
    srcSource pad of the route(or media link)
    dstDestination pad of the route(or media link)
    enable1 means the route or link is enabled, 0 means disabled
note

When two cameras are connected to Raspberry Pi 5 with identical media entity names, a single YAML link entry is sufficient to configure both cameras.
[Raspberry Pi 5 YAML Template]


Activate the Media Routes

After setting the routes in YAML file, you can activate these routes by VizionSDK API or run the command from vizion-ctl directly.

  • Using VizionSDK API to load and activate the YAML file

    std::string yamlPath = "routes.yaml";
    std::shared_ptr<VxRoute> yamlRoutes = VxLoadRouteYaml(yamlPath);
    if(yamlRoutes != nullptr) {
    VxActivateYamlRoutes(yamlRoutes);
    }
  • Using vizion-ctl to activate the route

    vizion-ctl --setroute <YAML_FILE_PATH>
caution

If the route fails to set successfully, verify that the YAML file is correctly formatted.
You can also use the VxResetActiveRoutes or vizion-ctl --reset-route to clear all active routes and then reapply the desired routes.