# Firm Sleep - Battery discharge 1% Per Hour



## no-tec (Aug 21, 2013)

I'm reading about everyone only losing 1-2% of their battery when they are in deep / firm sleep - but I lose about 10% every night, or about 1% an hour, which seems up to par with just regular standby. I have the tablet in the car (with FI mode), and ignition off greets with with a deep sleep count down - so I _think_ that it's going into deep sleep. Is there something I could be missing that's not allowing it to go into deep sleep? Is there more information I can provide that would help diagnose the issue better? The battery monitor says over 50% of the battery loss is due to idle time.

Thanks guys.


----------



## kodiack99 (Dec 6, 2012)

I would bet that it is an app causing your issue,the deep sleep function doesnt block rogue apps from periodically trying to wake to update or access certain gps location etc.

I would use titanium backup and the freeze app function to isolate the app or you can do a clean install and slowly reinstall the apps until you find which one is doing it. I had similar issues that were caused by the facebook app months ago,not sure if it still causes issues though.


----------



## no-tec (Aug 21, 2013)

Sounds logical enough - so not necessarily something running all the time, but just periodically pinging the system and not letting it sleep?

What is the freeze app function?

edit:

Haven't tested it yet, but there's a wake-lock detector app that monitors this exact thing:

https://play.google.com/store/apps/details?id=com.uzumapps.wakelockdetector&hl=en

I will test tonight and report back. Seems to be a common problem with android and improperly developed apps.


----------



## naiku (Feb 24, 2013)

Assuming that you are using Timur's ROM, go into Settings -> USB and then look under the System area. Here you will see an option for "Firm Sleep" make sure that is set to On. If you want to allow something to wake the tablet, go into Wake-Up Alarms and check anything you want to allow.


----------



## kodiack99 (Dec 6, 2012)

The freeze function is in titanium backup,it allows apps to be invisible to the system without being removed.


----------



## no-tec (Aug 21, 2013)

naiku said:


> Assuming that you are using Timur's ROM, go into Settings -> USB and then look under the System area. Here you will see an option for "Firm Sleep" make sure that is set to On. If you want to allow something to wake the tablet, go into Wake-Up Alarms and check anything you want to allow.


I thought firm sleep disabled that entire wake up alarms section (I have it on and thats what it says in the description of the option) - so I keep everything checked in there. I don't want anything waking the tablet ever when it is in deep sleep - so I should uncheck everything in that list? even all the system options?

Following up on the wake-lock detector app - I let it run over a few days and nothing really showed up as to keeping the system awake, and it said i was in deep sleep for all but a handful of seconds or something, with just pandora and gmaps waking it up one time. - yet I still dropped about 10% each night, so that app wasn't much of a help, unless it's something else from the system

Could the N7 just not be holding a charge cause it's a few years old? New battery?


----------



## no-tec (Aug 21, 2013)

Anyone got additional info on this? Still seeing this battery drop each night


----------



## poontab (Jun 7, 2011)

Moved to general. Please use development subforums for releases only.


----------



## no-tec (Aug 21, 2013)

I've got a pastebin here of some recent activity:

http://pastebin.com/S4UWZRPp

Is there someone in there who knows how to read through this and found out why my system isnt going or staying in deep sleep?

I replaced the battery recently with no real luck. Any advice is appreciated.


----------



## xapt3r5 (Aug 29, 2013)

Have you tried with a clean rom?

Do a backup with TWRP, wipe everything and try again with a clean rom. Check if the problem persist.

I'm having similar issues, since... Well, since I can remember, (It's been a while now... *sighs*)... My battery is discharging even faster than yours, about 30% every 8 hours!

I've checked, the tablet does in fact, sleep. CPU seems to be inactive too, but somehow, something must be still keeping the system active, as a whole. I had little time to test stuff, and when I did it, I haven't yet found the real, absolute cause for it, but I'm beginning to suspect it may be related to RAM accessing. Judging by the rate of repplies and quality of feedback about this subject, I assume pretty much everyone else, having same issues, has given up fixing them. So, my hopes for ever successfully fixing deep sleep aren't that high, as you can imagine.

Due to it being complicated, I thought another immediate approach was necessary and, could prove less painful for my daily use (sometimes I just couldn't boot it at near 0%), so for the time being, I've been working on and using a tasker shutdown procedure, at a user desired battery level, and combining this with the "off-mode charge 0" setting, to automatically boot up the system, after switching power on... This way I can, at least, keep enough charge to boot up the N7, (disregarding ready time).

I have been able to work around this and other USB rom issues/holes by just tweaking the right settings and using tasker actions. I will make posts revealing them soon, stay tuned!


----------



## no-tec (Aug 21, 2013)

Those logs were from a clean ROM, but after many moons, I finally figured out the cause of the drain. Having the location settings active was the cause of the problem. If I turn those off, I only lose what we are supposed to lose, about 2-3% a night. This means that I can't use GPS unless I switch it on, but at least I know the cause now. Give it a shot and see if you see anything similar.


----------



## xapt3r5 (Aug 29, 2013)

Oh really?!.. Well, I thought USB rom turned GPS off, by default, when putting the tablet at sleep. This one is new to me! :O

But what exactly have you turned off? All location settings, or just GPS satellite access? Or was it just one of the wake up alarm settings, and BTW, what was the wake alarm status for all settings, when you performed that test?

...And what about with a full customized rom, with all needed apps running, have you tried it? I´m not so sure if that is the only cause, If think there is still something randomly accessing RAM, but it could be anything, and I've got a ton off apps and services loaded!..

I tried once with a clean rom but I think I had pretty much the same results. The battery just didn't discharge as fast as 30% every 8h, maybe 15 or 10%, I don't quite recall it, but I guess I most certainly didn't care for GPS, at the time, anyway..

I will give it another shot, once I got the time for it, now I'm just too busy..


----------



## no-tec (Aug 21, 2013)

I don't see any mention of turn off gps in the rom details. I have_everything_ unchecked in the wake-alarm settings (aside from the data one, .phone something)

and I have location unchecked (so both GPS and Data, I haven't tested one or the other yet. )

Have you tried wake-lock detector? https://play.google.com/store/apps/details?id=com.uzumapps.wakelockdetector it will tell you what apps are keeping your tablet alive and waking it up.


----------



## xapt3r5 (Aug 29, 2013)

Well, here we go again. Nearly 7 months later from my latest check on this particular issue (It was boring to an extent), I finally scheduled some time and went through all the trouble of getting the N7 out from my dash, boot TWRP recovery, do a full backup, next a factory reset and flash again clean, the cm-10.1-20130817-USBROM-tilapia.zip (meaning Timur's rom for Tilapia N7), to have a baseline for comparison of battery stats plus running some tests free of 3rd party app polution. Just made it to the welcome screen, and barely setup very few basic stuff like language, time zone, and home wifi acess point, should I need to quickly use the stock browser...

I later installed GSAM battery monitor and the same Wake-lock detector app that the OP, @no-tec suggested, but, besides that, I didn't install anything else, not even the usual gapps zip file. I was anal enough to never activate my google account services (or playstore) so, those 2 apps were religiously downloaded from a desktop pc and then transferred to N7 internal storage and, installed from there using the rom's included root filebrowser. So, this should come up clean, and if anything, I should just need to tune up one setting or another, in hopes that could help me realize easy what was wrong.

First impression: Nothing has changed, really! The tablet just kept draining battery like crazy (the same 30% in aproximately 8 hours) while in firm, deep sleep. With a clean rom, can you believe this?! :O

So, I took a while longer and did a batch of tests, each one with even less, power hungry, settings activated. Wifi, wifi in standby, moblie data, BT, NFC, auto sync, background data, alll GPS related settings, auto brightness... You name it!.. All were deactivated in vain! Nothing ever seems to dramatically reduce battery consumption, no matter what I do. The latest test revealed that, N7 battery went from a fully charged 100%, to 85%, in little more than 3 hours! Outrageous!!

A hunt for a culprit took place, and I begun digging up some stats. Turns out the tablet is in fact, deeply sleeping during the time it is supposed to, every single time. GSam battery monitor also reports that the app "Android OS" is the one draining the most battery. Following up on wakelocks, I could only find relevant, those from the kernel, though they all are strangely few and short to begin with. Strings would come up, such as "event(#)-475 wakelock", "radio-interface", "baseband_xmm_power", etc... Being, "baseband_xmm_power", the one with the higher wake count.

Some googgling and after reading through discussions of similar issues, concerning many different devices, I arrived at this page:

https://code.google.com/p/android/issues/detail?id=42993

This one is actually an official issue tracker for the Tilapia Nexus 7, about the "baseband_xmm_power" wakelock . There's a lot of noise and people telling "got this", "tried that". There's even one guy, that says he has found an error in the source code. But, this one post that caught my attention is #170, where some guy claims his N7 has the NFC chip heating up, while in deep sleep. He also mentioned that the stats report tablet sleeps normally, despite the huge wakelock that shows up.

Some pics from the N7 Mboard and the NFC chip location








:










I didn't teardown my N7 but, I touched the back of it (while in deep sleep), on the exact same spot where the NFC module is and, I can say the casing definitely feels hotter in that spot, than anywhere else. I thought this could be just a matter of turning off the NFC in the settings, but as the poor dude in Google issue tracker complains, it wouldn't make any difference and I even witnessed it, randomly auto enabling itself, after rebooting, though by now I'm pretty sure It won't ever turn off, regardless of how much I reset it.

This has got to be it! In my electronics experience, if something is heating up, it's permanently active and it's drawing current and, it has to be drawing current from a power source, being in this case the N7 battery. After all the testing, I can't recall any other reason for my N7 to be draining that much battery. While in-dash, I know I have a heavy custom UI, with tons of widgets and stuff, and it really brings things to the edge. But now with a clean rom and a couple of hours of deep sleep, such a level loss, just doesn't add up!

@no-tec I'm glad, disabling GPS settings seemed to work for you.. Unfortunately, it didn't, for me. You haven't quite been around, for a while, I wonder how that worked out for you... Any clues as to how I may fix this?

What about all those other folks complaining about N7 battery drain with Timur roms? Does any of this ring a bell to you?

Timur himself? Anything, anyone?


----------

