I've recently known about a gps.conf
file in the /system/etc/
directory.
Seems that tweaking NTP_SERVER values to NTP servers nearer to the usual location improves TTFF.
Reading the source code in the LocationProvider
class, seems that at boot, time is retrieved from NTP server and "injected" in the calculations.
AFAIK each GPS sat has a very accurate atomic clock, and every one in the constellation is synchronized to the so called "GPS time". Once the receiver has got 4 or more satellites, it solves (by some method) an equation where there are four unknowns: x,y,z,b; where (x,y,z) is the receiver location, and b is the time difference between the receiver internal clock and the (correct) GPS time. Once it has a a fix, the receiver clock is synced with the correct time. (Please correct me if I'm wrong).
So far, I've some questions regarding the way NTP time injection works:
- GPS Time is roughly TAI (International Atomic Time) plus an offset. Those two times do not depend on the Earth rotation, however UTC does. Given that NTP servers return UTC time, it is possible to infer GPS Time from UTC time?
- How does retrieving NTP time from a nearer server improve the "quality" of the GPS time approximation?
- Assuming that we have an initial GPS Time value (inferred from NTP time somehow), what is the injection about? Is this time value taken as correct to solve the equation with only x,y,z as unknowns? If so, then the first fix is also just an approximation, isn't it?
- How does a higher quality initial approximation for GPS time improve TTFF? Is it because with a lower quality NTP time the first fixes are considered not acceptable and discarded?
- Does having an approximate initial position help retrieving the next correct fix (like listening only to a subset of sats)?