Remove All Ads from XDA

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

96 posts
Thanks Meter: 0
By Skywing, Member on 7th September 2008, 07:20 PM
Thread Deleted Subscribe to Thread Email Thread
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: 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:

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.



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:
Last edited by Skywing; 12th September 2008 at 05:50 PM.
7th September 2008, 07:21 PM |#2  
OP Member
Thanks Meter: 0
Reserved for future updates.
7th September 2008, 07:55 PM |#3  
Senior Member
Thanks Meter: 12
Downloading now but awfully slow.

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

Last edited by stevefxp; 7th September 2008 at 08:01 PM.
7th September 2008, 09:53 PM |#4  
Senior Member
Flag Mechanicsburg, PA
Thanks Meter: 254
Donate to Me
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)
7th September 2008, 10:04 PM |#5  
OP Member
Thanks Meter: 0
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.
7th September 2008, 10:23 PM |#6  
OP Member
Thanks Meter: 0
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.
7th September 2008, 11:26 PM |#7  
thundaar2000's Avatar
Senior Member
Flag New England
Thanks Meter: 1
Originally Posted by Skywing

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?
Last edited by thundaar2000; 7th September 2008 at 11:29 PM.
8th September 2008, 12:25 AM |#8  
OP Member
Thanks Meter: 0
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).
8th September 2008, 12:41 AM |#9  
thundaar2000's Avatar
Senior Member
Flag New England
Thanks Meter: 1
Doesn't work...
If anyone gets this to work with Iguidance v4.0 PLEASE let me know!!
8th September 2008, 01:08 AM |#10  
kdj67f's Avatar
Senior Member
Flag Maple Valley
Thanks Meter: 72
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!
8th September 2008, 02:41 AM |#11  
OP Member
Thanks Meter: 0
Originally Posted by thundaar2000

Doesn't work...
If anyone gets this to work with Iguidance v4.0 PLEASE let me know!!

You might try and see if you get location data returned by Google Maps, which will work if you do not configure it to use a specific COM port.

Read More
Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes