Skip to content

Instantly share code, notes, and snippets.

@felipecsl
Last active May 17, 2024 22:17
Show Gist options
  • Save felipecsl/5177790 to your computer and use it in GitHub Desktop.
Save felipecsl/5177790 to your computer and use it in GitHub Desktop.
Restart Mac OS X coreaudio daemon. Useful if you cannot change the audio output device to Airplay.
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'`
# or...
sudo killall coreaudiod
@hur-kyuh-leez
Copy link

the most simple command you can remember

sudo pkill coreaudiod

@f3z0
Copy link

f3z0 commented Jan 14, 2020

I know this is going to sound stupid, but the latest version of chrome also breaks coreaudiod so if you're running chrome and sudo killall coreaudiod doesn't work try killing chrome and then sudo killall coreaudiod again

@ILoGM
Copy link

ILoGM commented Jan 16, 2020

sudo kill -9 `ps -A | grep -Fa 'sbin/coreaudiod' | head -n 1 | awk '{print $1}'`

worked for me. And you'll have to restart your Chrome afterwards

@uhurusurfa
Copy link

Tried many solutions and the only one that works for me to get headphones to work again when only internal speakers seems to be "recognised" is:

  1. Close laptop lid
  2. Plug in external headset
  3. Open laptop and sign in again when it wakes

Restarting core audio does not seem to clear something that gets OSX confused but bizarrely the above sequence does work.

@buraga-dmitrii
Copy link

Tried many solutions and the only one that works for me to get headphones to work again when only internal speakers seems to be "recognised" is:

  1. Close laptop lid
  2. Plug in external headset
  3. Open laptop and sign in again when it wakes

Restarting core audio does not seem to clear something that gets OSX confused but bizarrely the above sequence does work.

Thank you very much. It's worked for me

@gianpaj
Copy link

gianpaj commented Mar 6, 2020

sudo killall coreaudiod

Did the job on macOS Catalina (10.15) on a MacBook Pro 2017.

The speaker icon 🔈 on the Menu bar on the top right reappear.
Also, the pid (process id) will have changed in the output of:

ps -ax | grep '[c]oreaudiod'

@taylor
Copy link

taylor commented Oct 30, 2020

or do sudo killall coreaudiod

This works great for me in Catalina 10.15.6. I did not have to restart Chrome.

@iMonZ
Copy link

iMonZ commented Jan 10, 2021

kill: illegal process id: ps awk: syntax error at source line 1 context is {print >>> $1} <<<
awk: bailing out at source line 1

@mastef
Copy link

mastef commented Feb 16, 2021

sudo launchctl stop com.apple.audio.coreaudiod && sudo launchctl start com.apple.audio.coreaudiod seems to be the better solution

@luckman212
Copy link

luckman212 commented Feb 24, 2021

or, using the newer launchctl syntax:

sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod

@eduuuardo
Copy link

Thanks!

@emalihin
Copy link

emalihin commented Mar 4, 2021

or, using the newer launchctl syntax:

sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod

thanks, this fixes big sur 11.2.2 daily issues with audio breaking and becoming glitchy

@ianthetechie
Copy link

or, using the newer launchctl syntax:

sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod

thanks, this fixes big sur 11.2.2 daily issues with audio breaking and becoming glitchy

Same for me! I'm not really sure what's going on, but the Big Sur issues have been SUPER annoying.

@webbp
Copy link

webbp commented Apr 21, 2021

@felipecsl please update your gist to
sudo killall coreaudiod
as recommended by @fred-revel.
it seems like many people refer to this gist, and this command is much easier to remember

@jp-nullpod
Copy link

sudo launchctl stop com.apple.audio.coreaudiod

that worked for me

@whimsyniche
Copy link

Just what I was looking for!

@chamatt
Copy link

chamatt commented Oct 27, 2021

This happens to me all the time because I spilled some wine on my mac. It gets tiring having to type sudo pkill coreaudiod all the time and then my password, so I created a packaged mac app version of it. If anyone is interested: https://github.com/chamatt/restart-coreaudiod

@davidblurton
Copy link

I created a shortcut to run this command in the Shortcuts app. You can add it to the menu bar or quick actions in Finder.
image

@justinkahrs
Copy link

This works perfectly for anybody wondering how to get their bluetooth headphones sounding good again. I really wish I didn't have to run this every time, but it's certainly better than restarting...

@joaodarocha
Copy link

This worked for my SteelSeries Arctis 7 that are wireless with a receiver (not BlueTooth).

Thanks 👏

@stefanhinker
Copy link

I recently had issues with no sound coming from a Sonos One SL when trying to connect with AirPlay from Monterey 12.3.1.
The above did not (reliably) solve this.
I've had reasonable success by including AirPlayXPCHelper in the list of things to kill (and therefore restart).
So the rescue line is now:

sudo killall coreaudiod AirPlayXPCHelper

@mmontag
Copy link

mmontag commented May 3, 2022

Does anyone know how to trigger a "software headphone jack event" similar to seating/unseating a cable in a Macbook's built-in headphone jack? Sometimes this unfreezes audio for me, but it's not always convenient to reach the jack/don't always have headphones handy.

@TYZY89
Copy link

TYZY89 commented Aug 19, 2022

Thanks, it's useful!

@JTBabelberg
Copy link

After losing my core audio completely (corauaudid didn't even start with the system), I tried all the tricks in the (Internet-)Book to solve this problem. Multiple re-starts with different buttons pressed and all the code lines that are recommended in the terminal. All that didn't work.

Even the Apple support could help me. There idea was: reset the whole system (with timemaschiine) (what probably wouldn't had helped..as I know now) OR Start from scratch and reinstall everything.

But the solution was way easier.
There was a driver in the /System/Library/Extensions/ that was left there after the deinstallation of a program I wanted to check out. In this case Voicemod.
After deleting VoicemodAudioDevice.driver the Audio Problem was solved the core driver was back everything was fine again. After a Restart!

So if you test a software and after that something doesn't work anymore, take a deep look into the system and find every file that came along with it and delete it. (I know...)

Additional I would like to point out that I use macOs 10.14 (what still works with 32-bit plugins...so i can not upgrade easily) the App Voicemod wanted an macOs 10.15 upwards, which it shows with the first start after the installation. I think that is the reason for all the trouble.

I hope I could help some desperate people with the same problem.

@itachi47
Copy link

I was loosing the audio but this happened after upgrading from Catalina, so I moved to Catalina tested around for 2 months and did not faced any issue, but as soon as I upgraded to the latest version of mac OS, started facing the same issue again.

@wblondel
Copy link

Had to use this after installing Microsoft Teams. I couldn't change the volume anymore.

@luckman212
Copy link

luckman212 commented Feb 24, 2024

Sadly no longer working on Sonoma 14.4:

Could not kickstart service "com.apple.audio.coreaudiod": 1: Operation not permitted

update 4/24/24: Apple says "Nope, that's the way we want it." 👎

@crunk1
Copy link

crunk1 commented Apr 16, 2024

Following. I'm seeing the same as @luckman212. I'm stuck trying to uninstall blackhole-2ch.

@skowalak
Copy link

skowalak commented Apr 17, 2024

@luckman212 , @crunk1
There is a reference in the macOS Release Notes about this, seems like it is no longer possible to kickstart coreaudiod.

https://developer.apple.com/documentation/macos-release-notes/macos-14_4-release-notes#Core-Audio

If you are unable to uninstall blackhole-2ch because the uninstall_postflight fails you could try changing the postflight command in the following file <homebrew prefix>/Caskroom/blackhole-2ch/.metadata/<version>/<timestamp>/Casks/blackhole-2ch.rb to use a different command or no command at all. Since version 0.6.0 the new behavior is reflected in blackhole-2ch homebrew package.

@aokie
Copy link

aokie commented Apr 23, 2024

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment