Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location timing issues #211

Open
ploink opened this issue Mar 3, 2021 · 2 comments
Open

Location timing issues #211

ploink opened this issue Mar 3, 2021 · 2 comments
Labels

Comments

@ploink
Copy link

ploink commented Mar 3, 2021

I have noticed timing issues with apps that use network location. Often it makes it very slow or impossible to get a location.

Using the latest microg v0.2.17.204714 but this has been a problem - if i remember correctly - since gmscore v0.2.11, that includes UnifiedNlp 2.0-alpha6.

After some testing with my Hellocation test app in combination with my fork of Local-GSM-Backend I noticed the following behaviour:

  1. The network location update interval cannot be shorter than 30 seconds. When an app requests updates faster than that, microG/Unifiednlp limits it to 30 seconds.
  2. No location update is performed until the first 30 seconds have expired, then you get an update every 30 seconds.
  3. When you close the app that requests the updates, then launch it again and restart location updates, the 30s timer is not reset. It means you have to wait anything between 0 and 30 seconds depending on the state of the location update timer.

Edit:
I did most of my testing with a previous microg version and things seem to have improved. There is still the 30s minimum, which I think is a bit slow but would need to compare with Gapps for reference. The behaviour is a little different but I can still get in a situation that it takes a while before the first location is requested. Will do some more testing.

@jwrdegoede
Copy link

I'm seeing similar network location timing issues on a lineage-17.1 + latest micro-G config. I've run several tests and the amount of time between updates (and the amount of time when only a "stale" location is available) seems to depend on which Nlp providers are used:

  • Networklocation works with 5 seconds ok + 10 seconds stale data when downgrading mozilla NLP (IchnaeaNlpBackend) to version 1.3.3
  • Where as with mozilla NLP 1.5.0 I only see a proper up2date network location once every minute / couple of minutes and when starting an app inside the cooldown window it seems no data is provided instead of the last location with a flag that it is old-data, breaking many apps
  • The mozilla NLP 1.5.0 issue is likely caused by: microg/IchnaeaNlpBackend@174e736 . Maybe in combination with GmsCore including the UnifiedNlp v2.0-alpha# versions
  • Networklocation works fine when using Apple Wifi NLP as sole provider

If you have no objection against using the Apple Wifi webAPIs (and thus sending some data to Apple) then using the Apple Wifi NLP provider from F-Droid is a good workaround for the timings issues. At least this seems to work well for me.

@jwrdegoede
Copy link

A quick update on this, I just retried this on a fresh install and for the apple backend to work properly I also need to disable the "throttle wifi scanning" option under developer options and then disable + re-enable the apple wifi backend in the microg location settings.

Without this the apple backend was behaving quite similar to the mozilla NLP (IchnaeaNlpBackend) version 1.3.3 case, where Networklocation works with 5 seconds ok + 10 seconds stale data. Unfortunately disabling "throttle wifi scanning" does not help for the 1.3.3 mozilla NLP backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants