osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.37k stars 987 forks source link

Excessive heating of the phone when using OsmAnd+ (most of the time with Android Auto) #20188

Open mdykierek opened 1 week ago

mdykierek commented 1 week ago

Description

I observed this heating phenomenon for quite a while. I saw some mentions in other bugs and mine as well. I decided to watch it closely. At first, I thought it was related to battery heating due to the fact that with Android Auto connected with USB usually charged the phone, but at certain point it reaches 100% and the phone kept being hot. This means, that the heat is coming from computing rather than charging. I don't know a good way of taking CPU temperature measurements so I decided to watch the battery for which I have a tool already. Here are my findings that I plan to update over time:

  1. During a 20 minute drive with OsmAnd+ only displaying the map on car's display the battery temperature went from 25 to 33 degrees Celsius - a 8 degrees increase in temperature and that was not caused by charging. The battery was at 100%. The car was cool (out of garage in the morning and air conditioning on).
  2. During similar 20 minute drive with Sygic only displaying the map, the temperature went from 25 to 26 degrees Celsius - a 1 degree increase. The conditions were the same -100% battery, cool car, AC on. I plan on measuring the same route with Google Maps displaying the map too and give the numbers. Then I plan on measuring somewhat longer route with a USB powermeter to see the consumption.

One can look at this issue as minor as the phone is constantly being charged, but the increased temperature fries the battery. Depending on where the suboptimal code is, it may also affect the on-the-phone use of OsmAnd (which as a cyclist I care a lot). I guess one can spare some CPU when cluttering items were removed from the car view.

Steps to reproduce

Connect the phone, enable Android Auto, show OsmAnd on car's display and go. Observe the phone.

Actual result

Excessive heating of the phone.

Expected result

Reasonable heat level.

Your Environment (required)

WARNING Crash-Logs MAY contain information you deem sensitive. Review this CAREFULLY before posting your issue!

OsmAnd Version: OsmAnd+ 4.7.17
Android/iOS version: 14
Device model: Motorola Edge 40 Pro
Crash-Logs: ?
yuriiurshuliak commented 1 week ago

Merged to https://github.com/osmandapp/OsmAnd/issues/9928

mdykierek commented 1 week ago

I've read the thread and please note that Sygic, Google Maps, and OsmAnd use GPS and display if used on the phone so the battery drain from these sources should be similar. In my case, the phone display is off and no routing done (just tracking location on car's display) - this means that getting data to present and displaying (animating) has to be the thing, a big thing. I remember from other issues that Android Auto uses a different algorithm than new renderer for the modern phones. It must be a hassle to maintain two renderers. For this case, the super fast and energy saving algorithm is not a must, but high temperatures kill batteries. I like my phone ;)

mdykierek commented 1 week ago

So I made similar experiments for Google Maps displaying position on car's display offline on the same route. I couldn't quite get the same starting points so I made 2 measurements:

MasseR commented 5 days ago

For what it's worth, I see similar experiences. Not only does the phone heat up, but it slows done the charging considerably. Phone is hot to the touch and takes hours to charge, considerably longer than when routing with gmaps for example.

If the screen does stay on, it will quickly heat even more, high enough to cause the Android "excessive heating" warning.

mdykierek commented 5 days ago

So I bought the USB power meter and going to take measurements. I took a short drive today and quickly looked at the mAmps with Google Maps, Sygic, and OsmAnd+ and it does not look good. I would say very bad in fact. I'll add mapy.cz to the measurements. I estimate, it will take a week or so to get the measurements for all the apps to get the same conditions.

mdykierek commented 4 days ago

The following measurements were made for OsmAnd+ 4.7.17 displaying map on Toyota Corolla display (no navigation). The rendering at speeds ~90 km/h drives 1-1.43 A (max. what the port can give I guess). At lower speeds the current is smaller. This seems to be what one could expect. My first guess is that there is a lot of useless and unnecessary items animated but still the difference against others is so big that it won't be enough. It seems that power consumption is 4.88 W, 4.95 W, 3.22 W. Not all power of course is used by OsmAnd. Phone idling takes about 0.1 A. This has be taken into account when comparing the actual power usage against other apps. A B C

DmitryAlexei commented 4 days ago

Some unnecessary map elements were hidden from the driving profile in that task https://github.com/osmandapp/OsmAnd/issues/18894#issuecomment-2185903095 We suppose, that energy consumption while driving will decrease. It can be tested in nightly version, new beta version is also expected by the end of the week

mdykierek commented 3 days ago

DISCLAIMER: The data is rather rough and approximate. There is a number of factors that have to be taken into account. We can set some reference levels now.

  1. Power consumption of a phone connected to car's USB when totally idle: AA The above measurement requires explanation. The power meter does not count the time when measurement is 0A. The actual duration was about 20-21 minutes. This gives ~ 0.25 W. This estimation is bad, but the best I can get for now.
  2. Power consumption of a phone connected with the car using Android Auto but nothing is displayed and the location is off: BB This gives ~ 0.45 W.
  3. Power consumption with AA and location turned on: CC This gives ~ 0.83 W. I would rather round it down a bit as I got a short call during the metering, but not by much.
  4. Finally AA displaying offline Google Maps on car's screen, no navigation. Two measurements: DD EE This gives 0.94 W - 1.45 W. This spread is rather big and based on the observation the lower is closer to be true. The 1.45 W measurement could be affected by charging at the very beginning. Then I adjusted for that and waited for the phone to reach 100% before metering. This is an incredible result but a) Google Maps show nothing in such scenario b) Let's be honest, it's not a fair competition against multi-billion company ;)

Note that the currents shown on the images are affected by taking the photo with the phone I measured.

DmitryAlexei commented 2 days ago

We've added battery consumption information to the development plugin It is now available in nightly builds (https://osmand.net/docs/versions/nightly_versions#nightly-builds) when development plugin enabled In my screenshot, OsmAnd consumes about 0.4% battery pro minute while simulating navigation. For testing I use 4-years old phone with old battery (the battery has not been replaced).
Thus, battery consumption can now be tested in various scenarios.

mdykierek commented 2 days ago

Nice. Does it work for scenario where the phone is connected to USB e.g. for Android Auto or this is for when phone is on battery alone?

DmitryAlexei commented 2 days ago

When charging, there will be positive values: they will show how much energy is being used from the socket

mdykierek commented 1 day ago

Time for a batch of numbers for a navigation app that is based on OSM too - mapy.cz. It's similar in the detail it (can) display. AAA BBB That would give 2 W - 2.23 W.