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?


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.

  • Huh. This works (as tactics if not strategy) and I would have never thought of it. It seems to timeout even with 50 seconds, so I adjusted the timeout to 30 and that kept everything going. Thanks for a great idea. – atroon Oct 30 '12 at 19:34
  • You are welcome! – myhd Oct 30 '12 at 19:56
  • This may well be useful for a bug I think I've discovered in a MacBook Pro, using Keynote when connected via HDMI. Any files with audio (including video files) fail to play after a period of silence. I've put the above line into a file (called 'nosilence') and chmod'ded it to 777. However, running ./nosilence just returns "Unspecified Exception" every time it plays the audio. Not sure why. – jamescridland Jul 1 '18 at 3:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .