advplyr / audiobookshelf-app

Mobile application for Audiobookshelf
https://audiobookshelf.org
GNU General Public License v3.0
1.16k stars 158 forks source link

[Enhancement] Reduce battery usage #1104

Closed p-rintz closed 1 week ago

p-rintz commented 6 months ago

Steps to reproduce

  1. Run app in background

Expected behaviour

Actual behaviour

Environment data

Audiobookshelf Version: 2.8.0

iOS Issue

iOS Version: 17.3.1 // 0.9.72-beta

iPhone model: 12

IMG_1111

TeroKeso commented 3 months ago

I use an iPhone 15 IOS 17.4.1 and typically get about 3 hours with ABS 12% battery. This with local books only.

With a 10 day view I get 22 hours and 5% total battery drain. I don't know how Apple calculates these numbers :D

Note: On the road I use tailscale connection back to my server and then ABS and tailscale use crazy amount of battery. Still this has been calculated to my 10 days usage and still overall low.

hjk321 commented 3 months ago

Considering this is now an enhancement and not a bug, I don't think it should be a blocker for the ios app to come out of beta. (#541)

mfcar commented 2 months ago

I'm trying to find some piece of information to understand why i'm out of juice so fast I don't have knowledge in Xcode, then probably all of this can be wrong

I kept the app running, playing an audiobook in the background with the device on standby, and I got these data after 1 hour:


Screenshot 2024-06-05 at 17 58 19

After 1 hour

Screenshot 2024-06-05 at 18 58 24

Look at the major problems: Overhead and the Network. In a 1-hour period, the gauge has always been in the Hard range.

Regarding the overhead, Apple says: Overhead represents energy use as a result of bringing up radios and other system resources your app needs to perform work.

Based on this, I activated the Network Inspector. Times in times, a POST request is sent to the session endpoint. I commented out the ReportProgress code just to check, and tried to run it again.


Screenshot 2024-06-05 at 20 01 35

I notice that the Energy Usage gauge sometimes drops to Low, sometimes goes to High, but generally stays on the Low

Screenshot 2024-06-05 at 19 31 32
jerry00020001 commented 1 week ago

Can this be marked as complete? I’ve got zero issues with battery after checking battery usage.

advplyr commented 1 week ago

Yup thanks for following up