Skip to content
zL00OL edited this page Oct 3, 2026 · 4 revisions

Audio

Status: FIXED and verified 2026-10-03. Both of the causes below are real and both had to be applied.

Two earlier diagnoses in this wiki were wrong — first a missing limiter, then kernel module ordering. Both were reached before searching the driver tracker for this exact machine model. That ordering mistake is what cost an evening.

Run scripts/imac-audio-fix. It never reboots.

Cause 1 — HDA runtime power management

davidjo/snd_hda_macbookpro issue #209 is filed on an iMac19,1 — this machine — and lists every symptom we had:

Primary patch_cs8409 NOT FOUND trying APPLE
codec CS8409/CS42L83, jack detection correct, PCM state: RUNNING
Pin-ctls: 0x40: OUT          <-- pin enabled
...silent at every volume

A debug build showed the amplifier I2C status reading 0x20 instead of 0x18, with neither the CS42L83 nor the four TAS5764L amplifiers responding.

Distros ship snd_hda_intel power_save=1, so the controller runtime-suspends after a second of idle. The CS8409's I2C bridge is powered from that controller — while it is suspended the amplifiers cannot be programmed at all. No error appears anywhere: digital path running, pin enabled, PCM running, no sound.

# /etc/modprobe.d/99-imac-audio.conf
options snd_hda_intel power_save=0 power_save_controller=N

Per the reporter, internal speakers then work with davidjo's driver unmodified from master. This may be why the model works on Fedora and Arch but not Ubuntu. Issue #217 adds that with the default the codec state goes bad after ~10 s idle.

Cause 2 — TDM slot corruption

Issue #211 bisected a case where only 2 of the 4 channels ever play:

slots 1 and 2 (the middle of the 4-slot frame) are never delivered correctly. Slots 0 and 3 are always clean.

Two of four working is exactly a "rear pair works, front pair silent" result. Apple's native codec format is 0x4033 — S24_3LE, 4ch, 44.1 kHz; adding S24_3LE to the driver's format mask woke the dead amplifiers.

Cause 3 — there is no hardware volume

Per #217, no codec node has an amp, so PCM Playback Volume is an ALSA softvol that PipeWire mistakes for a hardware mixer → stepped curve (mute up to ~12%, then near full). Needs api.alsa.soft-mixer = true.

The DKMS trap that hid all of this

On kernels where the HDA codecs moved to sound/hda/codecs/cirrus/, the module compiles but DKMS looks in the old build/hda path:

  LD [M]  codecs/cirrus/snd-hda-codec-cs8409.ko
  # exit code: 0
Error! Build of build/hda/snd-hda-codec-cs8409.ko failed

DKMS declares failure and installs nothing. One-line fix:

-BUILT_MODULE_LOCATION[0]="build/hda"
+BUILT_MODULE_LOCATION[0]="build/hda/codecs/cirrus"

So davidjo's driver may never have been under test here at all.

Apply

sudo ~/bin/imac-audio-fix --dry-run
sudo ~/bin/imac-audio-fix
sudo ~/bin/imac-audio-fix --check

Verified markers after reboot:

Primary patch_cs8409 NOT FOUND trying APPLE
Codec: Cirrus Logic CS8409/CS42L83

Two traps that cost hours

DKMS. Upstream dkms.conf already needs BUILT_MODULE_LOCATION[0]="build/hda/codecs/cirrus". A "failed" build whose log shows exit code: 0 means DKMS built the module but could not find it, and installed nothing.

This machine cannot reach cdn.kernel.org or github.com. davidjo's installer downloads the kernel tarball and hung here for many minutes; clone the driver on another machine and copy it in. The installer now copies sound/hda from a preserved source directory instead of downloading.

Unresolved: only tweeters

After the above, playback is audible but tweeters only - 2 of 4 channels, with a loud hiss on some tests. That is issue #211: the middle TDM slots are corrupted. The fix is to offer SNDRV_PCM_FMTBIT_S24_3LE, which the playback path omits.

Adding the flag is not enough. PipeWire always negotiates s32le and ignored it; restricting the mask to S24_3LE only made PipeWire unable to open the device at all (Input/output error).

If audio goes completely silent

Check for a stale WirePlumber state before blaming the driver - a muted sink and a sticky profile produced total silence once:

systemctl --user stop wireplumber pipewire pipewire-pulse
mv ~/.local/state/wireplumber ~/.local/state/wp.bak
systemctl --user start pipewire pipewire-pulse wireplumber

Warning: DKMS archived the in-tree codec, so there is no stock fallback. If the registration is removed, no codec loads at all.

If it is still silent after rebooting

Report:

  1. Does --check show power_save=N?
  2. Does /proc/asound/card0/codec#0 show the CS42L83 sub-codec?
  3. With a 4-channel stream, do channels 0 and 3 play while 1 and 2 stay silent?

That distinguishes cause 1 from cause 2.

Verification commands

cat /sys/module/snd_hda_intel/parameters/power_save        # want N
modinfo -n snd_hda_codec_cs8409                            # want updates/dkms
grep -m1 Codec: /proc/asound/card0/codec#0                 # want CS8409/CS42L83
grep -E '^0[0-9]-00' /proc/asound/pcm                      # want a 4-channel PCM

The external Behringer UMC204HD is unaffected by any of this.

Clone this wiki locally