# AES67 network audio — first release

Player 4.3.0 adds an authenticated **Config → AES67 Audio** page and an
**AES67 network audio** playback destination. The sender is disabled by default.

## Commissioning

1. Connect the player and receiver to the intended audio Ethernet network. A
   PTPv2 grandmaster must be present; this player is a clock follower.
2. Stop playback, including paused playback, calibration and Casting. Select the
   interface and its explicit local IPv4 address in Config → AES67 Audio.
3. Set an unused `239.x.x.x` multicast address, even RTP port, channel count
   from one to eight, and the receiver's PTP domain. Save the enabled sender.
4. Wait for **Streaming / Synchronized** and an observed grandmaster ID.
   Configure the receiver through the SAP announcement or download/import SDP.
5. Select **Use AES67 for playback**. The existing Playback → Audio output
   selector also lists AES67 while its sender is enabled.
6. Set the desired routing in Telemetry → Audio Matrix. The sender takes the
   first configured number of matrix outputs, after routing and master level.
   Selecting eight channels does not rewrite a two- or six-output matrix;
   unused matrix outputs remain silent. Verify each channel at the receiver.

The existing audio sync offset applies. Packet time is not end-to-end latency;
the receiver's buffering and output latency must also be commissioned.

Saving sender settings and choosing the playback destination are separate
actions. Select another output before disabling a currently selected AES67
destination. Changes are refused during playback/paused playback/calibration or
Casting. Settings persist in the player database under `aes67_output_v1`.

## Transport and timing

| Item | First-release behaviour |
| --- | --- |
| Audio | Signed 24-bit big-endian PCM, RTP payload type 96 / L24 |
| Output rate | 48,000 samples per second |
| Channels | One to eight interleaved matrix outputs |
| Packet time | 1 ms / 48 sample frames; eight channels use 1,152 payload bytes |
| Addressing | Explicit interface/IPv4, administratively scoped `239/8` multicast |
| Ports | Configured even RTP port, RTCP at RTP + 1 |
| Network | Configurable TTL 1–32; RTP socket uses DSCP EF (46) |
| Discovery | SAP on `239.255.255.255:9875`; SDP download while clock is valid |
| Clock | GStreamer private IEEE 1588-2008 / PTPv2 follower, configured domain 0–127 |
| Clock signalling | Observed grandmaster ID/domain; direct media-clock offset zero |
| Control | RTCP sender reports, SDES/CNAME and BYE; SAP withdrawal on disable |

The PTP clock uses software timestamping. It never sets the OS clock or changes
Chrony, trusted-time/KDM policy, recipient certificates or licence activation.
The distribution's existing GStreamer PTP helper supplies its narrowly scoped
network privileges; the player process runs as its normal account.

RTP and SDP are withheld until valid PTP synchronization exists. Once locked,
the stream carries silence while idle, stopped or paused so receivers retain
their stream. Valid clock updates have a bounded three-second holdover; repeated
rejected timestamps do not refresh it. A large scheduling/clock discontinuity or
clock loss during active audio stops network output and produces HUD, Status and
web error indications. Stop the show before restarting it after clock recovery;
pausing a displaced show does not clear this interlock. No sound-card fallback
is selected automatically.

Media from 8–192 kHz can be converted to 48 kHz with the audited FFmpeg
libswresample implementation already used for SDI. Decoding/matrix routing is
shared before the network/local split. A selected AES67 output that cannot open
causes a startup failure rather than quietly continuing the show without its
selected audio. A missing interface after restart leaves normal player status
and other destinations usable; restore the interface and reapply AES67 settings.

## Simultaneous local monitoring

Enable **Also monitor through a local audio device**, select a local output and
save while stopped. Monitoring uses the same decoded/mixed 48 kHz samples.
Devices that negotiate stereo receive the first two matrix outputs; other OS
routing remains the device/driver's responsibility. An unavailable monitor is
reported without stopping a functioning network stream.

The monitor has its own hardware clock and is not phase-aligned with an AES67
receiver. Its queue is bounded to about 100 ms and cannot backpressure the
network sender. Office measurements added approximately 0.4–1.8 percentage
points of one CPU core at 48 kHz, including normal measurement variability.
These runs used an SDL dummy monitor; physical device latency/drift and receiver
interoperability remain installation checks. SDI embedded output is not offered
as this first release's local monitor destination. Selecting AES67 alongside SDI
video selects network audio in place of embedded SDI audio.

## API handoff

All operations use the existing authentication mechanisms. Reads require
`status.read`; configuration changes require `config.write` (administrator).
Responses are `Cache-Control: no-store`.

| Method | Native path | Use |
| --- | --- | --- |
| GET | `/api/player/v1/audio/aes67` | Configuration, interfaces, selected output and transport/clock status |
| PUT | `/api/player/v1/audio/aes67/configuration` | Save a validated configuration after a native receipt |
| GET | `/api/player/v1/audio/aes67/session.sdp` | Current locked session; 409 if not synchronized |

Equivalent web operations are `/api/audio/aes67` (GET/PUT) and
`/api/audio/aes67/session.sdp`. The existing `PUT /api/audio/device` selects
`{"device":"__aes67__"}`. Native capabilities advertise `audio_outputs.aes67`.
Concrete schemas are in `player-api.openapi.json`. Unknown metadata/FLM cinema
soundfield declarations are not inferred from enabling network audio.

An example saved configuration (addresses and name are illustrative):

```json
{"enabled":true,"interface":"enp1s0","source_ip":"192.0.2.71","multicast_ip":"239.69.7.1","port":5004,"channels":8,"ptp_domain":0,"ttl":1,"name":"Screen audio","mirror_local":false,"mirror_device":""}
```

The native `aes67_config` command uses the same object under its `aes67_config`
member. `aes67_status` reads a bounded status snapshot. Initial acquisition is
asynchronous; a successful configuration receipt does not claim clock lock.
On storage failure, configuration writes attempt to restore the prior runtime
configuration. Polling snapshots do not flood the Status log.

## HUD

The playback HUD with CPU, bitrate and frame-buffer graphs now has dedicated
**J2K DECODE** and **AUDIO OUT** rows. J2K shows the actual Full/Half/Quarter
decode level and selected mode, including Auto. Audio identifies the active
local/SDI/AES67 destination; network output also shows clock state. These values
no longer depend on the long detail line fitting beside the graphs.
When no media audio is open, the selected destination is labelled as configured
or idle rather than presented as a verified open local device.

## Qualification and limits

See `aes67-qualification-2026-11-04.json` for reproducible results and coverage.
Software tests exercised actual GStreamer PTP against an isolated test
grandmaster, a separate multicast/L24 receiver, 48/96 kHz sources, all eight
channels, and a simultaneous local monitor. The sender was also run as the
actual `dcpplayer` account. They do not certify hardware clock precision,
switch QoS, a physical monitor or a particular receiver. No hardware receiver
was supplied during implementation; site commissioning remains required.

References: [GStreamer PTP clock](https://gstreamer.freedesktop.org/documentation/net/gstptpclock.html),
[RTP](https://www.rfc-editor.org/rfc/rfc3550),
[L24 payload](https://www.rfc-editor.org/rfc/rfc3190),
[clock source signalling](https://www.rfc-editor.org/rfc/rfc7273).
