yashsingh1/xdaforums huggingface dataset:
[HD2 Android NAND Development] memin1857:
SKYHOOK is a software location service that estimates your location from combination of wifi, gps and any available that gives rouch location. It wouldn't do us any good because we are trying to make gps fix faster. Skyhook uses the gps information as an aid, so it has to work first.
[HD2 Android NAND Development] AngelDeath:
I took a look at your file, and obviously PM-ed you as well, and as you said as have I this is all a WIP. So we're all helping one another, having said that:

I tried this script, now it might be a flase positive, but more testing obviously will show that, but when you restart GPS Status the right side doesnt show you 0/x when you start it, it doesnt come up until a lock.

supl.skyhook.com isnt needed, the reason is it no longer works or hasnt, me and SLBenz looked into this before the initial release and found it isnt implimented for use, you would need a specific way to get that and these roms dont have it. Enable Wiper is for wifi, which overrides the wifi under the location setting, again defeats the purpose since your not near a wifi when out and about, that will surely give you a false positive. But the key here is getting the xtra.bin file to actually download, with this script being almost like what comes in the rom, it doesnt download. And the very last line: operation_Mode=Standalone would make me think it would look at itself and a GPS unit and not a mobile phone, and if thats the case, standalone units do not use agps.

The rest of the commands have already been implimented. But if it works for you and your having great results thats the most important thing.
[HD2 Android NAND Development] D4rk50ul:
So for the threshold. Higher number is ignoring more false locks or vice.versa?
[HD2 Android NAND Development] AngelDeath:
SLBenz told me that the lower the number the more sats with weaker signals will be visible, if thats true, he asked me to test using 50 instead of 5000, I'd say try 50 before 0, cause I always look at 0 as either none or disabled.
[HD2 Android NAND Development] D4rk50ul:
I tested at 0, 100, 500, 5000, 10000, and 20000 and it made no difference. I don't know what its worth.

