Skip to content

Share play: stream delay, input delay and share_quality (T38) - #118

Merged
AlxcBTW merged 5 commits into
mainfrom
t38-measure
Oct 27, 2026
Merged

AlxcBTW merged 5 commits into
mainfrom
t38-measure

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Gap 2 of T38. Stacked on #113 (the diff shrinks when that one is merged).

  • Stream delay: the host worker stamps each picture with its system clock when it takes it from the ring; the guest's net service picks the host clock's offset from the pings (smallest round trip of the last minute, ClockPicker) and gives it to the viewer (ToWorker::Clock); the viewer works out each picture's age and reports median and 95th percentile of 10 s (DelayWindow).
  • Input delay: the guest remembers when it sent each pad sequence number; the host acknowledges the newest applied one with pad_ack (about 4 per second, with how long it held it); the guest takes half the round trip.
  • Both figures reach the launcher as stream_delay_ms / input_delay_ms (p50, p95) in the share event, on the guest's PC directly and on the host's PC through the guest's report.
  • share_quality (max_kbps, max_height): hub setting, applied to the running share's controller and to later ones.
  • Spec and plan updated.

Tests: unit tests for the window, clock picker and frame age (incl. the 32-bit wrap), link and control round trips, command parsing, and two in-process integration tests (figures appear on both sides and are sane on one machine; the host's limit holds the picture at 540p).

Not proven: the figures between two real PCs on two networks (clock offset, asymmetric paths), the engine's copy time (not in the figure by design, see spec).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

… (T38)

The host\x27s net service now moves the stream along the ladder from the guest\x27s reports: a new rate goes to the running encoder, a new size or frame rate is a new epoch, a new encoder and a config for the guest. The frame ring has the size of the top rung so that the picture can go up as well as down. The controller gets the player\x27s height limit for share_quality.
…y (T38)

The guest's viewer works out how old each picture is from the host worker's stamp and the host clock's offset, which the guest's net service picks from the pings (smallest round trip of the last minute). The guest times its pad states against the host's pad_ack. Both figures (median and 95th percentile of 10 seconds) reach the launcher in the share event on both PCs. share_quality sets the player's maximum rate and picture height on the controller.
@AlxcBTW
AlxcBTW merged commit 9366276 into main Oct 27, 2026
17 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