5,595,067 Members 40,257 Now Online
XDA Developers Android and Mobile Development Forum

Adapter program to enable assisted GPS on the Verizon xv6800 "MR1" (WM 6.1) ROM

Tip us?
 
Skywing
Old
(Last edited by Skywing; 12th September 2008 at 05:50 PM.)
#1  
Member - OP
Thanks Meter 0
Posts: 96
Join Date: Jan 2008
Default Adapter program to enable assisted GPS on the Verizon xv6800 "MR1" (WM 6.1) ROM

I've written up a program that will enable the use of assisted GPS on the MR1 Verizon ROM. This may be of use to you if you do not want to use a custom ROM, -or- you cannot get GPS working on a custom ROM.

Note: This method does not currently work on dcd's releases. My code has only been verified to work on the Verizion MR1 ROM. I believe this is because the Sprint GPS intermediate driver does not support the DRM/locked down GPS functionality required to talk to gpsOne once the firmware has been programmed for locked down GPS mode.

You can always flash back to MR1 from a custom ROM. If you already have GPS working on your custom ROM, this is probably not necessary, and you should keep your existing ROM.

A cab installer (courtsey of gc14) can be found here: http://forum.xda-developers.com/atta...4&d=1220913180. Note that due to a bug in the .cab file, you cannot automatically uninstall the cab, but you can just manually delete the files that it installs (see below to discover which files those include).

Otherwise, you can manually install the program, as detailed below.

The installation of my GPS adapter is a bit complicated right now, and this is a fairly beta release. I have only tested it with Google Maps. However, it should work with any GPS-enabled program that can use the standard GPSAPI.dll functions.

Note that your GPS program must be configured to use Windows-managed GPS and not an explicit COM port. My adapter module does not support the NMEA serial interface, only the "cooked" GPSAPI.dll interface. Notably, the HTC GPC Test program uses the NMEA COM port interface, and will not work with the GPS adapter.

The GPS adapter system consists of several parts under the hood:

- gpssrv.exe, a program that I wrote which understands how to decrypt GPS data from the chipset when it is operating in locked down GPS mode. This program acts as an intermediary server, through which all GPS clients can indirectly access location information.
- gpsapi.dll, a replacement for the OS-level gpsapi.dll. The replacement DLL communicates with gpssrv.exe to retrieve positioning information. This model allows multiple programs to receive GPS data at the same time, as the locked down GPS interface only supports one concurrent user.
- oemgpsOne.dll, a modified version of the Verizon oemgpsOne.dll module for communicating with the gpsOne chipset driver.
- stdgps.dll, a copy of the standard OS gpsapi.dll. Due to limitations in Windows CE, this needs to have a different name than the replacement gpsap.dll. It is otherwise identical to the shipping version of gpsapi.dll.

To install the GPS adapter, you should grab the program files at the following URL:

http://www.nynaeve.net/Skywing/xv6800gps/gpsserver.zip

Currently, there's no CAB installer, so all of the installation must be done manually. Sorry. A CAB may come later on, if someone feels like doing the work to build one for me.

After extracting the zip onto your device, follow these instructions:

1. Create a "\Program Files\GPSServer" directory on your device.
2. Copy gpssrv.exe, oemgpsOne.dll, and stdgps.dll to "\Program Files\GPSServer".
3. Copy gpsapi.dll into the directory where your GPS program resides. For example, "\Program Files\GoogleMaps".

Optionally, you can copy gpsapi.dll to your \Windows directory instead of the directory for the main .exe of your chosen GPS application. This may be more reliable, as if something loads the Windows-supplied gpsapi.dll before the custom gpsapi.dll, things will break. Doing this is slightly more complicated.

To (optionally) copy the new gpsapi.dll to your \Windows directory, you may use these steps:

1. Rename gpsapi.dll to something else (e.g. "gpsapix.dll").
2. Copy the renamed gpsapi.dll to \Windows
3. Rename the renamed gpsapi.dll in \Windows back to gpsapi.dll.

The renaming juggling is necessary as File Explorer will otherwise refuse to supersede an XIP ROM file. You can simply delete \Windows\gpsapi.dll after doing these steps to revert back to the standard Windows gpsapi.dll, without having to hard reset your device, although this will again break GPS for you.

After that, you should be able to start your GPS program (e.g. Google Maps) and receive location data. Note that being inside in a shielded location may impede the process of acquiring a GPS fix. Also, to gain the benefit of assisted GPS mode, you need to have an active cell data connection, and you should not be connected to ActiveSync or Wi-Fi.

There are some registry settings that you can create on the device to tweak how the GPS adapter functions:

REG_SZ HKEY_LOCAL_MACHINE\Software\Valhalla Legends\GPSServer\ServerPath = "Path to gpssrv.exe". Defaults to "\Program Files\GPSServer\gpssrv.exe" if not set.
REG_DWORD HKEY_LOCAL_MACHINE\Software\Valhalla Legends\GPSServer\AllowDeviceStateChange = 0/1. Defaults to 0 if not set. If set to 1, then gpsapi.dll will send device state change notifications to your GPS program. Some programs appear to have buggy GPS handling (Google Maps in particular), and will break if this option is set.
REG_DWORD HKEY_LOCAL_MACHINE\Software\Valhalla Legends\GPSServer\PDEAddress = IP address of the PDE to use. Defaults to 0x845FAE42.
REG_DWORD HKEY_LOCAL_MACHINE\Software\Valhalla Legends\GPSServer\PDEPort = Port number for the PDE. Defaults to 8888.
REG_DWORD HKEY_LOCAL_MACHINE\Software\Valhalla Legends\GPSServer\Mode = gpsOne mode to set. Defaults to 2.
REG_DWORD HKEY_LOCAL_MACHINE\Software\Valhalla Legends\GPSServer\QoSAccuracy = Relative fix accuracy requested. Defaults to 64. (Max of 255, higher values request a more accurate fix, but this may increase the time to acquire a fix.)
REG_DWORD HKEY_LOCAL_MACHINE\Software\Valhalla Legends\GPSServer\QoSPerformance = QoS performance flag. Defaults to 10. As to what effect this has on the gpsOne chipset, I'm not entirely certain yet. Debugging reveals that the value internally is called the QoS performance value, hence the name. The meaning of this value is likely buried in some gpsOne technical document that I have not found yet.
REG_DWORD HKEY_LOCAL_MACHINE\Software\Valhalla Legends\GPSServer\FixInterval = Time, in milliseconds, between requests to the gpsOne chipset for an updated GPS fix. Defaults to 1000.

The default values should work fine, so you don't need to bother with the registry values unless you really want to. Most of the defaults were gathered by researching the settings that VZ Navigator uses internally.

---

Program compatibility list:

---

- Only programs that use GPSAPI.dll and not a COM port will work with the adapter. Most GPS programs will support using GPSAPI.dll.

- Google Maps will function if you configure it such that the GPS setting is set to "Managed by Windows". This is the default setting. Also, remember to check "Use GPS" in the menu when you start Google Maps, in order to enable GPS inside of Google Maps.
- Live Search will function if you configure it such that the GPS setting is set to "GPS Intermediate Driver". This is the default setting.
- HTC GPS Tool will not work properly, as it can only use a COM port.
- If you want to use VZ Navigator after having installed the GPS adapter, then you need to place oemgpsOne.dll and stdgps.dll in \Windows.

---

Other notes:

- The GPS adater does not enable free use of VZ Navigator. It only allows third party programs that are designed to talk to the standard Windows Mobile GPSAPI.dll interface to operate on the xv6800 MR1 ROM.
- You do not need to manually start gpssrv.exe. When a program loads the custom gpsapi.dll and requests a position fix, gpssrv.exe will be automatically started on demand to power up the gpsOne hardware and start acquiring position data. It will automatically turn off the gpsOne hardware and exit on its own 60 seconds after there are no programs open that are still requesting a GPS fix.

---

Troubleshooting:

Here are some steps that you can take if you are having problems getting things to work.

1) Make sure that you're on the Verizion MR1 ROM and not a third party custom ROM, or the original release Verizion ROM.
2) Make sure that your Location setting is set to "LOCATION ON" and not "911 ONLY" in your Phone > Services > Location settings.
3) Make sure that your GPS program is configured to use Windows-managed GPS or "GPS Intermediate Driver", and not a specific COM port.
4) Give the following test program a try, to verify that GPS is working in general. The test program does not require the GPS adapter to run. If the test program can receive GPS data, then either the GPS adapter program is not installed correctly, or your GPS-enabled application is not configured properly. If the test program cannot receive GPS data, then you have a different problem (perhaps your location option is still set to 911 only?). Test program link: http://www.nynaeve.net/Skywing/xv6800gps/gpstest.zip
 
Skywing
Old
#2  
Member - OP
Thanks Meter 0
Posts: 96
Join Date: Jan 2008
Reserved for future updates.
 
stevefxp
Old
(Last edited by stevefxp; 7th September 2008 at 08:01 PM.)
#3  
Senior Member
Thanks Meter 12
Posts: 466
Join Date: Oct 2007
Default Adapter

Downloading now but awfully slow.

I will also work on a cab install for you too.

Steve
 
scrawnyb
Old
#4  
Senior Member
Thanks Meter 0
Posts: 176
Join Date: Jun 2008
Location: Mechanicsburg, PA
so this is just a modified version of the Verizon GPS driver?

I was wondering if it would be possible to OEM that into one of the Custom ROMS through the kitchen and making it work without a hitch (assuming this program replaces those bad .dll files)
Toys:

Droid X on VorteX ROM
HP Touchpad 32GB on CM7.1 A3.5 XRONified
 
Skywing
Old
#5  
Member - OP
Thanks Meter 0
Posts: 96
Join Date: Jan 2008
No, it's a bunch of new code that I wrote that understands how to decrypt the obfuscated GPS data returned by the Verizon GPS driver, when the firmware is in locked down GPS mode.
 
Skywing
Old
#6  
Member - OP
Thanks Meter 0
Posts: 96
Join Date: Jan 2008
Posted a new version (updated gpssrv.exe and gpsapi.dll, be sure to update both files when you upgrade).

This release fixes compatibility with Windows Live Search, adds support for caching position across API calls (required for some GPS programs), and fixes a number of bugs.

Please let me know if you have any issues with it.
 
thundaar2000
Old
(Last edited by thundaar2000; 7th September 2008 at 11:29 PM.)
#7  
thundaar2000's Avatar
Senior Member
Thanks Meter 1
Posts: 116
Join Date: Dec 2007
Location: New England
Quote:
Originally Posted by Skywing View Post
Note that your GPS program must be configured to use Windows-managed GPS and not an explicit COM port. .
I use Iguidance that requires me to choose a port. How would I tell it to use the above method? There is an option to search for a gps. Should I try to find it that way?
The gpssrv.exe file, does it need to be run at some point?
 
Skywing
Old
#8  
Member - OP
Thanks Meter 0
Posts: 96
Join Date: Jan 2008
If the program can only do NMEA serial, then it's not going to work, unfortunately. Reimplementing the virtual serial port interface is much more complicated to do on my end than reimplementing the GPSAPI.dll interface.

If your program has an "automatic", "use Windows settings", or "GPS Intermediate Driver" option, those options would typically mean that the GPSAPI.dll functions instead of NMEA serial will be used (if selected).
 
thundaar2000
Old
#9  
thundaar2000's Avatar
Senior Member
Thanks Meter 1
Posts: 116
Join Date: Dec 2007
Location: New England
Doesn't work...
If anyone gets this to work with Iguidance v4.0 PLEASE let me know!!
 
kdj67f
Old
#10  
kdj67f's Avatar
Senior Member
Thanks Meter 68
Posts: 658
Join Date: Jan 2008
Location: Maple Valley

 
DONATE TO ME
I just wanted to say great work to Skywing. I dont have any gps problems anymore, but I must commend you for coming up with solutions to help.

No real value to this post, just to say thanks to the community in general!
HTC One (S-off, stock, TWRP, rooted)
HTC Rezound (S-off tester phone)
HTC Incredible (old reliable backup)
Kindle Fire, Viewsonic Gtablet, Zune HD
Since Windows Mobile 2003SE

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Get the AOSP Lock Screen on Your ICS-Powered Samsung Device

Android is the only popular mobile operating system that allows users, … more

Motorola Droid RAZR HD and M to Receive KitKat in a “Few More Weeks”

Verizon and Motorola shocked us all back in November when … more

[APK] YouTube Update to 5.6 Now Lets You Cast Live Video to Your Chromecast

Earlier today, we talked about how Google brought two new apps to … more

[OTA Captured] Android 4.4.2 Now Rolling Out to the AT&T Galaxy S 4 Active

A little under two months ago, AT&T started rolling out … more