gpslogger icon indicating copy to clipboard operation
gpslogger copied to clipboard

FR: Passive logging debounce

Open sshaikh opened this issue 6 months ago • 7 comments

It seems that there are time when the scheduled GPSL location request causes another app to also request a location. If passive logging is set, then this causes two locations to be logged (and sent) very close together. Due to the accuracy differences, this plays havoc with reasonable location tracking. For example I see the following speeds logged:

Image

The pairs of immediate logs cause those spikes. They are milliseconds apart.

I do not see these during high frequency logging, so it seems to be an issue with sporadic checks.

So the feature request is to ignore passive GPS requests when they occur within a certain time (eg 1s) of a successful scheduled log.

sshaikh avatar Jun 21 '25 13:06 sshaikh

The v134 release (based on PR #1213) has already implemented similar functionality.

LOVE2CMOL avatar Jul 07 '25 17:07 LOVE2CMOL

Amazing, I'll play and feedback if required.

sshaikh avatar Jul 07 '25 18:07 sshaikh

@LOVE2CMOL Actually on reviewing the code, I'm not sure if this would help the situation described in this issue. The problem isn't too frequent passive logs between other passive logs, but subsecond passive logs after a native GPS log.

Have I understood the functionality correctly? If the setting is set to 5s, will it ignore passive logs received within 5s of /any/ log or just the last passive log?

sshaikh avatar Jul 07 '25 21:07 sshaikh

@LOVE2CMOL Actually on reviewing the code, I'm not sure if this would help the situation described in this issue. The problem isn't too frequent passive logs between other passive logs, but subsecond passive logs after a native GPS log.

Have I understood the functionality correctly? If the setting is set to 5s, will it ignore passive logs received within 5s of /any/ log or just the last passive log?

Basically with a 5s interval: record first data point → ignore everything for 5s → record next. Tried putting this in the passive listener's interval first, but it didn't work - that's why using the filter approach now.

One of the reasons I implemented this filter was actually the same issue you encountered.

For instance, the issue of location coordinates rapidly oscillating between two points within a short timeframe. This actually stems from Android's WorkManager submission mechanism, which in many cases doesn't guarantee execution order.

https://github.com/mendhak/gpslogger/issues/1201#issuecomment-2778771096

LOVE2CMOL avatar Jul 08 '25 12:07 LOVE2CMOL

with a 5s interval: record first data point

This is irrespective of where it came from (eg GPS vs network vs passive)? If so that's exactly what I'd need. Unfortunately I'm still receiving logs in quick succession - set to 5s, I still have the same issue:

Image

Thank you also for the WorkManager detail (helpful for something else I'm looking at).

sshaikh avatar Jul 10 '25 17:07 sshaikh

with a 5s interval: record first data point

This is irrespective of where it came from (eg GPS vs network vs passive)? If so that's exactly what I'd need. Unfortunately I'm still receiving logs in quick succession - set to 5s, I still have the same issue:

Image Thank you also for the WorkManager detail (helpful for something else I'm looking at).

My implementation only throttles passive data - your case might involve other data submissions. The passive filter uses timestamp comparison and will block submissions to WorkManager if intervals are unsatisfied. Recommend checking gpslogger's internal logs for additional clues.

LOVE2CMOL avatar Jul 14 '25 15:07 LOVE2CMOL

Yes, that was what I was asking above. In that case unfortunately your feature does not fix the issue I am experiencing[1], an a more general debounce might be useful.

[1] where GPS logs are immediately generating passive logs.

sshaikh avatar Jul 14 '25 16:07 sshaikh