Sleep mode & Power Saver

Started by bertie97, March 29, 2012, 04:13:33 PM

Previous topic - Next topic

bertie97

I imagine this may be PL related but I know MS power management can be a major biatch  ::)
Basically, the box won't go to sleep.  (It does normally sleep without PL power saver active if not in high performance mode)

Without PL interacting, if the PC is in high performance mode attempting 'sleep', even from the shut down menu doesn't work; in Balanced or power saver it will sleep (at least that's how my mobo responds to the commands).

When the PL Power Saver mode is active it logs the change of power profile state, so I have to assume that it is doing it's job; Win7 on the other hand does not trigger sleep mode as a consequence of switching to lower power use profiles.


If I understand PL Power Saver correctly entering a state other than high performance for the req'd interval should eventually bring the sleep mode trigger into action.  Or am I mis-interpreting the Power Saver protocols impact on the power options?

Jeremy Collake

#1
Hmm... there is something missing from this picture, as it doesn't make sense. The Power Profile, once switched however, by Windows or a third-party application, is switched. There's no difference whether you did it yourself or Energy Saver did it. OF COURSE, Energy Saver will UNDO the transition *IF* there is any user activity on the system. By 'user activity' I mean the same thing Windows users to determine if it's appropriate to sleep, the same metrics - the same API call. So, make sure there is not additional activity of some sort occurring that might cause Energy Saver to go back to High Performance. *IF* that is the case, then it would be shown in the log.

Also, make sure you haven't defined any 'No Sleep' processes in Process Lasso. There is a configuration dialog that lists these in the Options menu. If you had, and one is running, this would explain it.

Software Engineer. Bitsum LLC.

bertie97

Thanks for confirming my gut response. 
Now I 'know' PL won't be forcing a non-sleep state & that it shouldn't over-ride the Win sleep triggers.
My prevent sleep list is empty btw.
Is there anything which traces the responses of Win PM in windows itself, can event viewer give me enough information on failure to sleep, (it is recording some info) ie a specific search string? 
Guess this is a new opportunity to play with PL & see what is going on under the hood so it will keep me out of mischief  :)

Jeremy Collake

I don't know if the Windows Event Log can shed any light on this or not, since I have no idea the cause.

Here's my thoughts:

1. Many OEMs supply third-party software that creates all sorts of custom power profiles. It then can 'manage' them itself. Be sure to check for something like that installed.
2. Some hardware device may be preventing sleep. Verify that you see this phenomenon with Process Lasso terminated. There's no need to uninstall, as there's nothing else to it.

I wouldn't mind seeing the output of 'powercfg.exe -qh'. You can get it by running something like ' powercfg -qh > c:\users\myusername\Desktop\my_power_settings.txt ' .

Any readers who find this thread with similar concerns (I know you know):
Your Power Profile configuration is found in Windows. Find 'Power Options'. You have to make an extra click to see High Performance sometimes, then another click to see the Advanced Options. These should be checked carefully. They are very granular and cover lots of devices.
Software Engineer. Bitsum LLC.

Jeremy Collake

Oh, and multimedia applications can prevent sleep too, as well as other third-party software ... So, check your applications too.
Software Engineer. Bitsum LLC.

bertie97

Thanks for the tips, the cmd line was useful.
I initially decided to set all profiles to the same HDD, Monitor & system sleep minute value trigger (leaving other values alone).  I reasoned that that way whatever PL did, the final trigger time would match any profile.
I did find a couple of things but it seems that the main culprit is an instance of svchost keeping the system awake because of the network connection.
This must be related to wake on LAN but what is strange is that without that active, the box will sleep even if the net connection is actively working - ie I could download a file & the box would enter sleep mode during the process if it took longer than the duration of the sleep trigger setting.  Something like a large game demo gets cut off mid transfer...

I would say that it is driver/win related.  I guess PL has high-lighted the effects as I took a higher than normal interest in PM activity because of its' new features.   ;D

Thanks again for the prompt & relevant assistance!

Jeremy Collake

You may be on the right track. Wake On LAN *should* be used to 'wake up' a computer already asleep, not prevent one from sleeping .. Still, it sounds like you're on the right track. Perhaps go to Device Manager. Then find Network Adapters. Expand it. Double click your ethernet adaptor(s) and you'll find a 'Power' tab on each. Changing this setting (or others) *might* have an impact... but perhaps you've already been there ;)

Of course, ensure you don't have any streaming multimedia, as this will definitely prevent sleep. You may want to check other devices there too. It really could be any of your hardware devices, as about all have the ability to prevent sleep.

Good luck!
Software Engineer. Bitsum LLC.

DeadHead

Borrowing this thread.

Could you please check to see why it is that sometimes the settings in Energy Saver seems to change by themselves? For example just now, after I woke my computer up from Powersaving Mode, Windows (7 pro) was stuck in energy saving mode even while I was actively using the computer. I normally run it at High performance mode, and then let it go to energy saving mode when idle for 10.

Checking the Energy Saver dialogue in PL, the "current active power profile" reads out as energy saving mode. I think you'll have to take some steps to further enforce what's wanted from the user, something that can't be changed on it's own or through any other program if you for example check a box saying something like "Let rules set up by PL override all other energy saving managers", or something like that.

Windows 10 Pro 64 (swedish) || Xeon 5650 @ +4 GHz || 24 gig ram || R9280 Toxic

Jeremy Collake

Energy Saver only changes the power profile, and doesn't force it to stay there. Also, if it got lowered by *something else*, it won't force it back upwards.

If you mean the power profile is set to whatever Energy Saver uses on Idle, perhaps it was changed by the user or another application. Once changed *externally*, Energy Saver won't go 'upwards' again.

So, if possible, simply change your active power profile to High Performance (or whatever) and it will then work correctly. If you can't change the active power profile, then something is wrong, perhaps maybe an application power profile with Forced Mode enabled, I don't know.. or third party software even.

As for providing an option to *force* it to go back to another power profile (e.g. back up to High Performance), that will be present at some point for sure, though I'm still evaluating the precise way I'll expose it to the user.

I hope I understood your meaning. I also don't know what might be changing the power profile on your PC, but some PC's come with OEM software that changes the power profile on some events.
Software Engineer. Bitsum LLC.

Jeremy Collake

Ok, edited for final answer I think ;p. I got your question. I don't know why your power profile is changing sometimes, maybe third-party software, but yes it is an issue to consider.

The only problem is forcing an over-ride of a power profile change made by the user or a third-party application is it could cause chaos, or a fight between applications for management of the power profile. Thus, I'm still evaluating how to best offer up such a feature to the user. I've been thinking about it for a while, and why I added the 'active power profile' to the Energy Saver Dialog.
Software Engineer. Bitsum LLC.

DeadHead

Good! :)

I was preparing a rather lengthy "clarification answer", but yeah you got my point there! ;)

Aye, I agree that enforcing it could possibly cause chaos between other applications, that's why a checkbox or something would be a good option, possibly with a warning of what could possibly go wrong by enforcing these settings.

I'll check around a bit to see if I can find anything that triggers issue, I'll let you know my findings.
Windows 10 Pro 64 (swedish) || Xeon 5650 @ +4 GHz || 24 gig ram || R9280 Toxic

Jeremy Collake

Someday, I will learn to read before I write, lol ;).

Anyway, I have a couple ideas about how to do this safely. A checkbox with warnings might do it. Or perhaps something more elaborate, like notifying the user if an external change does take place, and prompting them what to do in that event, all similar events, etc... Like a firewall would notify you of an outgoing connection. We'll see how it pans out.

There has to be something that made the power profile switch. Windows itself shouldn't have done it. My bet would be on third-party software or maybe a rule of Process Lasso, unless you change profiles in your sleep ;).
Software Engineer. Bitsum LLC.

bertie97

After a few sessions of digging around.....

I discovered a few different sources of similar troubles, various forums show instances where Win7 PM is working one minute then for some reason it just won't behave as it had been previously. 
Who knows why a profile would seemingly change triggers on its' own?  Too many variables to get a straight answer/culprit I think.  :-\ 
Patch Tuesday take one step forward please.   :P

I found that my network card despite being set to obey WOL & (presumably) network activity now will over-ride that with PM shutdown/sleep.  Previously not the case... (Was in the throes of investigating this when you posted Mr Bitsum :) )
The temporary solution has been to disable the network adapters' PM but this now means the PC will NEVER sleep regardless of activity.   ???

I'm not the only one having the problem - Coffee http://sourceforge.net/projects/coffee-sc/ has been recently written to address this issue.

So I shall be trying this next  ;)


Jeremy Collake

It is interesting how the sheer complexity of the power management of Windows can cause problems. Since every device can participate in the power management process, it allows the opportunity for issues. The third-party OEM software often installed as a' bonus' also isn't helpful.

Coffee looks like an interesting tool to prevent sleep (or not) during network activity, but do be careful to backup your previous power settings first via powercfg.exe -qh > backup.txt or something like so. Create a restore point, etc..

I really had no idea this was such an issue until your post. i did not know many people had this problem [the inability for their PC to sleep, unrelated to Process Lasso]. Of course, there may be several major causes, which I'd be curious to discover for certain.
Software Engineer. Bitsum LLC.

DeadHead

My issue happened again yesterday; Windows was stuck in power saving mode even during activity. My machine don't have any third-party apps that I'm not aware of, since this is a home built PC with Windows installed from scratch by me.

This may happen after reboot, or after waking the computer up from sleep. It's rather uncommon afaik. Again, the option to enforce rules more strictly in PL would help sort this out I think.
Windows 10 Pro 64 (swedish) || Xeon 5650 @ +4 GHz || 24 gig ram || R9280 Toxic

Jeremy Collake

No idea how it got in power saving mode, eh? Desktop PC? .. Strange, I don't know.

Yes, I can enforce stricter profile management I suppose, over-riding any third party or user intervention.
Software Engineer. Bitsum LLC.

DeadHead

Quote from: bitsum.support on April 09, 2012, 01:06:41 PM
No idea how it got in power saving mode, eh? Desktop PC? .. Strange, I don't know.

Yes, I can enforce stricter profile management I suppose, over-riding any third party or user intervention.

The only program I have, that I know of, that puts the machine into power saving mode is PL, because I told it to - after the computer's been idle for ten seconds. As soon as I'm using it, it returns to high performance, except for these odd occasions.
Windows 10 Pro 64 (swedish) || Xeon 5650 @ +4 GHz || 24 gig ram || R9280 Toxic

Jeremy Collake

#17
Final analysis for DeadHead's issue is:

1. Energy Saver could get left in 'Balanced' or 'Power Saving' (whatever the profile you chose) *if* an unattended shutdown occurred or the governor was improperly terminated without user intervention.
My previous ASSumption that a crash of the governor would have to occur was incorrect.

Actions:
+ Fix applied to v6 beta branch for proper shutdown of Energy Saver during unattended shutdowns/restarts
+ Fix applied to v6 to recover from abnormal terminations of governor, restoring the power profile no matter what
+ Backported both of above to v5 stable branch - will be in v5.1.0.70

The first case is still presumed unrelated, as it is inverse of this one.
Software Engineer. Bitsum LLC.

Jeremy Collake

v5.1.0.69 beta resolves this. Will go final soon, as it is just barely a beta.
Software Engineer. Bitsum LLC.

DeadHead

Quote from: bitsum.support on April 09, 2012, 06:35:07 PM1. Energy Saver could get left in 'Balanced' or 'Power Saving' (whatever the profile you chose) *if* an unattended shutdown occurred or the governor was improperly terminated without user intervention.

Considering the fact that my kids from time to time mess with my computer, and more than once have managed to turn it off in a bad way, this seems to match what I've observed. Thanks for taking the time to look into this! :)
Windows 10 Pro 64 (swedish) || Xeon 5650 @ +4 GHz || 24 gig ram || R9280 Toxic

Jeremy Collake

Quote from: DeadHead on April 10, 2012, 06:23:40 AM
Considering the fact that my kids from time to time mess with my computer, and more than once have managed to turn it off in a bad way, this seems to match what I've observed. Thanks for taking the time to look into this! :)

Thank YOU for telling me about it ;). Opening my eyes, if you will. Sometimes it takes me a minute to think through what the reporter is saying, and how it might happen, but I usually get 'there' in the end, lol.

It is so difficult to test and regression test every feature, that's why I rely on users to help in beta testing. Hence the new v6 beta test group, whose goal is to make sure things are *right* before we reach final. Of course, I haven't reached a public alpha yet, so I need to quit mentioning v6 - as I get asked every day when it is coming ;p
Software Engineer. Bitsum LLC.

Jeremy Collake

And the final was released, game over on this bug. PLEASE, if you see this occur again, let me know. I did preliminary testing and code review, and it is so simplistic that it surely won't malfunction, but don't hesitate to tell me if it does. My ego is much less important than a quality product ;).
Software Engineer. Bitsum LLC.

bertie97

Just one quick follow up.
Juggling settings & the PL right click menu prevent sleep for processes seems to have things running as I would like (So far). 

I am sure I'll get more curve balls in future as MS PM is sooooo convoluted but right now I'm almost where I want to be  ;D
Thanks for looking into this.

Jeremy Collake

#23
Glad your PC close to your desired overall behavior ;). Just let me know if there's anything you feel that could use an adjustment.
Software Engineer. Bitsum LLC.

DeadHead

Just wanted to let you know, that *so far* I have NOT seen the issue I reported earlier appear again. I'll post here again, should it return! ;)
Windows 10 Pro 64 (swedish) || Xeon 5650 @ +4 GHz || 24 gig ram || R9280 Toxic

Jeremy Collake

Quote from: DeadHead on April 15, 2012, 11:46:30 AM
Just wanted to let you know, that *so far* I have NOT seen the issue I reported earlier appear again. I'll post here again, should it return! ;)

Great, thanks for reporting back ;)
Software Engineer. Bitsum LLC.

Tarnak

 I have read this thread, but for me with XP, I believe it not relevant in my case, since my computer is running 24/7. I hope my understanding, is not misplaced.  :)

edkiefer

Quote from: Tarnak on April 15, 2012, 09:10:51 PM
I have read this thread, but for me with XP, I believe it not relevant in my case, since my computer is running 24/7. I hope my understanding, is not misplaced.  :)
right, most of the sleep and power setting in PL only apply to vista/win7 + etc . MS changed how it works with more options now then in XP .

I just leave my desktop always on with only monitor shutting down after a while . I personally don't like HD, hibernation etc , it can sometimes cause issue when you wake it up again .

In XP the power/energy settings should be grayed out in PL .
Bitsum QA Engineer

Tarnak

Quote from: edkiefer on April 16, 2012, 07:36:34 AM
right, most of the sleep and power setting in PL only apply to vista/win7 + etc . MS changed how it works with more options now then in XP .

That's what I thought. Thanks or the confirmation.

Quote from: edkiefer on April 16, 2012, 07:36:34 AM
I just leave my desktop always on with only monitor shutting down after a while . I personally don't like HD, hibernation etc , it can sometimes cause issue when you wake it up again .

Me, too!

Quote from: edkiefer on April 16, 2012, 07:36:34 AM
In XP the power/energy settings should be grayed out in PL .

Confirm... except for 'Configure No Sleep processes', which is not grayed out.

bertie97

Quote from: bitsum.support on April 15, 2012, 09:33:54 AM
Glad your PC close to your desired overall behavior ;). Just let me know if there's anything you feel that could use an adjustment.

Very happy with the impact of the changes you have made to the PM control.  I can now leave the PC knowing it will sleep or not as req'd.  ;)
Not sure how tied the monitor vs box PM controls are, but is it a simple hack to separate monitor sleep & box sleep?  i.e. can I lock a process in prevent box sleep but have my monitor sleep as normal?  Perhaps via a right click option in the 'no sleep processes' dialog?

Jeremy Collake

*CORRECTION* to my previous hasty post.

Quote from: bertie97 on May 13, 2012, 04:33:18 AM
Not sure how tied the monitor vs box PM controls are, but is it a simple hack to separate monitor sleep & box sleep?  i.e. can I lock a process in prevent box sleep but have my monitor sleep as normal?  Perhaps via a right click option in the 'no sleep processes' dialog?

Yes, I can differentiate the two. If you want such, I can allow it. I will add this to version 6 for sure, maybe earlier. It's pretty darn easy, just gotta redo the GUI mostly.

QuoteIn XP the power/energy settings should be grayed out in PL .

The 'no sleep' function *is* supported in 2K/XP, as well as Vista and above, since it does not rely on changing power profiles. Hence, it is not greyed out, and will work fine.
Software Engineer. Bitsum LLC.

Jeremy Collake

I have added to the internal build of version 6 the option to choose either or both, "Prevent display from sleeping" and "Prevent PC from sleeping".
Software Engineer. Bitsum LLC.

edkiefer

Quote from: bitsum.support on May 13, 2012, 11:11:54 AM
*CORRECTION* to my previous hasty post.

Yes, I can differentiate the two. If you want such, I can allow it. I will add this to version 6 for sure, maybe earlier. It's pretty darn easy, just gotta redo the GUI mostly.

The 'no sleep' function *is* supported in 2K/XP, as well as Vista and above, since it does not rely on changing power profiles. Hence, it is not greyed out, and will work fine.

Ah, that would be my mistake a few posts back , no sleep is available , just power profile and energy saving is grayed out in XP .
Bitsum QA Engineer

GTX2GvO

I'm just wondering if there's a way to NOT use process Lasso's power profile settings.

Right now my windows energy scheme is a custom one. (that prolasso actually shows as used)
But according to certain preset rulings in ProLasso (e.g. Gaming Mode) it would be swapped to a ProLasso preset scheme.  :-\
(well. According to the documentation at least)

