Skip to content
Tero Marttila edited this page Oct 26, 2016 · 6 revisions

E2 tally output for Universe via TCP and/or UDP

Usage

See Tally Usage for the general tally usage options, including the required E2 discovery/client options.

Multiple --universe-udp= and --universe-tcp= options can be combined to stream the tally state to multiple destinations.

Each tally state update sends a series of multiple commands, one for each tally input. The same command will be repeated for each input if the tally state does not change. The same commands will be periodically resent at the --e2-timeout cycle.

Universe

Device Configuration

Use the following configuration options for the TCP/UDP Device:

Line Format

None

Start Byte

60 (ASCII <)

End Byte

62 (ASCII '>')

Trigger

Use the following trigger parameter for the TCP/UDP device:

Parameter

tallyX-high / tallyX-low

Example

Universe TCP/UDP Tally Device

UDP

Send UDP packets containing multiple command lines to 192.168.56.101:3050 and 192.168.56.102:3051 using the default template:

tally --universe-udp=192.168.56.101 --universe-udp=192.168.56.102:3051

The resulting UDP packet for an E2 configured with two tally inputs (tally=1 and tally=2), with the tally=1 input active on program:

Internet Protocol Version 4, Src: 192.168.56.1, Dst: 192.168.56.255
User Datagram Protocol, Src Port: 54733 (54733), Dst Port: 3050 (3050)

0000  3c 74 61 6c 6c 79 31 2d 68 69 67 68 3e 0d 0a 3c   <tally1-high>..<
0010  74 61 6c 6c 79 32 2d 68 69 67 68 3e 0d 0a         tally2-high>..

Split Packets

You may use the --universe-tally-lines --universe-line-format=none options to send each command as a separate UDP packet:

0000  3c 74 61 6c 6c 79 31 2d 68 69 67 68 3e            <tally1-high>

0000  3c 74 61 6c 6c 79 32 2d 68 69 67 68 3e            <tally2-high>

TCP

Connect to 192.168.56.101:3050 and stream multiple command lines using the default template:

tally --universe-tcp 192.168.56.1

The resulting TCP frames for an E2 configured with two tally inputs (tally=1 and tally=2), with the tally=1 input active on program:

Internet Protocol Version 4, Src: 192.168.56.1, Dst: 192.168.56.1
Transmission Control Protocol, Src Port: 58944 (58944), Dst Port: 3050 (3050), Seq: 117, Ack: 1, Len: 15
Data (15 bytes)
0000  3c 74 61 6c 6c 79 31 2d 68 69 67 68 3e 0d 0a      <tally1-high>..

Internet Protocol Version 4, Src: 192.168.56.1, Dst: 192.168.56.1
Transmission Control Protocol, Src Port: 58944 (58944), Dst Port: 3050 (3050), Seq: 132, Ack: 1, Len: 14
Data (14 bytes)
0000  3c 74 61 6c 6c 79 32 2d 6c 6f 77 3e 0d 0a         <tally2-low>..

The Tally driver only connects on the first tally state, and attempts to reconnect if the connection is lost. If the TCP sender does not have a connection, or if sending fails, then the tally state commands are dropped. Once the TCP server returns, the next set of tally state commands will be sent once the tally state updates.

Template

Send UDP messages / TCP lines using a custom format:

tally --universe-udp=192.168.56.10 --universe-tally-template cmd/tally/universe-tally.template

The template argument should be a path to a Go template used to generate the resulting TCP/UDP commands.

Each non-empty line of output generated by the template is sent as part of the resulting separate message using the --universe-line-format line ending. Each such message is sent as a single UDP packet, or as consecutive lines in a TCP stream.

Context

The root context of the template is the tally State struct, offering the .Tally map of TallyID: TallyState.

The TallyState struct includes the Status struct with the Program, Preview and Active fields.

See the example context below.

Example

The default template:

{{ range $id, $state := .Tally }}
<tally{{$id}}-{{ if $state.Status.Program }}high{{ else }}low{{ end }}>
{{ end }}

Generates the following output (hexdump format):

0000  3c 74 61 6c 6c 79 31 2d 68 69 67 68 3e 0d 0a 3c   <tally1-high>..<
0010  74 61 6c 6c 79 32 2d 68 69 67 68 3e 0d 0a         tally2-high>..

For the following example tally.State context (from tally --debug-output):

tally.State{
    Sources: {
        "192.168.56.10": {
            Discovery: discovery.Packet{
                IP:         {0xc0, 0xa8, 0x38, 0xa},
                Hostname:   "E2",
                XMLPort:    9876,
                Name:       "System1",
                UnitID:     0,
                VPCount:    1,
                MasterMac:  "08::00::27::cb::66::47",
                Version:    "3.2.25155",
                IPAddress:  "192.168.2.253",
                MacAddress: "08::00::27::cb::66::47",
                Type:       "E2-32L",
            },
            FirstSeen: time.Time{
                ...
            },
            LastSeen: time.Time{
                ...
            },
            Connected: true,
            Error:     nil,
        },
    },
    Inputs: {
        {Source:"192.168.56.10", Name:"Input1"}: {ID:1, Status:"bad"},
        {Source:"192.168.56.10", Name:"Input2"}: {ID:2, Status:"bad"},
    },
    Outputs: {{Source:"192.168.56.10", Name:"ScreenDest1"}:true},
    links:   {
        {
            Tally:  2,
            Input:  tally.Input{Source:"192.168.56.10", Name:"Input2"},
            Output: tally.Output{Source:"192.168.56.10", Name:"ScreenDest1"},
            Status: tally.Status{Program:true, Preview:true, Active:true},
        },
    },
    Tally: {
        1:  {
            Inputs:  {{Source:"192.168.56.10", Name:"Input1"}:true},
            Outputs: {},
            Errors:  {
                &errors.errorString{s:"Source 192.168.56.10 Input Input1 video status: bad"},
            },
            Status: tally.Status{},
        },
        2:  {
            Inputs:  {{Source:"192.168.56.10", Name:"Input2"}:true},
            Outputs: {
                {Source:"192.168.56.10", Name:"ScreenDest1"}: {Program:true, Preview:true, Active:true},
            },
            Errors: {
                &errors.errorString{s:"Source 192.168.56.10 Input Input2 video status: bad"},
            },
            Status: tally.Status{Program:true, Preview:true, Active:true},
        },
    },
    Errors: nil,
}