What is blocking my PC from sleeping after recording?

Post Reply
chupon

Posts: 60
Joined: Tue Mar 18, 2014 10:01 pm
Location:

HTPC Specs: Show details

What is blocking my PC from sleeping after recording?

#1

Post by chupon » Tue Aug 10, 2021 9:49 pm

I've had a heck of a time trying to figure this one out on my own, so I come to the forums. My machine wakes up to record just fine, but then never goes back to sleep. I don't think I have anything else running, but may be I'm missing something. Any ideas?

Thanks!

https://imgur.com/a/5Zrg7gh

edit: I am aware the RDP session is active, but that is only to take screenshots.

stuartm

Posts: 584
Joined: Mon Nov 05, 2012 8:05 pm
Location: Longmont, CO

HTPC Specs: Show details

#2

Post by stuartm » Tue Aug 10, 2021 9:57 pm

When it's in that state bring up a command prompt with administrator priviliges and type: powercfg -requests
It should tell you what is keeping you from sleeping.

Space

Posts: 2368
Joined: Sun Jun 02, 2013 9:44 pm
Location:

HTPC Specs: Show details

#3

Post by Space » Wed Aug 11, 2021 4:15 am

The output you attached shows that there are three things preventing the machine from sleeping (unless you used the /requestsoverride to override them).

One of them is that WMC is recording, if that is not the case, then you have a problem with WMC.

The other two are the RDP (remote desktop) service and file sharing (srvnet).

I've had problems on my system with the file sharing keeping the system awake, even if I haven't connected to a share in a while, so I used the "powercfg /requestsoverride" command to make the machine ignore the fact that file sharing is asking the PC to stay awake.

Assuming the WMC recording and the RDP (remote desktop) are valid (you really are recording and using remote desktop at the time you ran this command) then I am guessing your problem is the same as mine, the file sharing.

To make it ignore the file sharing request to stay awake:

Run in an "Administrator" command prompt (run cmd.exe as Administrator):

Code: Select all

powercfg /requestsoverride DRIVER "srvnet" SYSTEM 
Note that this change is "permanent" in that it survives reboots. If you want to remove this override, you need to run this command (leave off the last (REQUEST) parameter):

Code: Select all

powercfg /requestsoverride DRIVER "srvnet"
Beware that this will allow the system to go to sleep even if you are doing remote file sharing at the time. I think this should only be a real problem if you are writing to a file when the system goes to sleep (which may cause file corruption). If you are only reading a file, then you will just get a read error and be unable to continue until you wake the system again.

chupon

Posts: 60
Joined: Tue Mar 18, 2014 10:01 pm
Location:

HTPC Specs: Show details

#4

Post by chupon » Wed Aug 11, 2021 1:57 pm

Thanks I'll give that a shot today.

chupon

Posts: 60
Joined: Tue Mar 18, 2014 10:01 pm
Location:

HTPC Specs: Show details

#5

Post by chupon » Wed Aug 11, 2021 2:33 pm

Ok that seemed to work. Will it prevent playback of files on Plex, or will that part at least keep it awake?

chupon

Posts: 60
Joined: Tue Mar 18, 2014 10:01 pm
Location:

HTPC Specs: Show details

#6

Post by chupon » Wed Aug 11, 2021 6:09 pm

Nevermind, I tested it and it seemed to stay on while streaming, then went back to sleep as soon as it ended.

Thanks again!

chupon

Posts: 60
Joined: Tue Mar 18, 2014 10:01 pm
Location:

HTPC Specs: Show details

#7

Post by chupon » Wed Aug 11, 2021 9:14 pm

And just to completely close the loop I had a recording scheduled today, it finished and went to sleep.

Yay!

Space

Posts: 2368
Joined: Sun Jun 02, 2013 9:44 pm
Location:

HTPC Specs: Show details

#8

Post by Space » Thu Aug 12, 2021 12:18 am

Nice!

Post Reply