Installing Soundflower on Intel Macs with Big Sur or Monterey

There is a website titled "Signed Version for macOS Big Sur (11.1) and earlier" with a link which causes the file Soundflower-2.0b2.dmg to be downloaded. This file contains the Soundflower.pkg package which the Installer application can use to install the Soundflower kernel extension. The website has the following instructions.

M1 chip-based Macs are NOT YET SUPPORTED

PLEASE READ BEFORE ATTEMPTING TO INTALL!

Note that the even though this Soundflower extension is signed, but the installer is not! You will have to hold the control key down to open the Soundflower.pkg installer for the first time.

Apple makes you jump through a few hoops. The first time you run the installer (Soundflower.pkg), it will ask for your admin password, and will FAIL! A security alert will appear, with a button to take you to System Preferences "Security & Privacy - General" pane. Once there, there should be an "Allow" button (**) that you will need to click on to give permission to use Soundflower (developer: MATT INGALLS). Then, RUN THE INSTALLER AGAIN. It should inform you installation was successful. If the "Allow" button is disabled, you may need to click the lock icon in the bottom lower left corner first.

(**) If you see an "Open Anyway" button in the Security Preferences, this is something different!!! Most likely because you tried (and failed) opening the installer by double clicking without holding down the control key. If so, click the "Open Anyway" button which will display another window. Then click the "Open" button in that window to launch the installer. Now you can follow the instructions above to get the "Allow" button to appear in the Security Preferences.

I have Intel Macs with either Big Sur or Monterey installed. When I follow the above instructions, all executions of the installer fail. Yet after restarting my Mac, the Soundflower kernel extension appears to have installed. I have the following two questions.

  • Why does the installer fail on all attempts?
  • Did Soundflower kernel extension actually install correctly?

The website instructions left out the need to restart the Mac. In other words, instead of stating "Then, RUN THE INSTALLER AGAIN.", what instructions should have stated is "Restart, then RUN THE INSTALLER AGAIN.". The rest of this answer explains what is wrong with the Soundflower.pkg package and one possible fix.

The Soundflower.pkg package contains a post install script, which is shown below.

#!/bin/bash

echo "installer is loading the new Soundflower"
sudo touch /Library/Extensions
sudo kextload /Library/Extensions/Soundflower.kext

When this script is executed by the Installer application, the status returned to the application is the status returned by the sudo kextload /Library/Extensions/Soundflower.kext command. When this status is not 0, the Installer application assumes a failure has occurred. Below is a table of the relevant statuses that can be returned by this command.

Status Desription
0 Indication of Sucess
27 Extension with identifiers com.Cycling74.driver.Soundflower not approved to load. Please approve using System Preferences.†
28 Loading extension(s): com.Cycling74.driver.Soundflower requires a reboot†
Other
Values
Indication of Failure

† This is part of the exact text output from executing sudo kextload /Library/Extensions/Soundflower.kext command which returned the corresponding status.

A status of 27 or 28 does not indicate a failure, but rather actions that need to be performed outside of the Installer.

Therefore, the Installer cannot indicate success until at least the Mac is restarted. Also, an indication of failure, by the Installer, leaves the user no way of knowing if the Soundflower kernel extension actually installed correctly.


The rest of this answer outlines one possible way to correct the offending script. Start by entering the following commands

hdiutil attach $HOME/Downloads/Soundflower-2.0b2.dmg
pkgutil --expand /Volumes/Soundflower-2.0b2/Soundflower.pkg $HOME/Desktop/Soundflower
hdiutil detach /Volumes/Soundflower-2.0b2

Replace the contents of the $HOME/Desktop/Soundflower/Scripts/postinstall file with the following. (Actually, you are just adding to the existing file.)

#!/bin/bash

echo "installer is loading the new Soundflower"
sudo touch /Library/Extensions
sudo kextload /Library/Extensions/Soundflower.kext
case $? in
0);;
27|28)
   open x-apple.systempreferences:com.apple.preference.security\?General
   osascript -e '
      tell application "System Preferences"
         reopen
         activate
      end tell';;
*) exit 1
esac
exit 0

Enter the following command. This will create the corrected Soundflower.pkg package on your Desktop.

pkgutil --flatten $HOME/Desktop/Soundflower $HOME/Desktop/Soundflower.pkg

You can now open this package with the Installer application to install the Soundflower kernel extension. You still may have to click on the Allow button shown in the image below from the System Preferences application and restart the Mac after the Installer application has completed.


FYI, the code below attempts to make the General tab of the Security pane of System Preferences frontmost. These commands are optional and could be omitted from the updated $HOME/Desktop/Soundflower/Scripts/postinstall file.

   open x-apple.systempreferences:com.apple.preference.security\?General
   osascript -e '
      tell application "System Preferences"
         reopen
         activate
      end tell'