• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[Q] How to troubleshoot kernel wakelock problems?

Search This thread

iravanchi

Member
Apr 27, 2009
7
0
Hi everyone,

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: 2.6.35.7-N7000XXKK9-CL725676

Anyone has any idea what to do to find out what is causing the wake lock?


------------


Update:

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?


------------

Another update:

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...


-Hamed
 
Last edited:

EarlZ

Senior Member
Jun 21, 2010
6,285
327
I had the very same issue on KK9/KL3/KL7

I dont have the GPS enabled but the scenario is similar, I used the phone with wifi (but no wifi location services enabled) and it does not go into deep sleep till the phone is restarted and bettery battery stats show a huge uptime caused by the GPS.
 
Last edited:

yawnlike

Member
Nov 29, 2008
6
0
Bangalore
I seem to be facing the same issue. My phone used to go into Deep Sleep without any issue earlier, I noticed this issue today. I'm trying OP's suggestions and will report back if it helps.
 

ArcticCat

Senior Member
Feb 13, 2003
391
42
Making me crazy.. Anyone has a solution?
It happens whenever they phone boots with wifi on... Booting with wifi off then turning it on it will sleep fine
 
Last edited:

gaddy888

Senior Member
Dec 18, 2011
57
3
Exactly same problem here

SC20120117-084523.jpg

SC20120117-084719.jpg

SC20120117-084802.jpg

I have the same problem. Sometimes on restarting, the problem seems to go away. Have just not been able to find a pattern to see what triggers it off.
I've attached some screen shots.
My phone lost about 20% in 8 hours. At night. Ridiculous.
 

Attachments

  • SC20120117-084640.jpg
    SC20120117-084640.jpg
    41.8 KB · Views: 791
Last edited:

gaddy888

Senior Member
Dec 18, 2011
57
3
Maybe it's some program keeping it awake. Keeps trying to get a fix on location.
Are any of you using Samsung dive? Or have you enabled the "remote control" feature?

Sent from my GT-N7000 using XDA App
 

gaddy888

Senior Member
Dec 18, 2011
57
3
I did try logging out of Lattitude. The problem didn't appear for a while, but it's back now.

Has it got anything to keeping the Auto Sync on?
 

Anonymous Vagrant

Senior Member
Jan 1, 2012
375
105
I have the same problem and i am on RocketROM v19 + AbyssNote 3.2. The GPS appears after i discharge to about 80% mark.

f072730f08.png
a8321a266c.png
e331e0c83c.png


The percenetage of my battery is from 100% to 1%, what is "GPS" that is keeping my phone from sleeping?
 

sibere

Retired Recognized Developer
May 14, 2006
2,055
375
Paris
I have the same issue.

From time to time the GPS kernel wakelock kicks in and starts draining the battery.

This appears mainly when I connect to a Wifi network and never when I use a GSM network data link.

2 solutions for me: restart the phone with wifi off.
Enable GPS, start a GPS software like GPS test for a short while, and then leave the app and stop the GPS again.

When I check with CPU spy, the phone enters deep sleep again.
 

ArcticCat

Senior Member
Feb 13, 2003
391
42
it is not related to any widget or so, i tried all combinations and, no matter what, gps will come back again.

the only way around this I found was to reboot in airplane mode. it would work for a day or so and then GPS wakelock will show again needing another reboot
 

Anonymous Vagrant

Senior Member
Jan 1, 2012
375
105
No need to reboot in airplane mode, just turning off wifi and reboot will work. This is troublesome as i have encountered GPS waking my phone twice a day sometimes. I am fed up with rebooting my phone. I really hope they fix this in future ICS.

I am currently testing on logging out facebook, i have yet to encounter the GPS wakelock so far. Hope all goes well and facebook is the root of these GPS wakelocks.
 

sibere

Retired Recognized Developer
May 14, 2006
2,055
375
Paris
Did you also tried what I posted above?

Enable GPS, start a GPS software like GPS test for a short while, and then leave the app and stop the GPS again.

It's working for me.

I noticed that this "GPS" wakelock appears only when I'm connected via WiFi with a very weak signal.
 

Anonymous Vagrant

Senior Member
Jan 1, 2012
375
105
Did you also tried what I posted above?



It's working for me.

I noticed that this "GPS" wakelock appears only when I'm connected via WiFi with a very weak signal.

I am constantly connected to a very weak wifi connection too but does that really have anything to do with the GPS wakelock? if so, i will look into this to confirm.

And your methods above, does it work permanently or whenever the GPS wakelock occurs, i have to redo the steps?