[Q] Trying to get utility to auto-disable Wifi without wakelock on CM7 - Motorola Triumph

Okay, I've been trying to diagnose a somewhat annoying issue. I've been using a fairly simple set of conditions in the Llama utility to automatically disable Wifi when the screen turns off in CM7 to prevent a wakelock condition and reduce battery drain.
So I activate wifi, I reset the log in CPU Spy, and I lock the phone disabling the screen. When I reactivate the phone and check CPU Spy, wifi was definately off but the phone was never in Deep Sleep, so something was holding the wakelock I guess. I repeat the experiment with no changes and Llama still running, but this time I manually disable wifi before locking the screen. This time the phone immediately goes into Deep Sleep according to CPU Spy-- it works perfectly.
So what is the difference between Llama autodisabling and manually disabling wifi that leaves a wakelock active? I've repeated this experiment like ten times last night, and it isn't making much sense to me.
Thanks,
Gnat

I would love an answer to this as well. I can add that with juice defender ultimate the same thing happens. It will disable the wifi but the wakelock stays active. I have tried several settings and reboots and tests and the only thing that would get my phone to deep sleep was disabling JD.

mikel81 said:
I would love an answer to this as well. I can add that with juice defender ultimate the same thing happens. It will disable the wifi but the wakelock stays active. I have tried several settings and reboots and tests and the only thing that would get my phone to deep sleep was disabling JD.
Click to expand...
Click to collapse
I can't tell whether this is the exact same, because you make it sound like JD has the wakelock. In my case, Llama is running in both tests, the only difference is whether Llama turns off Wifi or I manually toggle it-- manual toggling puts it into deep sleep even with Llama running.
On the general battery issues on Triumph, one of the more helpful discussions I've seen is this one here-- http://androidforums.com/triumph-all-things-root/456795-cm7-triumph-battery-life-improvement.html. In it a quote from Tickerguy blesses the JuiceDefender approach to throttling data use for battery savings, but I don't think he had done any analysis regarding wakelocks. BTW, I reverted to stock today, and I am finding the exact same problems as CM7-- wifi imposes a wakelock, and Llama can't shut down wifi automatically without the wakelock persisting. I have to manually toggle wifi off before screen off before the wakelock is gone.
Regards,
Gnat

gnatd said:
I can't tell whether this is the exact same, because you make it sound like JD has the wakelock. In my case, Llama is running in both tests, the only difference is whether Llama turns off Wifi or I manually toggle it-- manual toggling puts it into deep sleep even with Llama running.
Click to expand...
Click to collapse
Sorry; the wakelock is WLAN. It is almost always active if JD is toggling wifi. I hadn't tried disabling wifi manually but leaving JD active yet. I just tested that and got deep sleep immediately. So it must have something to do with how it disables wifi isn't releasing the wakelock.

You know, after switching back to stock from CM7 I'm really not sure I'm not happier. With CM7 I was getting worse battery performance, which led me to start obsessing about wakelocks and deep sleep. Now that I am back on stock, I do the same analysis and see that I have the same problems with wakelocks and deep sleep-- but the battery performance is better so it's not that big a deal. I'm sure that there are things I could do to make CM7 have better battery performance-- but I wasn't enjoying the process and wasn't finding answers, so why bother?
It's like power management programs. I ran Green Power for a long time, and had some glitchy problems with being unable to get wifi to turn on even though it wasn't supposed to be managed while the screen was on. Then I disabled it, and you know what... my battery life was good enough to get me through the day. Froyo is good enough to get me through the day.

The wakelock was put in there on purpose to prevent the phone from hanging when WiFi was on and the phone went to sleep. I use my power widget to turn off WiFi before I turned off the screen unless I'm actually using it.
You could try and build it to see if removing the wakelock is still necessary. If you need help on that side, just post and I'll help. It's not hard, really.

Related

[Q] Wifi Sleep Policy of Off Screen on SUperAOSP ROM

I have trouble downloading large files using this ROM since when my screen turns off, WIFI is also disabled. How can I change it. I've been looking in the settings but to no avail.
Edit: Found it...you have to click menu when in the WIFI Settings, then choose advanced.
Edit2: Wifi is disabled when screen is turn off even if the Wifi sleep policy is changed to Never.
Any ideas?
then that is some kind of bug. because setting wifi sleep policy to never should behave as such.
related note, setting wifi sleep to never greatly increases batteyr life, as said thru the forums, because back on 3g the data kills your battery much faster. so allowing wifi to stay on makes a huge improvement on battery.
for example if you leave wifi on overnight, you might lose 5% total. but if it switches back to 3g overnight, you might lose 20%.
is this bug confirmed?
me too have same problem with SuperAosp (i will test with other rom....)

Ways to save battery

I've used the N5 for a few days now and I must say I'm impressed with everything except for the battery.
So the thing is, i really gave no craps about the battery on my Defy because I didn't care much for the phone either; so I'm sort of confused and out of ideas for battery saving.
I haven't rooted yet, but when I do my best guess would be just to down-clock the CPU, but how well does that really work? I use No-Frills and it works about 93% of the time, other times it just reverts. Do I need a kernel?
I keep it on about 10% brightness because I like soft lighting and screens. That works to a certain extent as well as the fact that I'm not a data user and I always turn wifi off when I'm not using it (like, immediately I will go and toggle it).
Other than turning off sync, is there anything else I'm missing? A good app maybe?
droid_<3er said:
I've used the N5 for a few days now and I must say I'm impressed with everything except for the battery.
So the thing is, i really gave no craps about the battery on my Defy because I didn't care much for the phone either; so I'm sort of confused and out of ideas for battery saving.
I haven't rooted yet, but when I do my best guess would be just to down-clock the CPU, but how well does that really work? I use No-Frills and it works about 93% of the time, other times it just reverts. Do I need a kernel?
I keep it on about 10% brightness because I like soft lighting and screens. That works to a certain extent as well as the fact that I'm not a data user and I always turn wifi off when I'm not using it (like, immediately I will go and toggle it).
Other than turning off sync, is there anything else I'm missing? A good app maybe?
Click to expand...
Click to collapse
Few things i've done is turn off wifi always scanning. set location to device only. undervolt -75 and max cpu 1575. i'm using cataclysm rom and frank r16 which was just recently released. when i was on r14 kernel i was getting about 7hour 1% drain on idle connected to wifi. I also try to monitor what I want to have push notifications for. So check what you have constantly Syncing.
cntrdctn said:
Few things i've done is turn off wifi always scanning. set location to device only. undervolt -75 and max cpu 1575. i'm using cataclysm rom and frank r16 which was just recently released. when i was on r14 kernel i was getting about 7hour 1% drain on idle connected to wifi. i also turn make sure i monitor what want to have push notifications. i hope this helps.
Click to expand...
Click to collapse
Biggest changes for me were:
-Disable Hotword detection. Turn it back on when you want to impress friends and otherwise hit the mic button manually. Increases Screen on Time.
-Disable Auto sync. Set an automation to only sync while charging instead. Increases Battery at all times, may slow charging a tad.
-Disable Locations. Enable if needed on the go. Can't automate this with Llama but I'm guessing it would work using Tasker. Many less wake locks you can go hours without a single one now.

Wifi will sometimes connect only when I turn the screen on

Hi, everyone.
I've noticed that, sometimes, my phone will only connect to a Wifi network after I turn the screen on, regardless of how long I've been inside the range of a particular acces point. For example, when I get home and I go to check my phone after I've been in there for a long time, I see the Wifi connecting right after turning the screen on. This isn't normal, is it? How can I fix this? I have it set to always active if that matters.
Thanks.
Most likely the phone is in deep sleep and doesn't scan for the WiFi network until you wake it. The alternative would be the phone waking itself to check, possibly "WiFi Always Scanning" would accomplish that.
bblzd said:
Most likely the phone is in deep sleep and doesn't scan for the WiFi network until you wake it. The alternative would be the phone waking itself to check, possibly "WiFi Always Scanning" would accomplish that.
Click to expand...
Click to collapse
Thank you, bblzd.
How long does it usually take for the phone to go into deep sleep? beacuse this has happened for example if I get out of the office for a while (a few minutes) and then go back in. I'll try the always scanning suggestion, but would it have a considerable impact in battery usage?
Adrianrff said:
Thank you, bblzd.
How long does it usually take for the phone to go into deep sleep? beacuse this has happened for example if I get out of the office for a while (a few minutes) and then go back in. I'll try the always scanning suggestion, but would it have a considerable impact in battery usage?
Click to expand...
Click to collapse
It should enter deep sleep as soon as the screen turns off, unless there is something using the CPU then it will stay awake or wake itself as needed.
Always scanning does use a significant amount of battery compared to if you were disabling the WiFi. However if you leave your WiFi on all the time anyways it shouldn't make any difference.
bblzd said:
It should enter deep sleep as soon as the screen turns off, unless there is something using the CPU then it will stay awake or wake itself as needed.
Always scanning does use a significant amount of battery compared to if you were disabling the WiFi. However if you leave your WiFi on all the time anyways it shouldn't make any difference.
Click to expand...
Click to collapse
Alright, I don't usually turn wifi off, so I'll try that.
Thanks again.
Didn't work, unfortunately.
Anyone else? I seem to be the only one experiencing this, can't find a single post about this online.
Any suggestions? I've tried rebooting into safe mode, turning data off, turning airplane mode on and enabling wifi, wiping cache partition, nothing helps. Still thee same behaviour.

[Q] WiFi not turning off automatically in deep sleep

Hello!
I finally received my OnePlus One and after setting it up I noticed that the phone will not turn off WiFi in sleep mode even though it's set to Never keep on WiFi during sleep. I suspect a wifi lock of some sort and I'm also noticing that after a period of time in sleep mode, wifi will periodically turn on and off for short duration.
I installed BetterBatteryStats, Wakelock detector and GSAM Battery Monitor but I can't find a clue as to what's keeping the WiFi on, or why.
Another thing I just noticed is that when charging now for the second time, the notification LEDs are not turning on while charging or when it's fully charged. It worked for the first time when I was charging it yesterday.
I am running all incremental upgrades (2 were installed when received yesterday), the device is rooted.
Could you help me find the app or setting that is keeping WiFi enabled and sometimes prevents the phone from entering deep sleep?
Thank you.
shiinkotheone said:
Hello!
I finally received my OnePlus One and after setting it up I noticed that the phone will not turn off WiFi in sleep mode even though it's set to Never keep on WiFi during sleep. I suspect a wifi lock of some sort and I'm also noticing that after a period of time in sleep mode, wifi will periodically turn on and off for short duration.
I installed BetterBatteryStats, Wakelock detector and GSAM Battery Monitor but I can't find a clue as to what's keeping the WiFi on, or why.
Another thing I just noticed is that when charging now for the second time, the notification LEDs are not turning on while charging or when it's fully charged. It worked for the first time when I was charging it yesterday.
I am running all incremental upgrades (2 were installed when received yesterday), the device is rooted.
Could you help me find the app or setting that is keeping WiFi enabled and sometimes prevents the phone from entering deep sleep?
Thank you.
Click to expand...
Click to collapse
Go into Settings>Wifi>Advanced and uncheck the "scanning always available" option.
timmaaa said:
Go into Settings>Wifi>Advanced and uncheck the "scanning always available" option.
Click to expand...
Click to collapse
Already done when I first got it. But thanks.
Does anyone have any idea on the charging light though as well ? It's enabled in the settings, everything is set up as it should be, indicator is working for other notifications but it's NOT turning on when charging or when fully charged.
EDIT: Figured that LED part out: turns out I accidentally disabled it during the quiet hours. :silly: But I still have the peristent WiFi on problem :/
So you're not getting any wakelocks show up when investigating via any of the apps you mentioned in the OP?
Transmitted via Bacon
timmaaa said:
So you're not getting any wakelocks show up when investigating via any of the apps you mentioned in the OP?
Transmitted via Bacon
Click to expand...
Click to collapse
No, nothing significant. And most of the time phone is not awake but wifi still stays on.
Are you actually experiencing bad battery life?
Transmitted via Bacon
I'm not experiencing a bad battery life, no. But I'm still interested in what's keeping the WiFi on when I explicitly set it to turn off when screen is off/phone is not awake. "Never settle", I guess.
Bump - so, is there a way to detect "wifi locks" and apps that turn it back on periodically while sleeping?

Battery Drain and Kernel Wakelocks

I've had this phone for a few days now and I notice some mean battery drain that happens from time to time. I dumped a Bug Report via developer options, and used Google's Battery Historian after leaving my phone unplugged and idle overnight after a full charge and reboot. The tool seems to show that the following kernel wakeup reason seems to be the problem and holding the phone awake for over 1.5 hours:
Code:
Ranking Name Duration/Hr Count/Hr Total Duration Total Count
0 Abort:Wakeup IRQ -1111803216 (null) pending 10m8s737ms 779.87 1h34m13.62s 7243
The only thing that looks remotely relevant is that on the tool WiFi signal strength became weaker when the above wakeup events started.
Has anyone else had similar issues with random battery drains like this and/or happen to know any workarounds?
Mine seems like it is always awake. Android OS has been keeping it awake for 8-9 while I'm at work.
I tried setting wifi to stay on when sleeping when plugged in, after a full idle overnight, I used my phone in the morning and the same issue came up. The ID above was different, but generally the same problem (IRQ with no description pending). Again, it looks to be wifi related based on the battery stats in Historian. I've rebooted, charged up and turned off wifi to see if the problem goes away.
ru_ready said:
Mine seems like it is always awake. Android OS has been keeping it awake for 8-9 while I'm at work.
Click to expand...
Click to collapse
You might want to try enabling developer options and getting a bugreport generated (which has battery stats), and then visualizing it in Google's Battery Historian to see if it is the same problem. Kind of convoluted, I know, but without root, I don't know of any better way to analyze kernel wakelocks (it isn't a partial wakelock issue on my device).
Last night I left my phone idle with wifi off and WLAN Scanning and Bluetooth Scanning off under Location Settings. The battery ran down only 2% over 9 hours and the Wakeup IRQ pending problem did not keep the phone awake!
I am going to try turning wifi back on today but keep the scanning off and see if that keeps this problem at bay. If not, I may use Tasker to force wifi off when the screen is not on and not plugged in.
The wakelocks seem to happen randomly no matter what my wifi settings are. Though I do think it is related to location settings trying to use wifi scanning.
I give up, there is no reason why a phone I just bought should be like this.
Maybe there are some apk wake up the system
@kumodog Maybe there are some apk wake up the system, you can reboot the system and kill all of application programs when you test it in night with wifi on.
After test, you can also use : "adb dumpsys alarm" in command line to find Top Alarms. it will tell you which alarm make system wakeup.

Categories

Resources