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

High system load on android after deselecting "rules->lock on road" #1230

Open
gefin opened this issue Mar 7, 2023 · 3 comments
Open

High system load on android after deselecting "rules->lock on road" #1230

gefin opened this issue Mar 7, 2023 · 3 comments

Comments

@gefin
Copy link
Contributor

gefin commented Mar 7, 2023

If you deselect rules -> "Lock on road" while navit has a GPS fix the system load rise
to 100% on the used core.

I found the problem trigger at navit.c navit_vehicle_update_position() at

if (this_->route) { if (tracking) route_set_position_from_tracking(this_->route, tracking, pro); else route_set_position(this_->route, &cursor_pc); }

It look like route_set_position() is called to often and maybe trigger a loop or excessive recalculations. I'm not able to debug this down.
If i add a timed Rate limit e.g. some seconds all work well.

The problem is tested with navit 0.5.0. to navit 0.5.6
Testdevice "LG K9 Android 7.12" and "Samsung S3 mini linage 13"

Thanks for your work.

p.s. please tel me a Linux distribution where i can build the actual version for android. My ubuntu work only till 0.5.3

@gefin gefin changed the title High system load on android after deselecting "rules->lock on roed" High system load on android after deselecting "rules->lock on road" Mar 7, 2023
@gefin
Copy link
Contributor Author

gefin commented Mar 12, 2023

Now i got my enviroment to compile navit. Setting ANDROID_HOME solved the error.

The high load is not a "logical" fail, but android GPS send position updates very often.
A new GPS position is delivered before the function route_set_position() complete on my hardware.

I will try to sort out GPS updates with no or with only minimal position change.

@OLFDB
Copy link
Contributor

OLFDB commented Mar 17, 2023

https://developer.android.com/training/location/change-location-settings

You could configure Android to send updates only at a specified interval:

Update interval
setInterval() - This method sets the rate in milliseconds at which your app prefers to receive location updates. Note that the location updates may be somewhat faster or slower than this rate to optimize for battery usage, or there may be no updates at all (if the device has no connectivity, for example).

Fastest update interval
setFastestInterval() - This method sets the fastest rate in milliseconds at which your app can handle location updates. Unless your app benefits from receiving updates more quickly than the rate specified in setInterval(), you don't need to call this method.

@gefin
Copy link
Contributor Author

gefin commented Mar 21, 2023

I tried to change a line in navit/android/src/org/navitproject/navit/NavitVehicle.java :
sLocationManager.requestLocationUpdates(mFastProvider, 0, 0 , sFastLocationListener);

and replaced 0, 0, with 1000, 1 (minimum 1 second, minimum 1 m between callbacks.
This did not help.

The question is whether this is a general problem at all or whether it is only due to the old hardware. Should I close this?

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

No branches or pull requests

2 participants