[Q] How to troubleshoot kernel wakelock problems?
I've been optimizing my battery drain issues as suggested in other threads in here and elsewhere, since I'm having unusual battery usage when the phone is off (even in the flight mode, with WiFi,GPS,Autosync off, it uses more than 10% of the battery in 6 hours).
I've used CPU Spy, OSMonitor, BetterBatteryStats, and terminal commands (ps, top, etc.) trying to pinpoint the battery problem, and I got to some results, but I got stock with this issue:
CPU Spy shows that my Galaxy Note never goes to "Deep Sleep". It's always stuck with 200 MHz when it's turned off. So, I figure the issue should be a wakelock.
The BetterBatteryStats everything is (to some extent) natural, except that it shows (in its Kernel Wakelocks page) a huge number under the name "GPS", and I don't seem to be able to find the problem. Actually, the time reported for the "GPS" wakelock is almost equivalent to the uptime of the device minus the time that the device was fully awake (screen on).
For example, I turn off the screen, wait for 10 seconds, turn back on, and the number is increased by 10 seconds. (It doesn't increase when the screen is on)
Here's what I've tried already:
- Turning off the GPS (it was off from the beginning actually)
- Turning off everything (Wifi, Cell)
- Killing most of the apps in Running Services
- Restarting the device
One important observation was that when I restart the device, the "Deep Sleep" is back for some few minutes. When I use my device for one or two minutes (nothing special, turn on Wifi, do a sync) the "GPS" kernel wakelock is back, and doesn't go away no matter what I do.
I searched a lot, and nobody seems to have noticed a high "GPS" wakelock on the kernel.
My ROM is Samsung's stock ROM (Updated to 2.3.6)
Kernel version: 184.108.40.206-N7000XXKK9-CL725676
Anyone has any idea what to do to find out what is causing the wake lock?
There's a few experiments that I had:
- When I have WiFi turned off and restart the device (hold the power button, turn off, and turn back on) there is no issue (phone can go to deep sleep, and there's no "GPS" kernel wake lock). After turning on the WiFi and passing a few minutes, the issue is back.
- When I have WiFi turned on and restart the device (so that the WiFi is on from the beginning when the device starts) entering Deep Sleep is impossible. The "GPS" wake lock exists from the very beginning.
- The above issue made me think that it might be a Network Location issue. So I went to Settings > Location and security > and disabled "Use wireless networks" and restarted the device. The issue never happened again no matter how long I waited. I turned on WiFi, auto sync, manual sync, turned on GPS and used Google Maps, ... There was no problem with Deep Sleep. The device can sleep alright.
- When I changed the "Use wireless networks" setting back on, to my surprise, the issue DID NOT COME BACK. I even used it (located myself without GPS in Google Maps) and everything else... But the device can still go to sleep.
So, bottom line is that I have the issue fixed (for now!) but I can't realize what was it and why isn't it there anymore.
Anyone has any ideas?
The phone got to sleep well last night. 1 percent battery drain during the whole night. But when I got to work (the location changed), the "GPS" kernel wake lock is back, and causing the phone to stay awake. I had to disable the Network Location again to put my baby to sleep again...