Skip to content

feat(stream): automatic bitrate on the page - #65

Closed
enricobuehler wants to merge 1 commit into
fix/web-quality-dotfrom
feat/web-abr
Closed

enricobuehler wants to merge 1 commit into
fix/web-quality-dotfrom
feat/web-abr

Conversation

@enricobuehler

@enricobuehler enricobuehler commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Design: web-client-tcp-bridge.md §7 (decision D12).

The page streamed at the rate the host resolved and never moved it. Now core's ABR driver runs on the page, fed through punktfunk_core::abr::feed the way the native pump feeds it. Everything lives in packages/stream/rust/abr.rs; session.rs calls in at the Welcome, per access unit, per control frame (BitrateChanged, accepted Reconfigured) and per pump.

  • ClientHello.abr_features = EXT_ABR_ACK_REASON. Acks go into the next tick, and the driver's SetBitrate goes out on the control stream.
  • Inputs: Session::stats, loss positions, shard delays (drained only), this session's ring drops, decode time from pf_hud_decoded, host encode time and timings from 0xCF, recovery keyframe asks.
  • No clock offset (clock_offset_ns: 0), so no one-way-delay signal. Every Probe goes back as on_probe_dropped. Report/Shape/LinkRate ride Feedback levels the page does not send yet. Loss and acks drive it.
  • FLAG_PROBE frames never reach the decoder now (there was no guard before).
  • The overlay gets the driver's target, Automatic, and the last cut reason.

Pin note. This builds against monorepo branch refactor/abr-feed (local, unpushed). The punktfunk-core pin in packages/stream/Cargo.toml must be bumped to a rev that includes it before this merges, so CI's wasm job fails until then.

stream_cap_kbps calls core's abr::stream_ceiling_kbps, exported by monorepo commit 45b4b1b11 on refactor/abr-feed (the same branch this pin bump needs).

Checked locally against that branch through a path patch (not committed): cargo fmt --check, cargo clippy (host and wasm, -D warnings), cargo test (21 pass, 2 new), build.sh links, npm test and npm run check unchanged.

@enricobuehler
enricobuehler force-pushed the feat/web-abr branch 2 times, most recently from b105e24 to ea4d09e Compare October 30, 2026 17:23
@enricobuehler
enricobuehler changed the base branch from main to fix/web-quality-dot October 30, 2026 17:23
The page streamed at the rate the host resolved and never moved it.

The driver is core's, fed through `abr::feed` the way the native pump
feeds it: the session's counters, loss positions, ring drops, decode and
host encode times, keyframe asks and the host's bitrate acks. Its rate
asks go out as `SetBitrate`. The stream ceiling is core's too.

No clock offset is measured and no probe is asked for yet, so loss and
acks drive it.
@enricobuehler

Copy link
Copy Markdown
Member Author

Merged as #66 (GitHub closed this one when its base branch went with #64).

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