daneren2005 / Subsonic

Home of the DSub Android client fork
GNU General Public License v3.0
581 stars 162 forks source link

Battery drain #751

Open ghost opened 7 years ago

ghost commented 7 years ago

It's happened quite a few times since I upgraded to Nougat on my Nexus 6P.

Example: http://i.imgur.com/xBxpIAn.png

DSub doesn't have to be playing music for it to occur.

daneren2005 commented 7 years ago

Can someone try out this apk and let me know if they see a brief toast onPause when they exit the application? Pressing back or pressing home should both trigger it.

https://dl.dropboxusercontent.com/u/23354647/DSub%205.3.1-fix.apk

ghost commented 7 years ago

"App not installed. This package appears to be corrupt."

daneren2005 commented 7 years ago

Weird. I tried re-compiling it and uploading so try again. I imagine something just got corrupted when either uploading to dropbox or you downloading it.

daneren2005 commented 7 years ago

Another user screenshot: screenshot_20161014-134552

ghost commented 7 years ago

Sorry it's not working

keckelt commented 7 years ago

Was able to install and saw the onPause toast when pressing back & pressing home on Android 6

daneren2005 commented 7 years ago

Another user was able to install and verify that the onPause is still being called correctly on Android 7: Just installed. I do see it when I exit by hitting back, by hitting home and when selecting exit from the daub home screen context menu. That last one it the only one that pauses the music though. I also see it a few other random times like entering the settings menu but that also doesn't pause music.

ghost commented 7 years ago

Maybe I wasn't able because I'm enrolled in the beta?

daneren2005 commented 7 years ago

It might be that simple. Here are a couple of apk's based off the latest Beta code. The first one upgrades the support library to the latest version made for Android 7.0. The second one just removes casting functionality to see if something is going wrong with that.

https://dl.dropboxusercontent.com/u/23354647/DSub%205.3.2%20BETA%20Upgrade%20Support%20Library.apk https://dl.dropboxusercontent.com/u/23354647/DSub%205.3.2%20BETA%20Remove%20Cast.apk

I am also looking into buying a a Nexus 5x to directly debug. Can you think of any options you normally change which are different than the defaults? While there are quite a few people reporting this, it definitely is not as high as it should be if everyone was experiencing this. I'm trying to think of anything which could narrow down what the issue could be.

ghost commented 7 years ago

Are these supposed to give me any toast messages? I installed the apk files.

daneren2005 commented 7 years ago

No they are not supposed to give toast messages. I just want to see if they still give you a huge battery drain while running them. And you can only have one installed at a time. Which one did you install and have you been noticing the same issue so far?

ghost commented 7 years ago

http://i.imgur.com/RwigkGi.png http://i.imgur.com/4eFpm55.png No drain yet on the apk that removes casting functionality. The initial wakelock with the screen off was because I was playing music with DSub.

daneren2005 commented 7 years ago

Another user has verified that the old version of DSub 5.2.2 works fine without the battery drain. If you are not seeing any battery drain with that version without casting functionality, I would try https://dl.dropboxusercontent.com/u/23354647/DSub%205.3.2%20BETA%20Remove%20DLNA.apk. This version ONLY removes DLNA casting functionality. Upgrading the library I use for DLNA casting was the only change related to casting I made between 5.2.2 and 5.3.

PS I am trying to get more people on this thread so the testing isn't all on you/so we can get more data.

khers commented 7 years ago

The battery drain for me only shows up when DSub has to fetch something from the server to play. If I am in offline mode or I play only cached music, battery usage is fine. My hacky work around has been to cache what I want to hear and then force kill DSub, this seems to keep battery usage down quite a bit. If you have something specific you want tested, please let me know (I have Nougat on a Nexus 6p).

daneren2005 commented 7 years ago

I purchased a Nexus 5x, but didn't realize it only came with a USB C -> C cable. I won't be able to do any more debugging on this for a couple more days until Amazon delivers some A -> C cables.

pdf commented 7 years ago

@daneren2005 should we be testing that 5.3.2 beta with DLNA removed? I see the same battery drain on a Pixel running Nougat.

daneren2005 commented 7 years ago

Yes that would be good. I bought a nexus 5x but am unable to reproduce the battery drain. Is anyone able to list their settings so I can see what I might need to set differently?

pdf commented 7 years ago

I get 'The package appears to be corrupt' trying to install that no-DLNA package. I tried downloading the file from my computer too, to be sure, same thing.

There's no settings export in DSub, is there?

daneren2005 commented 7 years ago

I forgot I have done an update since I put that out so the versions don't match. I will have to recompile them again. No there is no export. I will have to see how long it would take to make one

daneren2005 commented 7 years ago

Here are some different test versions: DLNA removed: https://dl.dropboxusercontent.com/u/23354647/DSub%205.3.2%20Remove%20DLNA.apk Chromecast removed: https://dl.dropboxusercontent.com/u/23354647/DSub%205.3.2%20Remove%20Chromecast.apk All casting removed: https://dl.dropboxusercontent.com/u/23354647/DSub%205.3.2%20Remove%20Casting.apk

QuillOmega0 commented 7 years ago

I found the same issue where dsub was using a proportionally high amount of battery%. I installed the All casting removed package and have thus far seen a marked improvement in battery usage. Before it was not unusual to see 15-20% usage for dsub, but thus far I haven't even seen it show up in the battery usage monitor since updating.

pdf commented 7 years ago

I've been using the DLNA removed version the last couple of days, seems good but I want to give it a little more time.

OpenAai commented 7 years ago

I've been experiencing the same battery drain since I'm on Android 7, and also Android 7.1.1 on my Nexus 6P. The test version without any casting seems to be fine, no battery drain so far. For the record. On one day battery usage for Dsub could be 20%, without actually using it, and the main usage of the app would be the Wifi connection. Now, after using Dsub listening to music for an hour it's only on 1% of battery usage.

pdf commented 7 years ago

DLNA removed version seems to do the job here.

daneren2005 commented 7 years ago

It's good to know the root issue is with DLNA. I am trying to figure out what the root issue is

OpenAai commented 7 years ago

5.3.3 Is a battery drainer as wel.

plastikman commented 7 years ago

Since I have the same issues with the current release, I will install the non cast version and report.

plastikman commented 7 years ago

I can confirm that running with "DSub 5.3.2 Remove DLNA.apk" the battery drain is gone. My phone is no longer smoking hot and the battery is back to respectable times!

I know that the issue is not "Fixed" but I am glad my favorite music streamer is working properly again.

Thanks @daneren2005

QuillOmega0 commented 7 years ago

5.3.3 is still sucking the battery dry.

plastikman commented 7 years ago

@QuillOmega0 I don't think that @daneren2005 ever said that 5.3.3 was fixed. Turn off auto updates in the play store for dsub, then install one of the known working versions that are listed in this issue. I am sure once there is a workable update to solve the drain issues there will be a 5.3.4 release.

daneren2005 commented 7 years ago

I'm sorry I have been out of town all week. I still don't have a solution but I am going to add a toggle to turn off DLNA for those with these issues as soon as I get back.

daneren2005 commented 7 years ago

If anyone can try this out: https://dl.dropboxusercontent.com/u/23354647/DSub%205.3.3%20DNLA%20setting.apk. There is a new setting under Settings -> Cast to turn off DLNA casting. It should fix the battery drain issue people are seeing. If it is I will probably add as part of the update to turn it off by default for everyone on Android 7.

OpenAai commented 7 years ago

Thanks Scott. I have just installed it, and will let you know.

OpenAai commented 7 years ago

The toggle works great!

plastikman commented 7 years ago

The toggle has solved the issue for me too. Thanks for all the hard work.

pdf commented 7 years ago

:+1: The toggle in 5.3.4 appears to work around the problem here too, thanks.

scienex commented 5 years ago

so in order to breathe some life into this conversation again, here's my contribution...

i've been a happy dsub user for years now, but after recently installing it on my brand new samsung galaxy s10+ (running android pie and samsung's one ui) i've been dealing with a battery drain issue as well

it's not as dramatic as some previous examples shown in this thread, but i think you'll agree that this is not as it should be:

Screenshot_20190311-151603_Device care

(i don't remember dsub taking such large bites out of my battery capacity when i was using it on my pixel 2 xl)

i'm aware of the fact that this is probably a different issue (i toggled dlna casting off just to be sure), but i didn't want to add a new one only to be referred here ;) if i should open this as a new issue, please let me know

bjhiltbrand commented 4 years ago

I was having really bad battery drain issues since upgrading to Android 10 as well. However, I toggled casting off and it fixed my battery drain issues. I toggled it back on and it started draining again. I don't know, it seems like it's still a problem somehow.

jef commented 4 years ago

Having draining problems as well. I haven't even used it today and it's used 14% of my battery.

Update 1: Turned off DLNA and Syncing (it was syncing every hour). Will report back later to see what the usage is.

Update 2: Wow... A lot better battery performance. Not sure if it's related to sync or DLNA.

awsms commented 4 years ago

Update 1: Turned off DLNA and Syncing (it was syncing every hour). Will report back later to see what the usage is.

Update 2: Wow... A lot better battery performance. Not sure if it's related to sync or DLNA.

https://github.com/daneren2005/Subsonic/issues/976 Yup it was