Remove All Ads from XDA
H10 Turbo

[BUG, WORKAROUND 10/24/2011] Issue with GPS drivers in AOSP ROMs

81 posts
Thanks Meter: 55
By kusuriurikun, Member on 11th September 2011, 09:54 PM
Post Reply Email Thread
I have noticed that there has been an ongoing issue with GPS in a number of stock ROMs deriving their driver code from the main Google branch (rather than HTC's stock drivers); I'll summarise the issue I've found in particular, and hopefully folks can come to a resolution of sorts.

Firstly, a bit of backgrounder--Android actually uses two different methods of reading GPS data and passing it along from satellites to applications. Some apps (notably, Google Navigation) can have "raw" data passed along via an API introduced in Gingerbread; others (including a lot of third-party GPS tools) read via "NMEA sentences", an open standard for GPS-enabled devices to receive and pass along data. (If a third-party GPS tool has been ported to multiple operating systems, it's almost a guarantee it uses NMEA sentences for its GPS data.)

An NMEA sentence starts with the time (in UTC), the satellite number, and then a string beginning with $GP<foo>, a mess of comma-delimited numbers and letters after, and then ending with a number or letter, an asterisk, and another number. This gobbeldygook basycally states "Hey, here's the sat, here's the ephemerides tables so we know where other sats are, here's where I am in the sky" and some other technical data. (If people want the gory details, including what NMEA sentences should look like, has info and examples.)

Normal stock ROMs (including rooted and de-odexed stock ROMs) WILL show these NMEA sentences with an appropriately intelligent GPS tool; there are two good and free apps on the Android Market that show this (Turbo GPS, ad-supported but free: and u-center GPS which is completely free:; the latter is explicitly designed as a GPS testing tool.

What I discovered with a number of third-party ROMs (that either have issues with some programs picking up a GPS sync at all, or which have issues with wildly varying GPS locks in the range of 10-50m) is that these particular third-party ROMs are NOT passing along NMEA sentences. The one issue these ROMs do have in common is that they are Gingerbread v2.3.5 ROMs apparently using Google's stock driver code.

These cause a number of symptoms including slow lock or failure to lock (occasionally Google Maps fails to lock or locks very slowly, CoPilot Live v8 typically never gets a lock or only does so very slowly, other apps may not get a solid lock and have wildly varying GPS fixes). Troubleshooting with u-center GPS shows no NMEA data is being passed; typically EFS wipe does NOT fix the issue, nor does download of AGPS data (with the Chartcross GPS Test or GPS Status tools).

Another tool (Aspara) along with some weirdness in Turbo GPS (lots and lots of blank NMEA messages) and logcat.txt with CyanogenMod ROMs indicate what's really going on--it is passing along NMEA sentences, but with all the important bits (all the stuff from $GP<foo> onward) redacted--so all GPS programs on Android have to work with is the UTC date and the GPS's own numerical identification. Sometimes they can work with this...sometimes, not so much.

At any rate, something's broken.

I have investigated the issue in the following ROMs (with the use of SuperWipe between ROMs, which wipes system/data/EFS) with the latest radio known to behave reliably on T-Mobile US (Vision_Radio_12.56.60.25_26.10.04.03). Here's what's known to have the issue and what's behaving right...unfortunately, from what I can tell, all v2.3.5 ROMs at the moment are hosed save possibly for Sense-based ROMs...



CyanogenMod nightlies since at least v.118 and possibly since v.43
XBoarderMod v3.0.0 (AOSP/CyanogenMod hybrid, apparently uses the problematic driver)
ILWT CM7, all known versions (CyanogenMod base with a few customisations, uses the problematic driver)
MeXDroid GhostChili (all versions)
CyanogenMod v7.1.0-RC1 (ROM has known GPS issues in general; as similar issues have been reported this has been reported to the CyanogenMod bug tracker)
Very likely all ROMs based on a release-candidate or nightly build of Cyanogenmod


MIUI Bulletproof v1.9.9 (v.2.3.5, apparently uses the problematic driver)
Possibly all versions of MIUI if they use the same driver


Stock T-Mobile G2 ROMs, de-odexed and rooted (all ROMs explicitly "stock" known to work, including G2-Bliss)
Virtuous G-Lite (v2.3.3 ROM, does receive NMEA sentences normally)
Stock HTC-WWE Sense-based ROMs (v.2.3.3 and up, do receive NMEA sentences normally--it's largely the Sense-based ROMs that are the basis for the swap fix)


Sense-based ROMs in general that have been customised, unless they use substantial bits of AOSP radio drivers (most are pretty much Sense tweaked for HTC Desire Z; would appreciate reports from people using custom Sense ROMs based on Sense 3.0 or 3.5).

This appears to be a general GPS driver bug with ALL Gingerbread AOSP roms at this point that extends all the way back to the earliest Gingerbread-based builds of CyanogenMod and MIUI; PLEASE star up issue 15500 on the main Android tracker ( and issue 3346 on the CyanogenMod tracker ( so that the bug fix is prioritised.

People may also wish to lobby HTC to share their fix with the community (which they're technically SUPPOSED to be doing under GPL; it's fairly obvious they patched the bug with NMEA sentences in their Gingerbread versions).

At least one person on the Cyanogenmod forums has reported the issue is fixed with a replacement of /system/lib/hw/ with the stock library file (available at and attached below) from the T-Mobile G2 OTA update ( which STRONGLY indicates a bug in

Recommended radios to use this fix with are as follows:

KNOWN WORKING COMBOS: (latest international ROM, is known to work, use 10.04.03 (Latest available radio for the Vision from Bell Mobility Canada, this DOES work with 10.04.03 (Latest available radio for T-Mobile G2, is known to work, use either 10.04.03 or (upcoming) 13.04.19 (already available with ILWT CM7 nightlies))

POSSIBLY WORKING (mostly older radios):

Very likely most HTC-WWE ROMs with internal version 2.42.xx (Sense ROMs) with 10.04.03 (Multiple reports now this is working; if this fails, try radio which is newer.)

VARIED REPORTS (not recommended at this time): with its own (some reports this works, others report this breaks GPS particularly if matched with its; this is an older radio and may not be so compatible with v2.3.5; due to release of a new radio from T-Mobile users of this radio are recommended to use the new radio if this gives issues)

KNOWN NOT WORKING/NOT RECOMMENDED: (this is the old Froyo G2 radio, but is used by quite a lot of folks using the G2 in T-Mobile US territory with CyanogenMod and stock GPS; does not work with either Gingerbread in CM7 builds and is likely an incompatible radio for modern ROM combos)


There have been some reports from posters that the newest T-Mobile radio ( combined with stock CM7 nightlies may have fully functional GPS. I haven't yet tried this, but if folks are willing to do so before applying the "GPS libraries patch" and who are or will be using the new T-Mobile radio--if you could report the following:

a) Which particular CM7 nightly you are using.
b) Results on whether NMEA is being passed with Turbo GPS or u-center Evaluation (both available for free in the Android Market)

If it turns out the latest nightlies + new radio don't need the fix, this would be awesome and win, but again, this is an area where volunteers are needed.


Special note to ILWT CM7 ROM users: If you are using a version of ILWT CM7 v212b and up, you can now select the option to use the appropriate instead of stock CM7 by adding/uncommenting the option "gpslib=htc" in ILWT.txt (the install script will automatch the appropriate to each radio). If you are changing radios or libs, be sure to EFS wipe first. Thanks to tsubus for being the first to implement this in a third-party ROM.

Support for the new T-Mobile radio ( begins with ILWT CM7 only from version v238 and up, but (personal verification) works flawlessly. If you're using an older version of ILWT CM7, you'll want to follow the procedure below if you use the new T-Mobile radio or upgrade ILWT CM7.

For non-ILWT CM7 ROM users, the procedure is now less painful.

Of note, following these instructions will be much easier with the new 4EXT recovery but can be done with CWM recovery--it's just easier to do the necessary steps without repetitively rebooting.

a) If you have not done so already, flash a known working radio to your phone using the usual instructions for flashing a new radio. (I recommend one of the three above radios UNLESS you are experimenting with a new radio/ combo and reporting the results.)

b) Reboot, rename, copy one of the update files below AND the Vision EFS Wipe tool (and optionally, the latest RIL automatcher zip) to the root of your SD card, then reboot into recovery.

c) Select "Install from zip", select the Vision EFS Wipe tool, let it run.

d) Do the same thing, only with the updater file you selected.

e) (OPTIONAL) Mount /system if you're running CM7, then select "install from zip", select the RIL automatcher, let it run. (RIL matching is NOT essential with this; I've run with and without, and wouldn't recommend matching JUST to install an alternate if you're having general radio performance issues.)

f) Select "Install from zip", select the Vision EFS Wipe Tool, let it run (probably only REALLY necessary if you're matching RILs at the same time).

g) Reboot. Use your favourite GPS tool (I personally like the free Chartcross GPS Test tool on the Market) to get an initial fix. This will take approximately 45-60 seconds indoors, faster if you're outside and it's sunny.


a) Don't panic.

b) Copy the to your SD card root. Follow the steps from b)-g) in that first section, and that should restore GPS functionality.

c) So we can know which ROM/ combos are no-go, please submit to this thread the following info:

1) The fact it went sideways.
2) The particular third-party ROM you are using (CM7 nightlies,, etc.).
3) The particular radio you are using (08.04.30, 12.04.03, etc.)
4) If you are NOT using the stock kernel, which kernel you're using (Pershoot, ILWT/Umaro/etc.).

(Yes, kernels CAN cause differences in performance in drivers. For example, most third-party kernels in pure stock ROMs tend to break WIFI because there's JUST enough difference in how the drivers talk to the kernel that things hiccup. There's a non-negligible chance that different radio/ combos may work better for particular third-party kernels.)

Also, if you're using a radio/ combo I've NOT listed here (particularly if you are using a radio from a pre-Gingerbread ROM), let folks know what works and what doesn't.
The Following 23 Users Say Thank You to kusuriurikun For This Useful Post: [ View ] Gift kusuriurikun Ad-Free
12th September 2011, 04:28 AM |#2  
Junior Member
Flag Manhattan, NY
Thanks Meter: 0
I have been meaning to make a post on this. I am currently running CM nightly 8/29 with Tmobile's latest radio. I have no issues getting an immidiate lock but about 10 to 15 min into my drive I will suddenly lose the GPS signal with a clear sky and no obstructions. I never had this problem with the original rom and was hoping someone on here had a fix for this or reason. This has one of the major problems I have had with CM7 so far everything else is minor.
12th September 2011, 05:20 AM |#3  
Senior Member
Flag Helena
Thanks Meter: 327
Originally Posted by kusuriurikun

