Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[DEV] Lets fix the GPS once and for all

OP Cipherblox

26th August 2012, 03:51 AM   |  #1  
Cipherblox's Avatar
OP Senior Member
Loudoun County, VA
Thanks Meter: 109
 
188 posts
Join Date:Joined: May 2010
Donate to Me
More
I started investigating this in sbrissen's AOSP JB thread when I was running Alpha 5 (Awesome ROM btw). In the interest of not hijacking/derailing this thread, I think it is time we finally figure out why in the world our phone's GPS is so flaky. The solution is almost assuredly in software.

Items of note:
Modem - Our devices GPS is housed within the Qualcomm QSC6085 silicon. Within there, according to http://forum.xda-developers.com/showthread.php?t=1343072 indicates that we have a pretty powerful SiRFStarIV chip. Thus, flashing new modems can affect our interaction with the GPS chip.

Additionally, the aforementioned thread indicates the AGPS is not used on our phone.

I've confirmed that AGPS is not used on our phone via the following logcat:
Code:
D/GPSD    ( 1767): load_xtra_bin: buf_len 50000
E/GPSD    ( 1767): load_xtra_bin: open /data/gps/xtra.bin failed. Permission denied.
E/GPSD    ( 1767): No cached xtra.bin. request to download new binary.
Perhaps with enough digging, we can find where our GPS gets stuck.

-GP

(FYI: Getting a fix on a GB ROM and then immediately flashing is not the solution. At best, the ARM Cortex M3 that operates our baseband, must store data in its own cache since it was recently accessed.)

Update: We have evidence that, in order to save costs on the SPH-D710, the SurfStarIV was removed and our AP (Exynos 4210) handles all GPS duties.

----------------------------------------------
Update 01/23/2013:
First off, I'm sorry for the lack of communication. Second off, I wish I had better news. To respond to a lot of the posts in the thread... this development is all but dead for a couple reasons:

1. IDA Pro is >$1000. IDA Free is free, but doesn't support ARM. I've been using IDA Pro Evaluation, but it only allows a certain amount of use before exiting and does not allow me to save my IDB files (Files that contain refactoring, comments, and changes). I dealt with it for a while, but it is extremely cumbersome to try and deal with while reversing an application of this size.

2. Despite the fact that it would be neat for us to completely understand the modem, it is unlikely that the modem image is directly related to our problem. Our phone has the Qualcomm QSC8085 CDMA Baseband processor. The modem.bin contains, in essence, a completely separate OS that runs in real time all the time (Commonly referred to as an RTOS or Real Time Operating System).

This OS has a lot of responsibilities such as tower negotiations and handoffs, maintaining account information with Sprint, among other things. It likely interfaces with a data buffer that is handled, in part, by the RIL (Radio Interface Layer) which is part of the Android Kernel. Aside from that, it is unknown everything else that the radio has access/control over.

With all of this in mind, it is *possible* that it has some manner of control over the GPS; however, the extent is unclear. Given that we can wipe the EFS partition, flash new Radio Images, and reprovision our phone with virtually no effect on GPS, we can conclude that the problem is unlikely to reside in this image.

--------------------

There are a couple things to consider:

1. Based on all of the above data, it is possible/likely that a small portion of flash memory (Perhaps SRAM (Synchronous RAM) - very small, very fast, very expensive, used for processor cache) is located on the die of the Qualcomm chip that stores data. Because this storage is not accessible to us (Though perhaps the radio OS has access in some way) it persists across data wipes. This would explain why a lock achieved on a TW based ROM will persist across flashes.

2. If we assume the above conclusion has any merit, it is possible/likely that the GPS Daemon or a similar closed source driver packaged with the kernel is not working entirely as expected. It would be very prudent to look into some of these closed source binaries and see what information could be extracted from them; however, they are, ARM binaries and would run into the same obstacles as I outlined above.

3. The tweaks and applications (ie: GPS Status, AngryGPS) that are so widely spread around our forums, while they are useful in optimizing a currently operational GPS, they will NOT/NOT suddenly make a GPS begin to work (This is not meant as a slight to those developers publishing the tweaks. They are, I'm sure, excellent developers who have found fantastic ways to optimize/tweak the functionality of various functions).

When flashing these tweaks, it is important to remember that you are dealing with an extremely complex piece of electronics with many shifting variables. In other words, coincidences happen. A bug fix is only truly a bug fix if it works consistently over a wide set of cases.

--------------

If there is enough developer interest (ie: ONLY those who have significant assembly language or RE experience) and if someone can come up with another way of disassembling ARM binaries, PM me and we can entertain a group effort over a few files that may yield some results.

-Gamingphreek

Edit: Just thought of this... objdump is not a viable disassembler for a binary of this size/complexity. Refactoring and Cross Referencing is all but a necessity.
Last edited by Cipherblox; 24th January 2013 at 03:48 AM. Reason: Update
The Following 14 Users Say Thank You to Cipherblox For This Useful Post: [ View ]
26th August 2012, 04:50 AM   |  #2  
Cipherblox's Avatar
OP Senior Member
Loudoun County, VA
Thanks Meter: 109
 
188 posts
Join Date:Joined: May 2010
Donate to Me
More
I wiped and flashed the latest CM9 Nightly. While the first lock took a few minutes, all subsequent locks have been nearly instantaneous.

While JB vs ICS may make this weird, I'm going to look at the diffs over the relevant files. I'd be particularly interest to see the results of a bdiff (Binary Diff) of the GPS Driver across different ROMs.
The Following User Says Thank You to Cipherblox For This Useful Post: [ View ]
26th August 2012, 04:56 AM   |  #3  
dohchp's Avatar
Member
Flag Fishersville
Thanks Meter: 31
 
69 posts
Join Date:Joined: Feb 2012
More
I used qualcomms qpst program and checked an extra setting under the gps tab and i get almost instant locks. You go through the steps like you are going to manually update a prl but stop at the click roam tab and scroll over to the gps tab. I will have to look in the morning at exactly what the box was that i checked. I did this about a month ago and i have faster locks than ive ever had with any phone.

Sent from my SPH-D710 using xda premium
The Following 2 Users Say Thank You to dohchp For This Useful Post: [ View ]
26th August 2012, 04:34 PM   |  #4  
calisro's Avatar
Senior Member
Flag noneya
Thanks Meter: 745
 
1,859 posts
Join Date:Joined: Sep 2008
Donate to Me
More
Bump
26th August 2012, 04:45 PM   |  #5  
puch0021's Avatar
Senior Member
Flag Minneapolis
Thanks Meter: 32
 
157 posts
Join Date:Joined: Nov 2011
More
Quote:
Originally Posted by dohchp

I used qualcomms qpst program and checked an extra setting under the gps tab and i get almost instant locks. You go through the steps like you are going to manually update a prl but stop at the click roam tab and scroll over to the gps tab. I will have to look in the morning at exactly what the box was that i checked. I did this about a month ago and i have faster locks than ive ever had with any phone.

Please keep us updated with that program.

Another quick question for discussion. Are quick alterations to the gps.conf likely to make any significant changes, or is it all placebo?
Last edited by puch0021; 26th August 2012 at 04:52 PM.
26th August 2012, 06:43 PM   |  #6  
Junior Member
Billerica, MA
Thanks Meter: 6
 
21 posts
Join Date:Joined: Sep 2010
More
After reading through the thread referenced in the OP I found the app mentioned on page 4. Even after i changed my build prop to GT-9100 the app GPS control SiRF refused to work. I emailed the developer to see what tweaks he is using underneath to enable the sleep mode on our SiRF IV gps chip. I'm awaiting feedback and will share any info the we might be able to apply into the Gps lib or through direct ways
Last edited by vinnythepooh; 26th August 2012 at 06:47 PM.
26th August 2012, 11:57 PM   |  #7  
Senior Member
Flag San Antonio, TX
Thanks Meter: 4
 
104 posts
Join Date:Joined: Dec 2010
More
Quote:
Originally Posted by dohchp

I used qualcomms qpst program and checked an extra setting under the gps tab and i get almost instant locks. You go through the steps like you are going to manually update a prl but stop at the click roam tab and scroll over to the gps tab. I will have to look in the morning at exactly what the box was that i checked. I did this about a month ago and i have faster locks than ive ever had with any phone.

Sent from my SPH-D710 using xda premium

Where did you get this software from? I'm desperate to improve my GPS in anyway possible.
27th August 2012, 01:50 AM   |  #8  
mxmr's Avatar
Senior Member
Flag Wisconsin
Thanks Meter: 216
 
203 posts
Join Date:Joined: Jan 2012
More
Quote:
Originally Posted by I'M NOT YELLING

Where did you get this software from? I'm desperate to improve my GPS in anyway possible.

Refer to this thread.
27th August 2012, 03:15 AM   |  #9  
Nannuq's Avatar
Senior Member
Thanks Meter: 69
 
128 posts
Join Date:Joined: Jul 2010
More
Quote:
Originally Posted by dohchp

I used qualcomms qpst program and checked an extra setting under the gps tab and i get almost instant locks. You go through the steps like you are going to manually update a prl but stop at the click roam tab and scroll over to the gps tab. I will have to look in the morning at exactly what the box was that i checked. I did this about a month ago and i have faster locks than ive ever had with any phone.

Sent from my SPH-D710 using xda premium

ok the information that Dohchp posted got me thinking so I started following what he did. However once to the GPS screen only the top box was selected and I had no clue what the rest meant so I searched and besides finding out what each thing means I found this site with a guide for blackberries. I decided what the heck I'll try before the hack it took 82 seconds to lock here in northern Idaho with mountains all around after the hack it took 17 seconds.

http://bbsoftware.weebly.com/uploads...ations_pdf.pdf

I take no credit for this since all I did was a little research. I have only had this on my phone for about 5 minutes now and will continue to test it out. if you screw up your phone that is your fault for not reading enough before doing stuff to it. If you are afraid to screw up your phone then don't mess with it.

Update: disabled GPS waited a few minutes turned it back on locked in 16s got 9 sats was only getting 4 sats before the modification

Not sure that is matters but I am using Calk's 3.0 GB rom and like Bigt2003's post below me I have been using Faster Fix from the market. However even with that I was getting the times I posted here in the valley.

update: 45 minutes after the mod. While standing in the yard I enabled the gps and had a lock in 24s. I then walked into my apartment to it's closest to center location and ,not surprising, Imidiately lost all satilites gaining them back with in 16s of moving back outside. Probably to much info but better to have too much than not enough.

Update: after just a few hours with the GPS left on but not mapping software running my lock is taking just as long as it did before 81s to lock all locks after that are sub 20s but that is after it's initial lock. So this method is a bust unless a slight variation of the settings changes something. There were no ill effects to doing this that I noticed.
Last edited by Nannuq; 27th August 2012 at 05:19 AM.
The Following User Says Thank You to Nannuq For This Useful Post: [ View ]
27th August 2012, 03:22 AM   |  #10  
Bigt2003's Avatar
Senior Member
Flag Cleveland
Thanks Meter: 80
 
693 posts
Join Date:Joined: Oct 2009
More
Don't know if it will help but I'm just reporting what worked for me. I'm using phantom's alpha 4.3 (jb) and I couldn't get a lock for over an hour. I had no satellites showing in GPS Status. I used Faster Fix from the market and set the location North America. I rebooted and locked on to 7/8 in 12 seconds. It may not be a technical repair, but it worked for me.

Sent from my SPH-D710 using Tapatalk 2

The Following User Says Thank You to Bigt2003 For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes