Skip to content

fix(relay): widen per-peer audio channel capacity 8->16 frames - #4178

Open
brunkstr wants to merge 1 commit into
block:mainfrom
brunkstr:fix/huddle-audio-channel-capacity
Open

fix(relay): widen per-peer audio channel capacity 8->16 frames#4178
brunkstr wants to merge 1 commit into
block:mainfrom
brunkstr:fix/huddle-audio-channel-capacity

Conversation

@brunkstr

@brunkstr brunkstr commented Aug 1, 2026

Copy link
Copy Markdown

Summary

  • AUDIO_CHANNEL_CAPACITY in crates/buzz-relay/src/audio/room.rs gates the per-peer mpsc channel the relay fans audio frames out through; at 8 frames (160ms) it sits right at the jitter ceiling for an ordinary residential-ISP path, so try_send was dropping frames outright under normal jitter — heard as audio grain, not lag.
  • Widens it to 16 frames (320ms) to give headroom against that jitter. This reduces how often frames get dropped; it does not recover content once a frame is actually lost (that needs receive-side Opus FEC, which requires forking the upstream neteq crate — tracked separately in Huddle: receive-side Opus in-band FEC for lossy relay paths #4177).

Context

Diagnosed live against the web3services GKE deployment (buzz-cluster) — pod CPU/mem were near-idle (ruling out a sizing/resourcing cause), but pings to the relay's LB IP showed jitter spikes of 150-152ms sitting right at the old 160ms channel-capacity ceiling.

Test plan

  • cargo test -p buzz-relay audio::room — 9/9 pass
  • cargo fmt -p buzz-relay -- --check — clean
  • cargo clippy -p buzz-relay --all-targets -- -D warnings — clean
  • Live verification against the web3services relay deployment (pending maintainer go-ahead to redeploy — this PR does not itself deploy anything)

Co-Authored-By: brunkstr 132263425+brunkstr@users.noreply.github.com

Jitter spikes of 150-152ms on an ordinary residential-ISP path to the
relay sit right at the old 160ms (8-frame) ceiling, so brief jitter
was enough to make try_send drop frames outright -- audible as grain,
not lag. Widening to 320ms (16 frames) raises the drop threshold.

This does not recover lost audio content, only reduces how often the
relay drops frames under jitter. Receive-side Opus FEC would recover
content but needs a fork of the upstream neteq crate (no fec-aware
decode entry point as of neteq 0.9.0) -- tracked separately in
block#4177.

Co-authored-by: brunkstr <132263425+brunkstr@users.noreply.github.com>
Signed-off-by: brunkstr <132263425+brunkstr@users.noreply.github.com>
@brunkstr
brunkstr requested a review from a team as a code owner August 1, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant