Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't let offers to receive simulcast overwrite existing [[SendEncodings]] #2758

Merged
merged 9 commits into from
Oct 13, 2022

Conversation

jan-ivar
Copy link
Member

@jan-ivar jan-ivar commented Jul 27, 2022

@jan-ivar jan-ivar self-assigned this Jul 27, 2022
@jan-ivar
Copy link
Member Author

I recommend ignoring whitespace when reviewing.

@jan-ivar
Copy link
Member Author

Feedback is it might be simpler to spell the failure criteria earlier in 4.1 explicitly instead of relying on it referencing whether this code that's being changed results in a change or not. That failure test would then (for the case where existing SendEncodings exist) disallow changes in SendEncodings.length and changes in ordering, or changes in rid names

Copy link
Contributor

@alvestrand alvestrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this still needs some work, in particular about being explicit about where inappropriate changes (adding RIDs, reordering RIDs) are being applied.

I think the only modification operation we really want to allow is to delete trailing RIDs (possibly dropping down to singlecast by deleting all RIDs?)

webrtc.html Outdated Show resolved Hide resolved
webrtc.html Outdated Show resolved Hide resolved
webrtc.html Outdated Show resolved Hide resolved
webrtc.html Outdated Show resolved Hide resolved
@aboba aboba added the Needs Test Needs a WPT test label Aug 4, 2022
webrtc.html Outdated Show resolved Hide resolved
webrtc.html Outdated Show resolved Hide resolved
@jan-ivar
Copy link
Member Author

I've updated this PR based on #2762 (comment), with one difference: it only fails over rid name mismatch on the first encoding in re-offers, and treats mismatch past that as absence.

IOW I saw no reason to treat known out-of-order rids any different from unknowns rids. This seems to match implementations (both result in layer reduction). @alvestrand @docfaraday PTAL.

Copy link
Contributor

@alvestrand alvestrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is close to being right, I think. But I worry about the removal (rather than disabling) of non-sent layers.

I think this means that the sequence:

offer: rid: 1,2,3
answer: rid: 1,2

means that subsequent offer is

offer: rid:1,2
and that
answer: rid:1,2,3
will lead to rejection.

Does this have an interaction with pr-answer? (ex: offer: 1,2,3; pr-answer: 1,2; answer: 1,2,3)?

webrtc.html Outdated Show resolved Hide resolved
webrtc.html Outdated Show resolved Hide resolved
webrtc.html Outdated
[=map/contains=] no
{{RTCRtpCodingParameters/rid}} member, set
<var>transceiver</var>.{{RTCRtpTransceiver/[[Sender]]}}.{{RTCRtpSender/[[SendEncodings]]}}
to <var>proposedSendEncodings</var>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and stop (I'm not clear if it should say "go to end of section", "stop processing RIDs", or "go on to the next transceiver").

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally had "and skip the remaining sub-steps" but since we're in nested sub-steps of sub-steps I worried it wouldn't be clear which sub-steps to skip. Fortunately, the remaining steps we care to skip are all no-ops in this case (all aspects being compared for are equal already), which is why I suggest leaving it this way.

This has the added advantage of running the assert.

@jan-ivar
Copy link
Member Author

This is close to being right, I think. But I worry about the removal (rather than disabling) of non-sent layers.

Having SRD toggle the active attributes would create more races like we're trying to remove in #2737 I fear.

offer: rid:1,2
and that
answer: rid:1,2,3
will lead to rejection.

This is already invalid in JSEP O/A. An answer must stay within the envelope of an offer AFAIK.

Does this have an interaction with pr-answer? (ex: offer: 1,2,3; pr-answer: 1,2; answer: 1,2,3)?

I don't think so. This PR isn't modifying any answer behavior.

@jan-ivar
Copy link
Member Author

jan-ivar commented Oct 6, 2022

cc @Orphis

@dontcallmedom dontcallmedom added the Simulcast Issue relating to Simulcast label Oct 12, 2022
@dontcallmedom
Copy link
Member

@jan-ivar can you rebase on main so that I add the necessary metadata on Rec changes, following #2713 ?

@jan-ivar
Copy link
Member Author

This PR needs more work to incorporate additonal findings:

  1. Its restriction that encodings[0].rid must match the first rid in a=simulcast seems too strict, when implementations allow rid pruning not just from the tail
  2. While letting remote offers prune rids is required by JSEP, browsers' immediate exposure of this effect on encodings in"have-remote-offer" seems poorly executed as it cannot be rolled back, and effects stack over back-to-back SRDs.

Instead, waiting until local answer to prune encodings avoids both problems (no encodings to rollback and no stacking).

Such waiting would maintain invariants the spec offers today, which seems more conservative as a first PR here, while moving us closer to how browsers work.

I think that's the right place to stop, as whether we should go any further I think requires further WG discussion.

@jan-ivar
Copy link
Member Author

PR updated. This simplifies quite a bit, which seems promising. PTAL.

@alvestrand alvestrand merged commit d183990 into w3c:main Oct 13, 2022
@jan-ivar
Copy link
Member Author

@dontcallmedom this one seems to be missing amendments as well, yet was able to merge. Did you change this requirement?

@dontcallmedom
Copy link
Member

merges aren't prevented by CI failure in our current setup - the merge was done here despite such a failure :)

Could you prepare a separate PR to update amendments.json?

jan-ivar added a commit to jan-ivar/webrtc-pc that referenced this pull request Oct 13, 2022
@jan-ivar
Copy link
Member Author

jan-ivar commented Oct 14, 2022

To qualify the title of this PR, remote offers to receive simulcast still trounce unicast [[SendEncodings]] (containing a lone encoding without a rid member).

@dontcallmedom-bot
Copy link

This issue was mentioned in WEBRTCWG-2023-01-17 (Page 14)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Test Needs a WPT test Simulcast Issue relating to Simulcast
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sRD(offer) completely overwrites pre-existing transceiver.[[Sender]].[[SendEncodings]]
6 participants