5,597,762 Members 36,538 Now Online
XDA Developers Android and Mobile Development Forum

[DEV] Lets fix the GPS once and for all

Tip us?
 
Cipherblox
Old
(Last edited by Cipherblox; 24th January 2013 at 02:48 AM.) Reason: Update
#1  
Cipherblox's Avatar
Senior Member - OP
Thanks Meter 109
Posts: 188
Join Date: May 2010
Location: Loudoun County, VA

 
DONATE TO ME
Default [DEV] Lets fix the GPS once and for all

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.
"And 'lo I am with you always, even to the end of the age -Matthew 28:20
The Following 14 Users Say Thank You to Cipherblox For This Useful Post: [ Click to Expand ]
 
Cipherblox
Old
#2  
Cipherblox's Avatar
Senior Member - OP
Thanks Meter 109
Posts: 188
Join Date: May 2010
Location: Loudoun County, VA

 
DONATE TO ME
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.
"And 'lo I am with you always, even to the end of the age -Matthew 28:20
The Following User Says Thank You to Cipherblox For This Useful Post: [ Click to Expand ]
 
dohchp
Old
#3  
dohchp's Avatar
Member
Thanks Meter 31
Posts: 76
Join Date: Feb 2012
Location: Fishersville
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: [ Click to Expand ]
 
calisro
Old
#4  
calisro's Avatar
Senior Member
Thanks Meter 716
Posts: 1,832
Join Date: Sep 2008
Location: noneya

 
DONATE TO ME
Bump
Samsung Galaxy SIII (Sprint) [ Carbon-Rom ]
Asus Eee pad TF300T [ CM ]
 
puch0021
Old
(Last edited by puch0021; 26th August 2012 at 03:52 PM.)
#5  
puch0021's Avatar
Senior Member
Thanks Meter 28
Posts: 151
Join Date: Nov 2011
Location: Minneapolis
Quote:
Originally Posted by dohchp View Post
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?
Device: Galaxy S2 Epic 4g Touch
 
vinnythepooh
Old
(Last edited by vinnythepooh; 26th August 2012 at 05:47 PM.)
#6  
Junior Member
Thanks Meter 6
Posts: 20
Join Date: Sep 2010
Location: Billerica, MA
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
 
I'M NOT YELLING
Old
#7  
Senior Member
Thanks Meter 4
Posts: 103
Join Date: Dec 2010
Location: San Antonio, TX
Quote:
Originally Posted by dohchp View Post
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.
 
mxmr
Old
#8  
Member
Thanks Meter 31
Posts: 99
Join Date: Jan 2012
Quote:
Originally Posted by I'M NOT YELLING View Post
Where did you get this software from? I'm desperate to improve my GPS in anyway possible.
Refer to this thread.
 
Nannuq
Old
(Last edited by Nannuq; 27th August 2012 at 04:19 AM.)
#9  
Nannuq's Avatar
Senior Member
Thanks Meter 69
Posts: 127
Join Date: Jul 2010
Quote:
Originally Posted by dohchp View Post
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.
The Following User Says Thank You to Nannuq For This Useful Post: [ Click to Expand ]
 
Bigt2003
Old
#10  
Bigt2003's Avatar
Senior Member
Thanks Meter 80
Posts: 694
Join Date: Oct 2009
Location: Cleveland
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
Phone: Sprint LG G2
ROM: Stock Rooted 4.2.2

Tablet: Samsung Note 10.1
ROM: OmniROM 4.4

(\__/)
(='.'=) This is Ninja Bunny.
(")_(")
Copy and paste Bunny into your
signature to help him gain world domination

Google+

The Following User Says Thank You to Bigt2003 For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes