Mast Kalandar

bandar's colander of random jamun aur aam

Sat, 27 Apr 2013

Fixing GPS for Wildfire with "blackmagic"


blackmagic, cyanogenmod, gps, htc, wildfire [link] [comments ()] [raw]

As explained in an earlier post my HTC Wildfire phone is now running Cyanogenmod version 7.2.0 for Wildfire (Buzz). The phone is pretty snappy with this image. I have not even felt the need for "Google Apps" except for those parts that are connected with Google Maps (primarily NetworkLocator and Maps but also some support files for these).

However, after installing Maps, I noticed that it was not able to get a tight fix on my location. (Note that Maps also gets a "loose" fix by getting the co-ordinates of the nearest cell tower using the NetworkLocator.) Searching the web turns up thousands of "GPS fix" therapies from all kinds of places.

In earlier experiments, I had been wary of "brick"ing my phone. Now that it is working so well, I am doubly so! Hence, any solution which seemed to be reversible was acceptable and those which were not, were not. Solutions that involved software changes alone would appear to be reversible. Hence, I tried:

All of these resulted in the following experience:

  1. Immediately after cold-start (power-off, battery removal and re-insert and reboot), the GPS fix would be done in seconds.
  2. About a minute or so later this GPS fix would be lost.
  3. In a completely un-predictable way, the GPS fix would be re-gained at different times and places only to be lost in a minute or so again!

One solution suggested in various places was to re-flash the radio. However, given the equally large number of warnings about "brick"ed phones due to radio flashing, I was unwilling to give it a go. Moreover, the current radio on the phone is "13.55.55.24H_3.35.20.10" which appears to be the latest (and last!) version for this model.

Finally, I came across a suggestion (see the fourth entry under Modifications to the System) that the file /system/lib/libgps.so from an earlier build (Froyo?) would fix the problem. Now, the file /system/lib/libgps.so on Cyanogenmod 7.2.0 is actually the same as that on the HTC stock image that was backed-up from my phone. So, I was a bit disbelieving, but the change was easy and reversible, so why not?

So I downloaded the Wild Ginger ROM by following a link on the same page and extracted the 96Kb file (from a 70Mb download ;-)). I then installed this file in place of the default /system/lib/libgps.so. Reboot the phone and GPS is working stably for 10 minutes! Go indoors for 5 minutes come back out and its back again!

Now a hacker cannot just let this go! So what would happen if I put back the CM-7.2.0 version of /system/lib/libgps.so? Surprisingly, the GPS continued to be stable! Perhaps there was something in the volatile memory, so do a cold-restart (power-off, re-insert battery and boot). Still stable! Wipe out the "Dalvik cache", the GPS loses its compass and pitch-roll settings. However, the wonderful GPSStatus can be used to fix that. Sure enough, once those are fixed, GPS is back to being stable again!

This feels like blackmagic! The software running on the phone is the same as before, but GPS which was not working earlier is working now. The indication seems to be that the older (HTC Froyo) library managed to "kickstart" the GPS somehow. Perhaps the downloading and injection of aGPS data into the GPS sensor was not working with the newer library. Perhaps there was some flag that needed to be reset.

So a lot of questions remain and at this point it just looks like blackmagic. In summary, I am now running the same software that I was running earlier --- even the firmware has not (as far as I can see) been changed. By some sort of "blackmagic" GPS is now working!


Wed, 24 Apr 2013

Root, Recovery, Unlocked bootloaders, S-OFF

Tue, 16 Apr 2013

Unlocking the HTC Wildfire

Archives

< April 2013 >
SuMoTuWeThFrSa
  1 2 3 4 5 6
7 8 910111213
14151617181920
21222324252627
282930    

2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002, 2001, 2000, 1999, 1997, 1995,