Closed Bug 1751532 Opened 2 years ago Closed 2 years ago

"inbound-rtp" stats sholdn't be exposed on receiver ahead of incoming packets

Categories

(Core :: WebRTC, defect, P2)

defect

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: jib, Assigned: pehrsons)

Details

Attachments

(2 files)

STR: Open https://jsfiddle.net/jib1/fjk3tw9e/1/ which calls pc1.addTransceiver("video") x 10

Expected results (based on spec. Chrome produces both 10 "inbound-rtp" and 10 "outbound-rtp"):

Wait 5 seconds for rtcp packets...
Have 10 sendonly transceivers

pc1:
1 "candidate-pair" stats
1 "remote-candidate" stats
1 "local-candidate" stats

pc2:
1 "candidate-pair" stats
1 "local-candidate" stats
1 "remote-candidate" stats

Actual results:

Wait 5 seconds for rtcp packets...
Have 10 sendonly transceivers

pc1:
2 "candidate-pair" stats
2 "local-candidate" stats
3 "remote-candidate" stats

pc2:
1 "candidate-pair" stats
2 "local-candidate" stats
2 "remote-candidate" stats
10 "inbound-rtp" stats

Firefox produces "inbound-rtp" on pc2 but no "outbound-rtp" stats on pc1.

The spec isn't super-clear here, but the overall direction the spec has taken is toward untangling the rtp pipes from the media sent through them. So while I could see some reason for the existing behavior (sender.track is null so nothing to report), the asymmetry on the other end seems to require the opposite rationale (no packets received yet, so let's report that). The former requires local action by JS while the latter doesn't, is perhaps one answer. At the same time I could see people expecting symmetry here.

Reporting this as a bug here. Happy to take it to the spec if we're confident about this being on purpose. See comment 2.

Byron, thoughts on whether the current behavior is intentional or not?

Flags: needinfo?(docfaraday)

I found the answer in the spec: "The lifetime of all RTP monitored objects starts when the RTP stream is first used: When the first RTP packet is sent or received on the SSRC it represents, or when the first RTCP packet is sent or received that refers to the SSRC of the RTP stream."

So based on this, we should remove "inbound-rtp" stats in this state, not add "outbound-rtp" as I originally suggested. I'll update the subject, edit the expectations in the OP, and file bugs on the other vendors.

Flags: needinfo?(docfaraday)
Summary: inbound-rtp stats on one side but no outbound-rtp on the other → "inbound-rtp" stats sholdn't be exposed on receiver ahead of incoming packets
Severity: -- → S3
Priority: -- → P2

So if no media is flowing, could RTCP packets still flow? If so, can you be certain whether your fiddle is working or not in Chrome?

I've filed crbug 1291019 with a simpler fiddle that reproduces without establishing a connection.

I've also filed a tracking issue on WPT https://github.com/w3c/webrtc-stats/issues/619.

Here's the simpler inbound-rtp fiddle showing the problem in Firefox https://jsfiddle.net/jib1/b32myw94/9/

Assignee: nobody → apehrson
Status: NEW → ASSIGNED

It's quite easy fixing the creation lifetime boundary of RTP monitored objects.

However:

RTP monitored objects are not deleted.

will require some refactoring, as this means rtp stats should remain available beyond pc.close(). But that's for another bug.

Pushed by pehrsons@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/0e7a4bf4ff32
Add WPT. r=jib
https://hg.mozilla.org/integration/autoland/rev/3f8323b0d44a
Do not expose rtp stream stats until there is packet flow. r=jib
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/32570 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
Upstream PR merged by moz-wptsync-bot
Status: RESOLVED → ASSIGNED
Closed: 2 years ago
Resolution: FIXED → ---
Target Milestone: 98 Branch → ---
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: