MacBook – stop the optical audio out from entering ‘time out’ when idle

audiomacbook proplistpreferences

In my office I have a surround-sound receiver, and I have my MacBook Pro (6,1) hooked up via a TOSLink cable and adapter, and it works beautifully, except this: if there are no sounds playing for a short time, the optical out port 'times out', and then the optical signal to the stereo receiver is shut off.

It's immediately re-established if something happens to make a sound (I start a song in iTunes, receive an IM or mail, etc) but it takes about 1.5 seconds to sync up with the stereo receiver, so the first 1.5 sec of sound is lost. After that the optical out port stays up for about 60 seconds, and then goes down again. So I tend to miss IM/email if I'm not looking at the screen when they come in, which is why I have sound turned on in the first place.

Obviously I could unplug the TOSLink when not looking at the screen, but this is very inconvenient, and seems silly. I would prefer the connection to just stay on when idle. Is there a plist setting buried somewhere to accomplish this? The system preference pane for optical out is very sparse, reading only "The selected device has no output controls." Presumably this is a power-saving gesture but the Energy Saver Preference pane is similarly devoid of properties for this feature.

Where can I find more properties?

Best Answer

Playing a one-second silent sound every 50 seconds or so might help. Try this:

  • download 1 second silent .wav file here to desktop (or make your own)
  • in Terminal, change Directory to Desktop: cd ~/Desktop/
  • Try the following one-line command and see if your problem is alleviated:

    while true; do afplay silence-1sec.wav ; sleep 50; done
    

The command above enters an infinite loop which plays the empty sound every 50 seconds. This should keep your output busy. You can exit the loop by pressing +.

NB: afplayis frequently overlooked for terminal sound playback, but is hugely useful.

If that works, one could convert the command to a command that invisibly runs in the background.