2

I have a Windows 10 Desktop PC I built recently with all new parts, Windows is fully updated, as are all drivers, BIOS, etc. I had a problem with my PC waking up from sleep randomly at night, and then staying on all night, so I disabled all possible wake timers, which seems to have fixed that issue; however, now the PC stays asleep until I press a key on my keyboard.

  • My PC does not go to sleep automatically by itself based on the timer I set in Power Settings (presumably this is why it would stay up all night after automatically waking up with the previous issue above)
  • When I try specific programs to make only the monitors go to sleep, such as Turn off LCD and NirCmd, the monitors turn off for 1 second, then turn back on, so that is perhaps a clue

I've tried virtually everything [screenshots below] and nothing makes my PC go to sleep automatically when idle, including disabling all Wake Armed devices in Device Manager, which didn't fix it either, so I only left the Keyboard enabled to ensure I can wake my PC when I manually put it to sleep. I do not want to reset anything as it's taken me a long time to get my PC configured just right and fix the issue of my PC waking randomly from sleep.

  • Advanced Power Settings:
    Advanced Power Settings
  • Power Troubleshooting Results:
    Power Troubleshooting

  • Group Policy Sleep Settings set to ensure automatic sleep:
    All relevant "Sleep Settings" in "Local Group Policy Editor" set to ensure automatic sleep

  • powercfg:
    • devicequery wake_armed:
      HID Keyboard Device (003)
      HID Keyboard Device (004)
      
    • -energy: 14 Errors, 9 Warnings, 58 Informational (rebooted, didn't touch anything)
    • -requests:
      DISPLAY:
        None.
      
      SYSTEM:
        None.
      
      AWAYMODE:
        None.
      
      EXECUTION:
        None.
      
      PERFBOOST:
        None.
      
      ACTIVELOCKSCREEN:
        None.
      

What else can I try to find out what in the world is keeping my PC from sleeping automatically and fix this issue, considering powercfg -requests returns everything as none?

FINAL UPDATE: With the help of a combination of everyone's suggestions (see my answer below), I was able to find the culprit: Creative Pebble V3 external speakers connected via USB-C. I updated its Firmware and it resolved the problem.

ProgrammerGirl
  • 263
  • 1
  • 6
  • 19
  • Have a look at https://superuser.com/questions/1576236/simple-windows-10-view-of-any-process-preventing-sleep – Tetsujin Mar 15 '21 at 17:13
  • @Tetsujin Thanks, but I had already seen that answer before I posted, and it did not provide a solution to my problem. As per my post and screenshot, `powercfg -requests` shows everything as "none". That answer you linked to does mention something interesting, that programs can "Call SetThreadExecutionState periodically to reset the idle time", but it doesn't answer or explain how to check for that. Any ideas? – ProgrammerGirl Mar 15 '21 at 17:20
  • tbh, no. That was my question, no-one came up with a satisfactory answer. I'm too used to Mac, where I can just look at the column that says 'preventing sleep' yes/no. – Tetsujin Mar 15 '21 at 17:26
  • Did you go to Multimedia Settings and made sure it was set to: Allow computer to sleep? – Pale Mar 15 '21 at 20:09
  • @Pale: Yes, it's set to "Allow computer to sleep" in the advanced power settings and it makes no difference (I'm not playing or sharing any multimedia anyway). PC still won't sleep. – ProgrammerGirl Mar 16 '21 at 08:33
  • Please post online the results of [powercfg -energy](https://www.tenforums.com/tutorials/5148-create-power-efficiency-diagnostics-report-windows-10-a.html). – harrymc Mar 17 '21 at 15:58
  • 1
    Have you disconnected all peripherals and tried it, and I mean even the mouse and keyboard? I had a PC that did this once and after doing this it worked, turned out the mouse was defective and showed movement on occasion that was not visible to the eye, but prevented the computer from sleeping. – acejavelin Mar 17 '21 at 16:07
  • @harrymc: Here are the results of running `powercfg -energy` after restarting my PC and not touching anything: https://i.imgur.com/hYc8VEo.png – ProgrammerGirl Mar 18 '21 at 08:26
  • @acejavelin: I had tried disabling all hardware-based wake-timers (which should have the same effect as disconnecting all peripherals that could keep it away), and it did not resolve this issue even after confirming that there were no hardware-based wake timers enabled via `powercfg devicequery wake_armed`. I then re-enabled only my keyboard to ensure I can wake my PC when manually putting it to sleep. – ProgrammerGirl Mar 18 '21 at 08:29
  • Please post the HTML results of running `powercfg -energy`. The image is not helpful. – harrymc Mar 18 '21 at 08:59
  • @harrymc: The image is a screenshot of those HTML results. Zoom in. – ProgrammerGirl Mar 18 '21 at 10:03
  • Infinite zoom-in only exists in movies - in real life the quality degrades. It's also quite hard to extract/copy text from an image. – harrymc Mar 18 '21 at 10:12
  • @harrymc: Here's the HTML version you requested: https://codepen.io/TheProgrammerGirl/pen/YzpozXo – ProgrammerGirl Mar 18 '21 at 10:59
  • Run *Start > Power Options > Change plan settings > Change advanced power settings*, and expand "USB settings" and "USB selective suspend setting". Are both the items of "On battery" and "Plugged in" set to the value of "Enabled"? – harrymc Mar 18 '21 at 11:14
  • @ProgrammerGirl When crafting long questions/answers, it helps with readability to use markdown formatting, such as bullets, to assign certain points to their relative paragraphs. Without clear delineations of information, long questions/answers can come across as a single train of thought, with information outside of its logical chronology. – JW0914 Mar 18 '21 at 11:20
  • @harrymc: There is no "On battery" and the "USB selective suspend setting" you mentioned is set to "Enabled" as per the screenshot in my original post. I just double-checked and it's still "Enabled". – ProgrammerGirl Mar 18 '21 at 11:23
  • The Energy Report shows that the USB devices refuse to sleep. This might be a driver problem. It's harder with a self-built computer, but what is the motherboard? If you have a list of all the components, this might help me or others. – harrymc Mar 18 '21 at 11:35
  • @ProgrammerGirl Often when a system refuses to go to sleep it's due to a running task in Task Scheduler [`taskschd.msc`] and Event Viewer should provide some information [`eventvwr.msc`]. A task is also likely why the PC was waking in the middle of the night and not resuming sleep after the task finished. – JW0914 Mar 18 '21 at 12:13
  • @JW0914: Please let me know what to check in those two MSC's to further debug this problem. – ProgrammerGirl Mar 19 '21 at 05:43
  • 1
    @harrymc: See the list of components here: https://codepen.io/TheProgrammerGirl/pen/qBqzYpZ (2 monitors are connected to the PC, one at 240hz and the other at 120hz, both via DisplayPort). PSU has USB link cable connected. 8TB drive is via RAID 0. (Please do not edit my post to include parts list here.) – ProgrammerGirl Mar 19 '21 at 05:52
  • Have you installed the drivers for the [X570 AORUS XTREME](https://www.gigabyte.com/Motherboard/X570-AORUS-XTREME-rev-10/support#support-dl-driver). Especially for the BIOS and Chipset. The BIOS update from 2021/03/12 says this: "Improve USB 2.0 devices **stability and compatibility**". – harrymc Mar 19 '21 at 10:51
  • @harrymc: Yes to all. Current BIOS version is "F33f". For the Chipset, I installed the most recent version from AMD which is more recent than the one listed on the MB support page. I did not install the AMD APU Driver. – ProgrammerGirl Mar 19 '21 at 18:17
  • If everything is correct as regarding software, then what is left is hardware. Normally the advice would be to contact Support, but for a self-built computer the most you may do is contact the motherboard manufacturer. – harrymc Mar 21 '21 at 10:50
  • @harrymc: Is there no way to 1) Find out which hardware is keeping the PC from sleeping, and 2) Force-disable that hardware's ability to do that ? – ProgrammerGirl Mar 21 '21 at 11:19
  • The Energy report listed 12 USB devices as not entering Selective Suspend. This probably means that they cannot power down. Given the excessive number of devices, I would guess the problem to be rather with the USB hub. – harrymc Mar 21 '21 at 11:25
  • @harrymc: But my PC is able to go to Sleep if I do it manually, so isn't there a way to make the PC follow those same manual sleep steps but based on a custom script that has a timer that resets based simply on keyboard/mouse movements? Perhaps a combination of *PsTools* and *PowerShell*? – ProgrammerGirl Mar 21 '21 at 11:41

4 Answers4

3

A workaround that might work if nothing else is an AutoHotkey script:

#Persistent
if not A_IsAdmin ; powercfg must run as admin
{
    Run *RunAs "%A_ScriptFullPath%"
    ExitApp
}

SetTimer, IdleCheck, 15000 ; checks every 15 seconds for idleness
Return

IdleCheck:
If A_TimeIdle > 300000 ; adjust to however many milliseconds you want to wait before standby
{
   RunWait, nircmd.exe execmd "powercfg -requests > "%A_Temp%\pwrcfg_output.txt" "
   Sleep, 1000
   FileRead, PwrOutput, %A_Temp%\pwrcfg_output.txt
   If RegExMatch(PwrOutput, "DISPLAY:\r\n *None")
   && RegExMatch(PwrOutput, "SYSTEM:\r\n *None")
   && RegExMatch(PwrOutput, "AWAYMODE:\r\n *None")
   && RegExMatch(PwrOutput, "EXECUTION:\r\n *None")
   && RegExMatch(PwrOutput, "PERFBOOST:\r\n *None")
   {
      Run, nircmd.exe standby
   }
}
Return

You can check to see whether or not the idle timer is not being constantly reset when there's no input by using the following script:

loop
{
  Sleep, 500
  Tooltip, %A_TimeIdle%
}

ESC::
ExitApp

The milliseconds in the tooltip should keep counting up without resetting when there's no mouse or keyboard input.

Aenfa
  • 511
  • 4
  • 12
  • The poster already indicated that nircmd didn't help. – harrymc Mar 24 '21 at 13:42
  • The thing the asker tried only turns off the monitor(s) without putting the computer on sleep mode (`nircmd monitor off`). The command in my script puts the computer on sleep mode just like as though it was done manually (`nircmd standby`). – Aenfa Mar 24 '21 at 13:56
2

Try to disconnect PSU USB 'corsair link' cable as googling corsair link sleep has people talking about that being problematic. In the comments you electronically disabled all your devices, please physically disconnect everything possible except for keyboard, might want to even try another one of those. This is a normal troubleshooting step that Microsoft recommends & Level 2 techs at HP (I was a lvl1 tech there) suggested, process of elimination. No one is saying disconnecting everything will BE the fix, it will help us understand IF ANY of the devices are problematic. If not then we know its not those pieces of equipment.

gregg
  • 5,598
  • 2
  • 21
  • 36
1

What you have done should have been enough, but is not working. You have done everything we could think of and answered all our questions, but Windows is still behaving in an abnormal manner.

Here are some more actions that you may take to check for and return Windows to a known state:

harrymc
  • 455,459
  • 31
  • 526
  • 924
1

After countless hours over many days, I was finally able to resolve this issue with a combination of all of the other solutions.

I used Aenfa's 2nd script for AutoHotKey:

loop
{
  Sleep, 500
  Tooltip, %A_TimeIdle%
}

ESC::
ExitApp

which showed something was definitely continuously resetting the idle timer, so this allowed me to easily tell when the idle timer was no longer being reset by something.

So then I followed gregg's answer and acejavelin's suggestion of physically unplugging peripherals. I just disconnected them one by one until I noticed the idle timer no longer resetting.

What was the culprit? The Creative Pebble V3 external speakers connected via USB-C.

harrymc's had earlier suggested a driver issue. Although there was no new driver for these speakers, there was a Firmware update. So I followed his advice and updated the Firmware of the speakers and it finally fixed the problem.

I want to thank harrmyc, gregg, Aenfa, acejavelin, and all others for their help with this.

I find it completely absurd that PC Sleep issues with Microsoft Windows 10 require this much effort and detective work to simply find the culprit. It's 2021!

ProgrammerGirl
  • 263
  • 1
  • 6
  • 19
  • Thank you for this answer! I had the exact same problem and I solved it like you! The simple [2nd script from Aenfa](https://superuser.com/a/1635719/327009) was the key to identify the device causing the problem! Incredible that Windows doesn't have a utility to help detecting this! – alelom Jan 27 '23 at 16:15