103

I have an external audio interface (M-audio fast track c400). In order to get my macbook to recognize it (display in audio/midi setup), I have to reboot, which is a hassle. I have had other m-audio interfaces that were automatically detected when connected, and I'm pretty sure this one should be the same. Most posts around the internet suggest updating the OS or the software/firmware for the device. I have done all of those with no luck. I am currently running OS X 10.8.5.

Is there a way to force OS X to reload the device? Preferably some command line voodoo that I could fire off quickly when needed or wrap up in a nice little shell script.

Edit: Progress..

The problem appears to be fixed now... I'm not sure how the following solved the problem. If you know, please comment!

Inspired by @sbugert's answer, I started looking into other system daemon's that might do the trick if restarted. As a shot in the dark I killed coreservicesd. This caused the OS to become visibly unstable and I was eventually logged out automatically. To my surprise, when I logged back in, my audio interface was recognized..

Based on that, I hypothesized that killing coreservicesd and logging out/in may be a possible (ugly) workaround. So I unplugged the interface and plugged it back in, and as expected, it was not recognized. So I killed coreservicesd and attempted to log out, however I could not get the system to log out due to the instability caused by killing coreservicesd. I eventually was forced to do a "hard" shutdown (i.e. holding the power button until it turns off). After booting up the macbook again, the interface is now recognized automatically every time I plug it in. I suspect that this "hard" reset may have solved the issue without all the shenanigans with the coreservices daemon, but I have no way to test that.

If anyone can shed light on this, please do!

Edit: It stopped working again so I don't know what's up.

6 Answers 6

120

EDIT: most likely only works for osx before 10.13

This is what you need,

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

But if you want to kill your coreaudio as well,

 ps aux | grep 'coreaudio[d]' | awk '{print $2}' | xargs sudo kill

use with caution.
The grep target is written this way specifically to exclude grepping the grep process itself in the ps out.

17
  • 7
    The driver loading/unloading is the only thing that worked to make the Mac detect my headphones. THANK YOU! May 17, 2014 at 0:26
  • The kext changes caused my laptop to reset - I don't recommend it. The fix for me was to go to Settings > Sound and check the Output is set correctly.
    – vaughan
    Dec 4, 2014 at 17:58
  • 1
    Works. I had to kill coreaudio first, probably because a track was playing - should've stopped it first. MacBook Pro 13, late 2013, 10.10.1
    – VladFr
    Feb 5, 2015 at 14:22
  • 11
    (kernel) Can't unload kext com.apple.driver.AppleHDA; classes have instances: (kernel) Kext com.apple.driver.AppleHDA class AppleHDATDMBusManager has 1 instance. (kernel) Kext com.apple.driver.AppleHDA class AppleHDATDMBusManagerCS4208 has 2 instances. Failed to unload com.apple.driver.AppleHDA - (libkern/kext) kext is in use or retained (cannot unload). Oct 1, 2016 at 12:09
  • 3
    I get the same error messages as @Sergei. After doing so, my sound is completely disabled. The icon is grayed out, the function keys don't work. I have to reboot to bring everything back.
    – Patrick M
    Aug 6, 2018 at 23:49
99

Try typing this into Terminal:

sudo killall coreaudiod

This will kill the coreaudio process and restart it.

10
  • 2
    This fixed my no sound effects problem.
    – wisbucky
    Mar 2, 2016 at 8:31
  • 3
    wow my issue was the internal speakers would stop working intermittently until i rebooted. thanks! this did the trick!
    – Elon Zito
    Apr 29, 2016 at 3:36
  • 2
    Did not restart for me. Sound is just off/disabled now. Aug 31, 2016 at 17:27
  • 2
    Did not restart for me as well. Any specific command to start it ?
    – ayrad
    Nov 15, 2016 at 14:32
  • 2
    @sequoiamcdowell This should work: apple.stackexchange.com/questions/187983/… Dec 14, 2016 at 4:02
19

The "proper" way to restart coreaudiod is this: sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod

7
  • 1
    This is the only thing that worked for me on Catalina. Aug 19, 2021 at 21:38
  • 2
    Big Sur as well Sep 8, 2021 at 17:13
  • 1
    Monterey too. Nothin else worked.
    – Vik
    Feb 27, 2022 at 11:12
  • 1
    Thanks! Worked on my M1 Pro (Monterey). Aug 31, 2022 at 14:40
  • Helps for when Core Audio Driver (SoundID Reference.driver) is unloaded on Ventura for some reason.
    – Henk Poley
    Nov 26, 2022 at 9:00
4

Same solution but with different variation

sudo kill -9 `ps ax|grep 'coreaudio[a-z]' | awk '{print $1}'`
1
  • 7
    Don't use kill -9 just for the sake of it. A bare kill is perfectly sufficient to halt the daemon in normal circumstances. Indiscriminate use of -9 can lead to situations where a daemon shuts down so brutally that you can no longer restart it.
    – dland
    Dec 19, 2014 at 9:15
0

I have the same interface and that happened to me a lot when I first got it.

I thought the audio drivers in my Mac were the problem, but it was just the way I plugged in the interface.

Every time I wanted to use it, I had to unplug it and plug it back into the computer.

-2

Here I have discovered that if I select another device before disconnecting the interface (Fast Track C400 too), I can connect it again later with no problem. But if I am using the fast track and then disconnect it, it can't connect again until restart it.

You must log in to answer this question.

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