...Android actually uses two different methods of reading GPS data and passing it along to satellites.

I think you mean passing data FROM satellites
12th September 2011, 06:40 AM |#4  
OP Member
Thanks Meter: 55
Originally Posted by burtcom

I think you mean passing data FROM satellites

I did, and I'll correct this. (This is what happens when one is typing when semiconscious. )
The Following User Says Thank You to kusuriurikun For This Useful Post: [ View ] Gift kusuriurikun Ad-Free
12th September 2011, 03:40 PM |#5  
Senior Member
Flag Helena
Thanks Meter: 327
Excellent bit of detective-work I hope its not too long till the various ROMs can fix this.
12th September 2011, 06:39 PM |#6  
OP Member
Thanks Meter: 55
Originally Posted by burtcom

Excellent bit of detective-work I hope its not too long till the various ROMs can fix this.

OK, so my original complaint on this ( has now been merged into the "mothership" thread ( the creator of GPS Status and Toolbox has apparently reported this.

There is a related issue 15500 ( that indicates this is a general AOSP bug; issue 7321 is similar (

(Of note, this has been a very longstanding issue--since the very first release candidates of CM7, and probably affecting ANY Gingerbread build that isn't using drivers from an OEM manufacturer like HTC. HTC has OBVIOUSLY done their own tweaks, but isn't sharing (isn't that technically a GPL violation?) a fix is known, just not being shared :P)

I strongly encourage people to "star" the issue at 3346 AND at 15500 and 7321 to get this moved up in priority so that the folks behind CyanogenMod and the main Google AOSP code know this is an issue.

(And yes, that even goes for you MIUI users--the issue affects you as well, and the fix could be incorporated into MIUI builds.)

I just hope the info dump I gave 'em helps narrow down the issue...
The Following 4 Users Say Thank You to kusuriurikun For This Useful Post: [ View ] Gift kusuriurikun Ad-Free
12th September 2011, 10:15 PM |#7  
Senior Member
Thanks Meter: 236
Just starred them. Everybody get on this!

Sent from my T-mobile G2 using Tapatalk
13th September 2011, 10:42 PM |#8  
Junior Member
Flag Toronto
Thanks Meter: 0
Good post! I'm running XBoarderMod and noticed this a lot, I always wondered exactly what it was, though I get ranges far worse than 50m. I'll have days where it identifies me as being 5-6 blocks away, closer to 250m.
15th September 2011, 01:47 AM |#9  
Thanks Meter: 14
Thanks for this, starring complete

Sent from my T-Mobile G2 using Tapatalk
15th September 2011, 11:41 AM |#10  
Flag Modena
Thanks Meter: 17
Don't know if it may help or not, but you may check this thread.
15th September 2011, 01:42 PM |#11  
Junior Member
Thanks Meter: 0
Thanks for explaining that, it was very informative. Ive been running Virtuous G-Lite v2.3.3 ROM, and have been more or less satisfied. About 25-120m off in buildings but great when on the road.(also the fact the country of residence only has edge, i'm sure that's a factor)
Just starred issues as well.

Post Reply Subscribe to Thread

bugs, gps, nmea, nmea data export

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes