yashsingh1/xdaforums huggingface dataset:
[G Tablet General] BuckeyBall:
Well, as I understand it - the solution proposed here is a wrapper implementation. Basically, it allowed the newer HC interface to plug into the old libgps.so. This is a completely different and direct implementation of the newer HC/GB interface without using a file names libgps.so at all (rather gps.tegra.so).

I suppose the main advantage would be the complete source availability of the whole module rather then using the closed source libgps.so. I imagine the overhead for the wrapper would be minimal, so there's probably not any CPU or memory benefit. Overall it means if there's an issue that crops up - you can fix it using the available source code and in my opinion the solution is neater :)

EDIT: I of course don't mean any disrespect to the work here. Both solutions work just fine and rajeevvp along with yourself have definitely done a great job getting it sorted.
[G Tablet General] sharshas:
Hmm... I guessed it. Let me breakdown the hardware and try to match the pins. Not hoping it to work, but if it works then its bonus...

Will update. Thanks fosser :)
[G Tablet General] fosser2:
The only difference us G-Tabbers need for this to work is a "1" needed to be written to /sys/devices/platform/gps_control/enable. This "1" physically powers on the GPS chip in the G-Tablet. The Adam does not have this feature and their chip is "always on." MrGuy, I tried out your GPS files that I ripped out of AdamComb 0.3. Everything works G-Tablet side aside from enabling the GPS. I did verify that you were pulling data from "ttyHS3" and it was defined in gpslib.c
[G Tablet General] fosser2:
rajeevvp or MrGuy,

What would have to be changed in MrGuy's GPS library to get the G-tablet GPS to enable? Is the physical turning on/off the GPS (/sys/devices/platform/gps_control/enable) part of the GPS library or is that feature controlled by another file?
[G Tablet General] rajeevvp:
The changes are pretty simple:

1. Open /sys/devices/platform/gps_control/enable for writing in gpslib_init().

2. Write a '1' in gpslib_start().

3. Write a '0' in gpslib_stop().

4. Close the file in gpslib_cleanup().

I'll send you a new gps.tegra.so incorporating these changes in the evening.
[G Tablet General] fosser2:
Is the file libgps.so not used in Honeycomb anymore? From what I have read it is obsolete and Google seems to have started using the file gps.tegra.so Does Gingerbread also use the file gps.tegra.so?
[G Tablet General] rajeevvp:
Your intuitions are correct, fosser2.

EDIT: Try the attached zip file--it contains the changes needed to power the GPS on and off on the gTablet.

If you are trying out different GPS library implementations, try the updated libgps.so (still Froyo) from the zip update file in this thread. Maybe VS has fixed that inverted longitude problem in the new one.
[G Tablet General] fosser2:
Actually that's a really good call. I will try both of those out and report back. Thanks for the new HC version too!

EDIT: ̶A̶t̶ ̶f̶i̶r̶s̶t̶ ̶l̶o̶o̶k̶ ̶t̶h̶e̶ ̶n̶e̶w̶ ̶H̶C̶ ̶i̶n̶t̶e̶r̶f̶a̶c̶e̶ ̶f̶r̶o̶m̶ ̶M̶r̶G̶u̶y̶ ̶s̶e̶e̶m̶s̶ ̶t̶o̶ ̶b̶e̶ ̶"̶a̶l̶w̶a̶y̶s̶ ̶o̶n̶.̶"̶ ̶I̶t̶ ̶w̶i̶l̶l̶ ̶s̶t̶a̶r̶t̶ ̶u̶p̶ ̶w̶i̶t̶h̶ ̶m̶y̶ ̶t̶a̶b̶l̶e̶t̶.̶ ̶U̶n̶c̶h̶e̶c̶k̶i̶n̶g̶ ̶t̶h̶e̶ ̶b̶o̶x̶ ̶i̶n̶ ̶s̶e̶t̶t̶i̶n̶g̶s̶ ̶t̶u̶r̶n̶s̶ ̶i̶t̶ ̶o̶f̶f̶,̶ ̶b̶u̶t̶ ̶r̶i̶g̶h̶t̶ ̶a̶f̶t̶e̶r̶ ̶r̶e̶c̶h̶e̶c̶k̶i̶n̶g̶ ̶i̶t̶ ̶a̶g̶a̶i̶n̶ ̶i̶t̶ ̶t̶u̶r̶n̶s̶ ̶b̶a̶c̶k̶ ̶o̶n̶.̶ ̶I̶ ̶t̶h̶i̶n̶k̶ ̶t̶h̶i̶s̶ ̶i̶s̶ ̶p̶o̶s̶s̶i̶b̶l̶y̶ ̶b̶e̶c̶a̶u̶s̶e̶ ̶t̶h̶e̶ ̶A̶d̶a̶m̶ ̶h̶a̶s̶ ̶a̶n̶ ̶"̶a̶l̶w̶a̶y̶s̶ ̶o̶n̶"̶ ̶g̶p̶s̶.̶ EDIT: I finally installed Gtabcomb and MrGuy's interface worked flawlessly. I have no idea what is going on with flashback but somehow there is a previous framework or application attempting to use GPS on boot this is really messing with things. I guess from now on I will be switching my main HC ROM to Gtabcomb instead of Flashback.

EDIT2: The 'tards working for Tap n Tap still have not gotten around to fixing the inverted gps issues.... (I tried with Brilliant Colors)

EDIT3: Tutorial updated.
[G Tablet General] dj710:
First I would like to thank everyone who has worked on this project. The install tutorial was fantastic. Fixing the software was made so easy by you all and I want to say that I for one really appreciate your efforts. I have installed the GPS in my G tablet and it is working great. I go into an app that uses GPS and it turns on and when I exit the app it turns off. I just have a couple of opservations to mention. When using the GPS test app has anyone else noticed that the UTC time is 4 hours off? Also in GPS test the yellow indicator will turn green (GPS lock?) but it still says In View 12 In use 0. I didn't install the lock LED but I'm assuming that the indicator in GPS test turning Green indicates a lock. When I use GPS on my phone ( Droid X ) when the GPS locks the signal bars turn to clolor and the In Use will say 6 or 7. I am using CM7 Gingerbread.

Onec again I would like to say THANK YOU to you all for your fantastic work. :D:D:D
[G Tablet General] fosser2:
Nice job getting it installed! I did notice the clock was off also, honestly I have no idea why...(not a big enough deal for me to care) Also for the lock, I did notice the lock problem also. I don't fully understand that one either, but the only thing that I use as a lock indicator is the light. A hardware lock indicator works so much better than a software one.

EDIT: Just wondering if you installed your antenna in the spot I showed in the tutorial or someplace else?
[G Tablet General] dj710:
I installed it where you reccomended. I found that it worked best there.
[G Tablet General] fosser2:
Sweet, glad to hear you got it working.
[G Tablet General] rajeevvp:
This is where not having the GPS hardware installed shows--you can test for basic functionality, but, corner cases will always escape the testing. I'll see what I can do about fixing this.

Try this command, which is straight from the RXM-GPS-SG spec sheet, to cold-reset the GPS chip--see if it helps:

$ [B]su[/B] [I]Become superuser[/I]
# [B]bash -i[/B] [I]Use bash for the next command which cold resets the GPS chip[/I]
# [B]echo -n $'$PSRF104,0,0,0,96000,0,0,12,4*1A\r\n' > /dev/ttyHS3[/B]

I saw this when I tested the GB GPS fix initially, and it confused me too, but, this problem, I think, will eventually resolve itself once you've used the GPS for some time. Check using another GPS test app -- GPS Status.
[G Tablet General] dj710:
I tried the cold start as you suggested. It didn't change the time. It is still 4 hours ahead of my Eastern time zone. It took a while to lock as any GPS will after a cold start (and I'm inside too) but it acted the same as before the cold start.

Thank You for your response and help. I love XDA-Developers. You guys here are great and I only hope you all know how much you are appreciated.

