[GUIDE] Why Samsung Galaxy S i9000 GPS is inaccurate and how to fix it. Update Jan 11
UPDATE JAN 11:
XDA member Da_G has done some excellent work on GPS performance. To summarise the situation as of Jan 11:
1. There is clearly an antenna issue for some users as highlighted by Samsungs Oct 10 redesign and the reports of good results from some users modifying the GPS antenna connection
2. The GPS implementation is indeed buggy out of the box. In particular my guess at some form of interpolation (see below) appears to be accurate. However I commend this post http://forum.xda-developers.com/showthread.php?t=881941 in the Captivate forums to you. Da_G has done excellent work and has made the gps daemon binary from the Nexus S available to SGS users in addition to modified jupiter.xml and gpssec.conf files which disable interpolation as well as refining several other parameters. He deserves thanks for his work and I can report that with hardcore's Speedmod kernel and the gpssec.conf, jupiter.xml and glgps_samsungJupiter from Da_G's downloads I have GPS performance I am completely happy with on my i9000. Root and some basic shell knowledge required for his fix.
The original post begins below.
I’ve tried very hard to write a definitive post on SGS GPS performance. Below I try to give a balanced view of GPS performance in the SGS and provide definitive explanations of the various functions offered by the Broadcom BCM4751 chipset and their effects on the quality of the GPS fix. There is a lot of noise and conjecture on this subject in the XDA-developers forum; some right, some wrong, some missing the point entirely. Below is some educated guess work and some hard facts about exactly what will and will not help with GPS performance on the Samsung Galaxy S i9000.
I have tried to remain non-technical while telling you ‘why’ things happen they way they do. At the very least I hope you come away from reading this post with a good understanding of the various settings available to you and which will actually affect the accuracy of your position fix. There are several excellent technical articles on GPS in the references below.
Mobile Device Design:
I’d like to start by making three points:
1. Obviously The Samsung Galaxy S is not a single-purpose GPS device. There will be inevitable design compromises when trying to fit all the hardware into the phone and in particular the GPS antenna will inevitably be inferior to the one in a standalone GPS or GPS Dongle. Having seen the GPS antenna it is indeed tiny, and halfway down the side, and at the back. But it needs to fit with the constraints of the hardware and has what appears to be a very sensitive chipset attached to it. I cannot find a full technical spec for the chipset but include a link to a technical overview in the footnotes. The GPS antennna on the i9000 is at the back of the main body, 1/4 of the way down the body on the left-hand-side as you view the phone in portrait mode. Image Here
2. If my conjecture is correct then I believe that Samsung/Google have made some design compromises in their software setup of the GPS on the Galaxy S that compromise positional accuracy, these can be overcome.
3. I do not believe that the GPS on any Samsung Galaxy S is fundamentally broken in any models. I do believe that the factory configuration choices are poor and I do believe it is hampered by hardware designs and their interactions with everyday use environments. Obviously any phone may have a one-off manufacturing defect but I cannot account for those.
Available Navigation Modes:
Verizon has this to say about the MS- modes, two of the three fundamental ways (MS-Based, MS-Assisted and Standalone) that you can gain location information:
What is MS-Assisted mode of operation?
In MS-Assisted mode, the network elements calculate the location of the device. This mode is suitable for one-shot fixes, wherein the location does not need to be updated frequently.
What is MS-Based mode of operation?
In MS-Based mode, the network provides the satellite information to the device, based on a rough estimate of where the device is located, and the device acquires the GPS signals from the satellites and calculates its location. After the initial fix, the device operates like an autonomous GPS receiver, until the satellite information must be refreshed, at which time the device goes back to the network to update the satellite information. MS-Based mode is appropriate for applications that require the device location to be updated rapidly, such as a navigation application.
The current advice seems to be to enable MS-Assisted as it appears to improve navigation performance. I believe that this is incorrect. When using MS Assisted positioning I see considerable wander occurring as the position is not GPS derived. The MS-Based settings send the GPS Almanac and ephemeris date to the device and save on initial lock times, particularly if the GPS has been unused for many weeks, however in terms of positioning once up-and-running MS-Based and Standalone should deliver identical results.
Environmental factors limiting GPS performance:
Many users are primarily using the GPS in their cars. Here the hardware design compromises come in, but there are also some properties of GPS signals which users should be aware of. Firstly, RF Interference (RFI) is unlikely to be a primary culprit. The problem with a Car is that it’s made of metal which rapidly attenuates the already very low power GPS signal. When dealing with GPS the Signal-to-noise (SNR) ratio is important. Satellites giving the best SNR are always overhead, rather the near the horizon where the signal is competing with any number of other nearby frequencies causing RFI/ general background noise. So in a car, particularly given the design compromises with the GPS antenna, you will be attenuating the overhead signal because of the roof and relying more then you should on the GPS satellites near the horizon with their lower SNR, multipath propagation etc. When driving in a town where there is no horizon you can see where the problems arise. When the SNR becomes too great the GPS can no longer compute the pseudo range from the signal and you loose the ability to use a satellite. You can see a maximum of 12 GPS satellites at any one time if you have a full sky view - if you take away the overhead ones you can see why the number of useful signals drops below the minimum (4) very quickly.
This is a problem not just for Samsung but also for Google, who tout the Google Maps nav as a killer feature in a whole group of phones which have designs compromised by requirements to squeeze a lot of functionality into a small form factor. Samsung may have done a worse job of GPS antenna positioning in the SGS then maybe HTC in the Desire but they were faced with a different set of design constraints.
Before I tell you how to fix the GPS settings for best performance, here are some hints for in-car reception:
1. Place the phone as far forward in the windscreen as you can. Note that Satnav systems usually come with a short-arm windscreen mount for this very reason as it ensures a great view of the overhead sky, yet we insist on comparable performance from our design-compromised phones when we attach them to the air vents or mount them in cup holders.
2. If you really want flawless in-car nav invest in a cheap bluetooth dongle. You will benefit from more flexible positioning options giving a better sky view, a larger antenna giving a better signal gain (and more directionality if it is pointing up) and if you get a SirfIII unit an extremely capable GPS chipset utilised without design constraints . Note that SirfIII does not always include WAAS while the Galaxy BCM4751 does, however for the requirements of in car navigation WAAS is really overkill and the quality of the signal/number of satellites in view is the real issue. It is no surprise that users find a bluetooth GPS unit gives better accuracy then the built in GPS – the antenna is massive and has a completely clear view of the sky!
Right, back the the phone.
One recommendation that I keep seeing is to activate "MS Assisted". This is what is responsible for all the drift. Standalone and MS-Based will give a pure GPS signal. MS Assisted tracks based on cell tower signals and gives worse results.
One issue that comes up in particular is the problem of 'position offset', where users see themselves consistently offset from a road by a few meters, often Google navigation will then erroneously re-route you, particularly in built up areas with high street density. There is one thing which I can say with absolute certainty... There is no GPS error I can think of which would generate a consistent offset. The only cause of this would be if you physically positioned your antenna meters away from your phone and this is clearly not the case. The inaccuracies in GPS position (and there are some, caused by timing errors and a low number of satellites available for positioning) are RANDOM. The only phenomena that I can think of that WOULD generate a consistent offset would be doppler-shift, and the mode this would be most likely to influence would be cell-tower based positioning. If you are experiencing consistent offset along straight tracks please double check that you are not using MS-Assisted mode.
About my SGS:
Hardcore's 'Speedmod' Kernel
Battery dated: 2010.08.30
So not a ‘post October’ phone (but I think that’s a false lead anyway). The installation of a custom ROM made no significant difference to GPS performance for me. In addition I can assure all readers that I have previously experienced absolutely abysmal navigational accuracy both in-car, walking and running giving tracks so bad that I looked like the worlds only blind, drunk, crack-addicted runner. (as an aside I thoroughly recommend the installation of a custom Kernel and lagfix as it transforms the performance of the Galaxy S).
I have written my own custom GPX logging program to test all this and so have a high level of confidence. I will amend this post with some proof tracks when able.
Here is a complete run-down of the GPS settings (explanations of the functionality they govern and the effects they will or will not have on the GPS signal) that take away the issues described above as set in LbsTestMode and result in the best observed GPS performance:
LbsTestMode can be enabled with the following key combinations in the dialler:
Android 2.1 - *#*#1472365#*#*
Android 2.2 - *#*#3214789650#*#*
1. Session Type: Tracking
A chipset feature which helps to boost SNR in poor RF environments)
2. Test Mode: S/W Test
3. Operation Mode: Standalone
The most important setting as this is the setting. Standalone or MS-Based. Not MS Assisted. I have had the best results with Standalone, cutting the whole Assisted-GPS segment out of the equation. That way I don't have to worry about who's databases are up to date, which base stations might inaccurate etc. The standalone mode is able to do everything you need at the cost of slightly increased start times if not used for some time.
4: Start Mode: Hot Start
This has nothing to do with re-downloading almanacs. It simply resets precise satellite timing data that must be extracted from the GPS signal to compute an accurate pseudo range. It’s good for about 4-6 hours. If you leave your GPS off for longer then the ‘ephemeris’ data will be re-downloaded anyway regardless of the Hot/Cold start settings. The GPS can’t be ‘more or less accurate’ with or without it, its simply a case that the ephemeris must be updated before you can get any position. You can sync the clock every time if you want, personally I’d choose ‘Hot Start’ and save a few minutes every time a GPS app is destroyed!
5: GPS Plus: On
The GPS Plus is the Wide Area Augmentation Service, extra satellites that transmit a deviation correction to correct minor positional inaccuracies within the space segment of GPSl. Not available globally (North America and Japan, maybe Europe and India by the time the phone is obsolete). Having it on will not cause problems if WAAS is unavailable in your region.
6: Dynamic Accuracy: On
This setting is used to filter data that is judged statistically to be in error based on deviation from the Circular Error Probability (CEP) calculated by the GPS system.
7: Accuracy: 30m
I believe that this is a cut-off for the overall GPS positional accuracy. If over this threshold the GPS will not report the position. I have yet to see a figure of more then 20 meters, so leave at 30. GPS precision is far more complicated then a simple inaccuracy based on distance)
8: GPS Logging: Off
This is a network layer operated by cellular operators. It delivers the AGPS data like timing corrections and the almanac to your phone as well as allowing a network operator to provide you with various location based services (and make more money from you). If you wanted to download the almanac from satellites it would take a minimum of 12.5 minutes and would need to be done every time you turned your GPS on if it had been off for weeks/months. The almanac has a long lifespan, so won’t age out in days, and the GPS receiver is still capable of downloading it from satellites if it can’t get it from the network, It also provides information to your mobile provider about where you are, regardless of your Google privacy settings so that they can provide you with location based services (so Google isn’t the only geolocation bogeyman!)
Again, I think there are lots of false leads here. The one thing that may be true is that the original SUPL provider on
handsets was providing inaccurate data. Recommended settings:
Server FQDN Type: Custom Config
Server Port: 7276
SUPL Secure Socket: OFF
AGPS Mode: SUPL
Use wireless networks option
Google do map WiFi hotspots in large cities, which is enabled by the "Use Wireless Networks" option in the android Menu. This may allow you to locate yourself accurately in an urban area where GPS is unusable. However, it is unlikely to provide tracking information for runners, probably providing street-corner location to pedestrians.
Use sensor aiding option
Google's own documentation states that this is for use in areas where GPS performance is degraded. I am unsure if the selection of "use sensor aiding" will have an effect if a good GPS signal is available. For those trying to troubleshoot their GPS setup I would advise that the low cost MEM sensors contained in mobile phones (solid state gyroscopes), while good for games are poor over more then a few meters in terms of accurately measuring velocities to determine distance travelled.
It is possible to use solid-state accelerometers when coupled with a GPS to refine positions and attitude information but it is unlikely that android employs the filters needed to do this well. If you navigate frequently in cities or environments with tunnels etc. you may wish to enable this feature but for most navigational needs I would advise leaving it off as the integration of sensor data with GPS positions may well be a source for positional bias and drift seen in the Galaxy S.
And that’s all you need.
I hope that that will be definitive. Using the above settings I get entirely accurate tracks from my phone using my GPS logging program. I may post that soon with my example logs. The reason I wrote from scratch was because I wanted to be sure that I was getting the pure output from Android dumpLocation with no adulteration to allow for a fair analysis.
HOWEVER (and here is where what I know comes to a end…):
When your app selects a location provider it won’t necessarily be ‘GPS’. A developer can select getBestProvider() and use something other then gps to save power. I assume that most developers use ‘gps’ but it would take a knowledgeable android programmer to tell us if we can guarantee to always get unadulterated GPS positions into the application layer with no mixing sneaking in!