Created
September 29, 2021 13:01
-
-
Save maximko/a32740e3588e7b18caca5c9c16e6ad11 to your computer and use it in GitHub Desktop.
Build desired number of BlackHole drivers
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
#!/bin/bash | |
# copy everything from drivers/ folder to /Library/Audio/Plug-Ins/HAL/ and run | |
# sudo chown -R root:wheel /Library/Audio/Plug-Ins/HAL/Pipe* | |
# sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod | |
driver_num=1 | |
build_driver_with_options() { | |
number=$(printf "%02d" ${1}) | |
channels=${2} | |
git reset --hard HEAD | |
sed -i '' "s/BlackHole%ich_UID/BlackHole_pipe_${number}_${channels}ch_UID/g" BlackHole/BlackHole.h | |
sed -i '' "s/BlackHole%ich_ModelUID/BlackHole_pipe_${number}_${channels}ch_ModelUID/g" BlackHole/BlackHole.h | |
sed -i '' "s/BlackHole %ich/Pipe ${number} ${channels}ch/g" BlackHole/BlackHole.h | |
sed -i '' -E "s/NUMBER_OF_CHANNELS[[:space:]]+2$/NUMBER_OF_CHANNELS ${channels}/g" BlackHole/BlackHole.h | |
xcodebuild CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO && mv -f build/Release/BlackHole.driver "drivers/Pipe ${number} ${channels}ch.driver" | |
} | |
mkdir drivers | |
# Build 8 2ch drivers | |
for i in {1..8}; do | |
build_driver_with_options ${driver_num} 2 | |
((driver_num=driver_num+1)) | |
done | |
# Build 4 8ch drivers | |
for i in {1..4}; do | |
build_driver_with_options ${driver_num} 8 | |
((driver_num=driver_num+1)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because 2 drivers are never enough.