🔊 iMac 2017 Linux Audio Fix — Cirrus Logic CS8409
🇬🇧 English · 🇪🇸 Español · Current version: 1.2.0 · Changelog
No sound on your 2017 iMac in Linux? This fixes the internal speakers, headphones and HDMI audio on the Apple iMac 2017 (iMac18,1 · iMac18,2 · iMac18,3).
It ships a patched driver based on davidjo/snd_hda_macbookpro, a universal menu-driven installer (Fedora, Ubuntu/Debian, Arch, openSUSE and NixOS), automatic DKMS builds so the fix survives kernel updates, a speakers / headphones mode switch, and a PipeWire / WirePlumber profile to use the internal speakers and HDMI at the same time.
git clone https://github.com/riqgonzalo/imac-2017-linux-audio-cs8409.git
cd imac-2017-linux-audio-cs8409
./instalar_audio_imac.sh # choose option 1 (autodetect)
The scripts’ menus are in Spanish. This page explains every option in English.
🙏 Did it work for you (or not)? Tell us here with your model and distro. Every report helps other iMac owners.
Symptoms
- 🔇 Internal speakers are silent, even though the volume slider moves and apps seem to play.
- 🎧 Linux says headphones are plugged in when they are not, and the output is stuck on “Headphones”.
- Only HDMI / DisplayPort output shows up, or no analog output at all.
- Plugging or unplugging the jack changes nothing.
- After a kernel update, sound you had working disappears again.
Is this my machine?
| Model | Machine | Tested |
|---|---|---|
iMac18,1 |
iMac 21.5” (2017) | ✅ Main test machine |
iMac18,2 |
iMac 21.5” Retina 4K (2017) | Expected (same audio hardware) |
iMac18,3 |
iMac 27” Retina 5K (2017) | Expected (same audio hardware) |
| MacBook Pro with CS8409 | MacBook Pro 2016–2017 | Supported by the original driver |
cat /sys/class/dmi/id/product_name # → iMac18,1 / iMac18,2 / iMac18,3
grep -m1 Codec /proc/asound/card*/codec#* # → Codec: Cirrus Logic CS8409
grep -m1 "Subsystem Id" /proc/asound/card*/codec#* # → 0x106b1000 / 0x106b0f00 / 0x106b0e00
If the codec is Cirrus Logic CS8409 and the subsystem starts with 0x106b, this is for you.
Why it happens
The iMac’s audio is split across several chips: the Cirrus Logic CS8409 HDA bridge, a CS42L83 codec for the headphone jack, and TI TAS5764x amplifiers driving the four internal speakers.
- The stock kernel can’t initialise Apple’s hardware. The mainline
snd_hda_codec_cs8409module supports Dell and Cirrus reference boards, not Apple’s start-up sequence, so the amplifiers never turn on. - davidjo’s driver reimplements that sequence and works on MacBook Pros and several iMacs.
- But on the 2017 iMac the jack sensor is read inverted. The original driver calls
cs42l83_tip_sense(codec, 1)for these iMacs, which gives a permanent false “headphones connected”: all audio goes to the headphone output and the internal speakers are muted.
What this driver changes
snd_hda_macbookpro_imac/ is davidjo’s driver with three changes (also available as a standalone patch: parches/imac-cs8409.patch):
- Jack sense no longer inverted on iMac18,x, so speakers and headphones switch correctly.
- New
force_speakersmodule parameter to force the internal speakers if your jack sensor still misbehaves. install.cirrus.driver.shfinishes cleanly under DKMS, so the module rebuilds on every kernel update.
Requirements
- A 2017 iMac (or MacBook Pro) with CS8409.
- A traditional (non-immutable) distro: Fedora, RHEL/Rocky/Alma (EPEL is enabled automatically), openSUSE, Ubuntu, Debian, Linux Mint, Pop!_OS, elementary, Zorin, Arch, Manjaro, EndeavourOS, Garuda, or NixOS.
- Internet access and
sudo. - PipeWire + WirePlumber for simultaneous HDMI (the default on current distros).
The installer first checks that the machine really is a Mac with CS8409. On any other PC it warns that you could lose sound and only continues if you type CONTINUAR.
Installation
git clone https://github.com/riqgonzalo/imac-2017-linux-audio-cs8409.git
cd imac-2017-linux-audio-cs8409
./instalar_audio_imac.sh
Choose 1) Autodetectar e instalar automáticamente (autodetect and install). You’ll hear a test sound at the end. If the modules were in use, it offers to reboot. Don’t move the folder before installing.
Optional desktop shortcuts: ./crear_lanzadores.sh.
Installer menu
| Option | What it does |
|---|---|
| 1 Autodetect | Reads /etc/os-release and runs the RPM, DEB, Arch or Nix flow. Stops on immutable systems. |
| 2 RPM | dnf/zypper dependencies, DKMS build, config, dracut initramfs. |
| 3 DEB | apt-get dependencies, DKMS build, config, update-initramfs. |
| 4 Arch | pacman (picks linux-headers, -lts, -zen or -hardened), mkinitcpio -P. |
| 5 NixOS | Generates /etc/nixos/cs8409-audio.nix (experimental). |
| 6 HDMI + speakers | Only the PipeWire/WirePlumber profile. |
| 7 Diagnostics | Shows the loaded module, patch status, DKMS, jack state, PipeWire outputs; plays a test sound. |
| 8 Uninstall | Removes the DKMS module, guard service and all config, regenerates initramfs. |
| 9 Exit | Â |
Speakers / headphones mode (force_speakers)
./cambiar_modo_audio.sh # 1) automatic detection 2) always internal speakers
By hand:
cat /sys/module/snd_hda_codec_cs8409/parameters/force_speakers
echo 1 | sudo tee /sys/module/snd_hda_codec_cs8409/parameters/force_speakers
echo "options snd_hda_codec_cs8409 force_speakers=1" | sudo tee /etc/modprobe.d/cs8409.conf
Kernel updates
- DKMS rebuilds the module whenever a new kernel is installed (as long as its headers are installed).
cs8409-audio-guard.servicechecks at every boot that the module exists for the running kernel and rebuilds it if not (sound returns on the next reboot). Check it withjournalctl -u cs8409-audio-guard.
Troubleshooting
lsmod | grep -E "cs8409|snd_hda_intel"
modinfo snd_hda_codec_cs8409 | grep -E "filename|parm"
dkms status
sudo dmesg | grep -iE "cs8409|cs42l83|tas57"
pactl list sinks short
| Symptom | Fix |
|---|---|
modinfo points to kernel/sound/… (stock module) |
sudo depmod -a, reboot, check dkms status. |
force_speakers not listed by modinfo |
The patched module isn’t loaded: reinstall with option 1. |
dkms status empty or “added” |
Install headers for your exact kernel (uname -r) and reinstall. |
| Still says “Headphones” with nothing plugged in | ./cambiar_modo_audio.sh → option 2. |
| “LA INSTALACIÓN NO SE COMPLETÓ” (install failed) | Read /var/log/instalar_audio_imac.log. |
| “Key was rejected by service” | Secure Boot: disable it or sign the module (MOK). |
| No “speakers + HDMI” profile | systemctl --user restart pipewire wireplumber. |
Known limitations
- Immutable distros (Silverblue/Kinoite, Bazzite, Aeon…) are not supported.
- Microphone level is very low and mic support is incomplete (as in the upstream driver).
- Suspend is untested; the amplifiers stay powered on.
- Sound won’t be identical to macOS, which applies its own DSP filters.
Full details (step-by-step install, files touched, NixOS, manual uninstall) are in the Spanish README.
Credits & license
- Original driver: davidjo/snd_hda_macbookpro. All the reverse-engineering work on the CS8409, CS42L83 and Apple amplifiers is theirs.
- iMac 2017 fix,
force_speakers, universal installer, mode switch and PipeWire setup: @riqgonzalo.
Licensed under GPL-2.0. ⚠️ This modifies kernel modules and audio configuration. No warranty; use at your own risk.