Created
February 18, 2020 13:10
-
-
Save lukasender/302e775aeeb48f00a7839ff4880e493a to your computer and use it in GitHub Desktop.
macOS Catalina: Kill Audio Service "coreaudiod"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function killSound() { | |
# log coreaudiod process stats | |
ps aux | grep -e '^_coreaudiod.*/usr/sbin/coreaudiod$' | |
# grab the coreaudiod pid, and kill it. | |
sudo kill -9 $(ps aux | grep -e '^_coreaudiod.*/usr/sbin/coreaudiod$' | awk '{print $2}') | |
# wait until restarted | |
sleep 5 | |
# log coreaudiod process stats again: verify process ID has changed | |
ps aux | grep -e '^_coreaudiod.*/usr/sbin/coreaudiod$' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Readme
What does it do?
Find the process ID of
coreaudiod
process ("What Is “coreaudiod,” and Why Is It Running on My Mac?"), forcefully kill the process (requiressudo
access).This forces macOS to restart the service.
Why does this exist?
On a MacBook Pro 16" 2019, I've experienced sound issues quite frequently.
The sound driver seems to keep crashing/restarting randomly. Read more here https://twitter.com/lukasender/status/1229740894015938560
Restarting
coreaudiod
process seems to "fix" the problems.How to use
In the simplest form, simply copy and execute the following command in a terminal:
If you frequently experience sound problems like I did, then add the function to your
.bashrc
/.zshrc
(don't forget tosource
the updated config - or start a new terminal session).Then, run
killSound
as soon as you experience the sound issues again.Tested on macOS Catalina 10.15.3