Which is rather always a LOWER power using scheme.
I've set my custom profile on a sort of "Full Power" setting, that never turns off HDD's, monitors etc.
And has everything on their highest energy settings.

Or is this already in the bag and I simply don't know where to look for it.  ???

Jeremy Collake

Quote from: DeadHead on April 15, 2012, 11:46:30 AM
Just wanted to let you know, that *so far* I have NOT seen the issue I reported earlier appear again. I'll post here again, should it return! ;)

Yes, please do - BUT, I am fairly confident I identified and fixed the issue you reported. (famous last words? ;p)
Software Engineer. Bitsum LLC.

bertie97

GTX2GvO - I assume you don't want to knock PL PM out completely via Main>Energy Saver Enabled  (i.e checked or unchecked.)  Personally I have allocated my games to my High Perf. profile via options>power>configure application power profiles.  Did that option not work out for you?

bitsum.support - look forward to seeing the added PM functions - & sorry for adding to your work-load...  ;)

Jeremy Collake

Here's a screenshot of that the expanded anti-sleep capabilities look like in the v6 GUI so far.
Software Engineer. Bitsum LLC.

bertie97

That looks like exactly what I need.   ;D

Looking forward to the next iteration!  8)

Jeremy Collake

Well you will have it ;). I am cranking things out as fast I can, want to have as much as I can in the first build, scheduled for 05/31/2012. Even if its not where I'd prefer it to be, its going out. If as an alpha or beta.
Software Engineer. Bitsum LLC.

bertie97

Good to know things are moving along.

I was looking around the site for any beta posts but can't seem to see any, maybe I'm now looking in the right place, or maybe there are none yet.  Seem to recall a beta tag somewhere but I don't see it now. ???

O.T. - PL has become an essential tool for me now.  I am finding  more & more that it is useful in diagnostic roles.  I am often trying to optimize things & the feedback of PLs main dialog is a great help.  I unreservedly recommend it wherever I can.



Jeremy Collake

Thanks bertie97 ;). I missed my revised release date of 05/31/2012, and while I have some darn good excuses for doing so (hard to work if you're deathly sick), I am getting it together now. There will also be a minor update to v5, not to be confused with v6.
Software Engineer. Bitsum LLC.

Jeremy Collake

Finishing up the dialog support for this feature (about 50% on that), forgot I'd have to rewrite that dialog completely for this too. The back-end stuff and governor is all written, though not yet tested much. Should do fine though, unless I made any mistake while sleepy. 7 more chores remain, just tedious stuff. Nothing difficult.
Software Engineer. Bitsum LLC.

Hotrod

I recently lost my HD and had to reinstall from scratch. In doing so I noticed that the "Disable when NOT running on batteries" checkbox does not stay checked in Energy Saver settings. When you leave the box and come back it is always unchecked.

Jeremy Collake

Quote from: Hotrod on June 05, 2012, 01:41:32 PM
I recently lost my HD and had to reinstall from scratch. In doing so I noticed that the "Disable when NOT running on batteries" checkbox does not stay checked in Energy Saver settings. When you leave the box and come back it is always unchecked.

Thanks. That is an artifact that went unnoticed. I will fix it on up in a minor update while v6 goes through its final cycle here. I can't believe nobody told me earlier, lol.
Software Engineer. Bitsum LLC.

Jeremy Collake

I am uploading a quick refresh of v5.1.0.84. It will NOT be pushed out as an update, no need for that. It simply removes that option from being visible. It was not supposed to be visible yet, that was the artifact. The backing code was incomplete.
Software Engineer. Bitsum LLC.

Jeremy Collake

EARLY alpha now out with this support
Software Engineer. Bitsum LLC.

bertie97

Looking good!

That leaves me with only one more question - what surprises have you planned for version 7?!   :P  ;D ;D ;)

Jeremy Collake

#47
There are still more surprises planned for version 6.
Software Engineer. Bitsum LLC.

bertie97

Not sure if this is me failing to understand the dialogs... but I just put 6.x.40 beta on the PC & I am seeing in the 'no sleep' settings :-
Prevent only Display
Prevent whole PC


ie prevent from sleeping... 
Wondering if this should be 'allow' only display to sleep rather than it's current ability to stay on when everything else is asleep  :D  or am I just not getting it somehow?  ???

Everything else seems good, will be 'pushing boundaries' later to see what happens.   Mission critical tasks like games for example  ;)

Hotrod

The whole idea of the feature is sleep prevention during specific events ...like overnight processes. This looks like just what we needed, with reservations for tweaks as we learn. ;)