feat(M2): UDP voice/media plane -- SFU relay, Opus, AEAD, jitter buffer

Adds the full voice pipeline: 14-byte binary frame header, ChaCha20-Poly1305
AEAD keyed from the TLS exporter, libopus encode/decode with FEC/PLC/DTX,
an adaptive per-ssrc jitter buffer, a miniaudio capture/playback engine, an
APM passthrough stub, and the UdpBinding/StreamAnnounce signaling chain
wired through ConnSession/SessionRegistry into a new server-side SFU
(MediaRelay) that decrypts and re-encrypts frames per channel member.

Exit criterion verified: test_m2_voice — two headless clients relay 50
encrypted Opus frames through the server; ctest --preset m1-dev is 9/9
green. Also corrects protocol.md's UdpBinding diagram, which described the
UDP-side binding packet as AEAD-sealed when it is in fact a plaintext
bootstrap frame (separate from the TCP/TLS UdpBinding ack).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-16 01:31:14 +02:00
parent 63f457fc54
commit 694494a5be
29 changed files with 2548 additions and 86 deletions

View File

@@ -36,6 +36,21 @@
"VCPKG_HOST_TRIPLET": "x64-mingw-static"
}
},
{
"name": "m2-dev",
"inherits": "vcpkg-base",
"displayName": "M2 Dev (voice + media, deps via vcpkg)",
"description": "Active development preset for M2+. Requires VCPKG_ROOT env var pointing to a bootstrapped vcpkg. Set VCPKG_ROOT=D:\\code\\nvgt\\vcpkg\\bin (or wherever your vcpkg is).",
"binaryDir": "${sourceDir}/build/m2-dev",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"VOICECAT_USE_VCPKG_DEPS": "ON",
"VOICECAT_BUILD_TOOLS": "ON",
"VOICECAT_BUILD_TESTS": "ON",
"VCPKG_TARGET_TRIPLET": "x64-mingw-static",
"VCPKG_HOST_TRIPLET": "x64-mingw-static"
}
},
{
"name": "server-release",
"inherits": "vcpkg-base",
@@ -51,10 +66,12 @@
"buildPresets": [
{ "name": "dev", "configurePreset": "dev" },
{ "name": "m1-dev", "configurePreset": "m1-dev" },
{ "name": "m2-dev", "configurePreset": "m2-dev" },
{ "name": "server-release", "configurePreset": "server-release" }
],
"testPresets": [
{ "name": "dev", "configurePreset": "dev", "output": { "outputOnFailure": true } },
{ "name": "m1-dev", "configurePreset": "m1-dev", "output": { "outputOnFailure": true } }
{ "name": "m1-dev", "configurePreset": "m1-dev", "output": { "outputOnFailure": true } },
{ "name": "m2-dev", "configurePreset": "m2-dev", "output": { "outputOnFailure": true } }
]
}