yashsingh1/xdaforums huggingface dataset:
[HD2 Android NAND Development] AngelDeath:
I just mentioned the radio in my last post #135 :D and since you said 2.08 produced interesting results, please do tell.
[HD2 Android NAND Development] D4rk50ul:
I live in an urban jungle like I said so signal bounces off buildings. Both radios 2.07 and 2.08 gain at least 10 points higher signal strength over 2.15. Radio 2.08 seemed the best so far with signal strength gains across the board, followed by 2.07 and then 2.10.

I'm sorry I missed your post I have been.flashing radios all day. I'm at my PC now and will upload screenshots in a minute of the differences found. I added a supl host supl.nokia.com as well to my config but I doubt that will matter. I think the AGPS data everyone is expecting to find is like that app dev said stored in the GPS subsystems. The problem we have and what the devs are working out is that our Radio isn't communicating the GPS information to Android properly. Running a logcat produces no info, whereas on a native device it will stream info constantly.

I'm going back to 2.07 radio really quick and going to stress test it over the next 3 days with cold starts, warm starts, etc. Will try with and without the extra files your fixes install as well. I'm on my buddies stock desire right now and I cannot find any AGPS files, so expecting to find one on our device seems doubtful.

I'm going to use his native and my device running hyperdroid gbx (asop) and compare logcats in real time using alogcat.apk and also the differences in signal strength from the satellites.

This is all being done without the apk that installed /data/xtra.bin and without those two strings.

Here is a copy of my current gps.conf if it matters at all, I'm not going to change it as something might actually effect the change in performance and I'm testing radios only at the moment.

http://pastebin.com/68c6pyqM

Here is me running 2.08 radio where I would normally have 4-7 sats in the 20-30 range and the rest gray with >15 with 2.15 radio.

This was actually a lower end score.. I had over over 40 on 8 sats while I walked around, this was one in the black hole of gps testing, in a space with 3 buildings blocking almost all view of sky.
[HD2 Android NAND Development] pyrorob:
actually i did some digging about that, and you have to go to:

data/data/com.android.providers.settings/databases/

thats where teh correct settings.db is

the one in the directory below it is a zero byte file..

i set it and it and it accepted the change with no error but, nothing happend..

also, you can use the internal veiwer in root explorer to see all teh values in it..

theres ALOT of interesting settings there...

i get the feeling that most of them can be adjusted in the build.pro since some of the options there are set in it
[HD2 Android NAND Development] memin1857:
What I see from the code is there was a value from gps which wasn't correctly working so a rough fix was made by just dividing it by 10 which is obviously wrong. Maybe the value is not accuracy in meters but GOP? AngelDeath had said his Inspire was reportng GOP HDOP and VDOP I think.

See here:

http://en.wikipedia.org/wiki/Dilution_of_precision_(GPS)

You are right, my logcat too doesn't show anything like this. Debug level has to be verbose for this to work but setting DEBUG_LEVEL=5 didn't seem to help. The sample log is from another forum thread for acer phone. II use DroidExplorer to see realtime logcat but unfortunately any PC I use droidexplorer crashes on startup with the samsung phone, so I can only watch hd2 logcat in realtime. I will look at the samsung logcat offline later on.

It seems all the gps software report the same accuracy values and they are always much higher than other phones and usually always 1 meter is reported outdoors which is in common sense too accurate!

With AutoKiller Memory Optimizer you can change the way android kills apps. It is not a simple task manager it changes android internal settings.

GPS Status can be set to autodownload agps data on startup or when agps age is 1 hours old. So it does update on its own. When I clear agps data in samsung -- is shown in agps age instead of days. Maybe kernel buffer has info about gps libs? dmesg?

I tried winmo a few days ago and it is working ver well with 2.15 radio. Yes, radio can make the difference since it contains the gps firmware too, but since 2.15 is working quite well in winmo it might be OK.

You are right I posted the folder wrong, but I actualy too looked at the 32Kbyte settings.db file. RootExplorer crashes on opening, I was trying to use a 3rd party sqlite reader, maybe it wasn't working well too.
[HD2 Android NAND Development] memin1857:
Do we have baco or diem's gpslib source code? Can we ask him? Normally froyo gps lib didn't work on gingerbread and diem fixed it.

http://xdaforums.com/showthread.php?t=900631

Gauner's fix on first post doesn't work properly.

Diem's working gingerbread gps lib is on page 13:

http://xdaforums.com/showpost.php?p=10636518&postcount=125

IT SEEMS 3 FILES ARE INVOLVED: (not just libgps.so)

gps.htcleo.so

libgps.so

sensors.bravo.so

We should find actual sources for these files and check the gps.htcleo.so code.

Gauners non properly working fix files can be found here:

http://www.mediafire.com/?bb7sf0dorot70vv

This is the file that can't be downloaded from the first post. It made gps lock on gingerbread possible but it wasn't stable. Baco and Diem's files from post 125 are the ones we are actualy using in gingerbread roms now. Still DFT Stock Desire Froyo has better working gps. (At least gps status doesn't complain about connection when trying to download agps data)
[HD2 Android NAND Development] AngelDeath:
Well I just did a log cat on my Inspire and during the tracing, in the Inspire, its calling 2 lib files that obviously I am not seeing in the HD2 logcat, and in the Inspire its constantly calling on these two files: libloc_api.so and librpc_api-rpc.so and at one point it shows this but its not a file in the rom: librpc_api-rpc_glue. And it has another call: a call to AK8975 which is the Compass.

If you want I can attach the log.

As for your looking at the Settings.db, dont bother, if you really want to see all that info, just look in the apk and open it with winrar and right click on classes.dex and choose view file, its all there.
[HD2 Android NAND Development] ozkaya:
if you check the sources of the GPS code, you will see that AGPS functions just return 0. It is empty, it does nothing. Until someone writes up some code in that, you can download whatever BIN file or apk file, or change the conf file, the results will be just random. For some it will be faster, because they have more satellites on that time, for some it will not. It will never have a 5 second cold lock like a proper AGPS implementation though. Sorry about that.
[HD2 Android NAND Development] D4rk50ul:
What are the /data/misc/rild_agps.feature and /data/misc/rild_agps.mode files used for? They have -1 and 0 as the only values inside. Just curious doubt its related to anything.
[HD2 Android NAND Development] AngelDeath:
Those keys only exist in Gingerbread, or the GBX 11 rom, it doesnt exist in sense roms, so it would be safe to say doesnt apply to our problem.

ozkaya,

Which source file did you look at? and is it a source for a lib file? And the reason for the edits for the gps.conf is to add the functions in there, so far Arne182 confirms that the command I found AGPS= does function in the gps.conf, unless you see something else?
[HD2 Android NAND Development] ozkaya:
It was a source file Gauner sent me to have a look. I will try and find it and post it here.
[HD2 Android NAND Development] memin1857:
I did some more side by side testing and saw that when going through tunnels samsung phone instantly reports loss of sats but hd2 believes it still has lock to sats.

Also hd2 sats are yellow with 30-35db snr (signal to noise ratio) but samsung have green sats with 40db snr. (Better reception) I will try with older radio.

hd2 accuracy report is still too accurate. (1meters)

EDIT: 2.08 radio did not do any difference in signal levels or lock times.
[HD2 Android NAND Development] htcvidi:
I use Hyperdroid (which is a very good rom) and I wanted to know what parameters from gps.conf were really used by this nand.

To do this, I downloaded the source code provided by pongster and I did a search on ALL files.

Here are the parameters actually present in the code.

NTP_SERVER

XTRA_SERVER

SUPL_HOST

SUPL_PORT

C2K_HOST

C2K_PORT

As I suspected, parameters such as ACCURACY_THRES, INTERMEDIATE_POS, CURRENT_CARRIER, DEFAULT_AGPS_ENABLE, ENABLE_WIPER ... are not present and are therefore not used. I think this is not specific to this rom.

These entries, for hyperdoird, are unnecessary in gps.conf (and probably for other android rom HD2)

Changing these values ​​will do nothing more to improve the fix.
[HD2 Android NAND Development] memin1857:
Actual testing also supports your findings. They don't matter at all.

We should be focusing on code of these three files:

gps.htcleo.so

libgps.so

sensors.bravo.so

and also this:

gpslocationprovider.java

THINGS TO FIX IN HD2 GPS:

1- Proper accuracy reporting (accuracy calculation and reporting formula is wrong)

2- Sat reporting before fix (no sats reported before lock)

3- Elimination of lag (hd2 doesn't find out about sat signal loss or speed change instantly)

4- 1 second delay of NTP time. (HD2 is behind actual gps time)

5- Lag of gps start stop cycles (can be seen from gps icon in notification bar)
[HD2 Android NAND Development] SNK180:
well how about in a recently fresh install rom? yesterday afternoon i installed a new rom completly from scratch. didnt touch anything that uses gps. today i instaled the gps fix apk and added the lines. went outside and ran gps status and in cold start it locked in 16s and relocks were 5s.
[HD2 Android NAND Development] htcvidi:
Do you know where i can find source code for gps.htcleo.so. (On Hyperdroid, it seems to be called gps.leo.so') ?

I think all the low level interface with gps chip is implemented in this file.
[HD2 Android NAND Development] arne182:
libgps.so

I have looked into our .so files and there is a function

pdsm_client_xtra_reg

I assume the same like the gitorious code. I have PM'd Diem to see if we can get his source code so that we can get the GPS working 100%.

Changing to radio 2.8 does improve the db value but the positioning is off, way off. It has more bugs than the 2.15. I advice everybody stick with 2.15.
[HD2 Android NAND Development] tytung:
If possible, can you share Gauner's source code for Gingerbread GPS fix?
[HD2 Android NAND Development] memin1857:
Gauner's source is a good start BUT it doesn't work properly. It locks but doesn't update location properly (resets to north every second) It was later fixed by Baco and Diem. Keep this in mind please.
[HD2 Android NAND Development] memin1857:
Useful info

Check this out;

Android gps implementation/porting guide complete with all the source codes agps info commands documentation etc:

http://source.android.com/porting/gps.html
[HD2 Android NAND Development] AngelDeath:
There is definitely more codes then this that the libs reference, I've looke thru it, as well Arne already confirmed one of the commands I found AGPS=

I think there is more then just those that need to be looked at, I mentioned two of them above before.

LOL, you just posted the same link, to the soruce code I started this whole thread about, the reference lines are the gps.h which I posted in my [OP] :D
[HD2 Android NAND Development] memin1857:
The source code in your first post is this one: http://source.android.com/porting/gps_8h-source.html

I am aware of it.

The page I posted is the documentation of that source code.

Also here is info for gps.c (the other one was gps.h)

http://gnsstk.sourceforge.net/gps_8c-source.html

Seems a little old.
[HD2 Android NAND Development] htcvidi:
I never said in my post that 'AGPS' is not used.

I didn't searched for 'AGPS' because there are to many line with terms like that.

I focused only on terms like ACCURACY_THRES, INTERMEDIATE_POS, CURRENT_CARRIER, DEFAULT_AGPS_ENABLE, ENABLE_WIPER and they are not present.

So, every people who said that changing these parameters improves the fix are wrong.
[HD2 Android NAND Development] D4rk50ul:
I said it and if you read the post you would.see that i straight up said i was guessing based on native device.commands. feel better now?
[HD2 Android NAND Development] htcvidi:
I do not understand what you're saying (English is not my first language and I have trouble with some turn of phrase). : (

Did you say that entries like "ACCURACY_THRES, INTERMEDIATE_POS"are used?

Edit1 : I've read again your post and i understood it :-)

Edit 2 : I have a remark. It's not because device-command are present that they are called. I don't think the chip reads file on the SD card, it is not its job. So, i think this job is made by Android and file content sent to chip.
[HD2 Android NAND Development] D4rk50ul:
OK so I don't know how much this helps anybody figure this stuff out but someone was very kind and shared some code with me on how android calls for AGPS and Resets its status. I know nothing of these things I was just trying to help the true devs out by gathering information. I already pm'd it but I figure if you guys want to take a look, it might already be well known I have no idea.

Pastebin link

I realize its Java code so I'm not sure if its applicable, but like I said I'm just trying to help.
[HD2 Android NAND Development] memin1857:
Unfortunately this is the code to use in apks to trigger download of data. We already have this (e.g. gps status) the problem is injecting the data to gps library/chip.
[HD2 Android NAND Development] memin1857:
First of all, nice work.

Second, we already kind of knew this, but you proved it.

So we should work on the gps library. First step should be to learn what was done to make gps work in gingerbread and find the source code. Since almost every phone with android has agps support, there should be ready to be used code for the gps lib. Some HTC phone must be using the same gps chip with HD2. (Desire maybe?)

http://developer.htc.com/ has the source codes for official phones, maybe we can dig something up there. We may be able to get agps code from another phone library and implant it to hours. That might be the way to do it.

http://gitorious.org/htc-hd2-android-libraries/libgps/blobs/master/leo-gps.c This is our gps library code for froyo right? Where is the gingerbread code, made by gauner and/or Baco and Diem?
[HD2 Android NAND Development] tobiascrystal:
First, let me say that I love this thread and I have learned so much from it and been following its progression every day.

Second, I want to say that I am no developer and I may be pretty far off but the one thing that has bugged me in my very short journey into learning Android on our HD2’s is that I have no idea how android talks to our phone hardware. From what I understand it is in the main Kernel and from there it all seems like Voodoo to me. This led me to ask that same thing when I read your diagnosis of our AGPS issue. Could the Kernel be mistakenly identifying our GPS chip, due to a driver error, as one that does not have AGPS and in turn disabling the phone from even trying? What is it that “translates” for our phone hardware so it can communicate with the Android software?
[HD2 Android NAND Development] AngelDeath:
Well reading all that has been posted, I have looked thru alot of the files, and obviously the information is there I do believe that the lines do help in gps.conf, in reality if they didnt, then we would still be at the 5min or longer mark of getting a signal, does the agps work? No, thats clear. But if you look at most of the sense builds you will see alot of that info is in there.

As for getting a native phones library, ask away, I have the Inspire 4g from ATT with sense, and agps works, as well as everything, but there is no gps library in the rom, I have checked, I have been doing comparisions of files and data.

At this point, I can provide any file from the inspire, I can even provide a signed rom, I still feel though, that the radio, and the kernel of native roms could very hold the key, If anyone wants they are more then welcome to the Inspire rom I have or any files thats needed from the system img, the boot.img and the radio img I dont know how to extract but Ask and I'll post it up.

As for this:

Where is the pb ?. All seem to be here !!!

In fact, no.

The main pb is that there is no interface in gps library for xtra.

How can i know it ?

It's simple : when you run logcat at android boot, the following line appears :

'E/GpsLocationProvider( 507): no AGPS interface in agps_data_conn_open'

This line is written by the function 'android_location_GpsLocationProvider_agps_data_co nn_open' called by the function handleUpdateNetworkState in GpsLocationProvider

So, Hyperdroid seems ready to manage Xtra Data but the gps module doesn't offer any implementation to store it in GPS.

I tried hyperdroid GB, and it took a long time to get a lock compared to my Raf's HD 4.0, and they both havent had gps connections in the two days, I did exactly the same thing, had the conf file installed, the gpsfix installed and gps status, the 4.0Raf too 54seconds, Hyperdroid V11 GBX took 178seconds, (I have two HD2's). So I do believe it makes a difference.

But if the gps library is missing the calls, then which library is it? Like I said I have the inspire I see no library with gps in the name, no modules, nothing in the hardware folder. Because if the library is whats missing it, wouldnt it be as simple as replacing the library?
[HD2 Android NAND Development] arne182:
Excellent Post. I have to say I agree with you.

I have compared GPS Test and GPS Status to NTP.

GPS Status time compared to NTP server is 14 seconds ahead.

GPS Test time compared to NTP server is 15 seconds behind.

I assume it has to do with Leap seconds

ftp://time.nist.gov/pub/leap-seconds.3427142400

The conversion made in

https://gitorious.org/htc-hd2-android-libraries/libgps/blobs/master/leo-gps-rpc.c#line361

Taking epoch time from 1 January 1970(Linux Epoch) to 6 January 1980(Qualcom Epoch)

http://en.wikipedia.org/wiki/Epoch_(reference_date)

We have had 15 leap seconds between 1980 and now

http://en.wikipedia.org/wiki/Leap_second

These leap seconds haven't been programmed into the code.

Here are two examples of the code

http://cboard.cprogramming.com/c-programming/72298-functions-c.html

http://www.tena-sda.org/doc/6.0.1/T...-v2/TENA-Time-v2-TimeConstants_8h_source.html

For us we only need to add 15 seconds to the libgps calculation go get the time correct.

I assume this is the cause of the NTP and GPS programs being off.

Can someone confirm this to be true?
[HD2 Android NAND Development] D4rk50ul:
Read some stuff. Try this.

Delete your gps.conf and its backup.

Uncheck location by wireless networks. Reboot.

Try to get a lock.

Then put it all back and check the wireless network locations and try again. LoL
[HD2 Android NAND Development] Lozone:
No GPS.config , I got a lock in less than 1 minute.

Put GPS.config back and it locked 4 seconds.

All done laying in bed indoors.

Interesting.

Is this what you saw?
[HD2 Android NAND Development] D4rk50ul:
What I see is that with the network location off I'm getting way more accurate readings. The file itself helps but only marginally. Its almost like having them both checked in settings is causing a conflict.

What im also seeing is with the file in place its using my data to download something. Lock speed wasnt really what I was looking at, accuracy of position.

Edit: This is my config file now. gps.conf

When I turn off the wireless network locations and use this file, I get good results. Since 0.us.pool.ntp.org is actually a header for about 600 ntp servers and it has the best ping using the NTP server test tool for me, I didn't see a use for adding extra ones.

Again I'm not trying to fix drivers, libraries, etc. I'm a beta tester and all I'm doing is testing things.

Edit: I added the global ntp pool servers to the file so that if the localized one fails it will kick back and auto-search for the closest available one. It does take longer this way but it never fails.
[HD2 Android NAND Development] AngelDeath:
A Quote from a Guy named mike on the Android Team, What I've said about the radio being a factor for communication I think is solidified, correct me if I'm wrong:

In the current HTC phones, the Qualcomm GPS handles all the SUPL

support within the firmware running on the radio processor. As I

mentioned earlier, we need to tell it the server address and port

number, and it taps into the cellular data connection to communicate

with the server and packet filters the incoming data so the code on

the application processor never notices the SUPL transactions.

But in order for this to work the data connection needs to be

established first. So there is an API for the GPS firmware (running

on the radio processor) to request the a data connection be brought up

so it can communicate with the SUPL server. In cupcake, this is only

working if a data connection is already available. But in donut, we

are now bringing up the data connection on demand (which is necessary

when Wifi is enabled, since we shut down the cellular data connection

when Wifi is up). After the data connection is available, we tell the

GPS engine the APN name for the data connection it should use. that

is what the native_set_supl_apn.

As you can see, this is pretty specific to the Qualcomm GPS

implementation on the existing HTC phones. We may need to do

something a bit different in order to support SUPL for other GPS

solutions.

Mike Lockwood

Google android team

Which refers to the GPSLocationProvider's SUPL.

But I still cant find which lib is responsible, if anyone finds out let me know and I'll post it or test it.
[HD2 Android NAND Development] AngelDeath:
From what I know checking off wireless networks under location uses wifi for position lock, for people reading this thread, this will give you a false lock (Meaning you are locking by wifi and not agps or gps).
[HD2 Android NAND Development] D4rk50ul:
I have wifi disabled. When I turn it on in maps I get a wifi lock, with it off it just keeps searching for GPS lock.

Link to the chip itself http://pdadb.net/index.php?m=cpu&id=a8250&c=qualcomm_snapdragon_qsd8250

Link to the chip features http://en.wikipedia.org/wiki/GpsOne

Interesting part is the modes in which it can operate.. at the bottom.. I've been using Standalone, and it worked great. I'm trying MSHYBRID right now.

Edit: No doubt the radio is the biggest factor in our GPS performance, this goes back into WinMo days even. I've been having great success with 2.10.50.26 but switched back to 2.15 just because most people use it.
[HD2 Android NAND Development] tytung:
Of course I know.

If we have Diem's source, it's best.

But in fact we don't.

So having Gauner's source is better than nothing.
[HD2 Android NAND Development] AngelDeath:
I zipped 5 logs, and would like someone to look thru this, I made changes to my phone, (Many infact) and I want to see especially htcvidi since you can read thru this pretty good, what do you people see in these logs. All were done on my test phone with Imilka's 0.3 GB sense.

Log.txt Straight GB sense.

Log2.txt same as above.

Inspire Log stock phone.

HD2 GB GPS Status Log Gps status running with some changes.

HD2 GPS Status Log 3 more changes.

Maybe its helpful, just let me know if anything stands out. Thanks.