After deleting the skyhook reference and the others that you pointed out my performance dropped down significantly. I don't understand why.
[HD2 Android NAND Development] memin1857:
My samsung phone with working agps have accuracy threshold=100 by default. I think it defines what accuracy is considered a lock. If you make accuracy value higher it will say it locked but accuracy will be bad so your position will be off real until you get better accuracy. Yes it makes lock report sooner (if accuracy value isn't ignored of course) but doesn't actually make you find sats sooner. accuracy_threshold may only be for intermediate position reporting anc accuracy=100 is what is written in my samsung phone. The file says it was generated by gpslocationprovider which I assume is a java class that is the same in all android roms?

The following gps.conf might be worth trying but don't use windows to edit yours, it causes problems with the end of line special character in linux/android. It is best to edit gps.conf directly in the phone. You may change europe to your country/continent.

NTP_SERVER=europe.pool.ntp.org

XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin

XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin

XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin

DEBUG_LEVEL=0

INTERMEDIATE_POS=1

ACCURACY_THRES=0

REPORT_POSITION_USE_SUPL_REFLOC=1

CURRENT_CARRIER=common

DEFAULT_AGPS_ENABLE=TRUE

DEFAULT_USER_PLANE=TRUE

ENABLE_XTRA=TRUE

START_MODE=HOT

OPERATION_MODE=MSBASED

AGPS=http://xtra1.gpsonextra.net/xtra.bin

SUPL_HOST=supl.google.com

SUPL_PORT=7276

SUPL_SECURE_PORT=7276

POSITION_MODE=7

SESSION_TYPE=2

ACCURACY=100
[HD2 Android NAND Development] AngelDeath:
My guess would be the enable wiper, add that back and see, remember if you go into settings/location, you have enable wifi and gps, if you enable wifi your locks will be near instant because your using wifi for your position and not the gps itself.
[HD2 Android NAND Development] D4rk50ul:
I'm not using WIFI to get my locks though, I enabled it so you could if you chose to use WIFI to assist it.
[HD2 Android NAND Development] rizky_p:
Just would like to chime in.

With gpsfix apk then add the 2 lines into gps.conf after that reboot, launch the gps fix(root permission) then run any gps softwares. Tested and confirmed i got gps lock within 5 seconds (cold start) in cloudy day. Amazing!

Hyperdroid GBX v11.
[HD2 Android NAND Development] memin1857:
Can you post which two lines they are?

You haven't got a lock in the last 8 hours before your last test right?

Guys would it be possible that this works with hyperdroid gbx v11 but not typhoon 2.8.x? (hyperdroid gbx is NOT cyanogen cm7. maybe that's why)
[HD2 Android NAND Development] nick2k:
http://xdaforums.com/showpost.php?p=12410693&postcount=14
[HD2 Android NAND Development] D4rk50ul:
Link to what worked the best.. most locks, most accurate, without the extra strings.

Feel free to try it.

http://pastebin.com/VVbp8rdT
[HD2 Android NAND Development] AngelDeath:
Enable_Wiper does exactly that, it overrides the wifi setting in locations regardless if you have it checked or not based on the info about this command.
[HD2 Android NAND Development] AngelDeath:
Indonesia No less, glad to hear it.
[HD2 Android NAND Development] memin1857:
You did download qbanin gps fix and run it frequently to get fresh xtra.bin placed in /data right? Because without qbanin gps fix app run, that two lines wouldn't matter.
[HD2 Android NAND Development] AngelDeath:
No duh :D Your part of the key as to the reason why the two lines work that apk was a huge missing link, and I owe you a debit of gratitude for that find my friend!
[HD2 Android NAND Development] AngelDeath:
If from now on, if people would please when saying that it works or doesnt work, please also in your reply tell me what rom you are using.

I would like to know and see if there is a pattern here about the roms. I think also it can help with the fixing of the library if we know which ones they work with and which ones they dont, obviously Hyperdroid GBX 11 seems to be having alot of success.

Thanks to everyone Helping out, whether it be by taking the time to test lines out or files, providing information, or sources to information, and everyone involved. I put in alot of time and effort in the past month with the testing and aiding help of the people I acknowledged in my Q&A thread, but in the short time every one of us altogether got more accomplished in 5 days then I could have alone. And I thank all of you.
[HD2 Android NAND Development] D4rk50ul:
Ultimate goals are shared by all. Your hard work and taking the time to make a custom file for Hawaii because of my terrible gps was incredible. Its nice to see the community working together to solve a problem that plagues every build of android on the device. Look forward to the results :)
[HD2 Android NAND Development] clyder:
edit: deleted my post because it is misguiding to avoid confusion....
[HD2 Android NAND Development] memin1857:
You MUST try the two lines along with qbanin gps fix app or it won't mean anything. And you must run qbanin gps fix app at least 30 seconds before you run your gps/nav app.

Normally android should download the file on demand, but since this is not working properly we are manualy downloading the file with qbanin gps fix app and point android directly to it. Without fresh xtra.bin in /data folder nothing will happen. This is important.
[HD2 Android NAND Development] memin1857:
Everybody, we MUST differentiate real fast locks from fast locks that are because another lock was previously made in short time (within 5 hours)

For this matter we have to test over about 2-3 days minimum to make sure what we did is actually working. (or some dev uses debug to see it actually work in real time) Any lock within few hours of another previous lock, or at similar location was ALREADY fast in HD2.
[HD2 Android NAND Development] K_Hismoom:
I'm using the gps.conf file that D4rk50ul posted (http://pastebin.com/VVbp8rdT), but modified the NTP_SERVER lines to reflect my country.

I have lock times on a cloudy day of about 30s indoors on a cold start, which is very good.

I'm on HyperDroid GBX v11.
[HD2 Android NAND Development] htcvidi:
Like clyder, there is no really improvement on my HD2 with the last modification made by D4rk50ul in gps.conf.

Moreover, there is no data exchange (3g, or wifi) when i run a gps software. So, at which moment the lines 'XTRA_SERVER_x=http://xtrax.gpsonextra.net/xtra.bin' are used by driver ?

The pb is with the driver. More and more lines are added to gps.conf but nobody knows really if these entries are used by driver.

I'm a developper, unfortunately not on android, but i know that when a config file is used, the entries used are referenced in source code.

So, does somebody can show me in the source code, where these entries are present ?

I continue my test with the app 'Qbanin gps fix' which seems to be the good direction to go and as said memin1857, 'Any lock within few hours of another previous lock, or at similar location was ALREADY fast in HD2'. A lot of people think it works because they don't wait long enough between 2 tests.

I test 2 times by day, the morning (08:00) and the afternoon (18:00) and i can say that the solution for a fast fix has not been found yet. :(
[HD2 Android NAND Development] memin1857:
I agree.

You can check these BTW

http://gitorious.org/htc-hd2-android-libraries/libgps/trees/5235baed73e82f51d372026604bc658d18f609ee

http://gitorious.org/android-eeepc/...id/internal/location/GpsLocationProvider.java
[HD2 Android NAND Development] htcvidi:
Thanks memin1857. :)

I will get a look.
[HD2 Android NAND Development] clyder:
My mistake.... I used a totaly different application that I downloaded from market and missed the actual app from here....

I should have seen that...Sorry to all..I will try later and post the results....
[HD2 Android NAND Development] memin1857:
FYI

I factory reseted my samsung phone and saw that the in default conf file it is like this:

START_MODE=WARM

OPERATION_MODE=MSBASED

(so factory default is not HOT or STANDALONE)

Running gpssetup2.apk corrupts the file (because new defaults are generated)
[HD2 Android NAND Development] D4rk50ul:
I was researching google style specs on the gps chip that resides in our.device

It suppposedly supports NMEA 0183 which didnt look like a logging function. Perhaps ENABLE_NMEA string is important.

sorry for limited data I'm mobile atm.. And to the devs.. I admire your work and skill at what you do. In no way am I claiming to be able to fix gps, im simply trying to help in my own rookieway. I will stop cluttering your thread with gps.conf info. Without you guys I wouldnt be using android right now at all. Aloha
[HD2 Android NAND Development] memin1857:
It's time for someone to look at the actual code of gpslocationprovider.java and libgps.so (For froyo and gingerbread) We don't know if any string in conf files are used at all.

http://gitorious.org/htc-hd2-android-libraries/libgps/trees/5235baed73e82f51d372026604bc658d18f609ee

http://gitorious.org/android-eeepc/...id/internal/location/GpsLocationProvider.java

Diem was the person who fixed gps for gingerbread but I didn't see if source code was available.

When DEBUG mode is set in gps.conf I think we may test if agps is actually working or not without going outside and waiting 8 hours for next test.

# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info

# 4 - Debug, 5 - Verbose

DEBUG_LEVEL = 5

adb logcat then should give detailed info about how gps works in the background

Example

log output from different phone: (we could see what gpslocationprovider reports about agps)

W/libloc ( 123): loc_inform_gps_status, status: GPS_STATUS_ENGINE_ON

W/libloc ( 123): Fix session state: RPC_LOC_FIX_SESSION_STATE_END

W/libloc ( 123): Fix session state: RPC_LOC_FIX_SESSION_STATE_BEGIN

W/libloc ( 123): loc_inform_gps_status, status: GPS_STATUS_SESSION_BEGIN

W/libloc ( 123): Fix session state: RPC_LOC_FIX_SESSION_STATE_END

W/libloc ( 123): Fix session state: RPC_LOC_FIX_SESSION_STATE_BEGIN

W/libloc ( 123): loc_inform_gps_status, status: GPS_STATUS_SESSION_BEGIN

E/acer_AgpsSetting( 120): Acer A-GPS Settings Interface init! Curren version(201)

W/GpsLocationProvider( 120): Doesn't have stored SUPL host and port, using PROPERTIES_FILE settings!

E/GpsLocationProvider( 120): GPS_CERT file exists: false

E/GpsLocationProvider( 120): Failed to default A-GPS settings!

E/GpsLocationProvider( 120): unable to parse SUPL_PORT:

D/libloc ( 123): Event RPC_LOC_EVENT_PARSED_POSITION_REPORT (client 0)

D/libloc ( 123): Session status: RPC_LOC_SESS_STATUS_IN_PROGESS Valid mask: 0xF1E9

D/libloc ( 123): Latitude: 54.7367835 (intermediate)

D/libloc ( 123): Longitude: 55.9604287

D/libloc ( 123): Accuracy: 1772.0000000

V/libloc ( 123): loc_eng_report_position: ignore position report when session status = 1

D/libloc ( 123):

D/libloc ( 123): Event RPC_LOC_EVENT_SATELLITE_REPORT (client 0)

D/libloc ( 123): sv count: 0

D/libloc ( 123):

D/libloc ( 123): Event RPC_LOC_EVENT_PARSED_POSITION_REPORT (client 0)

D/libloc ( 123): Session status: RPC_LOC_SESS_STATUS_IN_PROGESS Valid mask: 0xF1E9

D/libloc ( 123): Latitude: 54.7367835 (intermediate)

D/libloc ( 123): Longitude: 55.9604287

D/libloc ( 123): Accuracy: 1789.0000000

V/libloc ( 123): loc_eng_report_position: ignore position report when session status = 1

D/libloc ( 123):

D/libloc ( 123): Event RPC_LOC_EVENT_SATELLITE_REPORT (client 0)

D/libloc ( 123): sv count: 0
[HD2 Android NAND Development] htcvidi:
I got a look to leo-gps.c.

At first sight, this file has two goals :

- Retrievinging NEMA frames (position) and fill a data structure with all the information about the fix.

- Implementing main gps interface functions (init, start, stop, getfix, return position...)

I don't think there is something to do in this file to improve the fix because this code is used after the fix has been calculated by the gps chip. Perhaps, agps have to be put here to init gps ephemeris ?

I study these files because i want to understand why we see the satellites only when a fix has been done. In my opinion, the pb is not in this file. It is before.
[HD2 Android NAND Development] memin1857:
Did you look at the gpslocationprovider.java? Normally ntp time and xtra data is injected to gps lib to speed up the fix and that code is in gpslocationprovider:

http://gitorious.org/android-eeepc/...id/internal/location/GpsLocationProvider.java
[HD2 Android NAND Development] htcvidi:
I quickly read the java code and, you are right, there is a call to NTP_SERVER and a call to a method named 'native_inject_xtra_data.'

Unfortunately, the implementation of the function is not present in the file.

It must be in one of the 'imported' file listed at the top of the source code.

I will search.
[HD2 Android NAND Development] arne182:
I can confirm that it is working with the typhoon build. GPS "cold start" (at least 3 days off) locked in 40 seconds. Relocks in 2s. Warm start after update to 2.8.6 and reboot: 29 seconds Relocks 2s.

This is all by just adding

AGPS=http://xtra1.gpsonextra.net/xtra.bin

to the end of gps.conf

I find there must be an error in the leo-gps.c because the GPS error comes from there. It seams the error should be 4 times the size.
[HD2 Android NAND Development] jaba_cz:
Today I was running with memin's gps.conf. I was worse than my version posted yesterday. All locks were between 30 - 40s. No matter how long the device was off-GPS.

I was worse than my version posted yesterday. All locks were between 30 - 40s. No matter how long the device was off-GPS.

After returning home I reverted back to my version. The first lock after reboot was in 5 sec !!!!

I do not know, which line made it worse. But definitely, there is difference. Please, dev's look at the difference and try to explain. I cannot, as I do not understand it. I'm dummy experimenting tester.
[HD2 Android NAND Development] dlsniper:
I'll post my config here as well, it's a mix from the various configs I've found in this thread. For testing I didn't activated my GPS since two days ago and I've went outside in a semi-cloudy day. The initial lock was in about 2 minutes tops then the relock was like instant, I opened GPS Status and sats where just there. As a major thing, I had the data connection off and wireless didn't had any network connection but it was on. Also I had the xtra.bin fine in /data/ downloaded in the morning. System was after a fresh boot.

NTP_SERVER=ntp1.usv.ro
NTP_SERVER=0.ro.pool.ntp.org
NTP_SERVER=1.ro.pool.ntp.org
NTP_SERVER=2.ro.pool.ntp.org
NTP_SERVER=3.ro.pool.ntp.org
NTP_SERVER=europe.pool.ntp.org
NTP_SERVER=0.europe.pool.ntp.org
NTP_SERVER=1.europe.pool.ntp.org
NTP_SERVER=2.europe.pool.ntp.org
NTP_SERVER=3.europe.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
APGS=http://xtra1.gpsonextra.net/xtra.bin
INTERMEDIATE_POS=1
C2K_HOST=c2k.pde.com
C2K_PORT=1234
ACCURACY_THRES=100
DEBUG_LEVEL=5
ENABLE_WIPER=1
ENABLE_XTRA=TRUE
SUPL_HOST=supl.google.com
SUPL_PORT=7276
SUPL_SECURE_PORT=7275
SUPL_NO_SECURE_PORT=3425
CURRENT_CARRIER=common
REPORT_POSITION_USE_SUPL_REFLOC=1
DEFAULT_AGPS_ENABLE=TRUE
DEFAULT_SSL_ENABLE=FALSE
DEFAULT_USER_PLANE=TRUE
START_MODE=WARM
OPERATION_MODE=MSBASED

To quote from above:
[HD2 Android NAND Development] memin1857:
GPS Status sometimes comes with the sats on but that is not actual instant fix. It is just still showing last run state. You will see gps icon at the notification area flashing. This is a problem of hd2 gps libs.

I am still saying, DEBUG is the way to go, because of all the inconveniences of gps testing.
[HD2 Android NAND Development] clyder:
I tried using gps fix from here, but first cold lock was about 35s.

So, I changed the gps.conf with two extra lines, started gps-fix, waited for it to finish then checked in /data to see that xtra.bin was there. Then rebooted the phone and after I got off from work I turned gps on and gps status got a lock in 35s which is about normal for me. Last gps use before that was about 8 hours before that with very similar lock speed.

I am using gps.conf from Angel Death's thread for Serbia with two additional lines...
[HD2 Android NAND Development] memin1857:
Here are two screenshots taken "exactly" at the same time.

Both phones are indoor near the window when shots were taken.

HD2 reports too high accuracy (too low number in meters)

HD2 time "always" lags exactly one second behind the native android phone.

I think there is an accuracy calculation problem and it might be causing the lock to be reported later than possible Accuracy thresholds in gps.conf don't work at all.

I tested for many days and in outdoor conditions other phones usually report 4-6-10 meters accuracy while HD2 reports 1 meter. And in the screenshots below you can see samsung phone report 12meters accuracy (which is reasonable since it was indoors) hd2 reports 2 meters! About 1 minute before screenshots were taken samsung reported 32-48-64mteres but hd2 was still reporting like 4meters. I caught hd2 accuracy to flicker once to 666meters than quickly returned to 2. I remember in hd2 windows mobile google maps accuracy in meters were more realistic. As always the samsung phone reports realtime satellite info in grey before lock is made.

I was unable to find verbose gps information in logcat even when DEBUG_LEVEL=5 was set Can we check the code to see which file / strings it actually looks for?

Note: Samsung phones gps status is also green in color but in screenshots it appears as blue. LCD is 240x400 hence the blurry resized image.
[HD2 Android NAND Development] arne182:
https://gitorious.org/htc-hd2-android-libraries/libgps/blobs/master/leo-gps-rpc.c#line368

366

if (ntohl(data[75])) {

367

fix.flags |= GPS_LOCATION_HAS_ACCURACY;

368

fix.accuracy = (float)ntohl(data[75]) / 10.0f;

369

}

370

The accuracy is divided by 10.0

I assume it has to do with this division here that causes our accuracy to be so low/high.

I am just lacking the knowledge on how to compile the .so file. Will look into it on the weekend.

You need to run the APK on page 2 before it will work. Check that the /data/xtra.bin is downloaded on your device. I just use the lines with the URL as you can go back and read.
[HD2 Android NAND Development] clyder:
I used that APK....I think I said that...and that I checked for xtra.bin in /data...
[HD2 Android NAND Development] AngelDeath:
memin1857,

2 things, I didnt want to quote that screenshot of yours, but 1) When your doing the gps test are you using any of my conf fileson the hd2? The reason I ask is cause of the time servers added into the list could possibily be the cause too. 2) If you run a gps nav program, does that 12 or 2 meters change?
[HD2 Android NAND Development] arne182:
No, Deleting and using my line doesn't download the file locally. I assume it is reading it and then pushing the data into the libgps which can use the data to calculate faster. Having a local copy is nice but quickgps did download the the data regularly. The apk does open and download once but it gets closed after some point when android sees that it is inactive and then it doesn't ever open again or download again until the user opens the program again.

