Out-of-tree audio driver for the Cirrus Logic CS4208 codec in the 12-inch MacBook (MacBook9,1 / 2016 and MacBook10,1 / 2017).
The mainline kernel has no working configuration for this codec on these machines: the codec is detected, but the speaker amplifier is never enabled, so the built-in speakers stay silent. This module replays the initialization the codec needs (reverse-engineered from macOS) and adds proper headphone/speaker routing on top.
Based on davidjo's snd_hda_macbookpro.
- Internal speakers
- Headphone jack
- Automatic speaker / headphone switching on plug / unplug
- Volume control — needs one extra config step, see Speaker volume
- Internal microphone
| Models | MacBook9,1 (2016), MacBook10,1 (2017) |
| Not supported | MacBook8,1 (2015) |
| Kernels | ≥ 5.0 (including the 6.17+ sound/hda/codecs layout) |
| Audio server | PipeWire or PulseAudio |
Ubuntu / elementary / Debian
sudo apt install curl dkms gcc make git linux-headers-$(uname -r)Fedora
sudo dnf install curl dkms gcc make git kernel-develArch
sudo pacman -S curl dkms gcc make git linux-headersDKMS rebuilds the module automatically whenever you install a new kernel, so audio keeps working across kernel updates.
git clone https://github.com/leifliddy/macbook12-audio-driver.git
cd macbook12-audio-driver
sudo ./install.cirrus.driver.sh -i
sudo rebootNote
The first build for each upstream kernel downloads its matching source
tarball to obtain the HD-audio codec headers. The tarball is verified against
kernel.org's SHA-256 list and cached under
/var/cache/macbook12-audio-driver for later rebuilds.
Important
DKMS receives its own source copy under /usr/src, so the cloned directory
can be removed after installation.
To uninstall:
sudo ./install.cirrus.driver.sh -uManual build (fallback — does not survive kernel updates)
git clone https://github.com/leifliddy/macbook12-audio-driver.git
cd macbook12-audio-driver
sudo ./install.cirrus.driver.sh
sudo rebootThe internal speaker has no usable hardware volume control — the codec's only analog amplifier is wired to the headphone path. PipeWire therefore has to apply volume in software for this card. Without this step the volume slider appears to do nothing on the speakers.
Check your WirePlumber version first:
wireplumber --versionWirePlumber 0.5+ (most current distros) — create
/etc/wireplumber/wireplumber.conf.d/51-macbook-cs4208-softvol.conf:
monitor.alsa.rules = [
{
matches = [ { device.name = "alsa_card.pci-0000_00_1f.3" } ]
actions = { update-props = { api.alsa.soft-mixer = true } }
}
]
WirePlumber 0.4 — create
/etc/wireplumber/main.lua.d/51-macbook-cs4208-softvol.lua:
table.insert(alsa_monitor.rules, {
matches = {
{ { "device.name", "equals", "alsa_card.pci-0000_00_1f.3" } },
},
apply_properties = {
["api.alsa.soft-mixer"] = true,
},
})Copy-paste-ready versions of both live in contrib/wireplumber/.
Then pin the hardware amps to full, persist them, and restart WirePlumber:
amixer -c0 sset Master 100% unmute
sudo alsactl store
systemctl --user restart wireplumberNote
On these MacBooks the audio controller is at PCI 00:1f.3, which is what the
config matches. If yours differs, find the card name with
wpctl status or pactl list cards short.
# confirm this module (not the in-tree stub) is loaded:
modinfo snd_hda_codec_cs420x | grep filename # should point at .../updates/...
# then play a test sound and plug/unplug headphones — audio should follow:
wpctl statusThe CS4208 in these MacBooks drives the speakers over a digital link
(converter 0x0a → pin 0x1d, with the amplifier enabled by a GPIO) and the
headphones over the analog DAC (converter 0x02 → pin 0x10). The module
replays the macOS init for both paths and, on a jack interrupt, re-points the
active stream onto the correct converter (disabling the speaker pin so it
doesn't bleed while headphones are in).
- Switching is done at the codec level and cooperates with PipeWire's own jack handling.
- Because the speaker relies on software volume, very low headphone levels can sound slightly compressed (reduced effective bit depth). Normal listening levels are unaffected.
- davidjo — original snd_hda_macbookpro reverse-engineering this is built on
- leifliddy — macbook12-audio-driver, the base for this fork