ASI Card Configuration Tool

ASI Card Configuration Tool

Installation & Usage

The configuration tool is installed as part of the cRPM ASI driver installation. It is available from the following location on the M1 or G8 platform:

/opt/mediakind/utility/bin/asi_config/

To get help on the command line options, add -h to the command line.

Example: ./asi_config -h or ./asi_config set connector -h

By default, the ASI configuration tool connects to the Multiplexer ASI API on the machine where the tool is running, i.e., localhost.

To tell the tool to connect to a different server, use the --host optional command line argument: Example: ./asi_config --host <controller_vip>

For commands that produce output, you can use the optional argument --json to request that the output is rendered in as a JSON document. This can be useful if the content is used for further processing.

Known Server Types & Aliases

Many of the commands require the user to identify a specific card for the ASI API.

To simplify this for the users, the tool allows server definition files to be created, in which one or more aliases can be associated with a pre-defined PCI bus number/slot number pair.

If you provide your own servers, you can create your own server definition files by using the existing ones (for example: m1.json) as templates.

Server Type Description File Definition

Each server description file is a JSON document and is composed of an array of objects, one for each board location.

Each board entry in the array has three properties: pciBusNumber, pciSlotNumber and aliases.

  • pciBusNumber - The PCI bus number required for the ASI API.
  • pciSlotNumber - The slot number required for the ASI API. Also known as device by tools such as lspci.
  • aliases - An array of strings containing several alternative aliases for this board location.
    • Example: “2”, “top-middle” and “tm” might all be alternatives.

To help with identifying bus numbers and device slots in usage, you can use the lspci command. This provides the location of every PCI device in the format [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]. The domain is optional, or only shown if various domains are present.

Note: All values are hexadecimal.

Here is an example output of the lspci command for an M1 with 2 Dektec cards, on bus 01 and 02:

Commands

get servers

Displays a list of the ASI servers configured for the system.

Example of usage:

Gets the configured ASI servers for localhost.

get connectors

Displays a list of the configured connectors.

Required arguments in order:

asi_server_name: The name of the ASI server to show ASI information for.

Optional arguments:

  • --type server_type: Specifies a server type to look up an alias for a specific board. (Example: m1)
  • --alias alias: Specifies a board alias when used with the --type argument. (Example: top-left)
  • --pci *bus_number': Specifies the PCI bus number associated with a specific ASI card.
  • --slot slot_number: Specifies a specific slot number associated with a specific ASI card. Use with the --pci option.

Example of usage:

  • asi_config get connectors m1-227: Gets the configured connectors for ASI server 'm1-227'.
  • asi_config get connectors m1-227 --type m1 --alias top-left: Gets the configured connectors for the card in the top-left slot of the m1 ASI server 'm1-227'.
  • asi_config get connectors m1-227 --pci 1 --slot 0: Gets the configured connectors for the card attached to PCI bus 1 in slot 0 on ASI server 'm1-227'.

Example with output:

remove server

Removes all the connectors associated with the specified server.

Example of usage:

  • asi_config remove server m1-227: Removes the ASI server m1-227 and all the connectors associated with it.

remove connector

Removes a single connector.

Required arguments in order:

  1. asi_server_name: The name of the ASI server to update.
  2. server_type_or_pci_bus_number: The type of server when using an alias or the actual PCI bus number (int) of the board being removed.
  3. alias_or_slot_number: The alias for the board or the actual slot number (int) for the board.
  4. connector: The physical connector index (1 based) on the board.

Example of usage:

  • asi_config remove connector m1-227 m1 top-left 3: Removes the third connector for the top-left board in an M1 server.
  • asi_config remove connector m1-227 1 0 3: Removes the third connector for the board associated with PCI bus 1 on slot 0.

remove api-connector

Removes a single connector identified by its API number (REST ID in the table from get connectors).

Required arguments in order:

  1. asi_server_name: The name of the ASI server to update.
  2. api_connector: The API connector number associated with the connector to remove. This is a value that is set in Multiplexer configurations.

Example of usage:

  • asi_config remove api-connector m1-227 1: Removes the connector with the API number of 1 from the server called m1-227.

set connector

Sets the properties for a connector. Connectors can be identified via the board and index.

Required arguments in order:

  1. server: The name of the ASI server to update.
  2. server_type_or_pci_bus_number: The type of server when using an alias or the actual PCI bus number (int) of the board being removed.
  3. alias_or_slot_number: The alias for the board or the actual slot number (int) for the board.
  4. connector: The physical connector index (1 based) on the board.

After these arguments, you must specify either input or output.

input

Sets the connector as an ASI input.

Optional arguments:

  • --multicast: The multicast address (URL format) to which the content from this ASI connector should be re-transmitted. If not set, the tool will pick a multicast that is not already in use for an existing connector.
  • --interface: The name of the network interface to use for the multicast transmission. If not specified, the interface 'lo' is used.
  • --set_api_id: Specifies the ID to associate with this connector in the REST API. If not set, an ID is auto-generated.

Example of usage:

Configures the API connector with the ID of 1 to be an input and have the multicast and port values.

output

Sets the connector as an ASI output.

Optional arguments:

  • --set_api_id: Specifies the ID to associate with this connector in the REST API. If not set, an ID is auto-generated.
  • asi_config set connector m1-227 m1 top-left 3 input: Sets the third connector on the card in the top-left slot of the M1 server m1-227 to be an input.
  • asi_config set connector m1-227 m1 top-left 3 input --multicast udp://239.34.221.1:5000 --interface lo --set_api_id 3: Sets the third connector on the card in the top-left slot of the M1 server m1-227 to be an input with data transmitted on the loopback interface using a multicast group address of 229.34.221.1 on port 5000. The ASI content can be used by setting the ASI connector to 3 in the Multiplexer configuration.
  • asi_config set connector m1-227 m1 top-left 3 output: Sets the third connector on the card in the top-left slot of the M1 server m1-227 to be an output.

Example of usage:

Configures the API connector with the ID of 1 to be an output.

set api-connector

Sets the API number for a connector. Connectors can be identified via the board and index.

Required arguments in order:

  1. asi_server_name: The name of the ASI server to update.
  2. api_connector: The API connector number associated with the connector to remove. This is a value that is set in Multiplexer configurations.

After these arguments, you must specify either input or output.

export

Exports the current configuration to a file.

Required arguments in order:

file - The path to the file to create.

Optional arguments:

  • --server: The name of a single ASI server to export. If not set, all servers are exported.

Example of usage:

  • asi_config export /home/mfeng/asi_settings.json: Exports all the ASI configuration to the file asi_settings.json.
  • asi_config export /home/mfeng/m1-227.json --server m1-227: Exports the ASI configuration for server m1-227 to the file m1-227.json.

import

Imports the ASI configuration from a file.

Required arguments in order:

file - The path to the file to import the settings from.

Optional arguments:

  • --server: The name of a single ASI server to import. If not set, all servers are imported.

Example of usage:

  • asi_config import /home/mfeng/asi_settings.json: Imports all the ASI configuration from the file asi_settings.json.
  • asi_config import /home/mfeng/m1-227.json --server m1-227: Imports the ASI configuration for server m1-227 from the file m1-227.json.