I have a 2017 MBP and i'm using a pair of basic Sennheiser earphones. I am finding when the laptop is idle for a period of time (I can't work out exactly how long yet) the earphone jack seems to hang up.

The only way I can get sound out of it is to unplug the earphones and plug them back in and after 2-3 seconds I get sound again.

The spec of my machine:

MacBook Pro (13-inch, 2017, Four Thunderbolt 3 Ports)
macOS High Sierra 10.13.6 (17G65)
3.1 GHz Intel Core i5
16 GB 2133 MHz LPDDR3

1 Answer 1


The problem seems to be that OSX selects the wrong output device when returning from sleep mode. For me the issue is that it selects the DisplayPort audio instead of the headphone port.

I did the following to fix this:

  1. Install switchaudio-osx and sleepwatcher (I personaly use Homebrew for this)
brew install switchaudio-osx sleepwatcher
  1. Check the name of the audio output device you want to use by running
SwitchAudioSource -n

(for me this was Built-in Output)

  1. create a wake-up script using the output device from step 2:
echo -e "#\!/bin/bash\n/usr/local/bin/SwitchAudioSource -s 'Built-in Output'" >> ~/.wakeup
  1. Set the permissions for the file
chmod 700 ~/.wakeup
  1. Test the script (execute the command below and let your Mac go to sleep)
/usr/local/sbin/sleepwatcher --verbose --wakeup ~/.wakeup
  1. Set-up the launch configuration for sleepwatcher
ln -sfv /usr/local/opt/sleepwatcher/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist
brew services start sleepwatcher
  1. Done! Now every time your machine returns from sleep the script will run and select the correct output

You must log in to answer this question.

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