[CM7/ICSP/MIUI][GPS FIX] Yet Another Software GPS Fix VERSION 2 - 12/13/11

Search This thread

chui101

Senior Member
Sep 9, 2010
285
258
Lexington, KY
devilsbsd.net
Yet Another GPS Fix
YAGF Version 2
For users running AOSP Gingerbread (CM7) and ICS (CM9/ICS Passion) ROMs

Why another GPS Fix?
This GPS fix is a modification of the GPS fix by strictlyrude27 (link). The newest builds of CM7 don't play nice with that GPS fix and hang at the kernel boot screen for 10 minutes waiting to download GPS LTO data.

This fix does several things differently:
  • It addresses the 10-minute hang time by removing GPS LTO data download altogether. I have no problem getting a GPS fix without it! You can see the test results below.
  • It uses a modified GPS library that actually reads config files (even if you don't have AngryGPS installed), now finally allowing Google's SUPL server to be used.
  • It lets the GPS use hot fixes now. After getting an initial fix, if you leave and come back to the GPS later you can get a fix in as little as 2 seconds.
  • It cuts out AngryGPS. You can still use it if you want to do GPS performance testing, but the configuration it writes will not be of any use. You can uninstall AngryGPS if you want now! This is to allow the fix to work properly even if you do not have AngryGPS installed.
  • Important for ICS users: If you are getting issues with GPS locks after deep sleep, you may need to try WallaceLau's addendum to this fix. As I am not having issues with GPS dying after deep sleep, I cannot vouch for the effectiveness of copying over HTC Desire GPS files, but as it does not overwrite any existing files, it should be fairly harmless.
  • Note for ICSP RC1 (v13): This fix is only halfway onboard. You should flash this fix after flashing the ROM and cleanup zips to get the proper configuration files.

What does this work on?
This works on the latest CM7 and CM9/ICS PASSION builds.
This has been tested with the stock CM7 kernel, Eugene373's Streamline kernel (EB7 build), and the Glitch V13 kernel.
Users have reported it working with MIUI as well.

I have not tested this on any other configurations! YMMV even on these configurations!

Testing method
To test the GPS effectiveless, the time to first fix (TTFF) was tested using the S/W test mode in AngryGPS. Interval 5 seconds, cold fix, with XTRA download enabled. Timeout was set to 255 seconds.

I wiped and reinstalled nightly 182 between each set of tests. The phone was connected to a wifi network during all the tests to obtain the best possible speed for XTRA data download.

10 TTFF data points were obtained for each test configuration. Error bars are calculated as the standard error of the mean (SEM) of each data set.

Test results
The stock installations of CM7 and the Glitch kernel do not have any sort of GPS fixes built in and fail to lock within 255 seconds. The Streamline kernel has a GPS fix but only acquired a lock 5 out of 10 times (50%).
F8G3A.jpg


Comparing only the GPS fix from strictlyrude27 and this fix:
HynqK.jpg



What do the graphs mean?
This shows that these two GPS fixes essentially perform the same, and that removing LTO download (and the 10 minute hang time on boot) has no statistically significant effect on GPS performance.

In addition, one can conclude that using either Streamline or Glitch kernels offers significant GPS performance benefits over the stock CM7 kernel.

Is it safe to flash?
Most likely (though I offer no guarantee of this)! All this does is delete your old GPS fixes if they are present, delete the agpsd daemon that was causing problems on my CM7 Vibrant, and flash the gpsd and gps.conf that were in strictlyrude27's fix. If that fix didn't give you problems, this one definitely won't.

INSTRUCTIONS
  1. Have CM7.1.0.1 or a newer nightly installed on your Vibrant
  2. Transfer yagf2.zip to your phone
  3. Turn off the GPS!
  4. Reboot into recovery
  5. Flash your kernel of choice (if you have not done so already)
  6. Install yagf2.zip from wherever you put the file
  7. Reboot and turn on the GPS. Enjoy!

Download below as an attachment
Mirror
Version 1 (Old version)
 

Attachments

  • yagf2.zip
    482.5 KB · Views: 4,894
Last edited:

rexrbgh

Senior Member
Jul 16, 2010
158
9
I'd only had working GPS on one 2.2 rom since I'd gotten the phone in July of last year...until I'd flashed this! Thank you so much!

Sent from my SGH-T959 using XDA App
 

chui101

Senior Member
Sep 9, 2010
285
258
Lexington, KY
devilsbsd.net
Thanks for this. You know, I still can't reproduce the bootloop issue; I'm running the latest nightly. I wonder if this is a kernel thing? I'm on Glitch V13..
I think it's only in the more recent builds since they redid the init system that it happens. What nightly are you using, or are you on stable? I'm guessing the init scripts were reordered so that the network got initialized after the files in /etc/init.d were run, but I haven't really looked that much into it.

Interestingly enough, they did add in a gpslto service in init.aries.rc that calls a nonexistent file, /system/bin/get-gps-lto, but I was playing around with it and couldn't get it to work.
 

twotone8

Member
Oct 16, 2011
43
2
Already had a pretty stable gps running with Streamline Kernel and CM7 nightly (kb5)

it always took about a minute for it to load up, but it was getting to a point where I could expect a gps lock with a bit of hopeful regularity.

After flashing this, my first attempt for a gps lock would yield no results no matter how long i left it on, and if i exited out of gps test, the gps icon would never reappear. i attempted to delete gps data and do some tiff tests as well, but for some reason the gps icon will only initialize once per boot, and i've never gotten anywhere with it.

Should I re-flash streemline AFTER installing this patch? Do you recommend deleting gps data before you flash?

I've restored a pre-fix backup and reflashed twice now, yielding the same results.

Might try again tomorrow. I was very hopeful for this one.

Streemline has already worked wonders. I'm confident gps will only get better with the vibrant.

edit: hrm. I might have gone about this incorrectly. You have a gpsfix.zip file attacked to this post, yet your instructions are to flash yagf1.zip. I had assumed that you meant your gpsfix.zil file and perhaps made a type or something. going to attempt to flash one more time with the specific mirrored yagf1.zip file. What is the gpsfix.zip file attached to this post? It's not mentioned.

edit 2: also, step 3. in the first post is to flash the kernel of your choice. if i'm already on the kernel of my choice is this necessary? must we reflash the kernel AND the fix in one go from cwm before booting up?


edit 3: HOOOOOLY CRAP! THIS IS AMAZING! I used a kernel cleaning script in cwm, then flashed streamline, then the yagf1.zip file. booted up. and got a lock within 10 seconds. it's the fastest this puppy has ever EVER fired up. I'm so very impressed. Well done sir. This is the best gps signal i've ever gotten, and i was already impressed with the progress with eugenes kernel. Give this a try people!

edit 4: dumb question. in angry gps, what exactly does 'delete gps data' do. does it negate any of this fix? everyone seems to recommend it, but i don't want to ruin any fixes i've flashed.
 
Last edited:

chui101

Senior Member
Sep 9, 2010
285
258
Lexington, KY
devilsbsd.net
Should I re-flash streemline AFTER installing this patch? Do you recommend deleting gps data before you flash?
Reflashing the kernel will overwrite this GPS fix, so no, don't reflash it.

edit: hrm. I might have gone about this incorrectly. You have a gpsfix.zip file attacked to this post, yet your instructions are to flash yagf1.zip.
Oops. I didn't notice that, you're absolutely right. They're the same file, just with different names. I decided to rename it something with a later letter in the alphabet so I could just hit the vol+ button in recovery a few times to get to the file more quickly :D I've renamed it now.

edit 2: also, step 3. in the first post is to flash the kernel of your choice. if i'm already on the kernel of my choice is this necessary? must we reflash the kernel AND the fix in one go from cwm before booting up?
nope, just go ahead and flash this on top of it. This cleans up any interfering GPS fixes that might have been flashed alongside your kernel.


edit 4: dumb question. in angry gps, what exactly does 'delete gps data' do. does it negate any of this fix? everyone seems to recommend it, but i don't want to ruin any fixes i've flashed.

I think it deletes the temporary data about the satellites in current view generated by gpsd that can be used for a "hot fix" within the next few minutes. Deleting it forces your GPS to do a "cold fix" (assisted by the xtra data and network location). It doesn't negate this fix.
 
  • Like
Reactions: CTown

bigtom624

Senior Member
Jun 23, 2010
1,598
814
Philadelphia Pa.
I'd only had working GPS on one 2.2 rom since I'd gotten the phone in July of last year...until I'd flashed this! Thank you so much!

Sent from my SGH-T959 using XDA App

I finally have a working GPS on my Vibrant. This is the only fix that has worked for me. Every time I turn my GPS on now it actually stays locked on to satellites for the whole time I use it. This has NEVER happened to me before. Thanks alot.
 

moldyghosty

Senior Member
Jan 16, 2011
66
3
Never had working gps on gingerbread until now. Thank you very much kind sir.

Sent from my SGH-T959 using xda premium
 

markinct

Senior Member
May 23, 2009
54
4
Hartford
Excellent work. I never quite got there with previous GPS fixes for CM or other 2.3.x ROMs.

I love using Waze to monitor traffic conditions, report problems, etc. Lack of reliable GPS had kept me on 2.2. It takes a little while for GPS to get a lock, but I suspect that will improve.

So, do you have a tip jar?

---------- Post added at 07:03 AM ---------- Previous post was at 06:58 AM ----------

edit 3: HOOOOOLY CRAP! THIS IS AMAZING! I used a kernel cleaning script in cwm, then flashed streamline, then the yagf1.zip file. booted up. and got a lock within 10 seconds. it's the fastest this puppy has ever EVER fired up. I'm so very impressed. Well done sir. This is the best gps signal i've ever gotten, and i was already impressed with the progress with eugenes kernel. Give this a try people!

Which script did you use?
 

jsparakov

Senior Member
Aug 23, 2009
78
7
The GPS attempts to lock in maps then the GPS lock icon/indicator never shows up again when I try any other program that requires GPS... until I reboot.

  • Flashed the latest nightly with everything wiped
  • Eugene streamline
  • YASGPS fix

I think I'm in the "results may vary category". From what I've been reading, that is because Vibrant hardware differs from one another. The one I'm using was manufactured Jul/06/2010.
 

twotone8

Member
Oct 16, 2011
43
2
Don't give up yet. That's exactly what mine used top do when I flashed this. just keep trying things. what worked for me one time was simply to disable GPS before a restart, then re enable it and everything worked great.

I had it working perfectly, them had to do a nandroid restore, and that problem came right back. Somewhere between reflashing kernels, fixes, restarts, and finally just turning of GPS before restarting. every thing works great again.

Sent from my SGH-T959 using XDA App
 

chui101

Senior Member
Sep 9, 2010
285
258
Lexington, KY
devilsbsd.net
The GPS attempts to lock in maps then the GPS lock icon/indicator never shows up again when I try any other program that requires GPS... until I reboot.

  • Flashed the latest nightly with everything wiped
  • Eugene streamline
  • YASGPS fix

I think I'm in the "results may vary category". From what I've been reading, that is because Vibrant hardware differs from one another. The one I'm using was manufactured Jul/06/2010.
Can you try fixing permissions and clearing your dalvik cache in recovery? If that doesn't work can you send me a logcat?
 
  • Like
Reactions: jsparakov

jsparakov

Senior Member
Aug 23, 2009
78
7
Can you try fixing permissions and clearing your dalvik cache in recovery? If that doesn't work can you send me a logcat?
I've cleared dalvik cache many times already. Edit: but I'll continue to do so every time I make an attempt.

I'll go ahead and try those two with the nightly. Let me know if you have any particular way of doing logcat other than adb (I don't do this very often).
 
Last edited:

chui101

Senior Member
Sep 9, 2010
285
258
Lexington, KY
devilsbsd.net
I've cleared dalvik cache many times already. Edit: but I'll continue to do so every time I make an attempt.

I'd be very happy to follow those other two suggestions. Do you have any link to instructions on how to do those two things properly (what and how to fix the files + creating a logcat)?
Fixing permissions is under the 'advanced' menu in CWM recovery, I believe.

You can do a logcat on the phone by opening up the terminal emulator and typing logcat. You can redirect output to a file with -f (i.e. 'logcat -f /mnt/sdcard/logcat.txt'). Run it before you open up Maps, then let it run in the background while you open up maps. When you are done, close it with CTRL-C (VOL- + C in the terminal emulator).

Alternatively, you can do this from your computer by using adb if you have it installed. Just do adb logcat -f /mnt/sdcard/somefile.txt and it'll save a logcat to the same directory as it would have on your phone. CTRL+C exits.
 

jsparakov

Senior Member
Aug 23, 2009
78
7
Thanks a lot for your efforts and help, chui. I had to revert to Stable 7.1.0.1, hopefully that doesn't make a difference. Radio is KB5.

(Any flashing and permissions was done in recovery)
  • Recover to Stable 7.1.0.1, cleared cache, cleared dalvik, reboot
  • Flashed Ultimate Cleaning Script v4, flashed EB-Streamline, reboot
  • Flashed yagpsf, reboot, fixed permissions, reboot
  • Before Google Maps logcat (permission denied, dev/log/main is 0 bytes)
  • Open Google Maps
  • logcat post-Google Maps (again, permission denied for logcat)

Result: GPS icon/indicator works once. If I try to reload maps or turn my screen back on, the indicator no longer comes up. For some reason, logcat isn't being written into to it. The permissions for dev/log/main is rw-rw--w-.

Edit: I just tried alogcat, and it's giving an overwhelming amount of output. So I think it's because I don't know how to use logcat.

---------- Post added at 11:16 PM ---------- Previous post was at 10:51 PM ----------

Alright, got some logs, I'll be PM'ing you.
 
Last edited:

kdf2883

Senior Member
Apr 1, 2009
102
3
Thanks a lot for your efforts and help, chui. I had to revert to Stable 7.1.0.1, hopefully that doesn't make a difference. Radio is KB5.

(Any flashing and permissions was done in recovery)
  • Recover to Stable 7.1.0.1, cleared cache, cleared dalvik, reboot
  • Flashed Ultimate Cleaning Script v4, flashed EB-Streamline, reboot
  • Flashed yagpsf, reboot, fixed permissions, reboot
  • Before Google Maps logcat (permission denied, dev/log/main is 0 bytes)
  • Open Google Maps
  • logcat post-Google Maps (again, permission denied for logcat)

Result: GPS icon/indicator works once. If I try to reload maps or turn my screen back on, the indicator no longer comes up. For some reason, logcat isn't being written into to it. The permissions for dev/log/main is rw-rw--w-.