Android is irritating me when it just closes programs even though it has plenty of ram left.

With regard to the accuracy it is the same in all applications. So therefore it is wrong everywhere.
[HD2 Android NAND Development] clyder:
I dont really complain about 35s. My point is that using gps-fix from page 2 and two additional lines in gps.conf havent change anything for me, or at least so far I can't see anything different. I had first locks after day or two in less than minute before I did all that.

My first improvement in speeding the gps lock was when I used gps.conf for Serbia from your other gps thread. Before that, from my first days of using till then was very anoying. My usual first lock was 2-5 minutes and sometimes it went for 10-15 minutes. Very rarely I got a first lock under a minute. But when I used your gps.conf it got a lot better. I used SuplRootCert file also but dont see any difference with or without it.
[HD2 Android NAND Development] AngelDeath:
So unless you look thru with a logcat or the libgps itself after there is no way for sure if it is, you cant be certain its actually pushing the info the libgps.

I know I asked this already, or mentioned it, but would the inspire (only using that as an example cause I have it) rom help not in switching drivers, but because of the fact it works and since "most" android are the same can look at the lines to compare it to the current hd2 versions?

But as far as i remember quickgps never downloaded the info when needed, I always got a notification that it was older then 7 days and to re-download it. So I dont remember it ever running on its own and updating.
[HD2 Android NAND Development] D4rk50ul:
I was reading a bunch of internal e-mail transcripts from different cell phone manufacturers and google's android team and it seems that GPS performance is almost completely related to the radio firmware. Is it possible we have poor performance because we are using a radio that was meant for the newer SPL with the older 2.08hspl? I'm going to flash the radio that came paired with the last update before the new SPL was released (I believe it was 2.10) and see if that has any effect.

Apparently the AGPS data is downloaded directly to the gps subsystem and would not be a physical file on the device (according to a dev that makes a gps tool for android) so finding a file such as xtra.bin on ANY phone native or otherwise would be unlikely.

I will continue to scour the web for information that might be useful to you guys as you try to work out the problems with the actual code of the drivers.

Installing 2.08 radio produced interesting results. Try it out.