Battery Drain, WiFi and scanning/polling - AT&T Samsung Galaxy S II SGH-I777

It's my understanding that the wifi on this phone has a very low power usage when inactive in standby. I'm going to guess, however, that the power usage goes up when it "wakes up" to scan for open and/or configured AP's. I'd also guess that it'd have to take the phone processor out of "sleep" and wakelock in order to perform that function
I'm wondering how often android (or this phone's default ROM in particular) will wake up to perform a scan of access points when it's NOT currently connected (but the wifi radio is left on at all times), and configured to only connected to known AP's.
Anyone?
Thanks
Gary

Related

[Q] Android with a month of battery life?

Hi all!
I'm working on a cool University project here in Russia.
We have to make a mobile device that works for about a month without any charging.
Device should only wake up every day at 23:55 and send POST request to server to tell that "I'm doing science and I'm still alive.".
We've started with an Android device, ZTE racer and installed Cyanogen firmware.
We've made an application that:
enables AIRPLANE_MODE
asks AlarmManager to wake up at 23:55 every day
at 23:55 it disables AIRPLANE_MODE for a minute, aquires a wake lock for a minute
then sends "I'm doing science and I'm still alive." to server
and enables AIRPLANE_MODE again to save battery.
Right now we are getting 5-10 days of battery life.
I suppose that we could extremely increase battery life by:
removing some applications from firmware including "phone" and others
shutting down some services right in kernel sources. (In fact, we just need gprs and nothing else. We don't need Wifi, eccelerometer, GPS, ...)
decreasing CPU speed from application
I have couple of questions:
Is it theoretically possible to have 1 month of bettery life for an Android device? (I know that Kindle have more than 2 months of battery, so why we can't?)
Does anybody have an Android-based book reader? How long could it live in sleep mode and wifi turned off?
If device has no 3rdparty application installed, and it's sleeping in AIRPLANE_MODE... Who could possibly eat battery at that time?!!
Could you please give any kind of advice for our problem?
Thank you very much in advance!
I'd say yes it's possible to get that much battery life... Some suggestions from the top of my head:
Undervolt and/or underclock the processor (like you said), but do this from the kernel, rather than an application.
uninstall any unecessary system apps/turning off services (like you said)
Assuming your script/application is checking the system time of the phone to know when to wake, try having it just run an internal timer instead... I don't know how much battery life that would take, but I imagine that checking against its own timer would save battery vs requesting the time from the phone itself.
Assuming you haven't already, Try having so the display NEVER TURNS ON without physical input (i.e. pressing a button on the phone). The screen is a massive battery drain.

What's the WiFi doing

Archos 101 IT + UrukDroid 1.6.4
When the tablet is off (sleeping), my local DHCP server gets DHCP requests from the tablet every minute. The power led briefly lits when it wakes up.
When I switch the tablet on, the first thing it does is drop the WiFi connection and re-establishes it.
This seems higly illogical. Also, when I have networking applications running when I switch the tablet off, these apps crash or malfunction when I switch it on again.
Did I overlook a specific setting to avoid this?
I think that when you turn it on, the WiFi connection has already been dropped, but the indicator hasn't been updated yet. It then notices that the connection is down, updates the indicator, and re-connects. I'm not sure about the DHCP requests every minute. You can check in the System Monitor's Alarms tab what's waking your device that often; my guess is that the system figures it'll try to reconnect now that it's woken up, but it doesn't stay awake long enough to establish a useful connection.
I don't think there's really anything you can do to avoid this in general; it's just the way Android power management works. What you can do if you really want is to install an application that will hold a partial wake lock for you. As long as the wake lock is held, the device will never completely go to sleep; the screen will turn off (for a partial wake lock), but the network connection won't be dropped. Of course, this will consume much more power than letting your device sleep normally. I use this when I know I'm going to be intermittently using my tablet for a while (like when I'm cooking) and don't want to keep waiting for the network connection to come back up.
jfmcbrayer said:
I think that when you turn it on, the WiFi connection has already been dropped, but the indicator hasn't been updated yet. It then notices that the connection is down, updates the indicator, and re-connects.
Click to expand...
Click to collapse
That could very well be the case.
I'm not sure about the DHCP requests every minute. You can check in the System Monitor's Alarms tab what's waking your device that often
Click to expand...
Click to collapse
Whenever I switch it on, there's always an alarm scheduled for Android System for the next minute.

Fast Dormancy - A Quick Explanation and My Findings

There has been quite a bit of discussion about Fast Dormancy, so I thought I would try to investigate it, and to explain things a little.
I don't claim to be an expert on this. Far from it. I'm merely putting across what I have found out about the subject, and what my observations have been on the it.
Firstly a little explanation on what FD actually is.
When your phone is connected via 3G data (not 2G or wifi) your phone needs to enter certain states in order to maintain this connection and allow data transfer. If your Operator does not have FD support or you have it disabled, then basically your states are just connected or not connected. What this means is that every time your phone connects to data, it will have to go through all of its various stages and internal functions in order to make the connection and then perform the actual data transfer. This is slow and obviously the more processing that is required, the slower your experience will be, and the greater the affect will be on your battery.
FD tries to tackle this problem by having several different states so that the full connection/disconnection cycle is not required every time. Each state has a different level of data throughput and power consumption.
DCH - High volume data (highest power consumption)
FACH - Lower volume
PCH - No data but keeps connection
IDLE_CCCH - Not entirely sure about this one but I think its an interim, lower level stage between PCH and:
IDLE - Connection dropped (lowest power consumption)
When in DCH state, your phone is doing the highest volume of data transfer, and obviously consuming most power out of your battery.
The way FD works is when transfer rates drop, the state drops to FACH for less power consumption and then back up immediately to DCH as and when required, or if this transfer state is over for the time being, (eg. you have stopped browsing) instead of going back to IDLE which would mean going through all the connection procedures next time data is required, the state drops down to PCH. This is a very low powered state, and when data is subsequently required, it can then immediately go back up to FACH or DCH with minimal effort. The less stages that is required to get the connection back up and running the better, both in terms of battery and speed.
To turn FD on/off enter *#9900# in the dialler to get into the SysDump screen then select the Fast Dormancy option
Alternatively, gokhanmoral has an app called FastDormancy Toggle for i9300 which can also do the job. I've not tried this app personally, but I've been told it works fine on the i9100.
Whether you keep FD on or not depends primarily on if your network operator supports it.
If your network operator supports it, then enabling it is not necessarily the best answer, as it can depend on the combination of the following things:
1. How you use your phone - Are you a heavy or light data user?
If you are a heavy data user then enabling FD is almost certainly the way to go. The less the phone needs to do in order to fire the connection back up, the better. However, if you rarely use the phone for a data connection, then it may prove beneficial to you to switch it off so that the IDLE state is entered sooner. Bear in mind before you decide on if you should turn it on or off, consider what your data sync options for contacts/calendar/email etc. are. If you dont browse too often, you may still be using data in the background quite often even though you are not physically doing so through various background syncs.
2. How "intelligent" your Operator's FD actually is.
I believe the operator defines the parameters for the timings of these different FD states, so results can vary drastically between different networks. To see how your carrier handles FD can be done via a simple test on a Samung ROM. With wifi off and FD enabled, at the dialler, type *#0011#. This takes you into the ServiceMode menu. The important piece of information here is the RRC State line. Press the home button and open a browser session and go into a web site, then immediately long press the home to get the list of tasks and select the ServiceMode app. The RRC State line should be DCH (or at least FACH) and you should see some activity in your signal indicator arrows on the status bar. Eventually you should see it drop down from DCH -> FACH -> PCH -> IDLE (sometimes you may see IDLE_CCCH). Ideally, the state should stay at PCH for a while, then eventually drop to idle.
My findings so far on JB is that FD seems to be handled differently to the way it was on ICS. In fact, I'm not entirely sure its working on JB at all! For me, it seems to go from DCH -> FACH, and shortly after that (perhaps up to 5 seconds) drops to IDLE. This is not great if your going to be using more data shortly, but ok if you are no longer browsing.
After further testing, it seems on JB it make no difference if FD is enabled or disabled in the ServiceMenu.
The transitional RCC states it enters seem identical regardless of the FD option you have set.
My testing when on ICS suggested that when going from DCH eventually down to IDLE, the handset seemed to go to FACH for a short period, then sit on PCH for sometimes up to 10 minutes. This has a big advantage if you are about to do more browsing shortly, is it will take much less power to resume the connection and enable the data transfer to begin more quickly, but has the drawback of if you have indeed ended your browsing for the time being, it would be using more power compared to if it was in IDLE. So swings and roundabouts.
Perhaps my observations on ICS (ie, remaining on PCH for up to 10 minutes) is how FD should behave.
Remember FD only applies to a data connection. It does not kick in whatsoever when you are connected to wifi or on 2G.
The quality of your data connection (ie. H+, H, 3G) may also have a bearing on how FD will perform. Better connectivity should give you a more efficient FD performance.
Tip 1.
If your wifi sleep policy is set to "keep wifi on during sleep only when plugged in" then this will mean your data will take a hit whenever your screen is off (unless plugged in of course) If you think FD is not for you because "I'm almost always connected to wifi" (ie. at home/work) then you will still need to consider what the best FD policy is for you when on this sleep policy, as obviously, your screen is off most of the day.
Tip 2.
If you are not connected to wifi overnight (either your not at within your router's range, or you have set your wifi sleep policy not to be connected) bear in mind what your phone does overnight in terms of background data activity (ie. your data sync options and widgets such as news/weather etc). If you have minimal data activity overnight (you set your widgets to sleep for example), then it would be better to switch FD off, as less battery would be consumed to go straight back to IDLE than hang around for possibly 10 minutes or more each time in FACH.
Note
You may well have a higher l2_hsic wakelock when FD is disabled, but when FD is enabled you may find this drops slightly, only to find another one called secril_fd-interface kick in instead, so again, swings and roundabouts.
I did extensive testing on this on ICS, and came to the conclusion that was better FOR ME to turn FD off, but the differences were not drastic. It can however make huge differences for others, depending on your Operator and your usage habits.
On JB, I've found it better to keep wifi on constantly, and keep FD enabled.
It would be interesting to compare how your firmware/carrier handles FD.
Bottom line is, try it and see what works best for you.
Note:
I don't think the *# service codes work on CM/AOKP based ROMs but you can certainly give them a try!
If the codes do not work on your Samsung ROM then you will need to install FactoryTest.apk.
Thanks for sharing! :thumbup:
I hear many members asking 'why' when asked to disable it..
"To err is human, to forgive is divine"
Sent from my SGS II
Great work I have been reading up on this lately. Nice to know that in JB it seems almost irrelevant... That's what all my unofficial tweaking/testing was indicating. I thought I must be doing something wrong.
Quick question though, do you know of any ways to turn off Fast Dormancy in 4.2.2 ROMs? I haven't found a way. Using gokhanmoral's app still results in a secril_fd_interface wakelock in BBS.

[Q] Notifications arrive during sleep

I'm running on stock 4.1.2 and mobile data is always turned off. "Keep Wi-Fi on during sleep" is set to "Only when plugged in" so the phone should only connect to Wi-Fi when it's in use. It seems that the phone periodically connects to Wi-Fi even though it's been idle for extended periods (e.g. an hour) because it's able to deliver notifications (e.g. gmail and hangouts). Other Android devices that I have, including Nexus devices with the same settings don't deliver notifications until they are "awoken".
This might also explain where a lot of battery goes. Does anyone else experience this and does anyone know if other phones/brands/models behave like this?
I presume you got an app that keeps waking the phone up every so often. Which then enables Wi-Fi to activate. Or an app stopping your device from sleeping properly. If phone is on charge then Wi-Fi on all time.
Wrong forum by the way Q&A forum.
Sent from my GT-I9300 using Tapatalk 2
Thanks for the reply and sorry for posting in the wrong place.
I installed Wakelock Detector and I can seen numerous "CPU wakelocks" and "wakeup triggers" but no "screen wakelocks", so I didn't expect a Wi-Fi connection to be made unless I turned the screen on and started using the phone? Perhaps I misunderstand the meaning of "Keep Wi-Fi on during sleep", especially the meaning of "sleep"? And, it still doesn't explain why other devices with the same apps installed don't behave this way. That's why I wondered if it was something to do with mods that Samsung have made to the software?
Markanski said:
Thanks for the reply and sorry for posting in the wrong place.
I installed Wakelock Detector and I can seen numerous "CPU wakelocks" and "wakeup triggers" but no "screen wakelocks", so I didn't expect a Wi-Fi connection to be made unless I turned the screen on and started using the phone? Perhaps I misunderstand the meaning of "Keep Wi-Fi on during sleep", especially the meaning of "sleep"? And, it still doesn't explain why other devices with the same apps installed don't behave this way. That's why I wondered if it was something to do with mods that Samsung have made to the software?
Click to expand...
Click to collapse
The meaning of "Sleep" in Android is when the CPU is in a mode called deep sleep, the device is set to a really low power setting so it will just run, apps can wake the device up ie take it out of deep sleep if they need to sync with a server, etc and this is what a wake lock up, an app waking the device up, and as the device is out of deep sleep for those few seconds it can switch wifi on, I personally keep wifi and mobile data on all the time so I don't know much about it.
Thanks, it looks like I have misunderstood the meaning of "sleep". I do have apps that would run periodically.
For example I use SugarSync, which I have set to only backup while on Wi-Fi and when the device is plugged in. I assume that it will have a timer set (or cron job in the old speak) so that the app can run and check for the required conditions before attempting to backup? I guess when this happens, Wi-Fi might connect and any other app that wants Wi-Fi (like Gmail or Hangouts) would take advantage of the connection? I suppose that my older devices (that run Android 2.3) might not have time to connect and so don't get the notifications that the Galaxy S3 does?

[Q] wlan_wake wakelock on Hyperdrive RLS 12 on Verizon Galaxy S4

Hey guys,
On my second samsung device and my fifth rom (including eclipse TW, eclipse AOSP, aokp, CM10, now hyperdrive). Have to say thay I'm satisfied with pretty much everything Hyperdrive has to offer, its freaking amazing! One issue doesn't seem to be resolving despite many attempts. My phone stays awake nearly 100% of the time with a wlan_wake wakelock. This isnt the well documented wlan_rx_wake wakelock, which I've also had in the past but managed to squash. I'll recount my findings in some order below.
I installed Hyperdrive, restored some some vital apps. Waited a couple days and found the battery wasn't what I'd hoped it'd be. I usually run with auto sync enabled for total 8 mins per hour (via Tasker) and wifi and mobile data on. I've also used a script that disables IPv6 whenever it connects to a wifi network -- work network has tons of IPv6 broadcasts that were triggering massive wlan_rx_wake wakelocks which were vastly reduced with this fix. Even with these throttles, I noticed that some time after boot (10-15 minutes) on my work as well as home network (10 mixed devices on a belkin router), a wlan_wake wakelock would start triggering and my phone would then stay awake 90-100% of the time, screen on or off.
I went ahead factory reset the phone, loaded just my google account, and found the same problem with autosync on, autosync off, GPS was off, Wifi "always allow scanning" option was disabled in the advanced menu, Google's Wifi network location was disabled, and no 3rd party apps except for BBS installed. Of course, with Wifi disabled, the issue abated but 3g/4g doesn't offer much better battery life than the phone staying awake the whole time. During this time, I used Network Logger and Shark for Root to attempt to identify Wifi traffic and found that a few apps were transmitting frequently, but not enough to keep the phone awake for the amount of time the wakelock indicated. Total battery drain is up to 8-10%/hour with absolutely minimal use. I've never had this particular issue with any other OS i've installed, any ideas what could be going on? Really looking forward to being able to rip through days without charging on Hyperdrive!
I have a Samsung Note 3 and I too have this same problem (except that a factory reset solves it). Can't seem to find a fix. People on internet suggest that it's because of some rogue app but my phone starts behaving like this randomly until I do a factory reset.

Categories

Resources