Skip to content

BlackMatrix v0.2.0

Choose a tag to compare

@stoatworks-labs stoatworks-labs released this 22 Aug 03:16
· 15 commits to main since this release

Failover for redundant media servers

A redundant media server rig is two machines playing the same show and a router downstream deciding which one reaches the screens. This release makes an ATEM fleet that router, in both of the shapes the industry uses — and, because an ATEM re-syncs its inputs, main and backup do not have to be genlocked to each other for a clean cut, which an SDI router does require.

The media server drives it. disguise's understudy sends matrix routing itself the moment it takes over a failed machine; PIXERA fires a control action at a matrix switcher from its System Lost trigger. Both can already point at the Videohub emulation. Three things in it would have bitten a client written against a real router rather than the 2018 document, and all three are fixed:

  • END PRELUDE now closes the opening status dump. It is not in the published v2.3 spec, but real firmware sends it and a client may wait for it.
  • A bare request for a section this device has none of — monitoring outputs, serial ports, processing units — is answered with an empty block instead of NAK. A NAK reads as a broken router.
  • An output whose source cannot be named is left out of the routing block rather than sent as -1, which is not a thing the protocol can say.

videohub.modelName and videohub.protocolVersion are overridable for a driver that checks them.

The lock trap, which is the one that loses a show. A refused route is answered with ACK and an unchanged status — what the spec requires, and what a media server that fires and forgets never reads. So a locked destination was a failover that silently did not happen. videohub.failoverClients names the addresses whose routes walk through a lock, and says so in the log. Legality is never overridden.

A plain line protocol

New @av/ascii-matrix, on TCP and UDP (ascii.enabled, port 9995), for everything that can send a string but not speak Videohub — disguise's generic Telnet Matrix, PIXERA's TCP module, 7thSense, a show controller.

ROUTE 2 1          route output 2 to input 1
1*2!               the same thing, Extron style
SALVO backup       fire a salvo by name
3.                 fire the third salvo (Extron preset recall)
FAILOVER main      fire a watch's lost salvo

Extron-shaped requests get Extron-shaped answers, because a driver sending 1*2! is waiting for Out2 In1 All. Numbers are one-based and the greeting says so.

Failover watches

For the rig whose media server cannot drive a matrix at all: watch a TCP port, a URL, or a heartbeat it must be sent, and fire an ordinary salvo when it stops answering. Ordinary is the point — the failover can be rehearsed by pressing Take on it.

It will not fire before it has seen the machine working once (an unbooted rack looks exactly like a dead one), it starts disarmed, it fires once, and it does not switch back unless a restored salvo says what back means. Triggerable by hand from the UI, over REST, or over the line protocol.

Also

  • Mock ports are overridable (BLACKMATRIX_PORT, BLACKMATRIX_VIDEOHUB_BASE_PORT, BLACKMATRIX_ASCII_PORT, BLACKMATRIX_MOCK_ROUTER_PORT), so a second copy can run beside one already up.
  • docs/failover.md is the survey of how disguise and PIXERA actually do this, and what to type into their fields.

None of the failover support has been driven by a real media server. It is written from disguise's and PIXERA's published documentation and tested against this repo's own clients.

Installing

macOS installers are signed and notarised and open normally. macOS will still ask for local network access on first run — say yes, or no switcher will be found. The Windows installer is unsigned, so SmartScreen warns once. Container: ghcr.io/stoatworks-labs/blackmatrix.