Work in progress audio driver for the 12" MacBook 9,1 (2016) that's largely based on davidjo's snd_hda_macbookpro
Driver builds successfully on kernels 5.0 to 5.11 (haven't tested on earlier kernels)
At this time, only the speakers work with this driver (no wired headphone support)
In order to use wired headphones, you must switch between this driver and the stock kernel driver
Terminology
headphones == wired headphones (not bluetooth)
speaker driver == this driver
headphone driver == stock kernel driver
fedora package install
dnf install wget symlinks make gcc kernel-devel
ubuntu package install
apt install wget symlinks make gcc linux-headers-generic
arch package install
pacman -S wget symlinks make gcc linux-headers
build driver
git clone https://github.com/leifliddy/macbook12-audio-driver.git
cd macbook12-audio-driver/
# run the following command as root or with sudo
./install.cirrus.driver.sh
reboot
At this point, the speakers should (hopefully) be working. You can stop here if you don't plan on using headphones.
Following the steps below to switch between the speaker and heaphone drivers results in subpar sounding speakers.
If you want to use headphones, I would recommend that you run the switch.audio.driver.sh script and reboot.
Perform the same steps again when you want to use the speakers.
Things get a bit convoluted here....
Edit /etc/pulse/default.pa (to be able to reload the sound modules without rebooting)
With the changes listed in the pulse_audio_configs/default.pa file
Activate PulseAudio Changes
sudo chmod -x /usr/bin/pulseaudio
sudo killall -9 pulseaudio
sudo chmod +x /usr/bin/pulseaudio
pulseaudio --start # as normal user
Note: might be easier to just reboot
Use provided support scripts to switch between the speaker and headphone driver
-
switch.audio.driver.sh (run as root or with sudo)
Script will toggle between the headphone and speaker driver, but won't work if active audio streams are present. -
pulse.switch.audio.sh (run as normal user)
Script will also toggle between the speaker and headphone driver and will work if active audio streams are present.
Since this script calls switch.audio.driver.sh, the normal user running this script must have the necessary sudo rights.
ie:
/etc/sudoers
youruser ALL=(ALL) NOPASSWD: /usr/local/bin/switch.audio.driver.shNote: pulse.switch.audio.sh works perfectly on Fedora 31. Had trouble getting it to work reliably on Ubuntu 19.04