Closed Bug 1729455 Opened 4 years ago Closed 4 years ago

remote-outbound-rtp's remoteTimestamp field uses the time base of NTP (1 Jan 1900) instead of DOMHighResTimeStamp (1 Jan 1970)

Categories

(Core :: WebRTC, defect, P3)

defect

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: pehrsons, Assigned: pehrsons)

References

Details

Attachments

(23 files, 2 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

There's a good 70 extra years added onto remoteTimestamp compared to what an application might expect.

The timestamps from libwebrtc are also not going through the same precision reduction logic that our own TimestampMaker has. Could fix that here too.

Good catch. I am not sure about degrading the timestamps, as they can be used to uniquely identify specific packets, though I am not sure how accurate the current conversion code is. We should at least put that behind a pref to start.

Gotcha. Well let me know in review and I'll make adjustments. The patches are already written.

I'll leave out the precision reduction on remote timestamps then, but put them on local receive timestamps, which I'll be taking from libwebrtc now.

NTP time starts at "midnight on January first 1900" (RFC868).
DOMHighResTimeStamp starts at "midnight at the beginning of 1 January 1970 UTC"
(ECMA-262).

This is needed in order to provide precision reduction on timestamps from
libwebrtc.

Attachment #9241379 - Attachment is obsolete: true
Attachment #9241378 - Attachment description: Bug 1729455 - Modularize RTCStatsTimestampMaker::GetNow(). r?ng! → Bug 1729455 - Modularize RTCStatsTimestampMaker::GetNow(). r?ng!, r?bwc!

This solves issues around translating timestamps from the libwebrtc clock to
DOMHighResTimeStamp which is using our timestamp maker. With the regular
upstream clock there's a risk those timestamps appear in the future, compared
to Performance.now, leading to test failures in stats.

Attachment #9241379 - Attachment is obsolete: false
Attachment #9242284 - Attachment is obsolete: true

This patch makes libwebrtc use our clock for timestamps.
It also makes sure future libwebrtc updates don't introduce unaudited use of the
libwebrtc realtime clock.

Attachment #9244622 - Attachment is obsolete: true
Blocks: 1529581

This avoid triggering an assertion in RTPSenderVideo::SendVideo that doesn't
like negative timestamps.

Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/a2cee9ad6c6c Test remoteTimestamp's age in mochitest. r=jib,ng https://hg.mozilla.org/integration/autoland/rev/99267b6d193f Add to stats the local receive time for receiving video Sender Reports. r=ng https://hg.mozilla.org/integration/autoland/rev/cfcd4d853484 Fix timestamps for remote stats. r=ng https://hg.mozilla.org/integration/autoland/rev/8e036b0931e3 Make GetRemoteSSRC return a Maybe. r=ng https://hg.mozilla.org/integration/autoland/rev/907da0f267fd Rebase libwebrtc ntp timestamps to proper DOMHighResTimeStamp time. r=ng https://hg.mozilla.org/integration/autoland/rev/f058fbb8662e Cherry-pick libwebrtc patches that makes SystemTimeNanos overrideable. r=bwc https://hg.mozilla.org/integration/autoland/rev/080188fa01cf Cherry-pick libwebrtc ntp clock consolidation patches. r=bwc,ng https://hg.mozilla.org/integration/autoland/rev/7f7c9f002087 Define a gecko-specific rtc::SystemTimeNanos. r=bwc https://hg.mozilla.org/integration/autoland/rev/11637120b0cc Update generated gn-config files. r=mjf https://hg.mozilla.org/integration/autoland/rev/eb07a028bc43 Update gn-configs README with rust aarch64 stdlib instructions for Windows. r=mjf https://hg.mozilla.org/integration/autoland/rev/e8d24be16e22 Simplify gn-configs generation instructions for mac. r=mjf https://hg.mozilla.org/integration/autoland/rev/0cfae6f33c35 Let configure figure out the mac os sdk itself. r=mjf https://hg.mozilla.org/integration/autoland/rev/3e8ac168ee3d Ensure the libwebrtc system clock is not used. r=bwc https://hg.mozilla.org/integration/autoland/rev/5a3ecc96a699 libwebrtc: Don't use wall clock for stats. r=bwc https://hg.mozilla.org/integration/autoland/rev/40008e4f1c1f Modularize RTCStatsTimestampMaker::GetNow(). r=ng,bwc https://hg.mozilla.org/integration/autoland/rev/d112b90b7c05 Reduce time precision on timestamps from libwebrtc. r=ng https://hg.mozilla.org/integration/autoland/rev/b04e243f4ab5 Simplify RtpSources timestamp conversion. r=bwc https://hg.mozilla.org/integration/autoland/rev/9b44714d7fce Test that synchronization sources have a timestamp with the correct base. r=ng https://hg.mozilla.org/integration/autoland/rev/0473c7cfd344 Sort RTCStatsReport includes. r=bwc https://hg.mozilla.org/integration/autoland/rev/6911243d9ae0 Define our own webrtc::Clock based on RTCStatsTimestampMaker. r=bwc https://hg.mozilla.org/integration/autoland/rev/052a33acc2e4 Remove unused arg in DesktopCaptureImpl::DeliverCapturedFrame and simplify. r=bwc,ng https://hg.mozilla.org/integration/autoland/rev/0744d68b8c94 Inject RTCStatsTimestampMakerRealtimeClock into Call instances. r=bwc https://hg.mozilla.org/integration/autoland/rev/eb27a22d5419 Plumb video frame timestamps properly through the GMP encoder. r=bwc
Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/1a55783edb50 Test remoteTimestamp's age in mochitest. r=jib,ng https://hg.mozilla.org/integration/autoland/rev/75b2e5b22dd8 Add to stats the local receive time for receiving video Sender Reports. r=ng https://hg.mozilla.org/integration/autoland/rev/2bee95385d95 Fix timestamps for remote stats. r=ng https://hg.mozilla.org/integration/autoland/rev/ff2adec471a1 Make GetRemoteSSRC return a Maybe. r=ng https://hg.mozilla.org/integration/autoland/rev/404b8c40b078 Rebase libwebrtc ntp timestamps to proper DOMHighResTimeStamp time. r=ng https://hg.mozilla.org/integration/autoland/rev/89f79325e50a Cherry-pick libwebrtc patches that makes SystemTimeNanos overrideable. r=bwc https://hg.mozilla.org/integration/autoland/rev/d954e42b9fc3 Cherry-pick libwebrtc ntp clock consolidation patches. r=bwc,ng https://hg.mozilla.org/integration/autoland/rev/fdeabccf0376 Define a gecko-specific rtc::SystemTimeNanos. r=bwc https://hg.mozilla.org/integration/autoland/rev/064f668b8497 Update generated gn-config files. r=mjf https://hg.mozilla.org/integration/autoland/rev/b4b99d2a0e4b Update gn-configs README with rust aarch64 stdlib instructions for Windows. r=mjf https://hg.mozilla.org/integration/autoland/rev/9c79b8f388ac Simplify gn-configs generation instructions for mac. r=mjf https://hg.mozilla.org/integration/autoland/rev/bad692b90c78 Let configure figure out the mac os sdk itself. r=mjf https://hg.mozilla.org/integration/autoland/rev/ba5966905e63 Ensure the libwebrtc system clock is not used. r=bwc https://hg.mozilla.org/integration/autoland/rev/88281da6942e libwebrtc: Don't use wall clock for stats. r=bwc https://hg.mozilla.org/integration/autoland/rev/f5f9031ad36d Modularize RTCStatsTimestampMaker::GetNow(). r=ng,bwc https://hg.mozilla.org/integration/autoland/rev/2311db30725c Reduce time precision on timestamps from libwebrtc. r=ng https://hg.mozilla.org/integration/autoland/rev/fe6f8e1d360c Simplify RtpSources timestamp conversion. r=bwc https://hg.mozilla.org/integration/autoland/rev/6ff38fcddbbc Test that synchronization sources have a timestamp with the correct base. r=ng https://hg.mozilla.org/integration/autoland/rev/8f90f559af34 Sort RTCStatsReport includes. r=bwc https://hg.mozilla.org/integration/autoland/rev/f8e7943414f2 Define our own webrtc::Clock based on RTCStatsTimestampMaker. r=bwc https://hg.mozilla.org/integration/autoland/rev/facac6bb25c3 Remove unused arg in DesktopCaptureImpl::DeliverCapturedFrame and simplify. r=bwc,ng https://hg.mozilla.org/integration/autoland/rev/5388fb363fd2 Inject RTCStatsTimestampMakerRealtimeClock into Call instances. r=bwc https://hg.mozilla.org/integration/autoland/rev/7a84736b96c0 Plumb video frame timestamps properly through the GMP encoder. r=bwc
Flags: needinfo?(apehrson)
Regressions: 1788790
Depends on: 1788790
No longer regressions: 1788790
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: