yashsingh1/xdaforums huggingface dataset:
[HD2 Android NAND Development] memin1857:
It seems some agps working android phones have

secgps.conf file in /data/gps

libsecgps.so in /system/lib

agpsd file in /system/bin

I have found those files for gingerbread but as I have stated in my above post I need a few days to properly test.

secgps.conf is a text file that can be freely edited. Extrtact and put these files to above mentioned locations with root explorer and bu sure to

set permissions fully enabled

. (the zip files are not for CWM)

The contents of secgps.conf varies slightly from phone to phone.

From what I've read, SUPL module is part of libgps.so (and the gps library libgps.so for hd2 is likely to be missing supl module) http://gitorious.org/htc-hd2-android-libraries/libgps

I also learned that there is an older method of agps called Control Plane (as opposed to SUPL/User Plane) which gets the data from gsm provider directly, it could be an alternative way. Of course your provider may not be supplying this service. AGPS mode can be changed to CP from a secret menu with samsung phones, unsure about hd2.

SUPL port varies from 7275 to 7276. It might be standart and secure port. ro.ril.def.agps.mode setting in build.prop may be setting agps secure mode on and off, unsure about it. I think secgps means secure gps and possibly just uses ssl to download agps data.
[HD2 Android NAND Development] dlsniper:
Hey,

I've found some information here that could help the devs maybe:

http://android.git.kernel.org/?p=pl...b3c244bea5941d5a3e8d8ec1b905b5be3076e;hb=HEAD and here: http://android.git.kernel.org/?p=platform/hardware/qcom/gps.git;a=summary

Unfortunatelly I don't know C++ but from what I could read into the sources the data there could be used as a starting point in fixing the reminder of gps functions on HD2.

I've posted the link into the IRC channel but unfortunatelly no dev was around to have a look on it so I hope they are reading this here :)

Hope this helps.

Best regards.
[HD2 Android NAND Development] AngelDeath:
This GPSFIX apk is interesting, it is just a downloader for the xtra.bin file, which is one good step, but I have to look into the apk and see what region its downloading for.

As for the location of the xtra.bin file, its located in the root /data folder, and can confirm its existence after running this apk in Raf's 4.0.

I am going to look into the info you provided, because yes most of those files belong and we dont have all of them, but also you are missing the files in the alpha script I uploaded because they are the drivers from what I see for the agps. If you look at any of my conf files, the SUPL is there, but and User_plane, and I believe in the Alpha Script, I have additional commands for gps/agps, and that is one of them.

Thats the missing gps.c file thats needed to along with the gps.h, if they are compatabile, then they might be able to be compiled into the kernel, good find.

Now, I am posting this here and I am going to post it into my thread in the Q&A and I would like anyone to test this out to verify I'm not nuts.

I want anyone willing to try this to report back to this thread the results:

Install the GPSFIX 0.1 thats been posted by memin1857, then run it, after which I want you to use your favorite root explorer, navcigate to system/etc/gps.conf, open this file to edit the text, at the last line I want you to put this line:

AGPS=/data/xtra.bin

XTRA_SERVER_1=/data/xtra.bin

Then save and exit the file. Then run your GPS software, or GPS Status, and post the results, cause I just did this and added the two lines, and I got a very fast lock, much faster then that I anticipated.

Please post results!
[HD2 Android NAND Development] tytung:
AFAIK, http://gitorious.org/htc-hd2-android-libraries/libgps is the gps source code for Froyo, not for Gingerbread. Not sure.

We have "setprop ro.ril.def.agps.mode 2" in init.htcleo.rc.
[HD2 Android NAND Development] charnsingh_online:
HD2 has amss version 3200 for gps, but when we compile it it doesnt work.the amss version is same as all other *gsm* snapdragons. I think it could be a kernel and the lib incompatibility. HD2 kernel source is 99% based on HTC Kernel sources rather than aosp. AOSP sources are always better so thats the reason i want to fully change the kernel source to AOSP base rather than HTC. AOSP is more compatible with everything. So i am gonna see the gps kernel source for hd2 and bravo or nexus one in cm kernel and do the necessary changes, also there are some agps lines that were missing in init.htcleo.rc and i have added that to the latest build i have uploaded. So test if anything GPS related is speeded up.

Currently we have ported WIFI and Bluetooth AOSP drivers to HD2 source, GPS i dont know, kgsl(gpu) is the same and i am still reading its kernel for more changes so i think in some time we should have a better hd2.

Just for people who want 720p

if we do the HTC implementation we need to use the latest DSP drivers which are not being used right now and also configure 720p stuff in camera , encoders. We already have the omxcore for it

If we do Google Implementation we would only need the latest DSP drivers and use NExus One Camera and OMX libs
[HD2 Android NAND Development] Mafioso:
Yeah, I was wondering that...Wi-Fi works much better now on you're build with extremely low drain < 10 mAh normally, had even 2mAh with Wi-Fi ON :eek:

Its amazing, normally before it was 20-40mAh drain, even more...not to mention no wake up lag with Wi-Fi ON...Great work :D
[HD2 Android NAND Development] AngelDeath:
Then I have one question, why is the code in the first post, not anywhere in the kernel soruces that I have looked at? Apparently this code has something to do with it, now unless your statement of removing the code was based that the amss wasnt functioning with that, then I misunderstood, but if this script wasnt in there along with the gps.c then wouldnt that conform to it?

Also the huashan rom that was leaked about a month or two ago, being the "brother" of the HD2 in china, wouldnt that lead to some clues to the implimentation of the agps? Because it doesnt seem that the Desire or Desire HD has this in place either. I have the Inspire 4G from ATT and it has the same issues as our current ports, and this is stock directly from HTC itself, os it makes you wonder if its just missing entirely.
[HD2 Android NAND Development] tytung:
[platform/hardware/qcom/gps.git] / loc_api / libloc_api / Android.mk

It will produce /system/lib/hw/gps.mahimahi.so (e.g. for Nexus One) which cannot be used on HD2.
[HD2 Android NAND Development] charnsingh_online:
U can produce gps.htcleo.so if u do it in the vendor, compile cm7 for leo from sources and you will be able to compile it but i am not able to get the compiled version working, could be amss problem, kernel problem or hardware lib problem.
[HD2 Android NAND Development] memin1857:
You are right. I have looked into files and source of official HTC Desire rom and there is no gps .so file in /system/lib/hw

I thought Desire was the closest in hardware with HD2 and many hd2 android roms were based from desire rom with minimal changes.

Isn't there any native android htc phone that uses the same gps with hd2? I thought all qualcomm HTC phones used the qualcomm gps (gpsone)

Why does HD2 android have gps.htcleo.so (or gps.xxxx.so) in /system/lib/hw? Clearly htc desire and my samsung phone have gps working without any file in /system/lib/hw

AND for libgps.so:

Desire has 99KByte libgps.so but hd2 has only 21Kbyte! Samsung's implementation is 41Kbyte.

My question is, why hd2 has a gps driver in /lib/hw but Desire doesn't?

Correct me if I'm wrong: libgps in /system/lib is the library and gps.htcleo.so in /system/lib/hw is the module (driver?) If so, how does Desire phone work without it?

Is it because our radio is different?
[HD2 Android NAND Development] AngelDeath:
Look at the logs I posted, and as for the question about the desire, look carefully at the Inspire log and compare it with the HD2 log, you'll see that the inspire is using calls to two libs libloc_api.so and libloc_rpc.so.

4281-001_Huashan_Sense_21_Gingerbread.zip But this rom does have the gps driver (China's Brother to the HD2)

Its 7am here, and I have been doing this for 7 hours, need to get some rest, will do more testing tomorrow, but if you can attach that 99Kbyte file, I'll try it out.
[HD2 Android NAND Development] dlsniper:
Following the logic I would assume we can just replace the gps lib from bravo to leo and it should work. But since no chef did this I'd assume it's not working. Tho I'll try this in a few moments I highly doubt it will work.

Our best try would be to have Charnsingh either post his work so far either make a breakthrough and fix it :)

But beyond this, anything we do to tweak our gps.conf file is useless as the driver for GPS is not properly implemented. And yes, some might say I'm wrong but I'm pretty damn sure I ain't :)
[HD2 Android NAND Development] memin1857:
I've attached the file, BUT I doubt it will work. Here is what I think:

I've been following hd2 android scene from the first day. The baseline was desire or nexus one roms for hd2 but some changes were required to make things work with hd2. If desire rom with its libgps.so would work in hd2 then devs wouldn't have tried to make gps work at all. Since gps functions are related to radio, even if gps chips are identical, most likely the radio rom is different in hd2 and a gps.htcleo.so file was created to make it work. But this lacked the agps function. If I remember correctly libgps is from here http://gitorious.org/htc-hd2-android-libraries/libgps/blobs/master/leo-gps.c and daniel (dan1j3l) was the author for it.

We should look at older sd build threads exactly when and how gps was fixed in hd2 android, we may have a clue there.

I will compare official desire rom with dft hd2 nand desire rom and some sd desire builds.

From what I search, gps was first fixed with hd2 android around 1 august 2010.

http://irclog.netripper.com/htc-linux/gps This link shows the chat lines that contain gps in irc official htc-linux channel. It seems devs have been chatting about our gps thing for the last few weeks. (you should click on the day number (of march) to fully read what they had said including all the answers that don't contain the word gps) Check out these days and around those days:

http://irclog.netripper.com/htc-linux/2011/3/12/ (between 22:47-22:50)

http://irclog.netripper.com/htc-linux/2011/3/14/

http://irclog.netripper.com/htc-linux/2011/3/22/ (from 18:50)

http://irclog.netripper.com/htc-linux/2011/3/24/

http://irclog.netripper.com/htc-linux/2011/3/26/

If someone could fix agps it would be someone from that irc htc-linux channel

I also learned that when you inform the modem processor (it is part of the actual gsm phone hardware, not your phone hardware that runs android) it downloads agps data all by itself. The processor that runs android (part of snapdragon) doesn't know about it. According to irc chat, hd2 android libs lacks the necessary rpc calls that were in winmo (quickgps app used them) They have to be implemented.

The file attached below is from an official desire rom for htc desire. (not from a hd2 android rom based of stock desire such as dft stock desire froyo)
[HD2 Android NAND Development] dlsniper:
So I've downloaded RC4 from Cyanogen for Bravo, replaced: gps.bravo.so, gps.goldfish.so and gps.htcleo.so (the last one I've just replaced with the gps.bravo.so) from RC4 build of Typhoon and I've got the following logs (not in order because I'm doing like 6 console windows with various greps):

D/libloc ( 336): loc_read_gps_conf: using /etc/gps.conf

D/libloc ( 336): loc_read_gps_conf: PARAM INTERMEDIATE_POS = 1

D/libloc ( 336): loc_read_gps_conf: PARAM ACCURACY_THRES = 100

D/libloc ( 336): loc_read_gps_conf: PARAM DEBUG_LEVEL = 5

D/libloc ( 336): loc_read_gps_conf: PARAM ENABLE_WIPER = 1

D/libloc ( 336): loc_eng_set_position mode, client = -1234, interval = 1000, mode = 1

D/libloc ( 336): loc_eng_ioctl called: client = -1234, ioctl_type = RPC_LOC_IOCTL_SET_FIX_CRITERIA

E/loc_api_rpc_glue( 336): loc_select_callback: buffer full for this synchronous Loc API call, mask: 0x0

D/libloc ( 336): loc_eng_ioctl result: client = -1234, ioctl_type = RPC_LOC_IOCTL_SET_FIX_CRITERIA, RPC_LOC_API_SUCCESS

D/libloc ( 336): loc_eng_start called

E/libloc ( 336): loc_eng_start error, rc = -1234

The lines regarding gps.conf files look like the file is actually being read but then noting happens. The gps Icon doesn't show on my screen nor do I get a lock.

My gps.conf file is this:

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
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

I also think this might require some investigation into bravo sources if both leo and bravo use the same hardware but it's better for a developer to look into them.

I'm going to ask something dumb here but.. couldn't we just port the files here? https://github.com/CyanogenMod/android_hardware_qcom_gps/tree/gingerbread/loc_api/libloc_api_goog

From what I've seen they've implemented the AGPS function (see loc_eng.cpp) and I guess that for bravo AGPS is working...
[HD2 Android NAND Development] noellenchris:
I think I remember some lines in the build.prop also that interact or direct AGPS stuff for some of the roms also. Probably not much help, but maybe since we don't have the option in settings for AGPS we can turn it on somehow in the build.prop?

Cotulla had fixed the gps.so stuff last summer, I remember downloading it from his server when I was messing around with the SD builds. For whatever reason the Dev's couldn't find a compatable device for the gps. Someone should probably reengage this topic on IRC. I've been really busy, but I will give it a go on IRC and see if I can get some of the guru's involved in the thread here.

noellenchris
[HD2 Android NAND Development] dlsniper:
I've tried that a few moments ago but I might have used the wrong approach as no one seemed particularly interested in replying to my question, at least in a non-joking way.
[HD2 Android NAND Development] memin1857:
From irclog I can see these people were talking about implementing agps for hd2 in the last 3 weeks: (agps talk even goes to february in logs)

gauner1986

arrrghhh

Entropy512

bzo

Also

Dan1j3l

LeTama

should be contacted about this thread.

http://irclog.netripper.com/htc-linux/gps
[HD2 Android NAND Development] D4rk50ul:
I'm out my league but if you guys need someone to test possible fixes pm me anytime. Thanks from the hd2 community.

Sent from my HyperDroid powered HD2
[HD2 Android NAND Development] noellenchris:
This is out of my league too, what we need is good communicators to talk to dev's on IRC and to try and test what they suggest. I've done this in the past, but have been very busy lately. :)

So stick around and be useful....:P
[HD2 Android NAND Development] noellenchris:
Phh suggested this,

<phh> There seems to be a script missing in part of the kernel, its suppose to be located in include/hardware called "gps.h" which is the support for the agps.
[HD2 Android NAND Development] dlsniper:
That's the header file that should include the functions available in the gps.c file. It's just a 'descriptor' file so to speak.

If you take a look in the gps.c you will see that all the functions related to agps are empty, aka returning either 0 or doing nothing.

I don't know if we should use the sources available in the Cyanogen repository as a starting point in fixing this. Charnsingh seems to be willing to work on this but so far all the attempts are unsuccessful.

Unfortunately I don't know how to compile my own kernel, I've got a tutorial from g.lewarne but I couldn't produce the libs for the kernel so it was unusable. And I really have no clue about the libs either.
[HD2 Android NAND Development] noellenchris:
I think arne has been dabling with kernels, and tytung has been in the thread too. Now to find some examples of the gps.c and gps.h I guess that may work for Leo.
[HD2 Android NAND Development] noellenchris:
Update from Gauner1986:

[12:19:02] <Noellenchris> I know you messed with the agps stuff last summer a bit, did u ever get anywhere with it?

[12:21:59] <gauner1986> nah, didnt have much time to cope with it.. if you want to implement it you gotta need someone with disassembling skills

[[12:22:12] <gauner1986> look at quickgps from winmo

[12:22:40] <gauner1986> there or in some library that is connected there should be the correct rpc calls

[12:23:34] <Noellenchris> I have the tools to disassemble, but no skills. I will suggest that in the thread.. thx
[HD2 Android NAND Development] dlsniper:
It might be a long-shot here but what if we would request help from HTC/Qualcomm in this regard? (I know, crazy idea)
[HD2 Android NAND Development] D4rk50ul:
They have no motivation to help. Why fix this and not sell us a new device instead?

Sent from my HyperDroid powered HD2
[HD2 Android NAND Development] AngelDeath:
There are threee things that I believe and have said over and over again that needs to be in place for it to work:

1) Radio

2) Lib/drivers

3) Kernel

Without all 3 agps will not work completely, Now we can PARTLY get gps to function quicker, by adding lines into the gps.conf I know everyone says it doesnt help, but again, if it didnt, then the success we are having wouldnt be happening. If you look at the logs I posted you can see it is getting some info.

The reason why the icon isnt showing up has to do with compatibility, with sensor and possibly lights.

The build prop from what I see really doesnt do anything, in the past it might have when they were SD versions to point where to look, in the nand version I dont think that applies.

BTW you really live in marlton? LOL C.H. Neighbor! :D

Yeah I read the logs after you left, seems they are not overly interested, seems they are working on getting fastboot to work. :/

Main post has the gps.h already there. And yes gps.h and gps.c need to be in there, and I'll keep saying it.

LOL now that was utterly funny, First HTC bans their employees from acknowledging this site because of what we do (Good source), but yet as a hipocrite, they get their solutions from us, so who's helping who here?
[HD2 Android NAND Development] noellenchris:
Yep down by Berlin. Small world...lol.
[HD2 Android NAND Development] AngelDeath:
That it is, our luck we've probably crossed each others paths a few times, well if you ever want to get a cup of coffee you know where I am.

For anyone that wants to poke there nose, here is the link for the Inspire 4G source code, it might help in our dilema, also if anyone looked at the logs, you will notice a lib call that doesnt exist in the lib folder of the inspire: libloc_api-rpc_glue.

I found the reference to the "glue" in the source under arch/include/asm "glue.h"

http://dl4.htc.com/RomCode/Source_and_Binaries/ace-att-2.6.32-g3c08447.tar.gz

Source: http://developer.htc.com/
[HD2 Android NAND Development] mishik:
This change of the config file is pretty much useless indeed. As I said a few pages back, I beleive that the impression of this working was created due to people failing to perform the correct testing procedure.
[HD2 Android NAND Development] D4rk50ul:
It has some effect I've tested it to death. Its so minimal though it obviously points to a bigger problem. Just crossing my fingers on you guys to fix it now. :)

Sent from my HyperDroid powered HD2
[HD2 Android NAND Development] AngelDeath:
I just came up with something while I was reading the cLk thread. Are people that are testing this using magdlr, or cLk, or both? The reason why I am asking is could magdlr also be causing this or not? So anyone using cLk and getting the same results?
[HD2 Android NAND Development] AngelDeath:
Welp I looked thru the IRC logs, and Entropy states the location of the GPS code:

Entropy512 yup. I can't help you too much more specifically with libgps.so - I've been sticking with froyo where the GPS code is in libhardware_legacy.so

Which I had a small suspicision based on looking at the lib files.

Arne128 asked about gingerbread, Think I'll try the channel again and see if I can get any answers.
[HD2 Android NAND Development] AngelDeath:
After being on the channel htc-linux, I got to talking to ali1234, and you can see in the chat logs, he pointed me to a link based on the inspire logcat, and I wanted to share with everyone, based on his scans of the log he pointed me to this and believes maybe this is what we're missing. Thanks to him for chatting with me, you can read the whole thing if you wish in the chat logs, but here is what he pointed me to, remember this is for a driver in the inspire I have:

http://android.git.kernel.org/?p=pl...a092b6327b66d3f1609f068b98f0a2d4175d4;hb=HEAD
[HD2 Android NAND Development] dlsniper:
WOW, WOW, WOW!!!!! I'm frackin' amazed! You've stumble upon the file that I've posted back here?! http://xdaforums.com/showpost.php?p=12409106&postcount=13 That's the discovery of the century! I bet you were as excited as back then.

What's next? To think about searching in Cyanogen repository and post the link to their implementation of GPS, which by the way should be good for both Froyo AND Gingerbread?! Please do so fast as we need to be excited about it.

I don't know why the GPS code regarding AGPS is missing, maybe the developers where too lazy at that time to implement the extra features and they wanted to make the GPS work and that's all.

Maybe Gauner is right, you need heavy disassembly skills and look into how things get done into WinMO in order to implement them here but I guess only a dev can tell us that. And they did.

Think we got their attention but they just don't want to work on this as it isn't as cool/important as any other things that they might work on. Cotulla said that he is focus is into getting Android now onto TP2 then it's back to MAGLDR and HD2 and we are in for a treat so our best bet is to not mess with them :)

Maybe Arnee, Charan, Tytung will do the work and get this working, or maybe some other dev, but that's a matter of time/willingness to do it on their on spare time without getting payed by no one (I'm curious how many people donated here until now for any dev in that matter).

And no, it doesn't matter which bootloader you use, cLK or MAGLDR, it's the same code, which is missing! Bootloaders do just that, init/load stuff up upon booting the phone. They don't make missing code work.

It doesn't matter which gps file do you use as well, WE DON'T HAVE SUPPORT FOR IT, STOP ACTING LIKE YOU KNOW **** AND MAKE PEOPLE BELIEVE IN IT.

The whole gps.conf thingy you did.. it's nice, FOR WHENEVER WE WILL HAVE ALL GPS FUNCTIONALITY AVAILABLE.

Like someone said, in order to make proper tests you need to wait for like 5-7 days between test in order for the GPS chip to invalidate it's data and since you are toying around with GPS every single bloody day it's no use.

I've did some tests on my own. How come on a day I get a lock within 2 mins and the next week, same day, same hour, same weather I don't get a lock within 15 minute?! It is NOT from the CONFIG file!!! The code is NOT there. Simple, learn this, live with this and stop saying that gps.h holds the key. It holds nothing until the actual functions are in place and working. Also all the Java I've seen... it's useless because it makes call to those NOT implemented functions.

Can't wait for a reply where you break down and reply to each of the paragraph I've wrote saying something...