Skip to content

Remote API WS Plugin

Matthew Martin edited this page Mar 10, 2022 · 4 revisions

/x-pam/ws/plugin

This is a read only websocket connection. It provides live updates from the currently selected monitor/test plugin.

The websocket message format is JSON and dependant on the current plugin. All messages have the following general form

{
    "plugin" : {
        "type" : string, either "monitor" or "test",
        "name" : string, the name of the plugin sending the message
    }
    "data" : plugin dependant JSON object or array
}

Plugins

Meters and AngleMeters

The following message is sent as the "data" payload every time the meters update If two channels only

[
    {
        "channel" : "Left",
        "level" : double - the current levels in dbFS
    },
    {
        "channel" : "Right",
        "level" : double - the current levels in dbFS
    },
    {
        "channel" : "M",
        "level" : double - the current levels in dbFS
    },
    {
        "channel" : "S",
        "level" : double - the current levels in dbFS
    },
]

else

[
    {
        "channel" : integer - the channel number,
        "level" : double - the current levels in dbFS
    },...
]

LTC

The following message is sent as the "data" payload every time an LTC "packet" is decoded

{
    "date" : string, date in format Y-m-d,
    "time" : string, time in format H:M:S:Frames,
    "volume" : double, amplitude of signal in dbFS,
    "fps" : double, frames per second,
    "mode" : string, one of "Not specified", "8-bit", "Date", "Page/Line",
    "date_format" : string, one of "Unknown", "SMPTE", "BBC", "TVE", "MTD,
    "clock" : string, one of "External" or "Internal",
    "colour" : boolean, true if colour flag is set
}

Aoip Info

The following message is sent as the "data" payload every time the audio buffer is processed

{
    "audio" : {
        "timestamp" : integer, the current timestamp,
        "time" : {
            "transmitted" : string, the time the current audio buffer was transmitted in format Y-m-d H:M:S:ms,
            "received" : string, the time the current audio buffer was received in format Y-m-d H:M:S:ms,
            "played" : string, the time the current audio buffer was displayed/played out in format Y-m-d H:M:S:ms,
            "latency" : double, the latency between the "transmitted" time and the "received" time in milliseconds,
            "slip" : double, the difference between the current latency and the latency first calculated
        },
        "frame" : {
            "size" : integer, the size of the frame in bytes,
             "duration" : integer, the duration of the frame in milliseconds
        },
    }
}

The following message is sent as the "data" payload every time the session info changes

{
    "session" : {
        "name" : string, the name of the current session,
        "type" : string, the type of current session,
        "refclock" : {
            "type" : string, the type of the reference clock for this session,
            "version" : string, the PTP version of the reference clock,
            "id" : string, the Id of the reference clock,
            "domain" : integer, the PTP domain
        },
        "sdp" : string, the SDP,
        "subsession" : [
            {
                "id" : string, the id of the subsession,
                "source" : string, the source ip address,
                "codec" : string, the source codec,
                "samplerate" : integer, the sample rate of the subsession,
                "channels" : integer, the number of channels in the subsession,
                "sync_timestamp": integer, the timestamp at the epoch,
                "refclock" : {
                    "type" : string, the type of the reference clock for this session,
                    "version" : string, the PTP version of the reference clock,
                    "id" : string, the Id of the reference clock,
                    "domain" : integer, the PTP domain
            },...
        ]
    }
}

The following message is sent as the "data" payload every time QoS data is received

{
   "qos" : {
        "time" : string, time QoS received in format H:M:S:ms,
        "kbits" : {
            "average" : double, average kbit/s received,
            "current" : double, current kbit/s received,
            "max" : double, maximum kbit/s received,
            "min" : double, minimum kbit/s received
        },
        "lost" : {
            "total" : integer, total packets lost,
            "average" : double, average fraction of packets lost/packets received per second,
            "max" : double, maximum fraction of packets lost/packets received per second,
            "min" : double, minimum fraction of packets lost/packets received per second
        },
        "packets" : {
            "total" : integer, total number of packets received
        },
        "interpacket" : {
            "average" : double, average gap between packets in milliseconds,
            "current" : double, current gap between packets in milliseconds,
            "max" : double, maximum gap between packets in milliseconds,
            "min" : double, minimum gap between packets in milliseconds
        },
        "jitter" : double, current jitter,
        "ts-df" : double, current TS-DF,
        "SR" : string, either "na" if no SR packets have been received, else time of last packet in format H:M:S:ms,
        "NTP" : string, either "na" if no NTP packets have been received, else time of last packet in format H:M:S:ms, 
        "timestamp" : {
            "errors" : integer, number of timestamp discontinuities
    }
}

Channel Delay

The following message is sent as the "data" payload every time the channel delay is calculated

{
    "channels" : [
        {
            "id" : integer, the channel number,
            "name" : string, the channel name
        },
        {
            "id" : integer, the channel number,
            "name": string, the channel name
        }
    ],
    "offset" : integer, the offset between the two channels in milliseconds
}

Distortion

The following message is sent as the "data" payload every time the distortion is calculated

[
    {
        "running" : boolean, true if this channel is being monitored
        "distortion" : {
            "current" : double, the current distortion percentage
            "max" : {
                "percentage": double, the maximum distortion seen,
                "when" : string, the time the maximum distortion occurred
            }
        },
        "fundamental" : {
            "frequency" : double, the loudest frequency in Hz,
            "amplitude" : double, the amplitude of the loudest frequency in dbFS
        },
        "peaks": integer, the number of frequency "peaks"
    },...
]

FFT

The following message is sent as the "data" payload every time the fft is performed

{
    "peak" : {
        "level" : double, the amplitude of the loudest frequency in dbFS,
        "frequency" : double, the loudest frequency in Hz
    }
}

Levels

The following message is sent as the "data" payload every time an audio buffer is received

{
    "channels" : [
        {
            "max" : double, the maximum amplitude of the channel in dbFS,
            "min" : double, the minimum amplitude of the channel in dbFS,
            "current" : double, the current amplitude of the channel in dbFS,
            "status" : {
                "error" : boolean, true if the amplitude of the channel falls outside of the test,
                "reason": string, description of why the status is in error
            }
        },...
    ]
}

Lineup

The following message is sent as the "data" payload every time an audio buffer is received

{
    "channels" : [
        {
            "level" : {
                "current" : double, the current amplitude of the channel in dbFS,
                "max" : double, the maximum amplitude of the channel in dbFS,
                "min" : double, the minimum amplitude of the channel in dbFS
            },
            "frequency" : {
                "current" : double, the current fundamental frequency of the channel in Hz,
                "max" : 
                "min" : 
            },
            "distortion" : {
                "current" : 
                "max" : 
            },
            {
            "level" : {
                "current" : double, the current amplitude of the channel in dbFS,
                "max" : double, the maximum amplitude of the channel in dbFS,
                "min" : double, the minimum amplitude of the channel in dbFS
            },
            "frequency" : {
                "current" : double, the current fundamental frequency of the channel in Hz,
                "max" : double, the maximum fundamental frequency of the channel in Hz,
                "min" : double, the minimum fundamental frequency of the channel in Hz,
            },
            "distortion" : {
                "current" : double, the current distortion percentage,
                "max" : double, the maximum distortion percentage,
            }
        }
    ],
    "phase" : double, the phase between the two channels in degrees,
    "lineup" : string, the lineup tone detected if any
}

Peak Count

The following message is sent as the "data" payload every time an audio buffer is received

[
    {
        "peaks" : integer, the total number of peaks above the set level,
        "samples" : integer, the total number of samples above the set level
    },...
]

Peak Log

The following message is sent as the "data" payload every time an audio buffer is received

[
    {
        "Day" : double, amplitude (only sent when a max value is calculated in the day graph),
        "Hour" : double, amplitude (only sent when a max value is calculated in the hour graph),
        "Minute" : double, amplitude (only sent when a max value is calculated in the minute graph),
        "Second" : double, amplitude (only sent when a max value is calculated in the second graph)
    },...
]

Polar Scope

The following message is sent as the "data" payload every time an audio buffer is received

{
    "level" : {
        "angle" : double, the angle of the max level for this audio buffer,
        "height" : double, the height of the max level for this audio buffer
    },
    "balance" : double, the balance between the two channels,
    "correlation" : double, the correlation between the two channels
}

PTP Monkey

The following message is sent as the "data" payload every time a clock is added, updated or deleted

{
    "action" : string, one of "Added", "Updated" or "Removed",
    "id" : string, the id of the clock,
    "vendor" : string, the vendor of the clock calculated from the MAC address
}

The following message is sent as the "data" payload every time a clock message is received from a master clock

{
    "action" : "Message",
    "id" : string, the id of the clock,
    "address" : string, the ip address of the clock,
    "vendor" : string, the vendor of the clock,
    "master" : true,
    "sync" : {
        "count" : integer, the number of sync messages received,
        "rate" : string, the rate the sync messages are being sent,
        "flags" : flagObj,
    },
    "followup" : {
        "count" : integer, the number of follow up messages received,
        "rate" : string, the rate the follow up messages are being sent,
        "flags" : flgObj
    },
    "announcement" : announceObj (only if at least one announcement message has been seen)
}

The following message is sent as the "data" payload every time a clock message is received from a slave clock

{
    "action" : "Message",
    "id" : string, the id of the clock,
    "address" : string, the ip address of the clock,
    "vendor" : string, the vendor of the clock,
    "master" : false,
    "delay_request" : {
        "count" : integer, the number of delay request messages received,
        "rate" : string, the rate the delay request messages are being sent,
        "flags" : flagObj
    },
    "delay_response" : {
        "count" : integer, the number of delay response messages received,
        "rate" : string, the rate the delay response messages are being sent,
        "flags" : flagObj
    },
    "announcement" : announceObj (only if at least one announcement message has been seen)
}

where flagObj is of the form

{
    "alternate_master" : boolean,
    "two_step" : boolean,
    "unicast" : boolean,
    "profile1" : boolean,
    "profile2" : boolean,
    "LI_61" : boolean,
    "LI_59" : boolean,
    "UTC_Offset" : boolean,
    "timescale" : boolean,
    "time_traceable" : boolean,
    "frequency_traceable" : boolean
}

where announceObj is of the form

{
    "accuracy" : string,
    "count" : integer, number of messages received,
    "rate" : string, rate of messages received,
    "class" : string, the class of the clock,
    "source" : string, the time source,
    "steps" : integer,
    "UTC_Offset" : integer,
    "variance" : integer,
    "priority_1" : integer,
    "priority_2" : integer,
    "flags" : flagObj
}

The following message is sent as the "data" payload every time a PTP time offset calculation is completed

{
    "action" : "Time",
    "time" : string, the current calculated time,
    "frequency_lock" : boolean, true if the PAM clock is frequency locked to the PTP master,
    "offset" : {
        "mean" : double, the average calculated offset between the local clock and master clock,
        "standard deviation" : double, the standard deviation of the offset between the local clock and the master clock,
        "standard error" : double, the standard error of the offset between the local clock and the master clock,
        "linear regression" : {
            "slope" : double, the slope of the line calculated using linear regression on the offset data,
            "intersection" : double, the intersection of the line calculated using linear regression on the offset data,
            "estimate" : double, the estimated offset using the linear regression formula
        }
    },
    "delay" : {
        "mean" : double, the average calculated network delay,
        "standard deviation" : double, the standard deviation of the network delay,
        "standard error" : double, the standard error of the network delay,
        "linear regression" : {
            "slope" : double, the slope of the line calculated using linear regression on the delay data,
            "intersection" : double, the intersection of the line calculated using linear regression on the delay data,
            "estimate" : double, the estimated delay using the linear regression formula
        }
    }
}

R128

{
    "state" : "running",
    "time" : integer, time in seconds the meter has been running for,
    "momentary" : {
        "current" : double, the current momentary loudness level,
        "peak" : double, the maximum momentary loudness level
    },
    "short" : {
        "current" : double, the current short loudness level,
        "peak" : double, the maximum short loudness level
    },
   "live" : {
        "current" : double, the current live loudness level
    },
    "range" : double, the LU range,
    "truepeak" : {
        "left" : {
            "current" : double,
            "peak" : double
        },
        "right" : {
            "current" : double,
            "peak" : double
        }
    }
}

Radar

The following message is sent as the "data" payload every time the radar updates

{
    "dbfs" : double, the current amplitude in dbFS,
    "time" : string, the amount of time the radar has been running H:M:S,
    "radar" : {
        "x" : double, the "x" position of the radar,
        "y" : double, the "y" position of the radar
    },
    "max" : {
        "x" : double, the max "x" position of the radar,
        "y" : double, the max "y" position of the radar
    }
}

Spectogram

The following message is sent as the "data" payload every time the spectogram updates

{
    "heatmap" : [
        {
            "r" : integer the Red component (0-255),
            "g" : integer the Green component (0-255),
            "b" : integer the Blue component (0-255)
        },... (repeated for each pixel of the spectogram)
    ]
}