[2008.8] TangoGPS/gpsd and suspend/resume
Mike (mwester)
mwester at dls.net
Mon Sep 15 01:20:04 CEST 2008
Radek Bartoň wrote:
> Hi all.
>
> Is GPS supposed to work after suspend wake up?
I guess that's a matter of one's expectations; I can see strong
arguments that would say that GPS should not be suspended in the first
place (i.e. the GPS chip should remain running while the host CPU is
suspended, so that it can keep track of where we've been). The counter
to that argument is a technical one -- the GPS units can't keep their
own log info, so the host CPU needs to stay running in the first place
if you want the GPS to keep track of where one has been continuously,
and that therefore if userspace lets the host cpu suspend then it might
as well shut off the GPS too.
The way it works in the kernel is the latter assumption: power to the
GPS is turned off on suspend, and remains off (regardless of original
state) on resume. It is left to user-space to re-initialize the GPS on
resume, if a user-space application wishes to, but the primary
assumption is that if you want the GPS to stay running, don't let the
device suspend in the first place.
> I mean when I suspend Neo with TangoGPS running and GPS fixed and then wake up
> after while, should be GPS position updated after short period of time (for
> hot reset or something like that) without TangoGPS restart needed or track
> logging stopped? I'm asking because I didn't experienced this reasonable
> behavior in any of 2008.8 version I've tried nor any other distro (ASU,
> FDOM).
>
> If this is not implemented "feature" what is need to be done in theory to
> achieve that and what can I do to implement this?
You need to have something that executes post-resume (an apm resume
script, for example, on distros that use apm to handle suspend/resume).
This "something" would need to determine if the GPS needs to be powered
up, and then go through the necessary steps to power up the chip, and
signal or restart the application that manages the serial port data from
the GPS (gpsd, or whatever it might be on your device/distro). Perhaps
TangoGPS may also need a SIGSOMETHING_OR_OTHER sent to it to make it do
whatever is necessary to handle a "jump" in location and time -- that
would depend on the application itself.
This might all be trivial if your application was written with some of
these assumption in mind, or you might find that killing the application
and doing a complete restart of it is necessary if the application has
difficulty with sudden clock shifts and such.
Mike (mwester)
More information about the devel
mailing list