Thanks Again
[G Tablet General] rajeevvp:
Wait a mo... At this time of the year, UTC should be 4 hrs ahead of EST. This looks like a non-problem now.
[G Tablet General] dj710:
You're right. I wasn't very clear. UTC shows 8 hours ahead of of Eastern time and the local time shows 4 hours ahead. Sorry I should have been clearer in my post. I would think the time the GPS receives from the satellites would be UTC.
[G Tablet General] rajeevvp:
Can you guys run the test script in the attachment and send me the output so that I can cross-check the dates/times?

Before you run the script, make sure that the GPS is "locked": Run GPS Status, GPS Test, Google Maps, whatever, until you get a valid location lock, then close those apps, and only then run the script. And don't go back into Maps, or whatever else you used, while the script is collecting data. The script will automatically exit after 2 minutes. Just don't let the tablet go to sleep.

$ [B]su[/B]
# [B]chmod 700 [I]/some/path/[/I]date-test1.sh[/B]
# [B]bash [I]/some/path/[/I]date-test1.sh | tee /mnt/sdcard/date-test1.txt[/B]
[G Tablet General] fosser2:
I'll test out in just a bit and reply later tonight.
[G Tablet General] rajeevvp:
Use the updated zip file. I now try to force a date/time update using NTP before starting the test.

Also, include in your replies the local date and time when the test was started and stopped.
[G Tablet General] fosser2:
Ok, it was about 9:30pm when I tested it. The date was 8/7/11.

EDIT: from the looks of the file, It looks like it is pulling the right date and time.

PS. I did use the updated version of your file.
[G Tablet General] rajeevvp:
Yeah, the local time from the script and the UTC time from the GPS match. There is the correct 5 hr difference between the two.

I would recommend that you guys stick with the wrapped GPS implementation for now. (did you notice a time mismatch using that BTW?) The native source implementation is still not quite production quality yet.
[G Tablet General] fosser2:
Is that link the same as this post? and no i didn't notice the time mismatch, but I didn't pay much attention either :p sorry. http://xdaforums.com/showpost.php?p=15354655&postcount=378
[G Tablet General] rajeevvp:
Nope--my link fixes all known bugs. All the problems that you've reported so far should be fixed using my link. I was waiting for your final OK before I update the GB/HC files also with this version.
[G Tablet General] Doxeng:
U22 -- Could someone measure the voltage into the regulator

comment removed ....
[G Tablet General] fosser2:
Tutorial updated; I rewrote a bit of the software installation and roms tested section. I will also keep people updated to how this works with the new kernel that is in testing ".36"
[G Tablet General] fosser2:
As of right now, Flashback 10.1 does not have the necessary files for the gps to run. I am in the process of figuring out what happened right now. I will update soon.
[G Tablet General] fosser2:
For all of you who are still following this thread (if any at all) I was able to figure out how to get gps functioning again on Flashback 10.1 thanks to rajeevvp. After You install Flashback 10.1 and flash the Honeycomb gps firmware fix navigate to /system/lib/hw and rename

gps.harmony.so

to

gps.tegra.so

. You can make this change through a program called root explorer or another program similar to it. PS. GPS works best in Flashback 10.1 so far through sparse testing.
[G Tablet General] rheller219:
so GPS is working like it should?
[G Tablet General] fosser2:
Yes it is :D
[G Tablet General] Bhups:
This is some serious effort mate!

Well done!
[G Tablet General] april5th:
Love this hack, very interested in taking it on as a little project over the holidays. Takes for the detailed instructions!

How long do you find it takes to get a solid satellite lock with this set up?
[G Tablet General] fosser2:
It depends on a lot of factors (ie. weather and stuff) Normal lock time is 30secs to 1 min. Remember your phones will "lock" faster because they use cell towers to help the gps lock.
[G Tablet General] Doxeng:
cannot get a S - satellite signal on Flashback 10.3

Hello Fosser, Rajeevvp

Thanks for all the help with the GPS, I had been following this thread for a while and finally took the plunge and installed the GPS kit over the slow work week but I'm having no joy getting a satellite signal, the indicator for the GPS receiver turns on and off as it should. That is, the indicator turns on when I start Copilot8 and it turns off when I exit but I cannot get a GPS lock as the sattelites are not found for some reason.

I had used the Honeycomb-GPS-fix-signed update and the Honeycomb-MrGuy-GPS-signed updates, I had renamed the files at \system\lib\hw\ to gps.tegra.so as suggested, whether I used the file from Rajeevvp in post #378 or the one from MrGuy, they very much do the same thing. I took the tablet cover off last night to check if the antenna was connected and everything seemed ok. Before I continue barking at this, is there anything else I need to check?

Is there anyone else actually using this in Flashback 10.3, do I need to go back to 10.1 to get this to work?

Thanks a lot.

Doxeng
[G Tablet General] fosser2:
Sorry, flashback 10.3 is the only one that I haven't used yet. Try downgrading to flashback 10.1 and try it out. Basically go back to something you know "works." Then push forward from there
[G Tablet General] rajeevvp:
See these posts for software troubleshooting:

#341, #317, #450

I suggest that you use the Honeycomb-GPS-fix-signed file from post #417, instead.
[G Tablet General] Doxeng:
Hello Guys,

I'm happy to report the GPS mod is working under Flashback 10.3, my software setup is as described by Rajeevvp in post #417 of this thread.

My issues were due to poor GPS reception due to connection issues at the ANT2 connector. The hardware tutorial has all the needed information. I, however installed all the decoupling capacitors as recommended by the manufacturer

Many thanks, you guys rock!!!!

Doxeng
[G Tablet General] fosser2:
Awesome, nice job getting all those caps in there too!
[G Tablet General] fosser2:
Thought I'd post this here first:

ICS + GTAB + GPS MOD+ Linux Kernel 2.6.39 = WORKING GPS!!!

Now remember the ICS alpha hasn't even been released yet, but I'm working on if :D
[G Tablet General] gierso:
You are tha man..... my tab is sitting happy waiting for an alpha..... is the file posted like 5 days ago the latest one? And does it fix the SOD that makes you have to hardbutton reset your tab?
[G Tablet General] fosser2:
haha as bad as u wanna flash it, i would stay away from it. I have a newer build that i havent distributed yet. Still touching up on lots of stuff. Give it time. You'll get your hands on it soon enough ;)
[G Tablet General] gierso:
Excelent :-) will wait patiently !!
[G Tablet General] rajeevvp:
+1.

Have the interfaces for serial-GPS (both in the kernel and in Android ICS) changed at all, or, are they still the same?
[G Tablet General] fosser2:
They stayed the same. Atm gps stays on at low level all the time. I have to get the "switch" programmed in there. Most of the code is from the Adam guys (go figure). If you wanna take a look at my git its: https://github.com/fosser2/android-tegra-nv-2.6.39
[G Tablet General] rajeevvp:
I see--the gps_control driver hasn't been ported over then. It shouldn't be difficult--I'll see what I can do.
[G Tablet General] fosser2:
Sweet sounds good.
[G Tablet General] Doxeng:
Hello Fosser, Rajeevvp,

My tablet was seriously bricked (down to NVFlash to get it back) when I was recovering I decided to go with GtabCombOver 3.4.2.

After applying the Honeycomb-GPS-fix-signed.zip for the GPS my tablet was fully stuck at the birds, I have to reflash the tablet again to get it back...

Is there any special trick to get the GPS working with GtabCombOver or should I go back to Flashback 10.3 in which the GPS was working fine?

Thanks.

Doxeng
[G Tablet General] rajeevvp:
The 1.2 bootloader version of GtabCombOver-3.4.2 has an oversight in it. See this post for the fix.
[G Tablet General] temporalwar:
Same as USB GPS?
[G Tablet General] rajeevvp:
Try this for USB (serial) GPS modules.
[G Tablet General] fosser2:
rajeevvp,

Today I finally was able to get the power_on text file to enable/disable GPS in our ICS rom. Here is the commit and yes... it was just a simple fix.

https://github.com/TeamDRH/android-...mmit/818019543006ed4869440bb17d91ed8499dce5d1

Now its like it was previously, I can echo 1/0 the file to turn it on and off but there is still a disconnect between android and the power_on file. Like when maps is opened up gps does not turn on. Do you have any ideas on why android would not be able to write a 1/0 to the power_on file? Thanks!!!!

-fosser2

PS: to any of you using this mod still, hopefully we will have this properly fixed and integrated into the next DRH rom!
[G Tablet General] rajeevvp:
Ahh! the things a simple #define will do...

Assuming that the gps.XXX.so to system_server interface hasn't changed in ICS, check the obvious things:

1. The kernel path for the power_on file matches what the gps.XXX.so source uses.

2. The power_on file has the correct permissions (666 for now).

Otherwise, you'll have to see if all the functions in gps.XXx.so are being called by adding debug print messages to each one. Then check for those messages in the Android logs using logcat.
[G Tablet General] fosser2:
It actually wasn't the define. I had previously used that define to physically enable/disable the gps for the kernel's I was releasing. The fix was actually just to comment out the other 2 lines in board.c. I should have seen that earlier because it was telling the tablet to turn gps on during the init. All of the other commands were probably running in the background but the kernel didn't care because those commands trumped all. I will check on the other 2 things and get back to you shortly. Thanks :)
[G Tablet General] rajeevvp:
That's not how the code reads. And, only that last part is correct.

The way ejtagle's coded it (correctly, I might add), gps would be turned on at boot time, but, further calls to the _init() or _poweron() would have no effect at all. Both functions check atomic variables to make sure they do their initialization stuff exactly once. If things are working now, I don't think it's because those 2 functions aren't now being called twice.

This sentence doesn't make any sense. See above.
[G Tablet General] fosser2:
In the file board-smba1002.c the 2 functions in bold were the culprits. Ejatagle had the code set up properly (I believe) for the vega. RaYmAn and MrGuy added the 2 functions in bold to the board.c file so that on boot, GPS would init and stay on until power was off. With both of those lines in there you could echo the power_on file all day and it would have no effect. As soon as you remove those 2 lines from the processes that get initiated on boot, the echo 0/1 works like it should. I am still looking through the code, to see why android is not properly toggeling gps, but I believe it is a permission issue set in the init.harmony.rc. I had a busy weekend and ran out of time to look into this further.

/* Register Camera powermanagement devices */
smba_camera_register_devices();

/* Register NAND flash devices */
smba_nand_register_devices();

/* Register SDHCI devices */
smba_sdhci_register_devices();

#ifdef SMBA1002_GPS
/* Register gps powermanagement devices */
smba_gps_pm_register_devices();
[B]smba_gps_mag_init();
smba_gps_mag_poweron();[/B]
#endif
tegra_release_bootloader_fb();
[G Tablet General] rajeevvp:
+1. Yeah, you're right about this. It is those 2 functions, but, only because

a) a counter is being used instead of a boolean for the power-on/-off checks, and

b) a duplicate check for the same thing is being done in board-smba1002-pm-gps.c.

What you've done also works, but, it's better to fix the tests to make it match the intent of the code. In actuality, it would be simpler to just remove the atomic test from the _poweron()/_poweroff() functions. Similarly, the calls to the various regulator_*() functions in board-smba1002-pm-gps.c are, I think, unnecessary. You can remove those also for the gTablet.

That explains why there is a mis-match between what was intended and how the code actually works.

That's only because of the duplicate tests combined with a counter being used instead of a boolean for the checks. See the code.
[G Tablet General] fosser2:
Rajeevvp,

I looked through the init's and I think that everything "should" be in working order. I'm still stuck at why android is not writing to the power_on file. If you have any other ideas feel free to let me know. Thanks :)
[G Tablet General] rajeevvp:
The smba_gps_mag_init() is not the problem. It's the test in the poweron/off functions.
[G Tablet General] fosser2:
Sorry I meant init.harmony.rc and init.rc...
[G Tablet General] rajeevvp:
Put debug messages into all of the Android interface functions in the gps.XXX.so source. Then post the logcat output.
[G Tablet General] fosser2:
Rajeevvp,

Is there any other tablets that are "newer" and have similar gps's to what is installed in my gtab. Basically the .39 gps driver needs to be updated at kernel level and I was hoping to find some newer code that would work better with kernel 3.1. Thanks :)

EDIT: I looked through grouper (n7) and the xoom kernels. The xoom has a gps kernel file it seems, but I have no idea how the grouper kernel works... There was only like 3 lines of gps code in there. I only looked through the board files.

EDIT2: looking through the ventana files this seems to be the only gps code...

static int __init ventana_gps_init(void)
{
struct clk *clk32 = clk_get_sys(NULL, "blink");
if (!IS_ERR(clk32)) {
clk_set_rate(clk32,clk32->parent->rate);
clk_enable(clk32);
}

tegra_gpio_enable(TEGRA_GPIO_PZ3);
return 0;
}
ventana_gps_init();

Obviously this sets a clock and turns on a gpio. Is this really all that is needed for gps to work (at kernel level)? Recall this is the file that we are currently use to toggle gps...

Here is the xoom gps code (still much smaller than the mess I'm using in .39)

lastly, UART-B is the gps port right?
[G Tablet General] rajeevvp:
It shouldn't be difficult to port the 2.6.39.x GPS GPIO control driver to 3.1. In fact, given the simplicity of that code, it should be very straightforward. It just allocates a GPIO line, then toggles it.

The Xoom (Ventana) GPS is very different to your Linx RXM GPS module in many ways (see this post). I wouldn't rely on it for guidance.

No idea. Never looked into the mapping from board UART to Unix serial device. As long as NMEA data appears on some serial tty device, it should be OK as far as userspace is concerned.
[G Tablet General] fosser2:
Alright thanks for the reply. I will be re-working this kernel driver and will let you know if it works again :)
[G Tablet General] cemslam:
Can the poster update this thread (pictures) ? THANK YOU FOSSER2, YOU ARE GREAT!!!
[G Tablet General] fosser2:
Pics are working again. That site must have just had a bad day.
[G Tablet General] shrishadn:
Internal gps module

Hi ,

After installing this InternalGPSTab_aplha3.apk my gps started to work. I was porting gps for our tablet which has ics.

What exactly this app do and what and were we have to make changes in the code to make gps work without this app.

please help.

thanks,

shrisha
[G Tablet General] rajeevvp:
You will need to a new gps.XXX.so (where XXX is some platform name) native GPS interface library for your ROM. And, to create a new GPS library, you will need to either write, or port, some C source code. And, to do that you will need the exact specs for your internal GPS module--how it is connected to the tablet board; where GPS data appears; GPS data formats; etc.
[G Tablet General] fosser2:
Rajeevvp,

I'm looking into some new ways to enable gps and I'm wondering if you can look through the following code for me quick.

From board.c

static int __init smba_gps_init(void)
{
tegra_gpio_enable(SMBA1002_GPSMAG_DISABLE);
return 0;
}

static void __init tegra_smba_init(void)
{

smba_gps_init();

}

Obviously all the above code does is set a GPIO on start of the kernel. In that code there is no "control" of the gps power, its just always on until the tablet turns off. I then found the next set of code in init.xxxx.rc.

# GPS init
write /sys/class/gpio/export 162
write /sys/class/gpio/gpio162/value 0
write /sys/class/gpio/gpio162/direction out
chown gps system /sys/class/gpio/gpio162/value
chmod 0664 /sys/class/gpio/gpio162/value
mkdir /data/gps
chown gps system /data/gps
chmod 770 /data/gps
chown gps system /dev/ttyHS1
chmod 0660 /dev/ttyHS1

Obviously the gpio162 above should actueally be gpio171 for our tablet, but you get the point.

Would this combination of code be enough to enable/disable this gps? Thanks for the replay.

-fosser2
[G Tablet General] rajeevvp:
I'll need to see more than that single code fragment to say something definite. Post a link to the kernel source tree that you're planning to use.

No. Looks like this kernel code has regularized GPIO access--moving most of the previously in-kernel GPIO setting-up stuff out into userspace. Again, I'll need to see the kernel code backing up these new files in /sys, but, it looks to me like you'll have to change that AdamGPS gps.XXX.so code to manipulate these different files now.