Package: gpsd
Version: 2.33-4
Severity: important
(I'm unsure if this should be RC or not; it's possible to work around
depending on your GPS, though.)
gpsd has the concept of a "cycle", that is, a set of related data from
the GPS receiver. It tries to identify these cycles by the timestamps
contained in some lines, such as the GLL and ZDA lines; if the
timestamp differs from the last one, the "start a new cycle" flag is
set, and the current fix information is thrown away entirely to make
room for new data.
Unfortunately, the logic looks like this (libgpsd_core.c, starting at
line 577):
session->gpsdata.sentence_time = NAN;
[...]
received = session->device_type->parse_packet(session);
parse_packet, in turn, contains the logic that compares
session->gpsdata.sentence_time with the timing information from the line
that was just read. Unsurprisingly, this check will always return
"different from last time" (after all, it was just set to NaN!), so
_any_ NMEA command with timing information will start a new cycle. This
means that if you have two commands that both have giming information
(such as GGA and ZDA), gpsd will think it deals with two different
cycles, and fluctuate between the information they give. This gives
completely bogus fix and altitude information, among others -- probably
a lot of other issues as well. (xgps seems to have a similar issue, but
I haven't bothered to debug it.)
The following patch sets the sentence time to NaN at initialization time
only, which AFAICS would be the _correct_ logic. However, I fear that it
might uncover other latent bugs -- after all, if _no_ line contains
timing information, a new cycle would _never_ get set. It makes gpsd'
output a lot more sane here, though, and ultimately I believe it is
correct, so please consider applying it. :-)
diff -ur gpsd-2.33/libgps.c gpsd-2.33.patched/libgps.c
--- gpsd-2.33/libgps.c 2006-06-09 14:34:09.000000000 +0200
+++ gpsd-2.33.patched/libgps.c 2007-02-07 23:54:13.000000000 +0100
@@ -142,6 +142,7 @@
}
gpsdata->status = STATUS_NO_FIX;
+ gpsdata->sentence_time = NAN;
gps_clear_fix(&gpsdata->fix);
return gpsdata;
/*@ +branchstate @*/
diff -ur gpsd-2.33/libgpsd_core.c gpsd-2.33.patched/libgpsd_core.c
--- gpsd-2.33/libgpsd_core.c 2006-06-07 17:04:52.000000000 +0200
+++ gpsd-2.33.patched/libgpsd_core.c 2007-02-07 23:54:29.000000000 +0100
@@ -574,7 +575,6 @@
(char *)session->outbuffer,
(size_t)session->outbuflen, 2);
/*@ -nullstate @*/
- session->gpsdata.sentence_time = NAN;
session->gpsdata.sentence_length = session->outbuflen;
session->gpsdata.d_recv_time = timestamp();
-- System Information:
Debian Release: 4.0
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1,
'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.19.1
Locale: LANG=nb_NO.UTF-8, LC_CTYPE=nb_NO.UTF-8 (charmap=UTF-8)
Versions of packages gpsd depends on:
ii debconf [debconf-2.0] 1.5.11 Debian configuration management sy
ii libc6 2.3.6.ds1-11 GNU C Library: Shared libraries
ii libdbus-1-3 1.0.2-1 simple interprocess messaging syst
ii libgcc1 1:4.1.1-21 GCC support library
ii libstdc++6 4.1.1-21 The GNU Standard C++ Library v3
ii lsb-base 3.1-23 Linux Standard Base 3.1 init scrip
ii netbase 4.29 Basic TCP/IP networking system
Versions of packages gpsd recommends:
ii gpsd-clients 2.33-4 clients for the GPS daemon
ii python 2.4.4-2 An interactive high-level object-o
-- debconf information:
* gpsd/start_daemon: true
* gpsd/device: /dev/ttyUSB0
* gpsd/daemon_options:
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]