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

Search This thread

Skywing

Senior Member
Jan 29, 2008
96
0
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://xdaforums.com/attachment.php?attachmentid=111774&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
 
Last edited:

stevefxp

Senior Member
Oct 16, 2007
495
12
Adapter

Downloading now but awfully slow.

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

Steve
 
Last edited:

scrawnyb

Senior Member
Jun 23, 2008
399
1,007
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)
 

Skywing

Senior Member
Jan 29, 2008
96
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.
 

Skywing

Senior Member
Jan 29, 2008
96
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.
 

thundaar2000

Senior Member
Dec 31, 2007
116
1
New England
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:

Skywing

Senior Member
Jan 29, 2008
96
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).
 

kdj67f

Senior Member
Jan 23, 2008
665
72
Maple Valley
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!
 

ga_madman

Member
Sep 7, 2008
5
0
I just downloaded the adapter zip and followed the instructions to a "T" and was able to get a lock on some sat's using GPS Viewer, but spent an hour or better trying to get GOOGLE maps or LIVE Search to work and neither one could get a lock on any sat's... Any ideas?

Thanks,
GA MADMAN
 

Skywing

Senior Member
Jan 29, 2008
96
0
Are you certain that you placed gpsapi.dll in \Windows or in the directory with GoogleMaps.exe?

Other things to check:

- Make sure location is enabled in your phone setting. I assume that you have already done this, however.
- Make sure that Google Maps has the GPS confiugration set to "Managed by Windows".
 

kilgore19K

New member
Sep 8, 2008
2
0
Skywing,

Thanks for posting this software. I look forward to using it. I am convinced that mine is not working because I have not replaced the file in the \Windows folder.

I cannot rename it, I am using Total Commander.

I am convinced that I cannot rename it because something is using it.

I have a pretty basic install of XV6800 with MR1. Just a couple of programs installed.

Any advice on how to rename the file?

Thanks
 

Skywing

Senior Member
Jan 29, 2008
96
0
New build did not get put up properly; this has been remedied. Please re-grab the .zip if you had previously downloaded it before this message, and then update all of the files.

Note that you need to completely delete the gpsapi.dll in \Windows and then do the renaming trick again, otherwise, File Explorer will claim to copy the new file over, but it will actually delete it and switch to the ROM version.
 

Skywing

Senior Member
Jan 29, 2008
96
0
Skywing,

Thanks for posting this software. I look forward to using it. I am convinced that mine is not working because I have not replaced the file in the \Windows folder.

I cannot rename it, I am using Total Commander.

I am convinced that I cannot rename it because something is using it.

I have a pretty basic install of XV6800 with MR1. Just a couple of programs installed.

Any advice on how to rename the file?

Thanks

No idea about using Total Commander for it. You can use the (cumbersome, but working) steps I posted with the built in File Explorer (fexplore.exe) program. Those steps are confirmed to work.
 

Mugenakuma

Member
Jan 19, 2008
27
6
I also followed each step and my XV6800 is unable to get a GPS location in either Google maps or Live search.
 

exbabylon

New member
Sep 8, 2008
2
0
THANK YOU!

Thank you for the amazing tool!!! This has my MR1 ROM running GPS fast and efficiently. Let me know if I can be of any assistance... I have access to some webhosting space and other resources to keep this project alive if needed.