ReVanced / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
2.36k stars 112 forks source link

Excessive battery drain when enabling "battery optimizations igonored" #158

Closed kruttgutten closed 2 months ago

kruttgutten commented 2 months ago

When i opened yiutube after installing revanced the app told me to enable this setting as it could cause issues if not enabled, this however lead to my battery draining from full to about 30% in an hour of normal use. I was also not able to untick this setting and so the only way to fix it was to reinstall microG. I haven't had any bugs or issues after reinstalling and the battery drain seems normal too, so I don't understand why I would need it toggled. I also keep getting a promt to enable it every time i open youtube now which is pretty annoying.

My phone is a galaxy s23 ultra, running android 14

oSumAtrIX commented 2 months ago

Send a picture that shows GmsCore draining the battery in the battery usage settings

LisoUseInAIKyrios commented 2 months ago

The battery drain you are seeing is not MicroG, but YouTube itself.

Look under the battery usage, and MicroG will be less than 1%.

Turning off battery optimization for MicroG will not change YouTube battery usage.

If you want to reduce battery usage of YT itself, follow one or more of the suggestions here.

kruttgutten commented 2 months ago

Image Image Image Image Here are screenshots of the battery usage of youtube after installing revanced, and on the one for the 2nd of october you can see the rapid drain i mentioned, which is when i reinstalled microG. The 3 hrs 50 min screentime screenshot is from the 2nd of october. The 8 hrs 32 min one is from the day after when i had reinstalled microG. Claiming this has nothing to do with microG is absurd as my phone was noticably warm from light usage, which it hasn't been since i reinstalled microG. This is really making me question if this is some kinda bitcoinminer bullshit

kruttgutten commented 2 months ago

And again let me state that I am not able to change any settings in microG myself, I can't tick or untick any of the boxes. The only way i was even able to turn on the ignore thing was cus of the prompt in youtube

LisoUseInAIKyrios commented 2 months ago

You're comparing unknown conditions of how the app was used. Was one session using 2160p and the other 720p? Was it all shorts? Was it at night and ambient mode was on for one session? Ambient mode alone can make a huge difference.

Disabling battery optimizations will make zero changes to the battery usage YT uses. Don't believe me? Turn on battery optimizations for MicroG, and when RV YT prompts you to turn them off, press the back button and skip it.

And no it's not a Bitcoin miner. Look at the source code yourself instead of vague complaints.

oSumAtrIX commented 2 months ago

Like Liso said, changing the optimization of GmsCore has no effect on the battery usage graph of YouTube. The optimizations simply kill GmsCore in the background. If they do, YouTube will crash. Reproduce the battery usage drain with optimizations off and we will continue investigating

kruttgutten commented 2 months ago

All of it is just viewing 1080p videos. The main concern for me, which is hard to really show, was that my phone was heating up as if it was charging when using the youtube app. And it stayed really warm when I hadn't been using it for a good while too. This has not happened since i reinstalled. I can test it again to verify

oSumAtrIX commented 2 months ago

Sure

masterflitzer commented 1 month ago

All of it is just viewing 1080p videos. The main concern for me, which is hard to really show, was that my phone was heating up as if it was charging when using the youtube app. And it stayed really warm when I hadn't been using it for a good while too. This has not happened since i reinstalled. I can test it again to verify

i have the exact same since yesterday, just today i lost 62% battery through yt alone and my phone is very hot, while normally it's around 12-16% from yt, but i actually didn't patch yt recently (last time 1-2 weeks ago), and microg doesn't even appear in my battery drain graph, it's only yt, so I don't think it's revanced's fault at all, but for now i don't have any solution

LisoUseInAIKyrios commented 1 month ago

@masterflitzer try applying all suggestions listed here, especially turning on restricted battery mode for YouTube, and turning off cloud messaging for MicroG.

MicroG does not appear in the battery usage because it's using less than 0.1%