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

Closed

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.

@stevemayhew
Copy link
Contributor Author

@marcbaechinger do you want me to re-post this based to main?

@marcbaechinger
Copy link
Contributor

Sorry for no hasving responded so far. Yes, please assign to me when done. I'll try to do better then this time.

@stevemayhew
Copy link
Contributor Author

No worries @marcbaechinger, we are all busy at our respective day jobs. I'll opened a pull request based to main as well with this same code change, already formatted in Google style. #1794

@stevemayhew
Copy link
Contributor Author

You may as well also approve and merge #1794 since it is the same code already merged to main branch. Or you can simply close pull request. Which ever is easier for you internal git process.

@marcbaechinger
Copy link
Contributor

I'm closing this. Going to proceed with #1794 instead. Thanks Steve!

@androidx androidx locked and limited conversation to collaborators Dec 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants