How to disable inline volume controls on headphones connected to mac?

(I wanted to answer this question, but I didn't have enough reputation.)

Please note that loading and unloading kernel extensions can have unintended consequences. This solution worked for me without causing any issues on my mid-2013 Macbook Air, but that may not be the case for your setup. Understand what you're doing and perform at your own risk.

  1. Open Terminal
  2. With headphones plugged in, enter this command to ensure that AppleMikeyHIDDriver is controlling your headphones hidutil list | grep AppleMikeyHIDDriver. DO NOT CONTINUE IF THE OUTPUT IS BLANK. My output looked like this:
0x0      0x0       0x0        12        1     0x100000975 (null)    AppleMikeyHIDDriver Apple Mikey HID Driver             (null)    (null)
  1. Run this command to ensure that the com.apple.driver.AppleMikeyHIDDriver kernel extension is running kextstat | grep com.apple.driver.AppleMikeyHIDDriver. DO NOT CONTINUE IF THE OUTPUT IS BLANK. My output looked like this:
179    0 0xffffff7f83cf9000 0x2000     0x2000     com.apple.driver.AppleMikeyHIDDriver (131) DE4003F6-F4F3-3C84-AB83-6CCDE6CF5DFC <49 8 5 3 1>
  1. Unplug your headphones from your mac. The next step failed for me if they were plugged in with the following error:
(kernel) Can't remove kext com.apple.driver.AppleMikeyHIDDriver; services failed to terminate - 0xe00002c7.
Failed to unload com.apple.driver.AppleMikeyHIDDriver - (iokit/common) unsupported function.
  1. Run this command to disable the inline volume and mic control sudo kextunload -b com.apple.driver.AppleMikeyHIDDriver. You may need to enter your password.

If you ever want to enable it in the future just run sudo kextload -b com.apple.driver.AppleMikeyHIDDriver or reboot your mac and everything should go back to normal.