Winstep

Software Technologies


 Winstep Forums


Print view
Board index : Winstep Forums : General Discussion  [ 22 posts ] Go to page 1, 2  Next
Author Message
 Post subject: Dock freezes after standby
PostPosted: Sat Nov 18, 2017 8:28 am 
Offline

Joined: Sat Nov 18, 2017 8:17 am
Posts: 7
Hello,
the Nexus-Dock (current version Ultimate) freezes after standby mode (overnight).
The CPU load is then up to 50%. After 1 to 2 minutes the dock will work normally.
My system: Surface Pro 4 (i5 8GB 250 SSD, Windows 1709 (Build 16299.64)

Best regards Steffen


Back to top
 Profile  
 
 Post subject: Re: Dock freezes after standby
PostPosted: Sat Nov 18, 2017 9:33 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11930
Steffen, what version of Nexus Ultimate are you running?

That is an issue that has been fixed many years ago: it was caused by the multimedia timers (used to control the timing of animations) constantly firing on return from standby/hibernation to make up for the time the system was in a power saving mode.

It was solved by destroying the timer when the application receives a notification that the system is about to enter a power saving mode and recreating it later. So, either you are using a very old version of the software, or something in your system is preventing the Winstep application from getting that notification.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Dock freezes after standby
PostPosted: Sat Nov 18, 2017 10:33 am 
Offline

Joined: Sat Nov 18, 2017 8:17 am
Posts: 7
Hello, I'm using the current version 17.1, will rebuild the surface and see if it works then.


Back to top
 Profile  
 
 Post subject: Re: Dock freezes after standby
PostPosted: Sat Nov 18, 2017 12:21 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11930
One more thing: Standby is not the same as Suspend (Sleep). Are you sure you don't mean Sleep instead of Standby?

Anyway, in case you - or someone else - is curious I've been looking a bit more into this. The documentation itself regarding power events is confusing enough. Besides PBT_APMSUSPEND there is also a PBT_APMSTANDBY, but the documentation says it's not used/supported.

Here is where it gets tricky though: to put the system into a power saving mode, you use SetSuspendState, which has a ForceCritical parameter. According to the documentation, ForceCritical "has no effect". HOWEVER, I also spotted a post from a developer complaining that, at least under XP SP3, if ForceCritical is set to TRUE applications do NOT receive the notification that the system is about to be suspended (PBT_APMSUSPEND). They are only notified when the system resumes.

There is no reply to this post, and thus no resolution.

Now, as I explained above, when receiving a PBT_APMSUSPEND event (i.e.; just before the system is suspended) I kill the multimedia timers so they don't start firing continuously when the system resumes. Obviously the timers will remain 'dormant' if the notification is not received, ready to unleash hell as soon as the system wakes up again.

Just in case, when I get a notification that the system has just returned from suspend and the timers are still active (they shouldn't be), I kill them anyway to try and prevent them from firing continuously.

However, this might be too late - if the application does not receive that critical PBT_APMSUSPEND notification and thus does not kill the timers before the fact, it can happen that on resume the timers will start firing immediately and continuously even before the application has had time to process the Resume notification (in which case it won't until the timers have finished firing every single one of the missed 'ticks').

TL;DR: Microsoft has made a huge mess with this. I also heard the Surface Pro laptops have (had?) multiple power saving related issues.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Dock freezes after standby
PostPosted: Tue Nov 21, 2017 5:40 pm 
Offline

Joined: Tue Mar 01, 2016 11:46 am
Posts: 568
winstep wrote:

Just in case, when I get a notification that the system has just returned from suspend and the timers are still active (they shouldn't be), I kill them anyway to try and prevent them from firing continuously.

However, this might be too late - if the application does not receive that critical PBT_APMSUSPEND notification and thus does not kill the timers before the fact, it can happen that on resume the timers will start firing immediately and continuously even before the application has had time to process the Resume notification (in which case it won't until the timers have finished firing every single one of the missed 'ticks').

TL;DR: Microsoft has made a huge mess with this. I also heard the Surface Pro laptops have (had?) multiple power saving related issues.


Wouldbit be possible to build in a failsafe ino timers themselves? That before they fire they check a variable?


Back to top
 Profile  
 
 Post subject: Re: Dock freezes after standby
PostPosted: Tue Nov 21, 2017 8:18 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11930
seeker wrote:
Wouldbit be possible to build in a failsafe ino timers themselves? That before they fire they check a variable?


It depends on what is actually happening, and without being able to reproduce the problem here I can only guess.

You are literally only allowed to call a handful of functions during a High-resolution timer event (PostMessage, timeGetSystemTime, timeGetTime, timeSetEvent, timeKillEvent, midiOutShortMsg, midiOutLongMsg, and OutputDebugString).

To work around this, and since that is one of the functions allowed, the timer event posts a 'timer kick' message to a special control window via PostMessage, and that is ALL it does. It is the control window which will then do the actual work of processing the event. PostMessage, however, does not wait for the control window to respond, it simply places that message in that windows's message queue (to be processed later by the Windows message pump) and immediately returns.

Now, it's possible - and most probable - that the control window does not get ANY time from the system to process even the FIRST timer kick until the timers have finished firing ALL the pending kicks, i.e.; only when the timers finally make up for the lost time does the control window actually get a chance to process the FIRST of all the timer kicks posted into its message queue.

Again, since the application did not get a prior notification that the system was being suspended, the high resolution timer event routine has no way of knowing it is currently returning from a low power mode. It will only know that when the control window finally gets that notification, and again this will probably only happen once all the timers have finished firing all they had to fire.

Also, because of the limited number of functions you are allowed to call from within the high resolution timer event without causing an immediate and fatal application crash, you probably can't do much to figure out what is going on either.

Working with the high resolution multimedia timers is a true PITA, trust me. :)

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Dock freezes after standby
PostPosted: Wed Nov 22, 2017 12:16 am 
Offline

Joined: Wed Jul 09, 2014 1:35 pm
Posts: 50
I can chime in here, as I also have a Surface Pro 4. This seems to be an issue specific to Surface. I've noticed that it takes a while for the dock to respond after the Surface wakes up from sleep. The dock seems frozen for a minute or two, then eventually all is fine. I also have Nexus Ultimate on an HP and it does not happen with that system.


Back to top
 Profile  
 
 Post subject: Re: Dock freezes after standby
PostPosted: Wed Nov 22, 2017 1:01 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11930
Yep, it's beginning to look like something is flawed in how the Surface laptops implemented their power saving modes.

I suppose I could make a small test application to display which power-related messages the system broadcasts when entering and returning from Sleep. This would probably allow us to understand what is actually going on.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Dock freezes after standby
PostPosted: Wed Nov 22, 2017 1:52 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11930
And by the way, this is an issue that plagued Firefox for many years too, until Mozilla figured out what was causing it.

Funny how even after all these years the MS documentation STILL does not say that during a suspend/resume cycle, the multimedia timer events will be queued up, meaning we get all events which were supposed to happen since the suspend when you resume.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Dock freezes after standby
PostPosted: Wed Nov 22, 2017 8:04 am 
Offline

Joined: Sat Nov 18, 2017 8:17 am
Posts: 7
Hello, I have completely redesigned the surface. I didn't change the power settings. The dock still freezes for one or two minutes, the CPU goes up to 50 percent after waking up from standby.

I installed the dock on an Acer laptop for testing purposes. Everything's fine there. Seems to be really a problem of Surface. :-(

best regards Steffen


Back to top
 Profile  
 
 Post subject: Re: Dock freezes after standby
PostPosted: Wed Nov 22, 2017 6:41 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11930
Typometer wrote:
Seems to be really a problem of Surface. :-(


YES it is, and I finally found some information on what is causing this.

The Surface Pro laptops apparently use something called 'Connected Standby' (I strongly advise you to read the article). A PC with Connected Standby can’t use other power-management states like Sleep and Hibernate.

Essentially Connected Standby is supposed to be faster at waking the system up than Sleep or Hibernate, so the system works a bit more like your Smartphone (always on and responsive but always trying to save power wherever possible).

Because Connected Standby is 'different', Microsoft opted not to broadcast the regular WM_POWERBROADCAST + PBT_APMSUSPEND notifications when the system is entering Connected Standby.

This explains why the Winstep application does not get the notification that the system is about to enter a low power mode on the Surface Pro, therefore preventing it from disabling the multimedia timers on time. By the time the system resumes, it's too late to prevent those timers from firing all the queued up events.

So, from what I read so far, it *seems* that to receive the suspend messages on a system with Connected Standby I have to explicitly opt-in to receive said notifications via RegisterSuspendResumeNotification (an API call new to Windows 8 ). Going to give that a try.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Dock freezes after standby
PostPosted: Thu Nov 23, 2017 1:45 pm 
Offline

Joined: Sat Nov 18, 2017 8:17 am
Posts: 7
Hello, after disabling InstantGo via the registry (HKEY_LOCAL_MACHINE\SYSTEM\SYSTEM\CurrentControlSet\Control\Power - DWord CsEnabled) the dock works fine on the Surface pro. :D

Best regards Steffen


Back to top
 Profile  
 
 Post subject: Re: Dock freezes after standby
PostPosted: Thu Nov 23, 2017 2:21 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11930
Typometer wrote:
Hello, after disabling InstantGo via the registry (HKEY_LOCAL_MACHINE\SYSTEM\SYSTEM\CurrentControlSet\Control\Power - DWord CsEnabled) the dock works fine on the Surface pro. :D


Yep, InstantGo is the new name for what was previously known as Connected Standby.

Anyway, the changes I made for the next release *should* have fixed the issue. I will need confirmation though, since I don't have a Surface Pro laptop.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Dock freezes after standby
PostPosted: Sun Nov 26, 2017 10:14 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11930
There's a new beta out that should have fixed the issue with the Surface Pro laptops. Can you guys please test it and let me know? :D

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Dock freezes after standby
PostPosted: Mon Nov 27, 2017 5:27 am 
Offline

Joined: Sat Nov 18, 2017 8:17 am
Posts: 7
Hello,
I tested the Beta on the Surface pro, it works great, no freezing after standby :-) everything is fine.

Thank you for the quick help!!!


Back to top
 Profile  
 
Post new topic Reply to topic Board index : Winstep Forums : General Discussion  [ 22 posts ] Go to page 1, 2  Next
Display posts from previous:  Sort by  

Who is online

Users browsing this forum: Google [Bot] and 50 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron