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

SntpClient periodically re-syncs the offset to NTP server #697

Open
wants to merge 1 commit into
base: release
Choose a base branch
from

Conversation

stevemayhew
Copy link
Contributor

Many of the Android TV platforms do not report accurate SystemClock.elapsedRealtime() In addition this drift is not consistant accross multiple boxes, so the time offset between any pair of boxes will vary over time.

This variance will lead to a drift in the Live Offset calculation.

Fix is simple, inValidate the NTP server query after a period of time (10 minutes) and re-issue the call

Many of the Android TV platforms do not report accurate `SystemClock.elapsedRealtime()`
In addition this drift is not consistant accross multiple boxes, so the time offset
between any pair of boxes will vary over time.

This variance will lead to a drift in the Live Offset calculation.

Fix is simple, inValidate the NTP server query after a period of time (10 minutes)
and re-issue the call
@stevemayhew
Copy link
Contributor Author

See bug #696

@stevemayhew
Copy link
Contributor Author

stevemayhew commented Oct 5, 2023

@marcbaechinger as you can see, with Google TV time is off by 2 seconds from my workstation (which is a Ventura Mac synchronized to NTP):

smayhew2m-sjc1:ExoPlayer smayhew$ gdate -In ; adb -t 25 shell date -In
2023-10-05T11:14:15,121477000-07:00
2023-10-05T11:14:13,432206196-07:00
smayhew2m-sjc1:ExoPlayer smayhew$ 
smayhew2m-sjc1:ExoPlayer smayhew$ adb -t 25 shell getprop | grep fingerprint
[ro.bootimage.build.fingerprint]: [google/sabrina_prod_stable/sabrina:12/STTE.230319.008.H1/10319030:user/release-keys]

With this pull request and the one that fixes #702 we can play video on two devices synchronized. We are shipping this feature on our 1.15 based ExoPlayer product, my company is graciously allowing me to share the required changes.

Let me know if you want a live HLS URL to play with I can sent it to a private email only.

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.

None yet

2 participants