Watching an official client's 1440p60 H.264 stream (6-9 Mbit/s) showed a very bad frame rate. The peer sockets used the system's default buffers (208 KB on Linux, about 90 full-size packets once the kernel's per-packet overhead is counted), so a keyframe of hundreds of packets that arrives while the peer task is busy overflows them, and every packet the kernel drops costs the viewer a retransmission or a keyframe. Each peer socket now asks for 4 MB of receive and send buffer (PeerConfig::udp_buffer; the kernel caps it at rmem_max/wmem_max). What the system granted is logged, and once per process with a sysctl hint when it is less than asked. Measured on loopback, 9 Mbit/s of noise at 60 fps with a 400 KB keyframe every second, unpaced (high_bitrate_bursts, --ignored): with the default buffers the kernel dropped 118-209 datagrams per 5 s and 3 of 300 frames arrived after a gap; asking for 212992 bytes (what a default rmem_max allows, doubled by Linux) or for 4 MB, nothing was dropped and every frame arrived whole. Also checked: our answer to a real libwebrtc offer (headless Chromium 152, H.264 first, stored as a fixture) keeps nack, nack pli, transport-cc and an RTX payload type for every H.264 variant, and a relay that loses one media packet in 25 shows str0m's NACK and retransmissions repairing every loss before its depacketizer gives up (30 frames). The relay (tests/relay) also serves the fallback tests that follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.2 KiB
TOML
34 lines
1.2 KiB
TOML
[package]
|
|
name = "voelin-stream"
|
|
version = "0.1.0"
|
|
description = "TeamSpeak 6 streams: signalling commands, JSON signal messages and WebRTC peers (str0m)."
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
publish.workspace = true
|
|
|
|
[dependencies]
|
|
# DTLS with our SRTP profile order (third_party/dimpl, see its VOELIN-PATCH.md),
|
|
# with the features str0m's aws-lc-rs provider uses.
|
|
dimpl = { version = "0.7.4", default-features = false, features = ["aws-lc-rs", "rcgen"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
# Socket options std lacks: UDP buffer sizes.
|
|
socket2 = "0.6"
|
|
str0m = { version = "0.23.1", default-features = false, features = ["aws-lc-rs"] }
|
|
thiserror = "2"
|
|
tokio = { version = "1", features = ["macros", "net", "rt", "sync", "time"] }
|
|
tracing = "0.1"
|
|
tsclientlib = { path = "../proto/tsclientlib" }
|
|
tsproto-packets = { path = "../proto/tsproto-packets" }
|
|
|
|
[dev-dependencies]
|
|
anyhow = "1"
|
|
futures = "0.3"
|
|
tokio = { version = "1", features = ["io-util", "macros", "net", "process", "rt-multi-thread", "sync", "time"] }
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
|
|
[lints]
|
|
workspace = true
|