Battery Drain/Constant Wakelock
Let me get this out of the way first: This is about using an unofficial LineageOS build. I just thought you might give me some pointer where to try out different settings.
I just installed LineageOS 15.1 (as mentiones, unofficial) on my old Galaxy Note 4. All works fine, GPS accuracy just like before - but it's eating away the battery like crazy when recording a track. Turning on Flight Mode, changing the GPS method in Locus, doesn't change anything. I switched off background scanning in Location settings, too.
Now I have two other phones with LineageOS 15.1 (official), where Locus battery consumption is minimal, especially in Flight Mode. Also, when I still had CM12.1 on the Note4, it was minimal.
An analyzer app tells me, that Locus keeps constante Wakelock while recording. Doesn't do that on other phones.
As I said, I'm aware that this might be entirely the ROM's fault - but perhaps you know some stuff I could check/try out. After all, you probably spend quite some time on battery related issues before... Thx!
Good day Ingo,
wakelock is held when GPS is needed and also following conditions are met:
So if you think that this wakelock cause a trouble, try to use Google location assisted service to obtain location in Locus. Then wakelock should not be used.
There are also three services in Locus that hold wakelock during it's work: backup service, tasks service (tasks running in notification center) and Geocaching offlinizer.
Hope you find something useful from what I wrote. Otherwise feel free to ask.
Good day Ingo,
wakelock is held when GPS is needed and also following conditions are met:
So if you think that this wakelock cause a trouble, try to use Google location assisted service to obtain location in Locus. Then wakelock should not be used.
There are also three services in Locus that hold wakelock during it's work: backup service, tasks service (tasks running in notification center) and Geocaching offlinizer.
Hope you find something useful from what I wrote. Otherwise feel free to ask.
Thx a bunch for your reply. I installed a new build for that phone, and at first it looked like it got better, but on second try it was just as bad. Will do a full comparison of several phone son the weekend.
Additional question: What about Android Oreo's "Battery Optimization"? Is it OK to set Locus to "Battery Optimized" or does that mean the system could kill the recording process? So far, I always exempted Locus from optimization, but perhaps that's the mistake?!
Thx a bunch for your reply. I installed a new build for that phone, and at first it looked like it got better, but on second try it was just as bad. Will do a full comparison of several phone son the weekend.
Additional question: What about Android Oreo's "Battery Optimization"? Is it OK to set Locus to "Battery Optimized" or does that mean the system could kill the recording process? So far, I always exempted Locus from optimization, but perhaps that's the mistake?!
Battery optimization is an older system that should put apps to sleep when not needed. Anyway, how it will behave on your device, hard to say. More and more, every Android work differently. Best is to try it. Let Locus be affected by this battery optimization and if you notice any problems with sleep (of Locus Map), just next time exclude it. On my S7 device, this optimization has no effect for example.
Battery optimization is an older system that should put apps to sleep when not needed. Anyway, how it will behave on your device, hard to say. More and more, every Android work differently. Best is to try it. Let Locus be affected by this battery optimization and if you notice any problems with sleep (of Locus Map), just next time exclude it. On my S7 device, this optimization has no effect for example.
I did a big comparison on the weekend: 5 phones (3x 8.1, 1x7.0, 1x5.1), one test just lying on the window sill for 2hrs, one test on a 3hr bike tour. The Oreo results on the two newer phones (Note4, S9) are abysmal, especially on the Note4 (only <25% left after the bike trip, whereas the S5neo with 5.1 still had 87%). Surprisingly, the S4 with an unofficial LineageOS showed more or less normal battery usage.
One strange thing: SystemPanel2, which on Oreo can show app-specific usage, doesn't show especially high CPU/battery usage by Locus, but as soon as Locus records, the usage by System (or "Unaccounted" on the Note4) skyrockets.
I know, it's LineageOS, and one is even unofficial, but I think it's at least possible that Locus does something that was fine on older systems, but is problematic now on Oreo, isn't it?What I also noticed: I did tests with "Google location assistant services" and without, as you proposed, but in both modes SystemPanel2 shows me 100% wakelocks held by Locus. If I understood you correctly, that shouldn't be the case...
I've attached the SystemPanel2 overviews (battery/cpu/wkaelock) for 1hr recording with my Note4.
I did a big comparison on the weekend: 5 phones (3x 8.1, 1x7.0, 1x5.1), one test just lying on the window sill for 2hrs, one test on a 3hr bike tour. The Oreo results on the two newer phones (Note4, S9) are abysmal, especially on the Note4 (only <25% left after the bike trip, whereas the S5neo with 5.1 still had 87%). Surprisingly, the S4 with an unofficial LineageOS showed more or less normal battery usage.
One strange thing: SystemPanel2, which on Oreo can show app-specific usage, doesn't show especially high CPU/battery usage by Locus, but as soon as Locus records, the usage by System (or "Unaccounted" on the Note4) skyrockets.
I know, it's LineageOS, and one is even unofficial, but I think it's at least possible that Locus does something that was fine on older systems, but is problematic now on Oreo, isn't it?What I also noticed: I did tests with "Google location assistant services" and without, as you proposed, but in both modes SystemPanel2 shows me 100% wakelocks held by Locus. If I understood you correctly, that shouldn't be the case...
I've attached the SystemPanel2 overviews (battery/cpu/wkaelock) for 1hr recording with my Note4.
Hmm interesting, thanks for tests!
Isn't in this nice tool that displays battery consumption, option to display name of wakelocks that app held? Every wakelock has its name so maybe it should be possible to detect what is the name of this that cause trouble. Thanks.
Hmm interesting, thanks for tests!
Isn't in this nice tool that displays battery consumption, option to display name of wakelocks that app held? Every wakelock has its name so maybe it should be possible to detect what is the name of this that cause trouble. Thanks.
Thanks for a logs (received over private ticket) Ingo,
have to say, there is nothing unusual. Maybe little more work/CPU usage on work with NMEA messages (do you have enabled NMEA recording?), but nothing serious ... weird.
I'm worried, I can't help here too much. You may give a try to one thing .. does this happen only with Locus Map? You may in GPS screen > top toolbar > simulation, enable simulation of GPS and start recording or what you do as usual. To see, if enabled GPS system causes trouble. Then I may suggest trying to use a different application, to confirm that the problem is in Locus Map itself and not generally in your ROM.
Jiří M. aka Menion
Thanks for a logs (received over private ticket) Ingo,
have to say, there is nothing unusual. Maybe little more work/CPU usage on work with NMEA messages (do you have enabled NMEA recording?), but nothing serious ... weird.
I'm worried, I can't help here too much. You may give a try to one thing .. does this happen only with Locus Map? You may in GPS screen > top toolbar > simulation, enable simulation of GPS and start recording or what you do as usual. To see, if enabled GPS system causes trouble. Then I may suggest trying to use a different application, to confirm that the problem is in Locus Map itself and not generally in your ROM.
Jiří M. aka Menion
Hi Menion
Thx a bunch for the analysis. After I saw a few other comments regarding high CPU usage/hot phone when doing navigation on the respective XDA thread, I have to assume that it is a problem of the ROM after all.
I'm off to a Locus-free weekend now, will try that GPS simulation as soon as possible.
Anyway, two more remarks:
- When recording a long time, there are phases with very little CPU usage (just as one would hope for all the time), usually after there has not been much movement. When I turn the screen on or start to move again, it usually picks up.
- No, not using NMEA (set to "never")
First thing probably doesn't help, but I would say it's a little weird that there is any action at all with NMEA, when it's turned off. Perhaps this triggers some other bug in the system, which would go unnoticed otherwise...
Anyway, have a great weekend!
Hi Menion
Thx a bunch for the analysis. After I saw a few other comments regarding high CPU usage/hot phone when doing navigation on the respective XDA thread, I have to assume that it is a problem of the ROM after all.
I'm off to a Locus-free weekend now, will try that GPS simulation as soon as possible.
Anyway, two more remarks:
- When recording a long time, there are phases with very little CPU usage (just as one would hope for all the time), usually after there has not been much movement. When I turn the screen on or start to move again, it usually picks up.
- No, not using NMEA (set to "never")
First thing probably doesn't help, but I would say it's a little weird that there is any action at all with NMEA, when it's turned off. Perhaps this triggers some other bug in the system, which would go unnoticed otherwise...
Anyway, have a great weekend!
Hi,
oki, glad to hear it (that issue is most probably in ROM and not in Locus itself).
About NMEA messages: Locus register itself as possible NMEA reader no matter if these messages are saved into file or not. Based on your log it looks, that this add some additional work to GPS system. I'll try to improve this in next version and register Locus really only in case, NMEA messages will be needed.
Let me know if there will be something more I may help with.
Menion
Hi,
oki, glad to hear it (that issue is most probably in ROM and not in Locus itself).
About NMEA messages: Locus register itself as possible NMEA reader no matter if these messages are saved into file or not. Based on your log it looks, that this add some additional work to GPS system. I'll try to improve this in next version and register Locus really only in case, NMEA messages will be needed.
Let me know if there will be something more I may help with.
Menion
Thx! Is that little improvement already in 3.32?
Thx! Is that little improvement already in 3.32?
If we talk about better support for NMEA recording (better no NMEA handling when not needed), then no. But I have this in my task list for version 3.33.
If we talk about better support for NMEA recording (better no NMEA handling when not needed), then no. But I have this in my task list for version 3.33.
3.32.2.2 with NMEA fix: No real effect. :( Like I had once before, it started off with acceptable CPU usage, but then took off again (after I turned screen on/off). Phone doesn't seem to get as hot, but battery just like before.
Given how much I read about GPS hot phone issues (also with Google Maps for example) with this ROM in the XDA thread, I'm positive it's not Locus. So thx a lot for trying to find a solution/imporvement, Menion, but I think you can drop this on your end!
3.32.2.2 with NMEA fix: No real effect. :( Like I had once before, it started off with acceptable CPU usage, but then took off again (after I turned screen on/off). Phone doesn't seem to get as hot, but battery just like before.
Given how much I read about GPS hot phone issues (also with Google Maps for example) with this ROM in the XDA thread, I'm positive it's not Locus. So thx a lot for trying to find a solution/imporvement, Menion, but I think you can drop this on your end!
Hello, thanks for information. I did not expected any extra visible effect to be true. Anyway it make sense, not to receive NMEA data when you does not need it at all. So saved a little CPU is nice benefit.
Anyway I also think it won't be an issue caused by app itself.
Menion
Hello, thanks for information. I did not expected any extra visible effect to be true. Anyway it make sense, not to receive NMEA data when you does not need it at all. So saved a little CPU is nice benefit.
Anyway I also think it won't be an issue caused by app itself.
Menion
Replies have been locked on this page!