[Captivate Android Development] Rrryan2:
[FIX]◊[JVK]◊ PlumbBob GPS Fix [UPDATE 4/10/2011] <Insert unfunny Bob joke here>

UPDATE: plumbBob GPS Fix for Captivate v2.0 BETA 11 [JVK] is now available for testing

http://xdaforums.com/showthread.php?p=12761703#post12761703

UPDATE: plumbBob GPS Fix for Captivate v1.1 RC1 is now available for testing

http://xdaforums.com/showthread.php?p=12781991#post12781991

In short, I've managed to get the GPS running as well as I can, at least given the tools and sources available to me. Version 1.0 of the fix is now believed stable and effective on all platforms and ready for release.

Problem Summary:

Hardware:

- The Samsung Galaxy S series (and the Captivate in particular) make several design compromises to fit the superslim candybar form factor, some of which tend to limit GPS performance. Among them are the use of a very small patch antenna located in a less-than-optimal position (behind/underneath) as the primary antenna. The effect of this is worsened by an under-engineered attempt to use the aluminum battery door (of suboptimal size and material for this role) as an auxiliary antenna, a problem worsened by using only a weak hinge spring as the connection. In a nutshell, the Broadcom BCM4751 GPS chip itself might potentially be capable of very acceptable performance, but Samsung's design and implementation cripples it badly. There's quite little we can do about any of this, and many previously published hardware hacks risk permanent damage to the phone.

- Design and/or manufacturing faults may cause potentially problematic levels of electromagnetic interference (EMI) within the housing and/or lead to intermittent power starvation of the GPS unit (this hypothesis gains credence since GPS performance is frequently improved by plugging in to a car adapter) . Additionally, strategies for managing GPS processes and CPU load seem under-optimized with GPS processes not being properly prioritized. There's quite little we can do about any of this either, especially with the driver being closed source.

Software and Configuration:

- Samsung's drivers are proprietary closed source, greatly limiting the ability to date of open source developers to improve GPS performance. Since Samsung receives the chips from Broadcom sans driver and with only an SDK, this might be reasonable and tolerable ̶— if the drivers actually worked. However, nothing that can be done about this short of hoping for a leak or some other misplaced miracle.

- The stock Samsung driver and configuration does not make use of WAAS augmentations at all even though the chip is actually capable of utilizing WAAS. Modern WAAS-capable receivers are typically capable of at least <3m accuracy but SGS users seldom see accuracy of even 5-10m. Again, closed source driver = nothing can be done about this.

- The stock Samsung/AT&T configuration for the GPS settings is horribly, laughably, and inarguably flawed. The out-of-box configuration is essentially incapable of ever allowing acceptable AGPS-aided performance. This fix attempts to remedy the flawed configuration settings.

- In a slim mobile phone application AGPS (Assisted GPS) augmentations are not just optional performance enhancers. Indeed, AGPS augmentation is fairly necessary for a GPS receiver with such a small under-optimized antenna as once AGPS data is loaded weaker signals can be utilized. This fix attempts to make sure the AGPS augmentations are properly downloaded and implemented.

Description:

plumbBob GPS Fix uses a markedly different strategy from most previously released GPS fixes, most of which attempted to turn off some of the various augmentations and improvements to the raw GPS position data like AGPS and position smoothing. These strategies apparently operated under assumptions that the implementation of these features was simply too flawed to be useful and that eliminating these features would feed only "pure" data to apps instead.

It seems however that these features may have been more necessary than had been assumed. Since with previous fixes many users could get satisfactory stationary fixes but unsatisfactory tracking on the move, I decided some of the "purification" feature-deactivating strategies used by previous fixes might be instead feeding unusably "jittery" location data to the navigation app, confusing the app and causing some of the weird tracking errors many of us were getting.

Many previous fixes also focused inappropriately only on one or a few areas where configuration settings might be applied. Instead, plumbBob attempts to present a "whole solution" answer to the problem rather than hoping that a single magic bullet might do the trick reliably.

The plumbBob GPS fix has two primary goals:

- Make configuration changes to get the necessary AGPS augmentations working properly to allow the device to function as its designers presumably hoped for, and

- Reduce the mobile tracking errors that seem to persist under most previous GPS fixes

Features:

- Updated GLGPS daemon binary from Nexus S Gingerbread (which is also same as UCKB1 AT&T stock Froyo)

- Updated shared object libraries from stock UCKB1 release

- Official AT&T certificate file (usually omitted in most custom ROMs adapted from non-AT&T platforms) to allow Secure SUPL for security & privacy

- Regionalized NTP (internet time sync) server configuration for improved TTFF (Time to First Fix) performance

- Tweaks to configuration files needed to allow proper download and application of AGPS augmentations and improved mobile tracking

Supported Platforms:

-

Captivate only

, at least for now. In initial testing some Vibrant testers managed to successfully implement this fix with good results, but others experienced some fairly major problems. There are some important differences in the GPS handling on the different Galaxy S variants that may limit the effectiveness of this fix on other platforms. For instance, the Vibrant uses the AGPSD daemon for GPS handling but for some inexplicable, inscrutable reason the Captivate uses GLGPS instead even though they both use the same BCM4751 chip. And then the Galaxy S I9000 series uses a completely different chipset (Broadcom BCM20751) that includes Bluetooth and FM radio. Configuration interfaces vary considerably between the various models and as such installation on any other platform can only be undertaken

completely at your own risk

. Developers interested in porting and testing the plumbBob GPS Fix for other platforms are encouraged to contact me by PM.

Changelog:

See 2nd post.

Thanks to Da_g, CLshortfuse, and Adam Holden/Team Phoenix for their previous work that guided my research. And many thanks to the many testers who weathered my mistakes and contributed to the final product.

IMPORTANT: LbsTestMode settings

must

be manually updated as well!

SUPL/CP Settings: Server FQDN = Custom Config, Server: supl.google.com, Server Port: 7276, SUPL Secure Socket = ON, AGPS Mode = SUPL

Application Settings: Tracking, S/W Test, MS Based, Hot Start, GPS Plus = On, Dyn accuracy = on, Accuracy = 40, GPS logging = off

Installation Instructions:

Download the appropriate .zip for your region

BEFORE FLASHING - Use LbsTestMode to apply new SUPL/CP and Application Settings (see above) and delete GPS data

Copy to /sdcard/ root and flash using CWM recovery

Ensure Settings -> Location and Security -> Use GPS Satellites is ON

Ensure Settings -> Location and Security -> Use wireless networks is ON

Note: If your country or region is not listed or if you need to change regions while traveling etc., the easiest way to customize the NTP setting as needed is to use the free Faster Fix app from the market.

Note: At present Southern California is still located in the USA.

CAUTION: Though it works great for some, Serendipity 6.0+ and above DOES NOT seem to work well with plumbBob 1.0 for all users. I don't know if it's related to the JS7 base or Serendipity-specific customizations, but several Serendipity users have reported that this fix pretty much wrecks GPS. I'm continuing to look into it and hopefully future versions of this fix may be compatible. And FWIW in my testing I actually had very acceptable GPS performance using stock Serendipity 6.0 settings, so this fix is probably less necessary anyway....

The most recent stable version 1.0 is below. Advanced users who might wish to try out the latest 2.0 Beta version instead may get it at http://xdaforums.com/showthread.php?p=12761703#post12761703