Skip to content

fix(streamer): return the server's split-encode feature in ANNOUNCE - #1306

Merged
Kief5555 merged 1 commit into
OpenCloudGaming:devfrom
etgbrown:split-encode-4k
Nov 18, 2026
Merged

Kief5555 merged 1 commit into
OpenCloudGaming:devfrom
etgbrown:split-encode-4k

Conversation

@etgbrown

Copy link
Copy Markdown
Contributor

Problem

At 3840×2160 @ 120 the host sends a steady ~10.4 ms frame cadence (about 96 fps). 2560×1440 @ 120 on the same machine, account, zone and title gets 120 fps. Codec, bitrate cap, Cloud G-SYNC, L4S, save-bandwidth and 10-bit color did not change the 4K rate.

Cause

DESCRIBE answers main ;; features || upstream, and the ;; section is separately signed (o=NvStreamer, k=HMAC:). ANNOUNCE never returns its video[0].videoSplitEncodeStripsPerFrame. v1.0.0 and v1.0.1 sent a fixed 64 there; #1025 removed it as an invented value. The A/B below shows that the 4K rate depends on ANNOUNCE carrying the server's value. It does not show how the host uses the value.

Change

  • forward_server_features, at the end of negotiated_announce, returns exactly one allowlisted key, video[0].videoSplitEncodeStripsPerFrame, with the server's own ;; value. Nothing is invented: main-section and || values are never returned, nothing is sent when ;; lacks the key, and a value that is not an unsigned integer is dropped with ignored-server-offer.
  • The line replaces a same-name client line or goes before t= (set_session_attributes). The transport logs server-features returned=[name=value], never SDP or credentials. fix(streamer): put dynamic quality thresholds on the AV1 QP scale #1305 adds the identical helper, so whichever of the two merges second drops its copy in a trivial rebase.
  • The key stays out of SERVER_NEGOTIATED. Its equal-value suppression (fix(streamer): honor RTSP offer values and authenticate before PLAY #1168) runs after negotiated_announce and would drop a value that always equals the signed offer.
  • Docs: docs/streamer-comparison/rtsp-negotiation.md.

This does not claim that the official client echoes the feature block; #1166 shows its ANNOUNCE is a difference against the offer. Supporting evidence only: v1.0.0/1.0.1 sent 64, 72befd0 labelled 64 part of the "Official macOS ANNOUNCE baseline", and the wire capture in closed #1289 shows feature-block QoS values in an official ANNOUNCE.

Verification

Streamer workspace, Steam Runtime 4 SDK container:

  • cargo fmt --all -- --check: clean.
  • cargo clippy --locked --workspace --all-targets -- -D warnings: clean.
  • cargo test --locked -p opennow-streamer-core: 236 passed, 0 failed. --workspace: 1,338 passed, 0 failed, 13 ignored.
  • announce_does_not_echo_server_config_or_invent_server_owned_values keeps its assertions and adds cases: a main-section-only offer stays absent; a ;; offer is returned once, with the server's value, before t=; the || value is never used; the other server-owned keys stay absent even when signed beside it.
  • Six negotiation tests: ;;-only parsing, placement, replacement, withheld and credential keys, no features section, last value wins and must be an unsigned integer.
  • Mutations caught: adding the key to SERVER_NEGOTIATED, reading the main section, dropping validation, or unwiring the call each fails a test.

Live, on a v1.0.3-based Linux build (Fedora 44, KDE Wayland, RTX 3080 Ti, Ultimate, us-texas, SUPERHOT; fps from nvst-video frames= deltas), 3840×2160 @ 120:

  • Without: 18 sessions at ≤97 fps (steady 94–96).
  • With: 12 sessions at 119–120 fps (H.265 10-bit, AV1 8/10-bit).
  • Control: returning only framePacing.pid.minTargetFrameTimeUs=7936 stayed at 96 fps.

On dev, same day, zone and settings (AV1 10-bit 4:2:0, chromaFormat:0, save-bandwidth off), one session per arm:

  • Without: Linux nightly v1.0.4-nightly.1247.1 (dev 08822ce), 924–930 frames per 10 s (~93 fps).
  • With: the same nightly with libopennow_streamer_ffi.so built from this branch (dev 0467152 + this commit), 1,193–1,208 frames per 10 s (median 1,200) for 60 s.
  • A second session without this change (the AV1 QP branch, save-bandwidth on) also held 920–932 frames per 10 s.

Not verified

  • More than one session per arm on dev.
  • Windows and macOS clients.
  • Other modes (1440p @ 120, 4K @ 60, 240 fps), where the server may sign another value or none.
  • How the host interprets the value.
  • Qt ctest and the Windows and macOS builds, left to CI.

Related

#1025 #1168 #981 #1166 #1289

🤖 Generated with Claude Code

Problem: at 3840x2160@120 the host sends a steady ~10.4 ms frame cadence
(about 96 fps), while 2560x1440@120 on the same machine, account, zone
and title gets 120 fps. Codec, bitrate cap, Cloud G-SYNC, L4S,
save-bandwidth and 10-bit color do not change the 4K rate.

Cause: DESCRIBE answers `main ;; features || upstream`, and the `;;`
section is separately signed (o=NvStreamer, k=HMAC:). ANNOUNCE never
returns its video[0].videoSplitEncodeStripsPerFrame. v1.0.0 and v1.0.1
sent a fixed 64 there; OpenCloudGaming#1025 removed it as an invented value.

Change: negotiated_announce calls forward_server_features, which returns
exactly one allowlisted key, video[0].videoSplitEncodeStripsPerFrame,
with the server's own `;;` value. Main-section and `||` values are never
returned, nothing is sent when `;;` lacks the key, and a value that is
not an unsigned integer is dropped with ignored-server-offer. The line
replaces a same-name client line or goes before t=
(set_session_attributes), and the transport logs
server-features returned=[...]. The key stays out of SERVER_NEGOTIATED,
whose equal-value suppression would drop a value that always equals the
signed offer. This is not an echo of the feature section; other feature
attributes stay withheld.

Verification: cargo fmt --check, cargo clippy --workspace --all-targets
-D warnings, and cargo test pass (opennow-streamer-core: 236 passed;
workspace: 1338 passed).
The no-echo test keeps its assertions and adds main-section-only, signed
`;;` and `||` cases; it fails if the key joins SERVER_NEGOTIATED. Six
negotiation tests cover `;;`-only parsing, placement, replacement,
withheld and credential keys, a missing section, and value validation.
Live A/B on a v1.0.3-based build at 3840x2160@120: 18 sessions without
the attribute at <=97 fps, 12 with it at 119-120 fps (H.265 10-bit, AV1
8/10-bit); returning only framePacing.pid.minTargetFrameTimeUs instead
stayed at 96 fps. Not yet repeated on dev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 60e91e92-c980-479e-b0d0-5530894cb742

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Kief5555
Kief5555 merged commit 3a8d4e1 into OpenCloudGaming:dev Nov 18, 2026
12 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.

2 participants