Repository navigation
Hear the station here: stop cutting out behind a proxy or CDN - #36
Conversation
Through a reverse proxy (Cloudflare, nginx, IIS) the server's mix arrives in bursts. The app's jitter buffer held only ~0.3 s and dropped anything past ~1.2 s, and the server skipped audio after ~0.3 s of slow reads, so the sound cut in and out every few seconds while it worked by IP. - The app's listen buffer starts at ~0.3 s and doubles each time it runs dry, up to ~6 s, with room for bursts that size. - The server lets ~3 s pile up before skipping. - The listen stream also sends Cache-Control: no-transform. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016m2QHXXBfnqtnuqjXmR2zX
There was a problem hiding this comment.
MergeGuard review
Risk: 🟠 35/100 — moderate
Findings: 🟠 1 medium
Open Files changed for 1 inline review thread on the diff.
💡 Use the Fix All MergeGuard Findings checkbox comment on this PR to apply auto-fixes in batch, or reply
@mergeguards fixon any inline finding.
Reviewed by MergeGuard AI
MergeGuard agent actionsFix all findingsAll issues (1)
Apply auto-fixes for the findings above on this branch:
Or reply with |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016m2QHXXBfnqtnuqjXmR2zX
There was a problem hiding this comment.
MergeGuard review
Risk: 🟠 35/100 — moderate
Findings: 🟠 1 medium
Open Files changed for 1 inline review thread on the diff.
💡 Use the Fix All MergeGuard Findings checkbox comment on this PR to apply auto-fixes in batch, or reply
@mergeguards fixon any inline finding.
Reviewed by MergeGuard AI
Requested by epell · project thread
Problem
"Hear the station here" cut in and out every few seconds when the server was reached through its domain (rmstr.listen.dovafm.com), but played fine by IP. A reverse proxy or CDN passes the stream on in bursts. Both ends had very small buffers:
So every gap between bursts ran the app dry, and each burst then overflowed it.
Changes
engine::net_feed_adaptive: the prebuffer doubles each time the sound runs dry after playing, up to a limit, and the channel has room for bursts that size. The Listener starts at ~0.3 s (same as before on a LAN) and can grow to ~6 s. The server's mic keeps its fixed buffer (net_feed)./api/v1/listen: lets ~3 s pile up before skipping (LISTEN_BACKLOG), and addsno-transformto Cache-Control.Checks
cargo fmt,cargo +1.99.0 clippy --all-targets -- -D warnings,cargo test(all pass),tools/smoke_server.shpassed. Not tested against the real domain from here: the cloud sandbox can't reach it.No CHANGELOG entry yet, because v0.2.10 still has to be tagged. It goes in the next version's section.
Generated by Claude Code