Skip to content

fix(stream/audio): ask the host for the redundant audio plane - #89

Merged
enricobuehler merged 1 commit into
mainfrom
fix/audio-red-cap
Nov 26, 2026
Merged

enricobuehler merged 1 commit into
mainfrom
fix/audio-red-cap

Conversation

@enricobuehler

Copy link
Copy Markdown
Member

The page never declared CLIENT_CAP_AUDIO_RED, so a host never sent it the 0xD2 plane and a lost audio datagram was never rebuilt, in a browser or on a Samsung TV.

Why it was missed

punktfunk-core ORs the bit into every native client's hello (advertised_client_caps, client/mod.rs). The page builds its own ClientHello in rust/session.rs and set CLIENT_CAP_CURSOR alone. The host gates on the client's bit (redundancy_offered, native/handshake.rs).

The receive side has been here since d89fe5e: audio::on_datagram takes 0xD2, asks core's AudioRedRecovery whether the copy is owed, and releases it as seq - 1 ahead of its frame.

Checked

  • Read audio::on_datagram against AudioRedRecovery::recover_before: a reorder, a duplicate and a session's first packet recover nothing, and a copy that arrives after its original is dropped as stale by Plane::take.
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test in packages/stream.

Not checked — why this is a draft

The 0xD2 path has never run against a host, because no host ever sent it. It wants one session under loss on a real browser: audio plays, and pf_audio_lost stays near zero where it climbed before.

The page has rebuilt a lost audio frame from the copy in the next one
since it first played audio, but its hello never said so. A host sends
that plane only to a client that declares it, and core adds the bit for
the native clients, not for a hello the page builds itself.

The hello now declares it. A host that declines keeps the plain plane.
@enricobuehler
enricobuehler marked this pull request as ready for review November 26, 2026 11:33
@enricobuehler
enricobuehler merged commit 70e0af6 into main Nov 26, 2026
8 checks passed
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