Proper standby support is an essential part of the HTPC
experience, something that can help transform the “PC” experience into one much
closer to “CE”. While it’s not great
when the HTPC in the living room wakes up for “no reason”, when the one in the bedroom
does it in the middle of the night – it can be a serious SAF problem.
If you haven’t already read the MissingRemote guides
“Configuring Standby on your HTPC ”
and “Keeping your HTPC Awake ”
this guide picks up where those left off. Some information will be repeated for completeness, but a basic
knowledge of the topic will be assumed.
As noted briefly in the previous guide, the system utility powercfg
is a great place to start when the PC wakes up and you don’t know why. So when you find your PC running when it
shouldn’t be, open up a command prompt (type “cmd” in the start menu) and type
in “powercfg /lastwake” (note that while I ran the window as an administrator,
/lastwake does not require administrative privileges).
In this case it’s easy to identify the culprit as a
scheduled task named “mcupdate_scheduled”, but when a device wakes the PC the
result will be slightly different. Scheduled tasks are very easy to fix by opening up the Task Scheduler
(type “Task Scheduler” from the start menu) and browsing to the location listed
in the result (in this case “Microsoft\Windows\Media Center”).
Double-click on the offending task (mcupdate_scheduled) to
open the properties dialog.
Select the “Conditions” tab, uncheck “Wake the computer to
run this task” and click “OK” to save the change.
Looking back to the results of “/lastwake” we can see that
the source of the wake was a “Wake Timer”. For those using Windows 7 who just want the PC to always stay down
unless manually awoken there is a new feature to just disable all wake timers. Open up the advanced options for the current power
policy (see the previous guide for how to find this dialog) and expand the “Sleep” section to toggle the
“Allow wake timers” settings.
For those unfamilar, a wake timer is a programmatic way to
ensure that the PC is awake at a specific time in the future. In my experience many “random” wake ups can
be traced back to this feature, but as it is an essential part of keeping applications
like Media Center and SageTV recording your shows reliably I would only
recommend changing this setting on a dedicated “extender” and not the server.
Powercfg can also be used to query a device’s ability to wake
the PC from different power states using the “devicequery” argument. There are several sub-arguments that can be
used with DEVICEQUERY, but the most useful is “wake_armed” which returns the
devices currently configured to wake the PC. From the open cmd window type “powercfg /devicequery wake_armed” to list
all the devices currently able to wake the PC.
For the purpose of this guide I’m just going to pick one of
the more common devices (the network adapter) that can cause unwanted wakefulness. While powercfg can be used to disable a
device from waking the system (by using “devicedisablewake”) I prefer to use
Device Manager to manage devices.
After finding the network adapter in Device Manager,
double-click to open the properties dialog, and select the “Power Management”
tab. Simply uncheck “Allow this device
to wake the computer” and click “OK” to save.
As we can see from running “powercfg /devicequery
wake_armed” again, the adapter is no longer listed.
Remembering to track standby/resume events can be difficult,
not to mention hard to enforce if there is anyone else in the house. So to make it easy to track and troubleshoot
resume events I wrote a simple system tray application that logs the time and
date of a standby/resume events and capture the output of “powercfg /lastwake” after
the PC wakes up.
To use it just download StandbyTracker and
let it run for a while. Then check the log it creates in
Editor’s Note: A friendly reminder, if you want to avoid having to interrupt your movie or TV watching, don’t forget about the Concurrent Remote Desktop Sessions Guide we have which will allow you to remote desktop into your HTPC and perform all of the above, all without interrupting your viewing!