Repository navigation
Conversation
VP9, AV1 and H.265 simulcast use the Simulcast video layer selector without a temporal layer selector, so every temporal layer of the selected spatial layer is forwarded. On a spatial switch the selector set the current temporal layer to that of the switch key frame (always 0) and nothing moved it afterwards. With L1T2/L1T3 encodings the allocator target temporal layer is higher, so the target stayed pending forever: GetNextHigherTransition refused every transition and the stream allocator never probed, leaving a subscriber that was down-switched for congestion on the lower layer for the rest of the session. When no temporal layer selector is set, report the current temporal layer as the target, both at a spatial switch and when only the target temporal layer changes. H.264 is unaffected in practice (its target temporal layer is already clamped to 0). VP8 (which has a temporal layer selector) and the SVC selectors are unchanged.
A VP8 down track installs a VP8 temporal layer selector. On a codec change to VP9/AV1 simulcast (or H.264/H.265), the new selector is built from the previous one and keeps its Base, including that VP8 temporal layer selector. It cannot parse the new codec's payloads, so the current temporal layer never moves and the temporal layer recovery for selectors without a temporal layer selector never runs. Clear the temporal layer selector before configuring the new codec; the VP8 branch sets its own as before.
obcached
marked this pull request as draft
October 9, 2026 06:02
Author
|
Measurements show that unblocking temporal probing without TID filtering lets the forwarder send all temporal layers while the allocator budgets a lower one (~1.6× overshoot), causing probe/overshoot cycles under constrained downlinks. Adding a VP9/AV1 simulcast temporal-layer selector before re-requesting review... |
Contributor
|
Addressed this in #4991 and some subsequent PRs. Can you please try the latest and open an issue if that does not work? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title
fix: let VP9/AV1 simulcast subscribers reach the target temporal layer
Problem
With VP9/AV1 published as rid simulcast with temporal layers (
L1T2/L1T3), a subscriber moved to a lower ridfor congestion never comes back up after the link recovers: the allocator stays
DEFICIENTand never probes.VP9 k-SVC, VP8/H.264 simulcast and VP9 simulcast with
L1T1recover fine.Root cause
VP9/AV1 simulcast use the
Simulcastselector without a temporal layer selector(forwarder.go#L423-L430),
so all temporal layers are forwarded, but on a spatial switch the current temporal layer is set to the key
frame's TID (0) and never moves again
(simulcast.go#L125-L128).
The target temporal layer is 2 for
L1T3, soGetNextHigherTransitionsees a pending target forever(forwarder.go#L1557-L1561)
and
maybeProbeWithPaddingnever probes(streamallocator.go#L1356-L1361).
Fix
In
Simulcast.Select, when no temporal layer selector is set, the current temporal layer follows the target.VP8 (has a temporal layer selector), H.264 (target already clamped to 0) and the SVC selectors are unaffected.
Not addressed here: after a codec change from VP8 to VP9/AV1/H.265 simulcast, the down track keeps the VP8
temporal layer selector, so this fix doesn't apply to it. Clearing the selector in the non-VP8 branches of
DetermineCodecwould fix that; happy to send it separately.Tests
TestForwarderSimulcastTemporalLayerAfterSwitch: transition unavailable before the switch key frame, availableafter. VP9/AV1
L1T3fail on master; VP9L1T1, H.264 and VP8 pass on both.TestSimulcastSelectCurrentTemporalFollowsTargetWithoutTemporalLayerSelector(fails on master) andTestSimulcastSelectTemporalLayerSelectorOwnsCurrentTemporal.go test -race ./pkg/sfu/...and golangci-lint pass.Observed
v1.13.8 (same code as master), JS SDK, VP9 rid simulcast 720p/1080p, subscriber download capped at 600 kbit/s
for 60 s then restored:
L1T3(7 runs)L1T1L3T3_KEY