[Q] Suspend vs sleep (WTR AlarmManager) on Tegra 2 - G Tablet General

Hi, I'm a Vega owner but we don't have kernel source and given that the Gtab is pretty similar hardware I like to ask a question of you:
Does AlarmManager work while your device is sleeping?
The Android AlarmManager is used by most services but the most obvious and observable is the clock alarm. On any android phone I've used, if the device is sleeping then the AlarmManager will wake it up to perform the task at hand (E.G. switch on the screen and play an alarm, grab some RSS, pull tweets, etc) but from what I've seen the Vega goes straight into a kind of suspend where _nothing_ happens until you press the power button at which point the alarm fires even if it's well overdue. I'm wondering if this is correctable once we get kernel source.
So does having an alarm fire wake up your GTab device? If not are the any custom kernels that have fixed this for you?

Moved to general

SilentMobius said:
Hi, I'm a Vega owner but we don't have kernel source and given that the Gtab is pretty similar hardware I like to ask a question of you:
Does AlarmManager work while your device is sleeping?
The Android AlarmManager is used by most services but the most obvious and observable is the clock alarm. On any android phone I've used, if the device is sleeping then the AlarmManager will wake it up to perform the task at hand (E.G. switch on the screen and play an alarm, grab some RSS, pull tweets, etc) but from what I've seen the Vega goes straight into a kind of suspend where _nothing_ happens until you press the power button at which point the alarm fires even if it's well overdue. I'm wondering if this is correctable once we get kernel source.
So does having an alarm fire wake up your GTab device? If not are the any custom kernels that have fixed this for you?
Click to expand...
Click to collapse
I haven't really noticed in particular, but I can tell you that the G Tablet does plenty of resume/re-suspending when it's suspended, switching between L0/L1/L2 suspend modes, and so on. You can see all that activity from the dmesg output after an extended suspend. I've never tried the clock alarm, so not sure specifically if that can interrupt suspend state, but I wouldn't be shocked.
There is a ton of stuff in the Tegra2 kernel code regarding suspend/resume, so it's definitely possible that when you get the source code for the Vega kernel you can polish up the way it handles suspend/resume. We've had good luck merging up more recent changes from NVidia's mainline to fix some of the original kernel bugs regarding suspend/resume behavior (specifically low voltage states sticking the CPU at low clock speed after prolonged suspend).

Thanks rcgabriel, my worry is that people are currently blaming the lack of wifi during sleep on the failure of things like twitter/rss/etc not updating while the screen is off when in actual fact the AlarmManager events aren't even waking up the unit at all.
Could someone with a Gtab perhaps test if the alarm wakes up their device while it's asleep when they have a spare moment?

SilentMobius said:
Thanks rcgabriel, my worry is that people are currently blaming the lack of wifi during sleep on the failure of things like twitter/rss/etc not updating while the screen is off when in actual fact the AlarmManager events aren't even waking up the unit at all.
Could someone with a Gtab perhaps test if the alarm wakes up their device while it's asleep when they have a spare moment?
Click to expand...
Click to collapse
Hi,
I didn't know you could even do that (no Android phone here) .
My Gtab is stock TNT 3452, and I:
- Set an alarm for 11:25AM (it was 11:21AM)
- Pressed power
- Selected Sleep
- Screen went black
- At 11:25AM, the tablet started buzzing - Screen came on with the time and two buttons, Snooze and Dismiss.
Pretty cool!
I haven't tried the above just letting the tablet go to sleep on its own though.
Also, I can set the alarm to sound, but how do you do those other things like checking RSS, etc.? Is that dependent on an app to do that?
Jim

I have tried Juice Defender to accomplish this. Juice allows me to set the interval at which the tablet should wake, turn on the wifi, allow things like email to be polled then return to sleep. So far I cannot say if it is working or not working.
Before Juice my phone would buzz to say I had email at say 3 am, but the Gtab wouldnt get it until I woke it up hours later. My assumption was that the wifi was turned off when the tablet entered sleep and didnt turn on until I pushed the power button.
Well, after fixing my wifi at home I can say that Juice will allow email polling after the tablet has gone to sleep. this morning when I woke my tab up there were a three emails that arrived at 3 to 5 am in the inbox.

bboyle said:
I have tried Juice Defender to accomplish this. Juice allows me to set the interval at which the tablet should wake, turn on the wifi, allow things like email to be polled then return to sleep. So far I cannot say if it is working or not working.
Before Juice my phone would buzz to say I had email at say 3 am, but the Gtab wouldnt get it until I woke it up hours later. My assumption was that the wifi was turned off when the tablet entered sleep and didnt turn on until I pushed the power button.
Well, after fixing my wifi at home I can say that Juice will allow email polling after the tablet has gone to sleep. this morning when I woke my tab up there were a three emails that arrived at 3 to 5 am in the inbox.
Click to expand...
Click to collapse
i have juice defender but it seems it still cannot prevent wifi going to sleep even though i trigger on certain application and data transmission

Related

Cool Alarm that works on WM5..even in the morning :)

Hi just for your information,
I ve been using this for a while now and i think its one of hte best alarm clock app for any WM and it also works on the WM5! (finally)
try it out if you're having problems missing alarms on WM5
pTravelAlarm 2.6 -> http://www.burroak.on.ca/
never miss an alarm ever again..
hope this helps anyone out.
NR
PTravel...
Thank you VERY much for your information. I just downloaded and installed the software (which seems to do EVERYthing I wanted my alarm to do). Now I'll just hafta watch and see if it actually wakes me up. I will update this thread with my findings. Thanks again.
J
It may not... even BurrOak themselves acknowledge this if you read the FAQ:
http://www.burroak.on.ca/ptafaq.html#turnon
WakeUp Tweak, which they offer through that page for free, does work 100%. The WakeUp Tweak essentially tells the entire system to go to the 'Full On' power state, instead of going through the 'Resuming from Standby' transitional power state. Unfortunately, the side-effect for many devices is that they randomly turn on for seemingly no good reason. Which means that the screen appears to 'flash on', before flashing off again. As a result of this, on those devices, you'll be draining much more energy (due to the backlight and screen coming on, but also due to the power state changes - see also the MSDN articles on this) than if you were to simply leave the device on (but the backlight+screen off).

Battery dies over night.

I use awesome off to turn my pad on and off so I don't have to use the power switch all the time. I always do this so I don't have to go through the whole boot up process when I want to use it. I noticed that when I wake up in the morning the pad is dead or almost dead. Is there a better way to put this to sleep at night? There is always so much stuff running that kills the battery. I read on here somewhere that someone was not even losing 1% by putting it in some deep sleep. Is there a mode for long time sleep that does not use battery or run any processes? But without shutting it down all the way.
Sent from my Toasted Marshmallow using xda app-developers app
Toasted Marshmellow?
Can't you just set the tablet to sleep in 5 or so minutes after being inactive?
You can have the tab cut wifi off in sleep also.
I don't do the wifi off in sleep tho...sometimes it doesn't reconnect after a wake up.
I don't know what awesome off is...I'll have to check that out.
My tab just goes into sleep after 10 minutes when I set it down.
The problem is awesome off. It won't let the pad sleep and is constantly checking for movement, light levels etc. Dump it and use the power button to turn it off and on.
Battery dies
dpshptl said:
I use awesome off to turn my pad on and off so I don't have to use the power switch all the time. I always do this so I don't have to go through the whole boot up process when I want to use it. I noticed that when I wake up in the morning the pad is dead or almost dead. Is there a better way to put this to sleep at night? There is always so much stuff running that kills the battery. I read on here somewhere that someone was not even losing 1% by putting it in some deep sleep. Is there a mode for long time sleep that does not use battery or run any processes? But without shutting it down all the way.
Sent from my Toasted Marshmallow using xda app-developers app
Click to expand...
Click to collapse
I have Nook color power button donate that I got when I had my old rooted Nook color with flaky on off switch. It was in my google apps when I was loading apps on my infinity so I figured try it and see what happens lol It works remarkably well on my tab and does put it into deep sleep . See attached. I have not used my tablet much in last day but you can see that it does put it to sleep and turns wifi on and off and also reboots. Also BTW I then tried it on my rooted ICS leak Bionic and it gives reboot function instead of the long drawn out shut down then turn on process. It does not speed up any of these functions as far as rebooting.
Could be the "wifi location drain"-bug with google maps. From reading the forums it seems quite a few people have it without knowing it. You can of course disable wifi while sleeping, but this will not cure the main issue.
Turn the location settings on in google maps, then make sure that unneeded check boxes are disabled under location settings menu and you should be fine after that. The interesting part here is that google maps will drain the wifi even when the settings are not enabled, perhaps because you can't access the underlying menu without first enabling it. So only after you first enable this setting in maps will it work correctly.
Hopefully this helps, it did for me ..
Yoop,
I watched the awesome off YT video and it didn't look as though the tablet was being sent into full sleep.
I guess with it just grinding away essentially not shut down into a battery save mode it would die.
Doesn't the Tegra3 have a 5th core for minimum power processing or fast wake up?

Accellerometer Sleep App Showdown

Hello all,
There appears to be a few accelerometer based sleep apps that track your sleep cycles available. I always have issues waking up so the ability that these programs have to wake you up when you are in the "lightest phase" of sleep has been truly godsend. I have not been late to work once since I began using it (usually at least 3 days a week I'm late. It is truly life changing so far for me. But id like some feedback if there are other apps out there. or what personal experiences are. Id also like to know what most of you have for your "deep sleep ratio" to see how I stack up.
Sleep as Android - I am about 5 days from the trial version expiration of "Sleep as Android". So far I love the program and am highly considering purchasing it when the trial is up. I love that it can determine the best time to wake me up, and I have a nice graph of my movements through the night, another feature I like is that it record my noise. I have found that In the beginning I was a loud snorer it has apparently gone down by utilizing an eye mask that puts pressure on my nose as well. Just about everyday my % of deep sleep is falling into the 45-49% range with one bad night being 23%.
Sleep timer - I will be trying this program this weekend once my trial version of sleep as android is up. I want to test it over the weekend so I dont miss work or anything. will update my experience
Anyone have experience with other programs or the ones I mentioned?
Electric Sleep - Not tried yet
Smart Alarm Clock -Not tried yet
Gentle Alarm -Not tried yet
Suffering fron DSPS and Non24-h sleep/wake syndrome so it's crucial for me to monitor my sleep. Up to a year ago I was using SleepSense for WP6 when I reverted to Sleep as Android and was amazed by the features.
However recently I discovered Sleep Time which works in a similar way but is way more simple. Just enter the time, the offset, a couple of settings and you're good to go. Plus, the shake-to-snooze feature is awesome. I couldn't decide which one to use so I'm using them both on my two devices lol.
Sleep as android Trial ran out. I have been using sleep time I will post my thoughts on it below.
I like the charts given by sleep time a little more and it attempts to break your sleep into 3 segments (wake, light sleep, deep sleep). regarding the statistics, I am in the same range of sleep efficiency that I was with android so whether it is accurate or not remains to be seen but it is at least consistent. Another thing I can not vouch for on Sleep as android but the "algorithm" claim suggested by sleep time I believe is BS.
Theory, the app measures your movement throughout the night you set an alarm that is the "absolute latest" you can wake up. Then you tell the app either 10/20/30 minutes before the alarm you are willing for it to begin going off. Ideally the app monitors your sleep and as you come out of your deep sleep or in a light sleep phase the alarm is supposed to begin going off. This app is steadfast on ticking to the rules, you say 10 minutes with an alarm of 7 its gonna wake you at 650 everyday whether your in deep sleep or not. I notice my wakes are not as "refreshed" as SAAD was.
Bottom line, I like seeing the graph on this and it is very light on the options, but you cant expect much for free. Personally though, until they fix their setup and stop claiming it is an algorithm waking you up, I could just as easily just set my alarm to wake me up 10 minutes sooner.
Will begin trying another app over the weekend.
I haven't heard of these type programs, but now I'm intrigued (thanks for bringing them up in the forum).
As I understand, we have to allocate a window of time when the alarm might go off. So if I need to get up 5:00 absolute latest, the window might be 4:30 to 5:00.
a few questions:
1 - is 30 minutes a big enough window to make any difference?
2 - is this any better than just setting tradiaional alarm for 4:30 and hitting snooze until you're ready to get out of bed (or until it's 5:00, whichever comes first).
3 -you have to keep the phone in bed with you? How do you avoid rolling over on it?
electricpete1 said:
As I understand, we have to allocate a window of time when the alarm might go off. So if I need to get up 5:00 absolute latest, the window might be 4:30 to 5:00.
Click to expand...
Click to collapse
Yup.
electricpete1 said:
1 - is 30 minutes a big enough window to make any difference?
Click to expand...
Click to collapse
Short answer, yes. Provided that the app actually works as intended and does not just hit the alarm at the earliest time possible!
Long answer, this has to do with the duration of the sleep cycles, which last about 60 to 90 minutes on average, depending on the person. Those cycles consist of five sleep stages, stage 1, stage 2 (light sleep), stage 3 and 4 (deep sleep) and stage 5 (or REM). In general your sleep goes like this: [stage 1, 2, 3, 4, 3, 2, REM] - [2, 3, 4, 3, 2, REM] - [2, 3, 4, 3, 2, REM] etc.
The important thing is that during stage 2 and REM its easier to wake up, and both those stages last more than the rest, taking up to 65-75% of the whole sleep cycle. So, 30 minutes should be an ideal offset. No matter what time you set the alarm, it's almost certain that 30 minutes before that you will eventually enter light sleep or REM sleep.
That's how these kind of apps work, they're supposed to detect the sleep stage you're on using the accelerometer (based on any movements) and wake you up only during "light" sleep.
electricpete1 said:
2 - is this any better than just setting tradiaional alarm for 4:30 and hitting snooze until you're ready to get out of bed (or until it's 5:00, whichever comes first).
Click to expand...
Click to collapse
Theoretically, it is. If you just set the alarm earlier and it rings while you're in deep sleep, it could be a lot harder to wake up plus you will probably still feel tired and drowsy, possibly for the rest of the day. If, however, the alarm rings while you're in light sleep or REM sleep, it will be easier for you to wake up and you will definitely feel more refreshed.
I've woken up during deep sleep after 8:30 hours and felt awful for the rest of the day. I've woken up during light sleep after just three hours of sleep and had enough energy to pull an all-nigher the next night. It all comes down to general sleep hygiene of course but the actual sleep stage on which you wake up can and will have an effect on the quality of your sleep.
electricpete1 said:
3 -you have to keep the phone in bed with you? How do you avoid rolling over on it?
Click to expand...
Click to collapse
I usually keep it right next to my pillow (flight mode on), in it's case and connected to the charger.

[Q] what is sleep state?

As the title asks, what is it? I know that turning off the screen with power button is not sleeping. I believe it is the state when it takes more than a second (lag) to unlock the screen. This means that the phone was in sleep state and I woke it up. But the question remains, that what is it? How and when is it activated? What happens when the phone is sleeping? Effect on battery (I believe it's positive)? The notifications like sms and call? Is only the screen asleep or are the other functions sleeping as well? Final question, Can I activate the sleep mode with the help of an application if it helps save the battery?
Note that I don't want to use battery saver apps because I don't want anything on my phone to stop. I paid for the whole phone, "including" gps, wifi and things like that. Smartphones are for us, we are not for smartphones.
usman farhat said:
As the title asks, what is it? I know that turning off the screen with power button is not sleeping. I believe it is the state when it takes more than a second (lag) to unlock the screen. This means that the phone was in sleep state and I woke it up. But the question remains, that what is it? How and when is it activated? What happens when the phone is sleeping? Effect on battery (I believe it's positive)? The notifications like sms and call? Is only the screen asleep or are the other functions sleeping as well? Final question, Can I activate the sleep mode with the help of an application if it helps save the battery?
Note that I don't want to use battery saver apps because I don't want anything on my phone to stop. I paid for the whole phone, "including" gps, wifi and things like that. Smartphones are for us, we are not for smartphones.
Click to expand...
Click to collapse
Technically; sleep mode starts the moment the screen is switched off. With the exception of applications which can prevent the phone from fully 'sleeping'. A good and obvious example is the music application which keeps the phone awake in order to play music.
There's really nothing special about sleep mode except that the phone will execute a lot more tasks together but less frequently in order to save power, so you're still able to receive all messages, emails, calls and all notifications (from apps). Applications can also be informed about the change in power state (awake to sleep and sleep to awake) and therefore change the way they behave.
The amount of sleep time the phone gets is dependent on the apps you have installed and the amount of emails, calls and other notifications you get. There isn't a way to enable 'sleep mode' with an application as it would make little difference if your display is on. Your display is the main cause of power consumption, as is true with all smartphones.
Battery Saver apps are dangerous, by killing apps they have a negative impact on the phone. If the application is needed, the phone will restart it and add to the CPU cycles. The same goes with memory freeing apps. GPS/Bluetooth/WiFi are there for when you need them. Keeping them on when they're not needed is a waste of the phone's resources. As the more CPU cycles they use, the more power they consume.
DennisBold said:
Technically; sleep mode starts the moment the screen is switched off. With the exception of applications which can prevent the phone from fully 'sleeping'. A good and obvious example is the music application which keeps the phone awake in order to play music.
There's really nothing special about sleep mode except that the phone will execute a lot more tasks together but less frequently in order to save power, so you're still able to receive all messages, emails, calls and all notifications (from apps). Applications can also be informed about the change in power state (awake to sleep and sleep to awake) and therefore change the way they behave.
The amount of sleep time the phone gets is dependent on the apps you have installed and the amount of emails, calls and other notifications you get. There isn't a way to enable 'sleep mode' with an application as it would make little difference if your display is on. Your display is the main cause of power consumption, as is true with all smartphones.
Battery Saver apps are dangerous, by killing apps they have a negative impact on the phone. If the application is needed, the phone will restart it and add to the CPU cycles. The same goes with memory freeing apps. GPS/Bluetooth/WiFi are there for when you need them. Keeping them on when they're not needed is a waste of the phone's resources. As the more CPU cycles they use, the more power they consume.
Click to expand...
Click to collapse
That's a good explanation
I have read about term "deep sleep" while searching for this, but the explanations on the internet are not clear to me. I have understood a part of it, that this state comes when phone is at rest for too long. The phone pauses apps and their processes, except those who are downloading e.g games and only does basic tasks such as incoming communications (message, call etc.) and sync. Again, I could not find answer to when it state/mode starts.
About GPS/Bluetooth/WiFi: I said this because I had seen people talking about how they have to force otherwise unnecessary restrictions on them and thus have to worry too much to save their batteries. This is what I don't like. Technology is made to facilitate people and to make their lives easy, that's what I believe. On the other hand, I always keep bluetooth off because I need it very rarely. Well, you may have other preferences but I have to keep gps on in order to geo tag photos and to make it ready whenever I open maps etc. Wifi according to me is life blood of smartphones. So I can't live without it either.
When I had Nokia 5800 I had to turn off auto rotate because its menu took time to refresh if I turned the phone by mistake. That was the time when I came to know how bad it feels to go through the settings to turn it on when I need it urgently.

Battery Drain and Kernel Wakelocks

I've had this phone for a few days now and I notice some mean battery drain that happens from time to time. I dumped a Bug Report via developer options, and used Google's Battery Historian after leaving my phone unplugged and idle overnight after a full charge and reboot. The tool seems to show that the following kernel wakeup reason seems to be the problem and holding the phone awake for over 1.5 hours:
Code:
Ranking Name Duration/Hr Count/Hr Total Duration Total Count
0 Abort:Wakeup IRQ -1111803216 (null) pending 10m8s737ms 779.87 1h34m13.62s 7243
The only thing that looks remotely relevant is that on the tool WiFi signal strength became weaker when the above wakeup events started.
Has anyone else had similar issues with random battery drains like this and/or happen to know any workarounds?
Mine seems like it is always awake. Android OS has been keeping it awake for 8-9 while I'm at work.
I tried setting wifi to stay on when sleeping when plugged in, after a full idle overnight, I used my phone in the morning and the same issue came up. The ID above was different, but generally the same problem (IRQ with no description pending). Again, it looks to be wifi related based on the battery stats in Historian. I've rebooted, charged up and turned off wifi to see if the problem goes away.
ru_ready said:
Mine seems like it is always awake. Android OS has been keeping it awake for 8-9 while I'm at work.
Click to expand...
Click to collapse
You might want to try enabling developer options and getting a bugreport generated (which has battery stats), and then visualizing it in Google's Battery Historian to see if it is the same problem. Kind of convoluted, I know, but without root, I don't know of any better way to analyze kernel wakelocks (it isn't a partial wakelock issue on my device).
Last night I left my phone idle with wifi off and WLAN Scanning and Bluetooth Scanning off under Location Settings. The battery ran down only 2% over 9 hours and the Wakeup IRQ pending problem did not keep the phone awake!
I am going to try turning wifi back on today but keep the scanning off and see if that keeps this problem at bay. If not, I may use Tasker to force wifi off when the screen is not on and not plugged in.
The wakelocks seem to happen randomly no matter what my wifi settings are. Though I do think it is related to location settings trying to use wifi scanning.
I give up, there is no reason why a phone I just bought should be like this.
Maybe there are some apk wake up the system
@kumodog Maybe there are some apk wake up the system, you can reboot the system and kill all of application programs when you test it in night with wifi on.
After test, you can also use : "adb dumpsys alarm" in command line to find Top Alarms. it will tell you which alarm make system wakeup.

Categories

Resources