Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,778,968 Members 42,517 Now Online
XDA Developers Android and Mobile Development Forum

[Q] How to troubleshoot kernel wakelock problems?

Tip us?
 
iravanchi
Old
(Last edited by iravanchi; 31st December 2011 at 06:35 AM.) Reason: Added the "update" part
#1  
Junior Member - OP
Thanks Meter 0
Posts: 7
Join Date: Apr 2009
Default [Q] How to troubleshoot kernel wakelock problems?

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
 
co2m
Old
#2  
Junior Member
Thanks Meter 3
Posts: 23
Join Date: May 2011
Location: Jakarta
I have the same problem..Huge GPS percetage but the GPS is off.. I will try your methode now..hope it works
 
EarlZ
Old
(Last edited by EarlZ; 1st January 2012 at 01:28 AM.)
#3  
Senior Member
Thanks Meter 272
Posts: 5,707
Join Date: Jun 2010
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.
 
yawnlike
Old
#4  
Junior Member
Thanks Meter 0
Posts: 6
Join Date: Nov 2008
Location: 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
Old
#5  
Senior Member
Thanks Meter 41
Posts: 381
Join Date: Feb 2003
same issue here since kl7
 
ArcticCat
Old
(Last edited by ArcticCat; 7th January 2012 at 12:02 AM.)
#6  
Senior Member
Thanks Meter 41
Posts: 381
Join Date: Feb 2003
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
a Note for me, an S2 for my wife and we're a happy family
 
amdunfreak
Old
#7  
Junior Member
Thanks Meter 2
Posts: 25
Join Date: Jan 2012
i have exactly the same problem.

galaxy note on rocket rom v14 and v15.
i'll try your method and update if find anything. it's driving me nuts!
 
gaddy888
Old
(Last edited by gaddy888; 17th January 2012 at 04:28 AM.)
#8  
Member
Thanks Meter 3
Posts: 57
Join Date: Dec 2011
Default Exactly same problem here

Click image for larger version

Name:	SC20120117-084523.jpg
Views:	1144
Size:	26.0 KB
ID:	860393

Click image for larger version

Name:	SC20120117-084719.jpg
Views:	982
Size:	42.5 KB
ID:	860394

Click image for larger version

Name:	SC20120117-084802.jpg
Views:	904
Size:	18.2 KB
ID:	860395

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.
Attached Thumbnails
Click image for larger version

Name:	SC20120117-084640.jpg
Views:	652
Size:	41.8 KB
ID:	860404  
 
ArcticCat
Old
#9  
Senior Member
Thanks Meter 41
Posts: 381
Join Date: Feb 2003
The only way I found around this is to reboot in airplane mode...
a Note for me, an S2 for my wife and we're a happy family
 
gaddy888
Old
#10  
Member
Thanks Meter 3
Posts: 57
Join Date: Dec 2011
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

Tags
battery, betterbatterystats, gps, kernel, wakelock
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Make a Pre-Rooted Stock Sony ROMs in Just Few Clicks

Many usersdon’t see any particular reason to change out the stock firmware … more

Add Timestamps to Xposed Installer Logs with… Xposed!

If talking about the most interesting projects in the last few years, we must … more

Secrecy Goes Open Source, Assures File Encryption

As some of you may remember, a while back we spoke about Secrecy, an effective file … more

[APK] Google News and Weather Gets Material Design Makeover, Minor Maps Updates

Although Google has somewhat gotten out of the habit of their … more