Edit: I just tried alogcat, and it's giving an overwhelming amount of output. So I think it's because I don't know how to use logcat.

---------- Post added at 11:16 PM ---------- Previous post was at 10:51 PM ----------

Alright, got some logs, I'll be PM'ing you.

I don't know if this helps but i'm not seeing any issues with KA7
 
  • Like
Reactions: jsparakov

jsparakov

Senior Member
Aug 23, 2009
78
7
I don't know if this helps but i'm not seeing any issues with KA7
I've been using KA7 for the longest time now just before flashing it just for this. Yes, the problem persisted using BALI and Software GPS Fix v1.5.1.

In any case, I'll try KA7 again more methodically (KA7 + Clear Dalvik + Fix Permissions) and see if that allows the GPS indicator to work more than once per boot.

Out of curiosity, what's the date on the box/under-battery for your Vibrant? Mine is Jul/2010.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 64
    Yet Another GPS Fix
    YAGF Version 2
    For users running AOSP Gingerbread (CM7) and ICS (CM9/ICS Passion) ROMs

    Why another GPS Fix?
    This GPS fix is a modification of the GPS fix by strictlyrude27 (link). The newest builds of CM7 don't play nice with that GPS fix and hang at the kernel boot screen for 10 minutes waiting to download GPS LTO data.

    This fix does several things differently:
    • It addresses the 10-minute hang time by removing GPS LTO data download altogether. I have no problem getting a GPS fix without it! You can see the test results below.
    • It uses a modified GPS library that actually reads config files (even if you don't have AngryGPS installed), now finally allowing Google's SUPL server to be used.
    • It lets the GPS use hot fixes now. After getting an initial fix, if you leave and come back to the GPS later you can get a fix in as little as 2 seconds.
    • It cuts out AngryGPS. You can still use it if you want to do GPS performance testing, but the configuration it writes will not be of any use. You can uninstall AngryGPS if you want now! This is to allow the fix to work properly even if you do not have AngryGPS installed.
    • Important for ICS users: If you are getting issues with GPS locks after deep sleep, you may need to try WallaceLau's addendum to this fix. As I am not having issues with GPS dying after deep sleep, I cannot vouch for the effectiveness of copying over HTC Desire GPS files, but as it does not overwrite any existing files, it should be fairly harmless.
    • Note for ICSP RC1 (v13): This fix is only halfway onboard. You should flash this fix after flashing the ROM and cleanup zips to get the proper configuration files.

    What does this work on?
    This works on the latest CM7 and CM9/ICS PASSION builds.
    This has been tested with the stock CM7 kernel, Eugene373's Streamline kernel (EB7 build), and the Glitch V13 kernel.
    Users have reported it working with MIUI as well.

    I have not tested this on any other configurations! YMMV even on these configurations!

    Testing method
    To test the GPS effectiveless, the time to first fix (TTFF) was tested using the S/W test mode in AngryGPS. Interval 5 seconds, cold fix, with XTRA download enabled. Timeout was set to 255 seconds.

    I wiped and reinstalled nightly 182 between each set of tests. The phone was connected to a wifi network during all the tests to obtain the best possible speed for XTRA data download.

    10 TTFF data points were obtained for each test configuration. Error bars are calculated as the standard error of the mean (SEM) of each data set.

    Test results
    The stock installations of CM7 and the Glitch kernel do not have any sort of GPS fixes built in and fail to lock within 255 seconds. The Streamline kernel has a GPS fix but only acquired a lock 5 out of 10 times (50%).
    F8G3A.jpg


    Comparing only the GPS fix from strictlyrude27 and this fix:
    HynqK.jpg



    What do the graphs mean?
    This shows that these two GPS fixes essentially perform the same, and that removing LTO download (and the 10 minute hang time on boot) has no statistically significant effect on GPS performance.

    In addition, one can conclude that using either Streamline or Glitch kernels offers significant GPS performance benefits over the stock CM7 kernel.

    Is it safe to flash?
    Most likely (though I offer no guarantee of this)! All this does is delete your old GPS fixes if they are present, delete the agpsd daemon that was causing problems on my CM7 Vibrant, and flash the gpsd and gps.conf that were in strictlyrude27's fix. If that fix didn't give you problems, this one definitely won't.

    INSTRUCTIONS
    1. Have CM7.1.0.1 or a newer nightly installed on your Vibrant
    2. Transfer yagf2.zip to your phone
    3. Turn off the GPS!
    4. Reboot into recovery
    5. Flash your kernel of choice (if you have not done so already)
    6. Install yagf2.zip from wherever you put the file
    7. Reboot and turn on the GPS. Enjoy!

    Download below as an attachment
    Mirror
    Version 1 (Old version)
    3
    For those of you who use MIUI and had problem with the GPS "disappearing" after the first use, try this:

    http://forums.miuiandroid.com/showthread.php?6058-Tutorial-for-Gingerbread-GPS-Fix

    I have a Samsung Vibrant running MIUI 2.1.20 + Glitch 13.1. With just these 2, My GPS would work the first time after reboot, but as soon as I exit the Map app, the GPS icon would disappear and never appear again. Turn off/on GPS does nothing, I have to reboot the phone to get GPS to work again. Thereafter, I applied the fix from the link I posted, GPS icon will now re-appear after I re-enter Google Map. However, lock takes forever... so after some searching I found this thread. But when I applied the patch from the OP I am still getting very slow lock.

    So what I did was boot into recovery, apply "Ultimate Kernel Cleaning Script - 3.0", flash Glitch 13.1, and flash yagf2.zip — all in the same session. Then reboot, and immediately after boot turn on debug and apply the instructions from the my link via ADB. Now I get ~20 second cold-fix and sub 10-second hot-fix, sometimes as fast as 3 seconds if I exit Map and then come right back in, and the GPS icon always re-appear when needed.

    As always, YMMV and remember this is on a MIUI rom (although the link I posted was for gingerbread in general). I will monitor and report back if performance degrades in the future.

    Hope this helps and thank you guys for all your hard work!



    Wallace

    [EDIT: Per PM request I have uploaded the libgps.zip file here, that I downloaded from forums.miuiandroid.com. All credits goes to the original creator of the fix; please refer to the above link for instructions.]
    2
    Updated OP with latest version of fix! Added the extra bit about turning off the GPS before you reboot.
    2
    I'm starting to get degradation of performance, too. It mostly seems like it's taking a lot longer to get the AGPS data, though - whereas I used to have to only wait 2 or 3 seconds to get calculated ephemeris data, in some of my tests yesterday it took as long as 25-30 seconds to get it. After it gets the data though, it still only takes about 10-15 seconds to lock on to a few satellites and calculate position.

    Got a few interesting tidbits from your logs, jskasparov - working on an updated fix to try to address the issues.
    1
    Thanks for this. You know, I still can't reproduce the bootloop issue; I'm running the latest nightly. I wonder if this is a kernel thing? I'm on Glitch V13..