191

My macbook pro running Snow Leopard stopped making sounds a couple hours ago. I've found other reports of people with sounds working through headphones, but that's not the problem I'm seeing. I get no sound when my headphones are plugged in either.

I'm wondering if there's a LaunchAgent or LaunchDaemon to restart which would remedy this. I've already tried killing the coreaudio daemon (and it dutifully automatically restarted) but that didn't fix it.

I need to reboot for an OS update, so I think that'll probably rectify things.

Is there another way?

0

7 Answers 7

335

sudo pkill coreaudiod

On older OSes:

You can kill the CoreAudio process by opening Terminal and running:

sudo kill -9 `ps ax|grep 'coreaudio[a-z]' | awk '{print $1}'`

It will restart automatically after a couple seconds.

That fixes some problems my aging MBP has been having, where it sometimes fails to detect headphones or decides the speakers aren't connected. No guarantees it will work for every audio problem, but it's worth a shot.

Source: zakgreant on macosxhints forums.

5
  • 123
    sudo pkill coreaudiod
    – berto
    Mar 7, 2016 at 18:12
  • DO NOT use kill -9 unless the process is not responding. Nov 27, 2018 at 15:46
  • This worked for me with zsh: sudo kill -9 $( ps aux | grep 'coreaudio[a-z]' | awk '{print $2}' )
    – jxmorris12
    Jan 11, 2021 at 4:22
  • Unfortunately doesn't always help for Bluetooth advices – Apple please fix it Oct 25, 2022 at 1:43
  • On macOS Ventura, trying to kill that process with kill -9 will crash the OS and cause a complete system shutdown. Try the sudo pkill coreaudiod approach @berto suggested. Aug 22, 2023 at 21:20
100

sudo pkill -9 coreaudiod kills the coreaudio process immediately. MacOS will automatically restart the coreaudio daemon, which will fix audio output in most cases.

This works on all MacOS versions.

1
  • 4
    This should be the accepted answer. No need for awk shenanigans.
    – jottr
    Jul 29, 2020 at 17:10
35
sudo kextunload /System/Library/Extensions/AppleHDA.kext 

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

These two commands will unload then reload the audio kernel extension. This is cleaner than sending a kill signal but might need an adjustment for newer OS.

2
  • Executing: /usr/bin/kmutil unload -p /System/Library/Extensions/AppleHDA.kext Error Domain=KMErrorDomain Code=71 "Kernel request failed: (iokit/common) unsupported function (-536870201)" UserInfo={NSLocalizedDescription=Kernel request failed: (iokit/common) unsupported function (-536870201)} is the result on macOS 12 Monterey.
    – cachius
    Mar 14, 2023 at 18:48
  • Better answer. Fixed the issues that the accepted answer caused. Worked for me on Ventura 13.1.
    – Nick
    Mar 27 at 15:56
14

I am on 10.9.2 and have the same problem. Since there are two answers, I wanted to document my findings:

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

These two commands will unload then reload the audio kernel extension. This post fixes my problem 100% of the time, So please upvote that original post

This solution did not work for me:

sudo kill -9 `ps ax|grep 'coreaudio[a-z]' | awk '{print $1}'`

It shuts down the internal speakers and sends the sound to my 27" monitor but does not bring back the sound to my internal speakers or headset. Perhaps in some cases it works, but hopefully this post might explain when to use one solution vs the other.

2
  • 1
    Apple High Definition Audio kext? Neat, I would not have figured that acronym without this context. Apr 3, 2014 at 7:26
  • IMHO, the 'kill -9 `ps ax|grep 'coreaudio...' should always work without the need for a reboot. The restarted coreaudio daemon may pick an audio device which it finds first (no idea how the audio device is selected in that case), but you can reset to the wanted audio device by 'System Preferences...' -> 'Sound' settings. Also, for a browser session, you might need to select the appropriate audio device as well.
    – huch
    Nov 6, 2018 at 7:11
3

In my experience, a reboot is required to fix this. It's a poor fix since it seems to recover from the failure and not address the root cause. I would like to have, but have not yet discovered if there is another quicker/simpler method to get sound back...

2

The polite way to do this is:

sudo launchctl stop com.apple.audio.coreaudiod 

Please learn to avoid kill -9 except where it's the only thing that works; it kills things so suddenly that their shutdown/cleanup handlers are not allowed to run, which can often leave things in a weird partial states that aren't handled by the software.

1
  • This one is tricky to learn as it requires to learn more than the "coreaudiod" name, but I like that. Elegance over brutality! Dec 15, 2023 at 10:25
0

Use killall command with _coreaudiod user as parameter:

echo -e "# CoreaudioD restart\nalias audiorestart=\"sudo killall -u _coreaudiod -SIGKILL\"\n" >> ~/.bashrc
source ~/.bashrc
audiorestart

You must log in to answer this question.

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