HDMI audio prevents screen saver

Here's another brilliant Apple fuckup: if your system audio output is set to HDMI, and iTunes is playing, your screen saver will never activate, and your screen will never lock, because coreaudiod prevents it:

    pmset -g assertions | grep DisplaySleep

This makes no goddamned sense, of course. NoIdleSleepAssertion makes sense for audio, but NoDisplaySleepAssertion only makes sense if video is actively playing and not paused, not merely audio.

The only way to fix this is to gently apply the Stick of Correction to the binary:

    sudo sh
    perl -pi -e 's/N(oDisplaySleepAssertion)/_$1/g' /usr/sbin/coreaudiod

Then you have to replace the signature with your own or it won't launch:

    codesign -vfs 'Your Name' /usr/sbin/coreaudiod

Then restart it:

    killall coreaudiod

You'll probably have to do that again every time you upgrade the OS. "Hooray."

Update, 2015: The above instructions work on MacOS 10.9. For instructions that work on MacOS 10.11, see this post.


Tags: , , ,