Details: App Version: Plexamp 4.5.2 Phone: Pixel 4 OS: Android 13 - Oct 5, 2022 Update
The plex server hosting my music is not accessible from the public internet. When not at home, I play music from downloaded playlists.
Issue:
I have noticed since a recent update that Plexamp has a large background battery drain when not playing music. I will usually use Plexamp with Android Auto to listen to music on my commute. Recently, I’ve seen my phone’s battery drain substantially throughout the day, when the phone isn’t being used much. The Android settings battery screen points the finger at Plexamp. On a typical day, my phone would drain 10-15% while I’m at work, since I don’t use it much while I’m in the office. Since the Plexamp update, I’ve seen battery drain of 40-60% days. I have also confirmed that if I ‘Force Stop’ Plexamp after exiting my car, my battery drain goes back to the usual 10-15%.
Steps to reproduce:
Have playlist downloaded to Plexamp
Have Plex server for music inaccessible from public internet
Use Android Auto to play music from Plexamp
Turn off and exit vehicle
Don’t use the phone very much, just watch the excessive battery drain from Plexamp in the background
I was asked to provide logs, and the relevant portion (redacted) is attached. It doesn’t show much as far as I can see. The music stops playing at 18:46:10 when I exit my car, and the app then spends the next ~30 minutes trying to reach out to the server - which it can’t. The logs then stop until 00:16:09 when I connected my phone to home WiFi to upload logs. So the app isn’t logging what it’s doing, but it’s draining a lot of battery.
From what I can see, it’s trying to send older view states to a server which it’s having trouble connecting with.
Nov 10, 2022 18:43:37.586 [Javascript] INFO - ViewState: Sending view redactedmachineIdentifier/11221 (success: 0).
The only connection it’s testing is:
Nov 10, 2022 19:10:17.844 [Javascript] WARNING - DEVICE: Server connection https://10-10-redacted-ip.redactedurl.plex.direct:32400 didn't work for plex-music: HTTP status -28
Which is a bit weird:
It probably shouldn’t even try to connect to a private IP while on cellular.
Not sure why this server doesn’t have a public IP (maybe b/c of your penchant for privacy it’s not even accessible remotely?)
@elan This is awesome! Thank you so much! I don’t think I ever expected the creator of Plex to have a fix for the issue figured out in less than a day. Actually insane. I very much look forward to testing it out once it’s available for download.
Also, to your 2nd point in your 2nd post: Yep. I definitely have an eye out for privacy (it’s about 50% of my job too, so it’s kind of a habbit at this point). I can access my server on the go when I have my home VPN connected, but since a lot of my tracks are cached in the app, I don’t typically need to connect to it much for Plexamp. The VPN causes extra extra battery drain anyway - which I definitely notice (lol).
Thanks again for the (quite ridiculously) rapid response and action on this!
If I open the plexamp app, use it as normal, connected via Android auto/usb to my car’s ICE system. Finish my journey, disconnect and stop using the app. The app keeps using approx 20% battery in the background from that point onwards, regardless of what else is running on the phone. Only option seems to be too force stop the app from the “App info” page within Androids settings.
I can’t provide any logs right now as I have stopped using the app since I noticed the issue
Thanks! I have been performing the same steps (drive with Android Auto using Plexamp) the last few days trying to replicate the reported battery issues and I don’t get the battery drain reported.
We are continuing to investigate however it is difficult for us to resolve issues like this, when we can’t reproduce the problem, without logs.
I can confirm I am experiencing the same. It’s not every time, but it was twice this week. I use Plexamp via Android Auto to stream during my 20 minute car ride to the train. Halfway through the day, my battery was 40% lower than usual with Plexamp being the main culprit.
This should be the relevant log. I hope I removed all the personally identifiable information, but let me know if I missed anything.
I am also having this issue on my pixel 7 pro. Listened to Plexamp for about 30min and it is at the top of my battery list with 8 hours used and 12% drain. I’ll try to get logs in a couple of days when I am not working.
I have resolved this issue by setting battery optimization in Android from Optimized to Restricted. This will resolve any current or future battery drain issues.
I am now getting home from work with 70% battery instead of 30%. Plexamp still automatically start playing music when Android Auto is connected which is all I use it for.