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

StreetComplete uses a lot of battery #1036

Closed
Rudloff opened this issue Apr 28, 2018 · 21 comments
Closed

StreetComplete uses a lot of battery #1036

Rudloff opened this issue Apr 28, 2018 · 21 comments

Comments

@Rudloff
Copy link

Rudloff commented Apr 28, 2018

Hello,

I am using a Fairphone 2 with Android 6.0.1. My battery is is 2-3 years old and does not last very long but it is way worse when I'm using StreetComplete 5.0. When I'm actively using the app, I lose ~30% of my battery in 30 minutes.
At first I thought it was mostly due to the GPS, but I disabled geolocation in Android settings and it still uses a lot of battery.

The strange thing it that in the battery report, most of the battery usage is not attributed to StreetComplete but to "other usages":
screenshot_20180428-160922
(You can see the battery dropping very quickly near the end, when I started using StreetComplete.)

@westnordost
Copy link
Member

westnordost commented Apr 29, 2018 via email

@Rudloff
Copy link
Author

Rudloff commented Apr 29, 2018

Yes, I tried to completely disable geolocation and it still uses a lot of battery.

@westnordost
Copy link
Member

What is "autres utilisations" if you switch the smartphone to English? Did you try to google for what is behind this item?

@rugk
Copy link
Contributor

rugk commented Apr 29, 2018

He said:

The strange thing it that in the battery report, most of the battery usage is not attributed to StreetComplete but to "other usages":

(and DeepL also translates it to "other applications")

BTW, personally, I've never seen that entry in the Android battery usage – very strange it cannot attribute such a large amount of battery usage to an app.

@westnordost
Copy link
Member

westnordost commented Apr 29, 2018

I asked not how one would translate it but how specifically it is translated in Android - so that one can google for it.

@Rudloff
Copy link
Author

Rudloff commented Apr 29, 2018

It is called Miscellaneous in English. The detailed view contains some explanation:
screenshot_20180429-235602

This article also has some useful explanations: https://medium.com/@dotandroid911/what-is-miscellaneous-battery-drain-in-android-how-to-fix-it-d6eb9035e513

@westnordost
Copy link
Member

Phew, okay. I thought that the battery stats would be smarter. I.e. monitor the CPU usage of apps and calculate the battery usage of these apps based on that, etc.
Also, since the smartphone shows the connection strength of wifi and mobile to the user, it should be quite simple to put this into the calculation.

Anyhow, this leaves us (me) with no clue where this might be coming from. It is possible to monitor CPU usage with Android studio, might do that, but I don't think I will see any surprises.

@westnordost westnordost self-assigned this Apr 29, 2018
@matkoniecz
Copy link
Member

Is it possible that it was happening in area with poor network connection?

I never encountered it, but some people claimed to notice extreme battery consumption with phone attempting to use low quality or missing network connection (constant reconnecting).

It would fit that battery consumption was not attributed directly to Street implemented.

@Rudloff
Copy link
Author

Rudloff commented Apr 30, 2018

I already encountered the behavior you are talking about, but here it happened in a city with a good 4G signal.

I could reproduce the issue several times in the past days, it clearly happens when I'm using StreetComplete, the battery starts draining very fast (almost 1% per minute) and it stops when I kill the app.

@westnordost
Copy link
Member

westnordost commented Apr 30, 2018 via email

@Rudloff
Copy link
Author

Rudloff commented Apr 30, 2018

No, only if the app is in the foreground I think.

Edit: I also tried to uninstall/reinstall the app and I can still reproduce the issue.

Edit 2: Actually, it uses less battery (but still a lot).

@westnordost westnordost added the bug label May 1, 2018
@westnordost
Copy link
Member

I can reproduce it. It seems to be caused by the compass on the upper right corner. Will investigate.

@HolgerJeromin
Copy link
Contributor

Good that the fairphone battery are out of stock. Otherwise i would have ordered a new one already :)

@westnordost
Copy link
Member

It looks like looking for the compass was a red herring.

It is true that while the map is shown, even if not moved, rotated etc, 10% CPU is used continuously (as opposed to i.e. 0% when in the settings screen), so I guess this could be the reason for the battery drain. However, even if the compass is never updated, it changes nothing.

@westnordost
Copy link
Member

It looks like most of the CPU time is spent in a GL thread, I guess the tangram-ES GL thread, more specifically, in the function eglSwapBuffers.

profiler

I checked if the existance of shader code in the map style may be the culprit. It is not.

I think I will ask in the tangram-es bugtracker for help.

@westnordost
Copy link
Member

tangrams/tangram-es#1800

@westnordost westnordost removed the bug label May 1, 2018
@westnordost westnordost removed their assignment May 1, 2018
@westnordost
Copy link
Member

fixed

@Rudloff
Copy link
Author

Rudloff commented May 1, 2018

Thanks a lot for investigating this!

@HolgerJeromin
Copy link
Contributor

Could you push an update to play store? :)

@ENT8R
Copy link
Contributor

ENT8R commented May 1, 2018

In #1041 (comment) @westnordost said that he wanted to release an update today/tomorrow

@westnordost
Copy link
Member

Tomorrow. I want to have #1039 and ideally #1037 sorted out first.

@Rudloff Rudloff mentioned this issue Dec 31, 2020
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

6 participants