It’s funny how my computer purchase cycles seem to mirror Microsoft’s OS release cycles. I’ve had an XP machine, a Vista machine, and now—as of last week—I own a Windows 7 machine. I bought the first two within months of the OS release, but managed to hold out on Windows 7 for more than a year. I’m not really an early adopter or anything; my computers just seem to develop severe performance issues right about the same time the new release candidates go public.

Anyway, with every iteration I’ve been intrigued by Microsoft’s implementation of the sleep function. Virtually instant computer start up times are just so… Star Trekian. But every time I’ve been disappointed. When I woke up my XP box from sleep, the primary monitor would always have an annoying 25 by 25 pixel box of snow in the upper left corner and my sound card would go dead. Restarting was required to fix it. With my Vista box, 80% of the time it would work fine but the other 20% would result in the monitors refusing to come back to life. This meant a hard restart to get back control—and losing any unsaved work. For each OS I’ve spent a ridiculous number of hours researching solutions, but have never gotten sleep to work reliably. In the end, I’ve always resorted to running my computer virtually 24-7. I knew when I finally got my Windows 7 box together, sleep would be one of the first things I tried to get working. This time I had high hopes. Windows 7 seems remarkably improved over its predecessors.

Shortly after installing Windows 7 I tested sleep and was pretty happy. I had to change my BIOS sleep setting from S1 to S3, but that’s all. After that, my system went to sleep automatically when it was supposed to and woke up exactly like it should. No sound or display problems whatsoever. But, of course, two days later, after installing a bunch of applications, my system stopped sleeping automatically. And that set me off on another wild frenzy trying to find a solution.

It amazes me how many Google hits you get for “windows sleep problems” and how many sites provide the same tired advice about changing your power management settings. Yes, yes, yes. You and 50,000,000 other people have made the same suggestions. But what if that’s not the problem?

After many Google searches and many tests involving running this application but not that application while staring at a stopwatch and waiting for my power management settings to kick in (the minimum delay is 1 minute), I finally got sleep to work correctly and consistently. Hooray! Nothing like waiting ten years for a feature and finally getting it. The culprit? One of my favorite web services, That wasn’t even close to the top of my list of suspects. Turns out Rdio opens an audio stream that blocks automatic sleep as soon as you load their site. Doesn’t matter whether you’re logged in or not. In a way, this is pretty cool because it means my system won’t sleep when I’m streaming music and away from my desk. But it would be nice if their audio stream was closed after their player has been paused for an extended period. As it is now, I have to either manually put my computer to sleep or remember to close my Rdio tab before leaving my computer for any prolonged amount of time. I contacted them about it, we’ll see what happens. I’m not really expecting anything. But it would be nice to at least see a note about this in their documentation. (Assuming, of course, that they’re able to duplicate the issue on other systems.)

How did I finally figure this out? I discovered the PowerCfg utility. This awesome tool tells you pretty much exactly what’s preventing sleep. I say “pretty much” because the initial report I used (/energy) blamed a “USB Audio Device”, which I incorrectly took to mean my USB speakers. Much more helpful was the /requests option which immediately lists out any requests made to the system to prevent automatic sleep. This report clarified that the USB Audio Device in use was an audio stream which only exists when I have open. I’ve also occasionally seen chrome.exe make such a request and my Mozy backup utility does the same whenever it’s running. But the former is very rare and the latter makes perfect sense. The only “problem” was, but that’s easy enough to work around now that I know it’s an issue.

The only bummer about PowerCfg is that both the /energy and /requests options are, apparently, only available on Windows 7. For everyone else, here’s a couple of links I found which are more helpful than average for troubleshooting atypical Windows sleep disorders:

Engergy Report