signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.46k stars 6.1k forks source link

battery drain on signal 5 (LOS+microG) on mobile network #10336

Open maricn opened 3 years ago

maricn commented 3 years ago

Bug description

Battery drain. I updated to version 5 last night and battery started draining a lot. Also I usually use WiFi, but this time I was on mobile data. I have turned off battery optimisation when i installed signal long time ago.

Steps to reproduce

Actual result: observe battery drain

Expected result: low battery consumption - usually my battery drain during night would be almost none, but this time it just kept on going down.. also some unusual SSLException s happen as seen in the logs..

Screenshots

<img src="https://user-images.githubusercontent.com/3995223/103128622-4ca73f80-4696-11eb-8ed8-4f08028516e0.png" width=300" />

Device info

Device: Sony Xperia XZ2 Compact (H8324) xz2c Android version: 10 Signal version: 5.0.8

Link to debug log

https://debuglogs.org/d9c3a683e5040b3263547ae6ac492d65ea2185597c5077c798fefd440ea38d9d

9Lukas5 commented 3 years ago

I'd like to add that Version 5.x doesn't recognize MircoG as Google Services anymore and refuses to enable Push Notifications but rather uses Websockets on a fresh install/backup restore. Last 4.x Version registers flawlessly.

For completeness, my Device info

Device Xiaomi Mi 8 Lite (platina)
Android 11
Signal 5.0.8
MicroG 0.2.15.204713
maklimcz commented 3 years ago

I'm also issuing a battery drain on Lineage OS. But I think it happens both on WiFi and mobile data. Isn't there an option to set notification refresh rate?

Device Sony XZ1 Compact
Android Android 10 (Lineage OS 17.1) without Google Services
Signal 5.0.9
ThmsP commented 3 years ago

I'd like to add that Version 5.x doesn't recognize MircoG as Google Services anymore and refuses to enable Push Notifications but rather uses Websockets on a fresh install/backup restore. Last 4.x Version registers flawlessly.

For completeness, my Device info

Device Xiaomi Mi 8 Lite (platina) Android 11 Signal 5.0.8 MicroG 0.2.15.204713

It seems to have the same behaviour on my phone. The app doesn't use microG despite having a Google id and push notification activated. And using websocket it seems to wake up the device often (mesured with BetterBatteryStat).

Moto G 2015 Osprey Lineage OS 17.1 MicroG 0.2.16.204713-10 Signal 5.0.9

I can test or make log if needed.

kyljys commented 3 years ago

I had excatly the same issues in my Oneplus 6. First with LineageOs+MicroG, then with latest Omnirom&MicroG. Huge drain. Now I have latest 'weekly' Omnirom without Gapps or MicroG. Now the Signal-app's battery usage is simply beautiful. 10hrs usage less than half an hour videostreaming. I did however also downgrade Magisk to v. 21.3, which corrected many FC:s in Omnirom and may have something to do with Signal also. Tip for omnirom users: don't upgrade webview.

beatjost commented 3 years ago

I use a Huawei without GMS - and also on my hone Signal is the top battery consumer!!! Uses much more battery then e.g. Telegram which also need's to do a 'polling'...

roppppp commented 3 years ago

https://github.com/signalapp/Signal-Android/issues/9729

fabbra commented 3 years ago

I'm also issuing a battery drain on Lineage OS. But I think it happens both on WiFi and mobile data. Isn't there an option to set notification refresh rate? Device Sony XZ1 Compact Android Android 10 (Lineage OS 17.1) without Google Services Signal 5.0.9

Same problem here on a similar configuration:

Device Sony XZ1 Compact (G8441)
Android LinageOS 18.1/Android 11
Signal 5.3.12 (785, 78500)

Before, on the Sony Stock ROM (with G play services) the device lasted for 4-5 days. Now (without G) the device lasts for 3 days at maximum and Signal consumes about 30-40% of the entire battery. In comparison, my other instant messaging app (Threema) uses about 5% of battery.

PS: Here's a Signal debug log in case this could help.

Noob729 commented 3 years ago

I've noticed a similar issue for several months. I'm using a LineageOS fork with microG on a Xiaomi whyred. https://github.com/microg/GmsCore/releases/

First, there's an always-present notification for Signal mentioning "Background connection enabled". I assume this is the Websocket vs Push Notification issue discussed above. (This may be relevant for a battery drain issue)

When I'm on WiFi, Signal uses "normal" battery. However, when I'm on 4G mobile data, battery drains quickly (~10% per hour for a 4Ah battery)

eNTi commented 3 years ago

I'm seeing the exact same behavior using my Google Nexus with an experimental Lineage 7.1.2 (no microg, no gapps) build. "Relatively" normal battery drain on WiFi, extremely high battery drain on mobile. Like 40-60% and my battery curve looks like a waterfall.

ioctl-user commented 3 years ago

I'd like to add that Version 5.x doesn't recognize MircoG as Google Services anymore and refuses to enable Push Notifications but rather uses Websockets on a fresh install/backup restore. Last 4.x Version registers flawlessly. For completeness, my Device info Device Xiaomi Mi 8 Lite (platina) Android 11 Signal 5.0.8 MicroG 0.2.15.204713

It seems to have the same behaviour on my phone. The app doesn't use microG despite having a Google id and push notification activated. And using websocket it seems to wake up the device often (mesured with BetterBatteryStat).

Moto G 2015 Osprey Lineage OS 17.1 MicroG 0.2.16.204713-10 Signal 5.0.9

I can test or make log if needed.

The same problem with actual software versions. At that, MicroG apps installed with F-Droid are not working with Signal and work with other apps. The same latest versions from Magisk installed to /system/ works fine even with Signal.

Rude-Boy commented 2 years ago

The same problem with actual software versions. At that, MicroG apps installed with F-Droid are not working with Signal and work with other apps. The same latest versions from Magisk installed to /system/ works fine even with Signal.

I can confirm this. i would be interested to know if it works with LineageOS for microG

ioctl-user commented 2 years ago

i would be interested to know if it works with LineageOS for microG

Yes, it's working.

Noob729 commented 2 years ago

I use /e/ (a LineageOS fork with microG; yes, it's a stupid name). https://en.wikipedia.org/wiki//e/_(operating_system)

I can use Signal, if I manage the pesky issue of battery drain on mobile network. (I force-kill Signal when I'm away from WiFi for long stretches.)

stale[bot] commented 2 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

eNTi commented 2 years ago

Still an issue for me on mobile data. Not so much on WiFi.

Noob729 commented 2 years ago

Those "stale bots" are so annoying.
They're just rubbing one's face in the fact that the devs have no time to spare on some issues.

FWIW, it feels like the app draws more power when I leave it in a conversation, vs going back to the main screen.
(But I didn't test scientifically, so don't quote me on that.)

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ioctl-user commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Wait, it's still actual problem.

Noob729 commented 2 years ago

@stale go away, annoying bot.
Just because the Signal Foundation doesn't care about this issue, doesn't mean you get to torment us bimonthly.

Noob729 commented 2 years ago

As I have stated, the app draws more power when left in a conversation vs going back to the main screen.

I have the hunch that this is because, in a conversation, the app constantly scans for incoming text, in order to display the "3 dots" indicating that the other person is currently writing a message. This probably has the effect that the OS cannot disable network connectivity (4G and WiFi) nor set the phone to deeper sleep modes (for greater energy savings).

gryban1 commented 1 year ago

Same problem as #9729 ?

On my Pixel 5 with GrapheneOS is Signal the battery drainer no 1.

panomitrius commented 1 year ago

Still an issue, yes. Would be glad to see a response from the developer team!

eNTi commented 1 year ago

For me too. Running LineageOS 12.1 on Pixel 3 XL.

starbrights commented 1 year ago

I am running LOS19.1 and Signal 6.1.4 (both WiFi and mobile network). While my old setup runs for 2 days without problems it is now just one.

In BetteryBatteryStat I found that there are many KernelWakeLocks "mmc0_detect". I didn't have a clue what this means, suspected SD card or internal memory. But finally the power drain (wake up while screen off) reduces a lot after disable Signal. Sure it needs to be connected to Server, but it reduces my battery time to 50%! I can't remember this was such a heavy drain in my older version, but I changed both phone and signal version and didn't have the BBS values from previous installation.

I am not sure whether finally that mmc0_detect is connected to Signal, but none of the other messangers (WA, Telegramm) causes such a drain.