Because that happens to me a lot.
Anyway, MacOS 10.11 still has the ridiculous bug that if your system audio output is set to HDMI, and iTunes is playing, then the screen saver will never activate and your screen will never lock. I fixed this once before, but the procedure has gotten more complicated because now certain system files can't be modified even by root. So now the new recipe is:
- Gently apply the Stick of Correction to a copy of the binary:
sudo -s
mkdir -p /usr/local/sbin
cp -p /usr/sbin/coreaudiod \
/usr/local/sbin/coreaudiod.hacked
perl -pi \
-e 's/N(oDisplaySleepAssertion)/_$1/g;' \
-e 's/P(reventUserIdleDisplaySleep)/_$1/g;' \
/usr/local/sbin/coreaudiod.hacked
codesign -vfs 'Your Name' \
/usr/local/sbin/coreaudiod.hacked - Boot in "Recovery Mode" (Cmd-R), and in "Utilities / Terminal", type:
csrutil disable
- Boot in "Standalone Mode" (Cmd-S), and type:
mount -uw /
rm /usr/sbin/coreaudiod
ln -s /usr/local/sbin/coreaudiod.hacked \
/usr/sbin/coreaudiod - Boot in "Recovery Mode" (Cmd-R), and in "Utilities / Terminal", undo what you did the first time:
csrutil enable
- Third reboot, and you're done. EASY.
Update: It turns out that upgrading to 10.11.2 blows away that coreaudiod symlink. Since I don't want to have to reboot three times every time I do a point-release update of the OS, here's a way to fix coreaudiod that does not necessitate rebooting.
- Step 1 is the same as above.
- Create a new plist file:
sed
's@/usr/sbin/coreaudiod @/usr/local/sbin/coreaudiod.hacked@g' < /System/Library/LaunchDaemons/ com.apple.audio.coreaudiod.plist > /usr/local/etc/ com.apple.audio.coreaudiod.plist chmod og-w
/usr/local/etc/ com.apple.audio.coreaudiod.plist - Kill the old coreaudiod and launch the new one:
launchctl unload
/System/Library/LaunchDaemons/ com.apple.audio.coreaudiod.plist launchctl load -w
/usr/local/etc/ com.apple.audio.coreaudiod.plist - Restart iTunes, or whatever was making noise and now isn't.