Take a look at our
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message

Preventing X1G6 running W10x64 from sleeping upon idle timeout

X1 / X1-Carbon (X1C) / X1-Extreme (X1E) Series/Generations
Post Reply
Message
Author
dandreye
Junior Member
Junior Member
Posts: 280
Joined: Tue Feb 07, 2012 11:48 am
Location: London, UK

Preventing X1G6 running W10x64 from sleeping upon idle timeout

#1 Post by dandreye » Thu Mar 04, 2021 1:11 pm

Hi All,

How do I achieve the following simple behaviour with my work X1G6 running our corporate IT "enhanced" W10x64 that was recently updated to the May 2020 update v2004:
- When left idle longer than our corporate idle timeout (~5min IIRC) it's allowed to lock the screen but has to remain powered on (S0 power state afaik): it may not sleep as it's doing now
- Meanwhile if possible it can still be explicitly put to sleep whenever necessary, e.g. with Fn+4, ideally into the proper old style deep sleep (S3 power state afaik)

I already have all kinds of sleep timers in my currently active Balanced power plan I could possibly think of and find set way higher and still it sleeps every time upon idle timeout expiry.

After reading all those complaints about S3 revoked in X1G6 at BIOS level, e.g. https://forums.lenovo.com/t5/Linux-Disc ... -p/3998182 (and other makes/models too, particularly Dell), or at least advertisement of its support by ACPI I understand the idea was to replace proper deep sleep S3 with this Modern Sleep (aka S0i3) more suitable for the phones/tablets. That however I could still live with - it's entering that state upon idle timeout that is the main issue for me, as my VPN connection and all ssh/sftp sessions to several remote servers all bounce every time, making me re-login (bearing all that security obsession in mind).

I've just tried this, which deprived my laptop of the Sleep option and still the laptop enters some kind of sleep upon idle timeout somehow:

Code: Select all

reg add HKLM\System\CurrentControlSet\Control\Power /v PlatformAoAcOverride /t REG_DWORD /d 0
Many thanks in advance!
2x T480s, 6x X61s, X60s, T43, T42

dr_st
Admin
Admin
Posts: 9701
Joined: Sat Oct 29, 2005 6:20 am
Location: Israel

Re: Preventing X1G6 running W10x64 from sleeping upon idle timeout

#2 Post by dr_st » Thu Mar 04, 2021 4:57 pm

Can you please run powercfg -a from the command line and provide the output?

When you say it enters sleep - which exact sleep mode are you referring to? What are the external signs that the laptop is in this mode?
Thinkpad 25 (20K7), T490 (20N3), Yoga 14 (20FY), T430s (IPS FHD + Classic Keyboard), X220 4291-4BG
X61 7673-V2V, T60 2007-QPG, T42 2373-F7G, X32 (IPS Screen), A31p w/ Ultrabay Numpad

dandreye
Junior Member
Junior Member
Posts: 280
Joined: Tue Feb 07, 2012 11:48 am
Location: London, UK

Re: Preventing X1G6 running W10x64 from sleeping upon idle timeout

#3 Post by dandreye » Thu Mar 04, 2021 5:24 pm

dr_st:
Can you please run powercfg -a from the command line and provide the output?
Please find that output below. It was obtained after changing the registry as mentioned in my initial post, which I suppose is why S0 Low Power Idle also shows up as unsupported. Meanwhile it confirms S3 is not supported as mentioned in that thread at Lenovo Forums, so unless there's a modded BIOS unmasking S3 support I guess I have no chances enabling it. Hibernate option is not that good for the SSDs but I have no choice but to use it now that the Sleep option is gone.
When you say it enters sleep - which exact sleep mode are you referring to? What are the external signs that the laptop is in this mode?
Right now with that registry change it starts cycling the power button light high-low-high-low exactly as it would previously, however one big change seems to be no VPN flapping anymore when I log back in. So it looks like it's not using that Modern Sleep S0i3 anymore and perhaps even stays active all that time despite that power button light behaviour as if it's sleeping.

Code: Select all

Microsoft Windows [Version 10.0.19041.804]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>powercfg /a
The following sleep states are available on this system:
    Hibernate

The following sleep states are not available on this system:
    Standby (S1)
        The system firmware does not support this standby state.

    Standby (S2)
        The system firmware does not support this standby state.

    Standby (S3)
        The system firmware does not support this standby state.

    Standby (S0 Low Power Idle)
        The system firmware does not support this standby state.

    Hybrid Sleep
        Standby (S3) is not available.

    Fast Startup
        This action is disabled in the current system policy.


C:\WINDOWS\system32>
2x T480s, 6x X61s, X60s, T43, T42

dr_st
Admin
Admin
Posts: 9701
Joined: Sat Oct 29, 2005 6:20 am
Location: Israel

Re: Preventing X1G6 running W10x64 from sleeping upon idle timeout

#4 Post by dr_st » Fri Mar 05, 2021 2:36 am

With Modern Standby (S0i3) on Windows, there is no notion of sending the computer to sleep. As soon as the screen is off (whether manually or by idle timer), the OS is free to start sending devices to a low-power state, based on whatever policies are set up. It is possible that an active network device will never be sent to standby, but a lot depends on how exactly the OS implements the policies and how the drivers are written.

Strange that you still see the power button as if it is in standby, even though you disabled S0i3.

I assume you are on WiFi, not LAN, and it's WiFi where you see this connectivity flap upon resuming from S0i3, right?
Thinkpad 25 (20K7), T490 (20N3), Yoga 14 (20FY), T430s (IPS FHD + Classic Keyboard), X220 4291-4BG
X61 7673-V2V, T60 2007-QPG, T42 2373-F7G, X32 (IPS Screen), A31p w/ Ultrabay Numpad

dandreye
Junior Member
Junior Member
Posts: 280
Joined: Tue Feb 07, 2012 11:48 am
Location: London, UK

Re: Preventing X1G6 running W10x64 from sleeping upon idle timeout

#5 Post by dandreye » Fri Mar 05, 2021 4:47 am

dr_st wrote:
Fri Mar 05, 2021 2:36 am
With Modern Standby (S0i3) on Windows, there is no notion of sending the computer to sleep.
Phone/tablet style I suppose. It'd have been fine if the connectivity didn't flap. Here's what I'd describe as ideal behaviour: use S0i3 putting all but network devices into that low power mode to avoid any flaps, and otherwise behave as before, i.e. allow deep sleep S3 upon Fn+4 and (if enabled) hibernate. Apparently they didn't longer see the need in S3 now that S0i3 is there :-)
dr_st wrote:
Fri Mar 05, 2021 2:36 am
I assume you are on WiFi, not LAN, and it's WiFi where you see this connectivity flap upon resuming from S0i3, right?
That's correct.
2x T480s, 6x X61s, X60s, T43, T42

dr_st
Admin
Admin
Posts: 9701
Joined: Sat Oct 29, 2005 6:20 am
Location: Israel

Re: Preventing X1G6 running W10x64 from sleeping upon idle timeout

#6 Post by dr_st » Fri Mar 05, 2021 7:53 am

Yes, in the past I have not quite understood why Microsoft made a decision to make S0i3 and S3 mutually exclusive in Windows. As far as I know - nothing in the ACPI specification mandates this specific implementation.

Furthermore, there is now a new thing - called S0idle, which can put selective devices (like network controllers) into a low power D3 state, if there is no activity - without even waiting for the screen to turn off. Essentially, it allows every device to implement its own idle timer without tying it to the system-wide screen idle timer.

This, of course, adds extra complications for implementation of device drivers. Microsoft's requirements from network controllers during low power states are sometimes inconsistent, often confusing, typically not bug-free, and in certain cases contradict other requirements. They also often vary depending on target system power state (e.g., is it S0idle, S0i3, S3 or S4?), even though there is not always an easy way for the device to know the system state. Some improvements have been made in recent years, but alas - with every batch of improvements, new requirements and features are also introduced, adding to the confusion.

Then there is also the matter that user expectations may vary, which means that no matter how you implement a certain feature, someone out there is bound to want it done differently.

It is likely that the connectivity flap you are experiencing is a bug caused by just such a inconsistent interpretation of requirements. It may even be a bug in the VPN software/driver itself, above the miniport driver and Microsoft's own network drivers.
Thinkpad 25 (20K7), T490 (20N3), Yoga 14 (20FY), T430s (IPS FHD + Classic Keyboard), X220 4291-4BG
X61 7673-V2V, T60 2007-QPG, T42 2373-F7G, X32 (IPS Screen), A31p w/ Ultrabay Numpad

dandreye
Junior Member
Junior Member
Posts: 280
Joined: Tue Feb 07, 2012 11:48 am
Location: London, UK

Re: Preventing X1G6 running W10x64 from sleeping upon idle timeout

#7 Post by dandreye » Fri Mar 05, 2021 8:21 am

dr_st wrote:
Fri Mar 05, 2021 7:53 am
It is likely that the connectivity flap you are experiencing is a bug caused by just such a inconsistent interpretation of requirements. It may even be a bug in the VPN software/driver itself, above the miniport driver and Microsoft's own network drivers.
Quite possible. In fact I was hoping for our company IT to dig out the root cause but apparently it's all outsourced now and they were offering things like "update all drivers, update Windows itself and if no luck we'll have to reimage your laptop", so I searched on my own and told them about all these recent S3/S0i3 changes, which they had no clue about. I'll probably have to leave it as is, i.e. w/o Standby of any kind and manually done Hibernate whenever necessary (e.g. before commuting).
2x T480s, 6x X61s, X60s, T43, T42

dandreye
Junior Member
Junior Member
Posts: 280
Joined: Tue Feb 07, 2012 11:48 am
Location: London, UK

Re: Preventing X1G6 running W10x64 from sleeping upon idle timeout

#8 Post by dandreye » Sun Mar 07, 2021 7:48 pm

Wow: apparently S3 support is back with BIOS v1.30 & up, not only for Linux but also for Windows - what a surprise from Lenovo:
https://forums.lenovo.com/t5/ThinkPad-X ... -p/4075415

That Sleep Mode in BIOS config toggles between W10 and Linux and defaults to W10. Switching it to Linux re-enables S3 support (the naming is somewhat confusing as calling it S3 on/off would be clearer). I've done it and my old style deep sleep is now back whenever I need it (either Fn+4 or Sleep timeouts in the Power Plan). I've just successfully verified that it stays active w/o bouncing connectivity and just locks and then turns off the screen past those initial 5min of inactivity, again as per Power Plan config, hence no S0i3 (I haven't tried undoing that registry change though). Also those on that thread report power consumption while in S3 matching expectations (~0.2W).
2x T480s, 6x X61s, X60s, T43, T42

dr_st
Admin
Admin
Posts: 9701
Joined: Sat Oct 29, 2005 6:20 am
Location: Israel

Re: Preventing X1G6 running W10x64 from sleeping upon idle timeout

#9 Post by dr_st » Mon Mar 08, 2021 2:21 am

Great to know, and thanks for sharing this with us. :thumbs-UP:

I must say that so far Modern Standby does not quite deliver the seamless experience it promised...
Thinkpad 25 (20K7), T490 (20N3), Yoga 14 (20FY), T430s (IPS FHD + Classic Keyboard), X220 4291-4BG
X61 7673-V2V, T60 2007-QPG, T42 2373-F7G, X32 (IPS Screen), A31p w/ Ultrabay Numpad

Post Reply

Return to “ThinkPad X1 / X1-Carbon / X1-Extreme and later Series”

Who is online

Users browsing this forum: No registered users and 14 guests