Contribute
Register

Toggle VoodooHDA + Mount EFI

Joined
Apr 5, 2018
Messages
50
Motherboard
ASRock Fatal1ty Z270 ITX/ac
CPU
I7-7700K
Graphics
GTX 1060
Mac
MacBook Pro
Hi all,

I'm sure no one will need these scripts but I built them and thought I'd share.
For each file, remove .txt and run the following command in Terminal:
sudo chmod u+x <path of script file>


Toggle VoodooHDA:
> Mounts your macOS EFI
> Checks if VoodooHDA.kext is in /Volumes/EFI/EFI/CLOVER/kexts/Other
> Allows you to Enable or Disable then opens the Restart prompt
DISKLIST=$(diskutil list)
BOOTDISK=$(df -h / | awk 'NR==2{print$1}' | grep -o 'disk[0-9]*')
EFI=$(echo $DISKLIST | grep -Eo "EFI.*disk[0-9]*s[0-9]*.*Container ${BOOTDISK}" | grep -Eo "disk[0-9]*s[0-9]*" | tail -1)
echo ""
diskutil mount $EFI
if [ -z "$EFI" ]; then
echo -e "\nEFI partition not found!\nAre you sure this is a Hackintosh?\n"
diskutil unmount $EFI
exit
fi
VoodooHDA_enabled=/Volumes/EFI/EFI/CLOVER/kexts/Other/VoodooHDA.kext
VoodooHDA_disabled=/Volumes/EFI/EFI/CLOVER/kexts/Other/disabled/VoodooHDA.kext
NOTREALMAC=/Volumes/EFI/EFI/CLOVER
ISREALMAC=/Volumes/EFI/EFI/FIRMWARE
if [ ! -d "$NOTREALMAC" ] && [ -d "$ISREALMAC" ]; then
diskutil unmount $EFI
echo -e "\nDo not run on a real Mac!\n"
exit
fi
if [ -d "$VoodooHDA_enabled" ] && [ -d "$NOTREALMAC" ] && [ ! -d "$ISREALMAC" ]; then
echo "VoodooHDA is currently Enabled"
read -rs -p "Press Enter to Disable or Cmd+Q to quit..."
mkdir /Volumes/EFI/EFI/CLOVER/kexts/Other/disabled
mv /Volumes/EFI/EFI/CLOVER/kexts/Other/VoodooHDA.kext /Volumes/EFI/EFI/CLOVER/kexts/Other/disabled/VoodooHDA.kext
sleep 0.1
if [ -d "$VoodooHDA_disabled" ]; then
echo -e "\n\nVoodooHDA.kext Disabled"
diskutil unmount $EFI
fi
sleep 0.3
osascript -e 'tell app "loginwindow" to «event aevtrrst»'
open -a loginwindow
kill `ps -A | grep -w Terminal.app | grep -v grep | awk '{print $1}'`
exit
else
if [ -d "$VoodooHDA_disabled" ] && [ -d "$NOTREALMAC" ] && [ ! -d "$ISREALMAC" ]; then
echo -e "VoodooHDA is currently Disabled"
read -rs -p "Press Enter to Enable or Cmd+Q to quit..."
mv /Volumes/EFI/EFI/CLOVER/kexts/Other/disabled/VoodooHDA.kext /Volumes/EFI/EFI/CLOVER/kexts/Other/VoodooHDA.kext
rmdir /Volumes/EFI/EFI/CLOVER/kexts/Other/disabled
sleep 0.1
if [ -d "$VoodooHDA_enabled" ]; then
echo -e "\n\nVoodooHDA.kext Enabled"
diskutil unmount $EFI
fi
sleep 0.3
osascript -e 'tell app "loginwindow" to «event aevtrrst»'
open -a loginwindow
kill `ps -A | grep -w Terminal.app | grep -v grep | awk '{print $1}'`
exit
fi
fi
if [ -d "$NOTREALMAC" ] && [ -d "$ISREALMAC" ]; then
echo -e "\nEFI partition structure corrupted. Please check CLOVER and FIRMWARE folders.\nDo not run on a real Mac! Fix your EFI folder if this is not a real Mac.\nEFI left mounted for analysis\n"
pause 2
open /Volumes/EFI/EFI/CLOVER/kexts/Other
exit
fi
echo -e "\nVoodooHDA.kext not found!\nEFI left mounted for analysis\n"
pause 2
open /Volumes/EFI/EFI/CLOVER/kexts/Other
exit

Script written by ssorpg + Papadiche
(c) 06/02/2019

Mount EFI:
> Mounts your macOS EFI, then opens a Finder window to it
> Unmounts your macOS EFI if it is mounted
DISKLIST=$(diskutil list)
BOOTDISK=$(df -h / | awk 'NR==2{print$1}' | grep -o 'disk[0-9]*')
EFI=$(echo $DISKLIST | grep -Eo "EFI.*disk[0-9]*s[0-9]*.*Container ${BOOTDISK}" | grep -Eo "disk[0-9]*s[0-9]*" | tail -1)
if [ ! -d /Volumes/EFI/EFI ]; then
echo ""
diskutil mount $EFI
open /Volumes/EFI
else
echo ""
diskutil unmount $EFI
fi
kill `ps -A | grep -w Terminal.app | grep -v grep | awk '{print $1}'`
exit

Script written by ssorpg + Papadiche
(c) 06/02/2019


Background on the scripts:
I work as a professional music producer and thus need as efficient audio drivers as possible. Since I have a GeForce GTX 1060 3GB, I do not have any HDMI or DisplayPort audio drivers (c'mon nVidia and Apple!). Though my audio interface has great drivers, I have found that having VoodooHDA enabled causes audio tearing occasionally. Obviously while in a session with a client, I must make sure not to have any audio glitches. Since I sometimes want to play audio through HDMI/DP and nVidia has no drivers that support 10xx HDMI/DP audio, I opted to create a script that simply toggles VoodooHDA with a restart to allow me to have the best of both worlds: HDMI/DP audio when I want, and seamless glitch-free audio interface sound when I work. In pursuit of this I also had to figure out how to mount my EFI and broke that out into its own script. Simply clicking a file is much faster than having to open Clover Configurator and guess at which EFI is the 'real' one.

All the best! Maybe someone in the future will find these useful ;)
 

Attachments

Top