Apple - Mavericks: No sound after sleep

I could fix the problem by reloading the kernel extension for audio with these command:

sudo kextunload /System/Library/Extensions/AppleHDA.kext
sudo kextload /System/Library/Extensions/AppleHDA.kext

I had to reboot, but to summarize the thread's problem and apparent solution, which worked for me (but only for a week): The problem occurs if your macbook goes to sleep with earphones plugged in for a sufficiently long time (more than 1h) when it wakes up audio won't work. ALSO some people notice overlay for changing volumes doesn't respond (it actually did for me), and plugging in or removing headphones doesn't trigger any change in the sound settings as to which device (speakers or headphones) is displayed for output.

You should try to trash the com.apple.audio.DeviceSettings.plist and com.apple.audio.SystemSettings.plist in /Library/Preferences/Audio and reboot with a reset of pram (hold command-option-p-r before you power on, and until you hear a second boot "bong" sound). This stopped it from recurring for me when the laptop went to sleep with headphones plugged in - for a week; later it happened again when sleeping while the quicktime player was playing an mp4 video with headphones plugged in.

As an aside I have another sleep-waking issue where the network won't reconnect properly (wifi, to an 802.11N access point) but instead will show it's connected to the right point, and no traffic will go out (E.G. can't ping 8.8.8.8, nor 192.168.0.1) this was also supposed to go away if one clears pram, but it did not. The work around there is to turn off wifi, and turn it back on.

There's even a rumor that if you always use the power adapter that came with your macbook pro retina the pram fix will stick, while switching to an adapter with the old style magsafe plug causes it to recur. It gets a little too tin-foil-hat for me.


The first suggested fix worked for me . I wrote a quick script that runs both of them, you can get it by running either

cat > ~/Desktop/audiofix.command <<EOF
#!/bin/sh
sudo kextunload /System/Library/Extensions/AppleHDA.kext
sudo kextload /System/Library/Extensions/AppleHDA.kext
sudo kill -9  `ps ax | grep [c]oreaudio | awk '{print $1}'`
EOF

or

curl https://raw.githubusercontent.com/dashdanw/Handy-Scripts/master/for%20users/audiofix.command > ~/Desktop/audiofix.command

followed by

chmod 775 ~/Desktop/audiofix.command

to make it executable.

You can double click it any time you have the issue and it should work, does for me!


It's just 3 commands that you can read in plaintext so no worry for viruses, you can view the script that is downloaded by visiting the page itself:

https://raw.githubusercontent.com/dashdanw/Handy-Scripts/master/for%20users/audiofix.command

and if you want to get really fancy you can figure out a way to run it on wakeup!

Tags:

Macos

Audio