FORUMS
Remove All Ads from XDA

[GUIDE] Wakelocks Definition and how to prevent them

9,954 posts
Thanks Meter: 6,811
 
By Goku80, Senior Member on 1st March 2013, 12:05 PM
Post Reply Email Thread
Please be patient with me guys this thread is work in progress...Many thanks to ahalford and with reading and learning from our great kernel devs here i will build this thread up as we go along


Right first up this thread is work in progress. Most of the info is from ahalford. He has been kind enough for me to use the information on his thread and share it here with you guys. Now to start with i will be sharing his info here and then i will be adding my own information as i go along with this thread as i am still learning and i feel i can add my own input here to...So enough of this and lets get going with the thread


What is wakelock and why it may cause battery drain:

Wakelocks or to be more precise partial wakelocks is a pattern (in fact a class) than helps devs to make sure that important pieces of their code do not get interrupted.
Basically the phone has (simplified, kernel devs don't shoot) three states:
1. awake with screen on
2. awake
3. sleeping (that's you phone favorite state)

The transitions are from (1) to (2) and finally from (2) to (3). Now as long as you use your phone it's in (1) and does not leave that state as long as you keep using it interactively. If you stop using it the phone is aiming to go to (3) as fast as possible.
And here's where wakelocks are important: as our phones as smartphones they tend to do background processing. Some of this processing is important like e.g. making a phone call, listening to music or synchronizing your contacts.
As the phone wants to go from (2) to (3) and on the other hand you don't want to hang up while you are in a call the app keeps hold of a wakelock to prevent that transition. When you hang up the partial wakelock gets release and here we go (the phone goes to sleep).

So partial wakelocks is a tool and it's not something that we should forbid for obvious reasons. Now there are cases when the design on an app is not real life proven (conditions of poor of no coverage) and the wakelocks have negative effects because they are held unnecessarily or for too long.

How can we identify it?

BetterBatteryStats app identifies these wakelocks and using your expertise or the once from our users here you can understand what happens and find a strategy to change that for the better.
Link for BetterBatteryStats:
XDA Thread
Playstore Link

New app as well other than BBS is Wakelock Detector..
Link: WakeLock Detector - XDA thread
With this app you can detect applications which are consuming much battery by checking wakelock history.
It simplifies BetterBatteryStats by concentrating more on wakelocks.
No any background services or system bootup events for gathering data.



Brief explanation, about where to look at the wakelocks:
  1. Set your reference as "Since unplugged" in the second line.
  2. Then, in the first line: "Other" - look at the "Awake" vs "Screen on". If it differs a lot, continue with a drill-down.
  3. First line - check under "Partial Wakelocks" and "Kernel wakelocks".
  4. "Menu" - "More" - "Raw kernel wakelocks"
  5. For more help: "Menu" - "Help" - "Getting started" or "How to".


Brief History Lesson
The relationship between embedded system developers and the kernel community is known for being rough, at best. Kernel developers complain about low-quality work and a lack of contributions from the embedded side; the embedded developers, when they say anything at all, express frustrations that the kernel development process does not really keep their needs in mind. A current discussion involving developers from the Android project gives some insight into where this disconnect comes from.
Android, of course, is Google's platform for mobile telephones. The initial Android stack was developed behind closed doors; the code only made it out into the world when the first deployments were already in the works. The Android developers have done a lot of kernel work, but very little code has made made the journey into the mainline. The code which has been merged all went into the staging tree without a whole lot of initiative from the Android side. Now, though, Android developer Arve Hjønnevåg is making an effort to merge a piece of that project's infrastructure through the normal process. It is not proving to be an easy ride.

The most controversial bit of code is a feature known as "wakelocks." In Android-speak, a "wakelock" is a mechanism which can prevent the system from going into a low-power state. In brief, kernel code can set up a wakelock with something like this:

Code:
 #include <linux/wakelock.h>
wake_lock_init(struct wakelock *lock, int type, const char *name);
The type value describes what kind of wakelock this is; name gives it a name which can be seen in /proc/wakelocks. There are two possibilities for the type: WAKE_LOCK_SUSPEND prevents the system from suspending, while WAKE_LOCK_IDLE prevents going into a low-power idle state which may increase response times. The API for acquiring and releasing these locks is:

Code:
void wake_lock(struct wake_lock *lock);
    void wake_lock_timeout(struct wake_lock *lock, long timeout);
    void wake_unlock(struct wake_lock *lock);
There is also a user-space interface. Writing a name to /sys/power/wake_lock establishes a lock with that name, which can then be written to /sys/power/wake_unlock to release the lock. The current patch set only allows suspend locks to be taken from user space.

This submission has not been received particularly well. It has, instead, drawn comments like this from Ben Herrenschmidt:

looks to me like some people hacked up some ad-hoc trick for their own local need without instead trying to figure out how to fit things with the existing infrastructure (or possibly propose changes to the existing infrastructure to fit their needs).
or this one from Pavel Machek:

Ok, I think that this wakelock stuff is in "can't be used properly" area on Rusty's scale of nasty interfaces.
There's no end of reasons to dislike this interface. Much of it duplicates the existing pm_qos (quality of service) API; it seems that pm_qos does not meet Android's needs, but it also seems that no effort was made to fix the problems. The scheme seems over-engineered when all that is really needed is a "do not suspend" flag - or, at most, a counter. The patches disable the existing /sys/power/state interface, which does not play well with wakelocks. There is no way to recover if a user-space process exits while holding a wakelock. The default behavior for the system is to suspend, even if a process is running; keeping a system awake may involve a chain of wakelocks obtained by various software components. And so on.

The end result is that this code will not make it into the mainline kernel. But it has been shipped on large numbers of G1 phones, with many more yet to go. So users of all those phones will be using out-of-tree code which will not be merged, at least not in anything like its current form. Any applications which depend on the wakelock sysfs interface will break if that interface is brought up to proper standards. It's a bit of a mess, but it is a very typical mess for the embedded systems community. Embedded developers operate under a set of constraints which makes proper kernel development hard. For example:

One of the core rules of kernel development is "post early and often." Code which is developed behind closed doors gets no feedback from the development community, so it can easily follow a blind path for a long time. But embedded system vendors rarely want to let the world know about what they are doing before the product is ready to ship; they hope, instead, to keep their competitors in the dark for as long as possible. So posting early is rarely seen as an option.
Another fundamental rule is "upstream first": code goes into the mainline before being shipped to customers. Once again, even if an embedded vendor wants to send code into the mainline, they rarely want to begin that process before the product ships. So embedded kernels are shipped containing out-of-tree code which almost certainly has a number of problems, unsupportable APIs, and more.
Kernel developers are expected to work with the goal of improving the kernel for everybody. Embedded developers, instead, are generally solving a highly-specific problem under tight time constraints. So they do not think about, for example, extending the existing quality-of-service API to meet their needs; instead, they bash out something which is quick, dirty, and not subject to upstream review.
One could argue that Google has the time, resources, and in-house kernel development knowledge to avoid all of these problems and do things right. Instead, we have been treated to a fairly classic example of how things can go wrong.

The good news is that Google developers are now engaging with the community and trying to get their code into the mainline. This process could well be long, and require a fair amount of adjustment on the Android side. Even if the idea of wakelocks as a way to prevent the system from suspending is accepted - which is far from certain - the interface will require significant changes. The associated "early suspend" API - essentially a notification mechanism for system state changes - will need to be generalized beyond the specific needs of the G1 phone. It could well be a lot of work.

But if that work gets done, the kernel will be much better placed to handle the power-management needs of handheld devices. That, in turn, can only benefit anybody else working on embedded Linux deployments. And, crucially, it will help the Android developers as they port their code to other devices with differing needs. As the number of Android-based phones grows, the cost of carrying out-of-tree code to support each of them will also grow. It would be far better to generalize that support and get it into the mainline, where it can be maintained and improved by the community.

Most embedded systems vendors, it seems, would be unwilling to do that work; they are too busy trying to put together their next product. So this sort of code tends to languish out of the mainline, and the quality of embedded Linux suffers accordingly. Perhaps this case will be different, though; maybe Google will put the resources into getting its specialized code into shape and merged into the mainline. That effort could help to establish Android as a solid, well-supported platform for mobile use, and that should be good for business. Your editor, ever the optimist, hopes that things will work out this way; it would be a good demonstration of how embedded community can work better with the kernel community, getting a better kernel in return.

Many thanks firstly to the following:
ahalford: for his awesome thread and his awesome work and a great guy for allowing me to share his work here...please click the thanks for him for all this
chamonix and his team: for his awesome must have app BBS and for all the work they put in it...without that app we would be lost..
Entropy512: guy is a human wikipedia...
To all the kernel devs and those who explained in detail regarding the wakelocks definitions and everything else..

Like i said above i merely put all the info together from ahalford...he is the genius behind this thread and please click here to check his thread out and thank him...I will be adding my own info here as well and make this thread in the long term as my thread to be proud of..
The Following 67 Users Say Thank You to Goku80 For This Useful Post: [ View ] Gift Goku80 Ad-Free
 
 
1st March 2013, 12:05 PM |#2  
Goku80's Avatar
OP Senior Member
Flag Within the Matrix
Thanks Meter: 6,811
 
More
TYPICAL REASONS FOR WAKELOCKS & APP SUCKERS, KNOWN ISSUES:

*Any kind of messengers, social clients – like Skype, Facebook, Twitter, etc. Any of those, who want to be online, receive a push messages, sync every while. If it’s must to have them, disable it in accounts sync settings, and disable notifications in each app’s setting.

*“Energy savers” – Green Power, Timeriffic, etc. They mess with the system power policy, if you choose to enable/disable wi-fi, gps, data, Bluetooth, etc. Especially, Samsung’s one is known as problematic.

*“Soft-buttons”, so called “power button savers” – like ScreenOff & Lock and such. Related to previous group. Let the hardware do the job.

*Task killers - If it kills some services in the middle of their action, it will cause’em start all over again or even stuck, and eat your precious battery resources. If you have to use it (like in case with JB 4.1 memory leak issue, do it manually).

*Your sound settings – screen vibro & sounds on tap, haptic feedback – disable it.

*Media Scan – process, that will run after each fresh install & reboot. Typically takes about 10-15 minutes, runs on high CPU frequency. If stuck more than this, causes no Deep Sleep (can be seen in CPU Spy app) – you have an issue with Media Scan. It can stuck on large files directory – nothing to do here, unless you can reduce files number. Another case – problematic memory cluster, and there is only solution to back your data, format your storages, and start over.

*Startup - Check it – do you really need this entire long startup list? Throw some; it will only make the system act better.

*Accounts sync – again: Minimize your list. Drill down every account setting, Google especially: Picasa, Google Disc, G+, etc.

*App settings – always drill down your app settings – it may be some nasty hidden setting, that enables your app to be in constant action. No concrete advise, treat each app individually.


TIPS:
  • Always perform clean install! Backup your stuff – App2zip (free on market) app, Titanium, whatever – spend some time for formats and setting up your settings, you will only have profit on this.
  • Don’t judge your battery consumption right after new rom/kernel install. Especially in the first hour, while Media Scan is busy with scanning your storage. System needs some time to settle.
  • It is highly suggested, after you installed all apps and made your configurations, to reboot recovery and clean your cache & dalvick.
  • If you’re installing custom kernel and any .zip flashable files, don’t do it in the same time with rom flashing. Flash the rom, reboot system, let it settle, then reboot recovery again, flash your kernel/mods, let it settle again.
  • WI-FI sleep policy: leave it on “Always”. Note’s wi-fi chip consumes nearly zero energy, and it would be much healthier to leave it on.
  • WI-FI home network: if you’re on dynamic IP, set to maximum your DHCP lease time in router setting, and bind your device to the MAC address. Also, fix your WI-FI channel and frequency both on device and router.
  • Don’t mess with Fast Dormancy app, if you don’t have dormancy related wakelocks, or if you don’t know your cell operator dormancy setting! And, on JB 4.1 it’s sometimes more preferable to leave it on, than to deal with some weird wakelocks, that may appear. Another case – if your operator setting for dormancy is “off”, app won’t discover it, and, actually, you may enable it instead of disabling it.

PWL Bloodsucking apps that drain the battery due to constant wakelocks. (thanks to T.J.Bender)

A note when uninstalling Google built-ins: Google built-ins are often system packages, and deleting them can have unpredictable results. I highly recommend freezing them in Titanium Backup for several days to see how the phone runs before uninstalling them through there as well. Deleting system processes is inherently risky, and I assume no responsibility for your own decisions.

Facebook: Any social networking app will want to sync as often as it can, but you can overrule that by setting notification intervals. Thing is, Facebook doesn't respect those intervals, and wakes up the device for data exchanges pretty constantly (even though your news feed may only update every hour or so when you want it to). This app is no better than bloat, and should be treated as such when you clean house.
Alternative App: Friendcaster. It's as good a third-party Facebook client as you'll find on Android, and it only wakes up when you tell it to.

Gmail: A running theme here will be that if there's a non-Google equivalent to a Google app, you should probably kill the Google and download the alternative. Gmail is an alarm fiend, and one of the main offenders if you have an excessive SyncLoopWakeLock problem.
Alternative App: How many email clients are out there? I've had the best luck with the stock Email app, but K-9, Kaiten, MailDroid, even Enhanced Email and Touchdown for the power users are all great alternatives. Speaking of which...

Whatever email client you're using: Email clients will always be high up on the list of alarms, and that's by their nature. Keep an eye with raw network stats on how long they're connected for, and don't be afraid to experiment. I tried K-9, Kaiten and MailDroid before settling back on the stock Email app as the one that gave me the best balance of battery life and necessary features.
Alternative Apps: Download and try out different clients until you find the one that works for you. Nothing ventured, nothing gained, right?

Google Latitude: Latitude is a tracking service. As such, it tracks you. Beyond the creepiness aspect of that, it holds your phone awake pretty often while doing so. Kill it. Kill it with fire.
Alternative App: Personally, I'm not into the whole stalking thing, but I've heard that Glympse works quite well.

Google Maps: Colossal waste of space and battery. You can do better. An important note on Google Maps: this app will still wake your device up even after being frozen in Titanium Backup. I don't know how it happens, but it does. To truly solve the alarms from Google Maps, you have no choice but to uninstall it. Do so at your own risk.
Alternative Apps: I'm a fan of Waze for navigation and MapQuest for a Google Maps-ish browseable interface. OSMAnd is also a great alternative, but it uses a ton of internal memory because of its offline nature.

Google Play Music & Movies: Updates itself constantly and wakelocks. Even if you freeze it, it still somehow manages to tell you that there's an update available. It's the Google zombie.
Alternative App: There are literally 100+ music and/or movie players out there. I'm sure you can find one that works for you. I'm a big fan of RocketPlayer for music, and I just use the stock video app more often than not.

JuiceDefender: What's that you say? JD sets off tons of alarms and holds the device awake for more time than I'd care to discuss, largely because of its data control settings. More harm than good, in my opinion.
Alternative Apps: JuiceDefender's main goal in life is to minimize the amount of time your device is held awake. Therefore, if you've just gone through all this to clear out wakelocks, do you really need another wakelock-prone app to do what you've already done?

Skype: Occasionally, after a call, Skype will wakelock. This is not designed to happen, and is more a glitch in the app than a forced sync. Force-stopping the app and clearing its cache have solved it for me on the rare occasion that I've seen the wakelock occur.
Alternative Apps: No idea. I don't personally consider this a "replace" situation.

World Weather Clock Widget: Do you have this on your phone? Get rid of it. I installed it as an alternative to SiMi Clock Widget, and while it certainly looks pretty, it ignored my "Update every 3 hours" and tried to update 275 times in that 3 hour window. This drove AlarmManager, GSYNC_ACONN, and NetworkStats off the deep end, and left me at 82% deep sleep with 6% of my battery gone in 3 hours. Kill it. Kill it with flaming nuclear waste.
Alternative Apps: I liked SiMi Clock and wanted to try something new, basically. I'm back to SiMi, but there are literally hundreds of clock widgets out there.


Wakelocks - XDA Developers Wiki - Worth the read trust me
The Following 34 Users Say Thank You to Goku80 For This Useful Post: [ View ] Gift Goku80 Ad-Free
1st March 2013, 12:06 PM |#3  
Goku80's Avatar
OP Senior Member
Flag Within the Matrix
Thanks Meter: 6,811
 
More
Wakelocks Definition
AlarmManager:
Speaking Name: Alarm Manager
Rationale: AlarmManager provides access to the system alarm services. These allow you to schedule an application to be run at some point in the future. When an alarm goes off, the Intent that had been registered for it is broadcast by the system, automatically starting the target application if it is not already running. Registered alarms are retained while the device is asleep (and can optionally wake the device up if they go off during that time), but will be cleared if it is turned off and rebooted. The Alarm Manager holds a CPU wake lock as long as the alarm receiver's onReceive() method is executing. This guarantees that the phone will not sleep until you have finished handling the broadcast. Once onReceive() returns, the Alarm Manager releases this wake lock. This means that the phone will in some cases sleep as soon as your onReceive() method completes.
Know actions: AlarmManager itself is not generating partial wakelocks but the applications (intents) that were set to be called when an alarm goes off do. Alarms can be listed through the menu "Actions - Alarms".
AlarmManager is a universal process that MANY apps use to update time, push you notifications, etc. In most cases, it is a necessity; in other cases, you should really check it out and disable/uninstall things that have invoked it too much.

AudioOut_1
Speaking Name: AudioOut_1
Rationale: AudioOut is used to play notification and system sounds.
Know actions: From the home screen... Menu -> Sounds -> uncheck "Touch Sounds", uncheck "Screen lock Sounds"
Known conditions of occurence: Each time the screen is touched or locked.
Definition: "AudioOut_1" is a Wakelock that is basically a kernel process that funnels data from audio apps to the audio hardware. It's what processes audio from say, Pandora or Slacker Radio, and passes it to the phone's audio hardware.

AudioOut_3

User Experience
But for those of you that have lockscreen sounds on, touch screen sounds on and dialpad touch tones on then you will have massive wakelock. I had this same problem with my S2.
Only way to beat this. Settings - Sound - system and untick the first 3 options. Reboot and charge your phone and then check the difference. You will see that the wakelock is not as high as it use to be.
More info regarding this you can find here

ConnectivityService
Speaking Name: ConnectivityService
Rationale: Service responsible for tracking data connection / apn, establish and maintain connections. This wakelock is held during transition between data connections.
Know actions: May be conditioned by using a different radio/modem or bad coverage, may be reduced by forcing 2G.

deleted_wake_locks
Speaking Name: deleted_wake_locks
Rationale: In the API available to android drivers it is advised to call wake_lock_destroy before freeing the memory of the wakelock struct that they created. This is done above all on shutdown, but also in a few situations where a driver is unloaded dynamically from the kernel. Whenever it happens, the destroyed wakelocks disappear from the list but their stats are added up to this pseudo-wakelock to the deleted_wake_locks. This allows knowing that a set of old wakelocks had a combined set of stats that this entry shows. The stats of this entry do not increase unless additional real wakelocks that have non-zero stats are destroyed.
Know actions: Since this is merely an entry that combines the activity of all the kernel wake locks that no longer exist, there's nothing that can be directly done to reduce this entry. The best course of action is to identify the wake locks that generate activity and that are later deleted, before that happens and they end up showing in a combined way on this entry.
Known conditions of occurence:
The Wifi driver is one known source for kernel wakelocks that are destroyed whenever the driver is unloaded (when Wifi is disabled manually or as part of the turn-off policy). Wakelocks such as wlan_rx_wake and wlan_wake, when the driver is unloaded, will no longer show up in the list and their stats be added to the deleted_wake_lock previous values.

GTALK_ASYNC_CONN_com.google.android.gsf.gtalkservi ce.AndroidEndpoint
Speaking Name: AndroidEndpoint
Rationale: This wakelock has been found to occur under certain non reproducible conditions, showing high wakelock counts and in certain cases high wake times. As the reasons are not exactly known there is no garanty that this wakelock does not occur for other yet unknown reasons.
Know actions: In one case (see ref) this wakelock was successfully removed by changing the proxy / re-creating an APN definition and leaving the proxy blank for that APN. The "faulty" proxy was predefined for the provider Orange but it is not excluded that proxies from other providers show the same effect.
Known conditions of occurence:
Conditions are unclear, to be confirmed

network-location
Speaking Name: Network Location
Rationale: The network location service is responsible for providing coarse grained location information to requesting applications.
The frequency of updates (and of wakelocks) is related to the precision requested by the application (max. time between updates, precision in meters).
Examples of app requesting coarse grained location: weather widgets, latitude, most social tools, google+
Know actions: Actions to reduce wakelocks:
• Find the responsible app: look for all network-location wakelocks and check for the responsible apps on the second line of the list
• Check the settings of the app to see if the precision can be changed
• Use the benefits of Wifi based location (stable location minimizing the update frequencies)
• Look for alternative apps with a better design
Known conditions of occurence: Poorly designed apps with too high requirements on precision will drive the Network Location Service up.
Unstable network conditions (frequent handovers between towers) may trigger location updates.
In some cases updating the radio/modem has effect on the network location: the location is based on the tower information delivered by the RIL.
Related wakelocks: LocationManagerService, NetworkLocationLocator, WifiService, GpsLocationProvider, network-location-cell-update

PowerManagerService
Speaking Name: PowerManagerService
Rationale: This kernel wakelock is a placeholder for all partial wakelocks being held in userland.
Know actions: Use "Partial Wakelocks" to drill down the applications / services causing wakelocks.
Known conditions of occurence: Some devices show userland wakelocks as a total named PowerManagerService

suspend_backoff
Speaking Name: suspend_backoff
Rationale: suspend_backoff is triggered whenever there's a rapid succession of sleep-wakeup-sleep transitions in a short period of time (10 occurrences within x ms IIRC). When that happens, SB makes sure the device is continuously awake for a bit instead of alternating a lot. The KWL count indicator could give a hint about the source of those continuous wakes, but not a definite answer because it doesn't show their time distribution.
Known conditions of occurence: Read here on how to tackle this wakelock and read here to

svnet
Speaking Name: svnet-dormancy / multipdp from the man himself(those are synonyms, depending on android version)
Rationale: svnet-dormancy is a kernel wakelock related to cell data transfers - Fast dormancy or not, you get a 6 second wakelock any time the radio transfers data..In other words, the phone stays awake for 6 seconds for every incoming data packet which effectively prevents it from sleeping.
Know actions: Change the duration of the wakelock (use at your own risk). Reduce the wakelock by reducing the amount / number of data traffic requests
Known conditions of occurence: Caused by data traffic

Sync:
Speaking Name: Account Sync Service
Rationale: The sync service is responsible for syncing all the accounts from "Settings" - "accounts and sync". A wakelock is held while the sync process is running.
The more items are getting synced and the more often the sync occurs the higher the wakelock time will be.
Potentially the wakelock time is prone to raise in case of bad data connectivity.
Examples of accounts are: twitter, google+, linkedin, google mail
Know actions: Actions to reduce wakelocks:
• Remove any unwanted accounts
• Check the settings and remove any unwated options (contact sync)
• Check the frequency of the sync and see if you really need it as defined
Known conditions of occurence: Under bad data connectivity conditions, with poorly designed Sync providers
Related wakelocks: none
References: A known bug related to gmail:Email app wakelock

SyncLoopWakeLock
Speaking Name: SyncLoopWakeLock (Account Sync)
Rationale: SyncLoopWakeLock is the wakelock used by the Android SyncManager (android.content.SyncManager) and was introduced starting in 4.01. The sync service is responsible for syncing all the accounts from "Settings" - "accounts and sync". A wakelock is held while the sync process is running.
The more items are getting synced and the more often the sync occurs the higher the wakelock time will be.
Potentially the wakelock time is prone to raise in case of bad data connectivity.
Examples of accounts are: twitter, google+, linkedin, google mail
Know actions: Actions to reduce wakelocks:
  • Remove any unwanted accounts
  • Check the settings and remove any unwated options (contact sync)
  • Check the frequency of the sync and see if you really need it as defined
Known conditions of occurence: This wakelock is held by the SyncManager while handling sync actions (method handle()). Previously this wakelock was known as sync. Under bad data connectivity conditions, with poorly designed Sync providers this wakelock is held longer.
Related wakelocks: sync https://github.com/asksven/BetterBatteryStats-Knowledge-Base/wiki/sync
Which stated as above both similar and can cause same drainage if not tackled properly.

com.android.phone(under alarms,BBS)
Way to beat it:
1. Choose SETTINGS - WIRELESS CONTROLS - MOBILE NETWORKS -
2. uncheck everything unnecesary ie. "Data Roaming" and "Enable always-on mobile" -
3. Change setting on "Use only 2G networks", wait 10 seconds, then change it back.
4. Now try NETWORK OPERATORS. Here you will get a network error (Not the "com.android.phone" error)
Just continue and you'll get your wanted network.
The reason for this behavior is that android uses a new type of network and supports old ones.
Some countries dosen't use this new network.
When your android phone makes a handshake in these countries it'll accept without error, but when it returns to the new type it won't connect.
This must be a bug and you can solve / workaround this by doing the above
The Following 26 Users Say Thank You to Goku80 For This Useful Post: [ View ] Gift Goku80 Ad-Free
1st March 2013, 12:06 PM |#4  
Goku80's Avatar
OP Senior Member
Flag Within the Matrix
Thanks Meter: 6,811
 
More
Remember: there is no app, that behaves in same way on different system. While it can drain on CM, it can be rock solid on the TW, and vice-versa. So, don't take those examples too serious and don't run to uninstall your apps just for preventive maintenance. Act per need. Anyways..I already mentioned a few things in the above posts but here is a few more added to what i said above and few new ones..

So, as listed above, our Top Chart leader is Media Scan:
- Media Scan – process, that will run after each fresh install & reboot. Typically takes about 10-15 minutes, runs on high CPU frequency. If stuck more than this, causes no Deep Sleep (can be seen in CPU Spy app) – you have an issue with Media Scan. It can stuck on large files directory – nothing to do here, unless you can reduce files number. Another case – problematic memory cluster, and there is only solution to back up your data, format your storages, and start over.
Stopping the process won't help much, as on next reboot it will resume. Suggestion - charge the battery to 100% before Media Scan starts to rebel, and let it finish.
Another case - stopping any download (browser, market) in the middle. Media scan can possibly stuck until next reboot.
- Media Scan stuck:
  1. You probably have some corrupted files, on which it stuck. Backup, start to restore to the step it was OK, to find the culprit
  2. Folder with many files - likely to stuck or to spend a lots of time to scan it. Do the math. If you have to have this folder (likely to be a cache folder) - disable your media scan.
  3. I/O scheduler - CFQ sometimes being reported as taking longer time to media scan to complete. Try NOOP.
  4. And, of course, sometimes it won't work without formatting emmc and starting over.

- Google apps/services:
  • - Google Plus - there were cases, when this app, with auto-sync left, was just hanging in the memory and caused drain.
  • - Google Currents - depends on system, but there were also cases, when the service left active on CPU resource after it was even completely killed in task manager.
  • - Google Location service - if you choose to update your location by GPS only, expect wakelock, when GPS can't lock on a stellite. Second case - if location being updated from internet, and your mobile data is in bad state (poor signal, etc.). And, of course, it depends on apps, who require location update, and there are a lot of such. Whenever you don't need it - disable your locations service in Settings.
  • - Google Maps - brightest example of wakelock, caused by requiring your location. If you want to run Google Maps, disable the Location services, and disable Maps in start-up.
  • - "The Holy Trinity" - Skype, Facebook, WhatsApp. Just be sure to kill the app and & services, when you don't need it.
  • - Same applies for a clients of a kind: Viber, Twitter, etc.
  • - “Energy savers” – Green Power, Timeriffic, etc. They mess with the system power policy, if you choose to enable/disable wi-fi, gps, data, Bluetooth, etc. Especially, Samsung’s one (power policy) is known as problematic.
  • - “Soft-buttons”, so called “power button savers” – like ScreenOff & Lock and such. Related to previous group. Let the hardware do the job.
  • - Task killers - If it kills some services in the middle of their action, it will cause’em start all over again or even stuck, and eat your precious battery resources. If you have to use it (like in case with JB 4.1 memory leak issue, do it manually).
  • -Sopcast - very likely to stuck in memory, and to cause multi_pdp wakelock. Worse, it may keep consuming your precious data. Suggestion: reboot right after you ended using Sopcast.
  • - *new* - Weak network signal. Pretty understable, but still - weak network signal can cause some weird wakelocks. Especially, when you're on autosync on with mobile data, and the signal is weak, you will get "*sync*com.google.android.apps...." wakleock, "genie.widget" is you're syncing "new&weather" thing, RILJ is very likely, etc.
The Following 22 Users Say Thank You to Goku80 For This Useful Post: [ View ] Gift Goku80 Ad-Free
1st March 2013, 01:08 PM |#5  
Mr Hofs's Avatar
Senior Member
Thanks Meter: 14,641
 
More
Re: [GUIDE] Wakelocks Definition and how to prevent them
LOL ! Nice one Goku
The Following User Says Thank You to Mr Hofs For This Useful Post: [ View ] Gift Mr Hofs Ad-Free
1st March 2013, 03:07 PM |#6  
Goku80's Avatar
OP Senior Member
Flag Within the Matrix
Thanks Meter: 6,811
 
More
Quote:
Originally Posted by Mr Hofs

LOL ! Nice one Goku

thanks Hoff more to come mate
The Following User Says Thank You to Goku80 For This Useful Post: [ View ] Gift Goku80 Ad-Free
1st March 2013, 03:53 PM |#7  
Shan89's Avatar
Senior Member
Thanks Meter: 3,256
 
More
Nice thread kakaroth , this should prevent alot of questions about wakelocks
The Following User Says Thank You to Shan89 For This Useful Post: [ View ] Gift Shan89 Ad-Free
1st March 2013, 04:19 PM |#8  
Goku80's Avatar
OP Senior Member
Flag Within the Matrix
Thanks Meter: 6,811
 
More
Re: [GUIDE] Wakelocks Definition and how to prevent them
Quote:
Originally Posted by Shan89

Nice thread kakaroth , this should prevent alot of questions about wakelocks

More to come.

Sent from my HTC One X using xda premium
1st March 2013, 04:42 PM |#9  
XxVcVxX's Avatar
Senior Member
Flag Hong Kong
Thanks Meter: 112
 
More
Re: [GUIDE] Wakelocks Definition and how to prevent them
How about the AudioOut_4 wakelock(?

Sent from something that's BETTER THAN YOURS
1st March 2013, 04:47 PM |#10  
Goku80's Avatar
OP Senior Member
Flag Within the Matrix
Thanks Meter: 6,811
 
More
Quote:
Originally Posted by XxVcVxX

How about the AudioOut_4 wakelock(?

Sent from something that's BETTER THAN YOURS

same as audioout_1 and audioout_3

EDIT:added a bit more info regarding those 2 wakelocks and provided another link as well if anyone needs to do more reading
http://forum.xda-developers.com/show....php?t=1629346
The Following User Says Thank You to Goku80 For This Useful Post: [ View ] Gift Goku80 Ad-Free
1st March 2013, 05:08 PM |#11  
XxVcVxX's Avatar
Senior Member
Flag Hong Kong
Thanks Meter: 112
 
More
Re: [GUIDE] Wakelocks Definition and how to prevent them
Quote:
Originally Posted by Goku80

same as audioout_1 and audioout_3

EDIT:added a bit more info regarding those 2 wakelocks and provided another link as well if anyone needs to do more reading
http://forum.xda-developers.com/show....php?t=1629346

AudioOut_4 seems to be different. At least on my phone, it occurs when I leave a game, say NFSMW without actually killing it then turning the screen off.

Sent from something that's BETTER THAN YOURS
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes