Analog audio on iMac 2019.1 with Ubuntu 24.04.4 requires corrections in sound card rules and missing ALSA UCM for iMac
https://askubuntu.com/questions/1565407/analog-audio-on-imac-2019-1-with-ubuntu-24-04-4-requires-corrections-in-sound-caWhen I installed Ubuntu 24.04.4 on my 27" iMac version 19.1, analog did not function:
Hardware: iMac 19,1 (2019) Audio chip: Cirrus Logic CS8409 (Vendor Id: 0x10138409, Subsystem Id: 0x106b1000) Kernel driver: HDA Intel PCH (snd_hda_intel) Audio stack: PipeWire + WirePlumber. oot Causes There are two independent bugs that must both be fixed:
- Missing SOUND_INITIALIZED udev property PipeWire's ALSA udev plugin (libspa-alsa) skips any sound card that does not have the SOUND_INITIALIZED=1 property set in the udev database. Normally this property is set by /usr/lib/udev/rules.d/78-sound-card.rules during the kernel's initial add event sequence. On the iMac 19.1, this property is not reliably set on the controlC* devices that PipeWire checks, so PipeWire silently finds zero audio devices at startup. Symptom: wpctl status shows no Audio Devices, Sinks, or Sources. WirePlumber logs show spa.alsa ... start_inotify but no card enumeration messages follow.
- Missing ALSA UCM (Use Case Manager) configuration for Apple hardware WirePlumber tries to use ALSA UCM profiles to configure audio devices. UCM configs for Apple iMac hardware are not included in the alsa-ucm-conf package (version 1.2.10 as of Ubuntu 24.04). Without a UCM config, WirePlumber cannot activate any audio profile for the CS8409, leaving it in the off profile with no sink or source nodes created. Symptom: Even when the CS8409 device appears in wpctl status, no Sinks or Sources are listed under it.
Fix Step 1: Create a udev rule to set SOUND_INITIALIZED bashsudo tee /etc/udev/rules.d/91-sound-initialized.rules << 'EOF' SUBSYSTEM=="sound", KERNEL=="controlC*", ENV{SOUND_INITIALIZED}="1" EOF This ensures PipeWire's ALSA plugin finds the sound cards at every boot. Step 2: Disable UCM for ALSA devices in WirePlumber Check your WirePlumber version first — the config format changed between 0.4.x and 0.5.x: bashwireplumber --version Ubuntu 24.04 — WirePlumber 0.4.x (Lua format) Create the WirePlumber user config directory and a Lua rule file: bashmkdir -p ~/.config/wireplumber/main.lua.d bashcat > ~/.config/wireplumber/main.lua.d/51-disable-ucm.lua << 'EOF' table.insert(alsa_monitor.rules, { matches = { { { "device.name", "matches", "alsa_card.*" }, }, }, apply_properties = { ["api.alsa.use-ucm"] = false, }, }) EOF
Important: This file must be in main.lua.d/ and use Lua syntax. WirePlumber 0.4.x uses Lua-based configuration. A .conf file in wireplumber.conf.d/ will silently break device enumeration — do not use that format on Ubuntu 24.04.
Ubuntu 26.04 — WirePlumber 0.5.x (conf format) WirePlumber 0.5.x (shipped as version 0.5.13 in Ubuntu 26.04) replaced Lua configuration with a JSON/SPA .conf format. The Lua file above will be ignored on 0.5.x. Use this instead: bashmkdir -p ~/.config/wireplumber/wireplumber.conf.d bashcat > ~/.config/wireplumber/wireplumber.conf.d/51-disable-ucm.conf << 'EOF' monitor.alsa.rules = [ { matches = [ { device.name = "~alsa_card.*" } ] actions = { update-props = { api.alsa.use-ucm = false } } } ] EOF
Note: On WirePlumber 0.5.x, do not create files in main.lua.d/ — that directory is no longer used. Use wireplumber.conf.d/ with .conf files only.
Step 3: Reboot bashsudo reboot A reboot is required so that:
The new udev rule fires during the kernel's initial device add event sequence PipeWire and WirePlumber start cleanly in the correct order
Step 4: Verify After rebooting, SSH back in and check: bashwpctl status You should see something like: Audio ├─ Devices: │ 42. Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] [alsa] │ 43. Built-in Audio [alsa] │ ├─ Sinks: │ * 48. Built-in Audio Analog Stereo [vol: 0.40] │ ├─ Sources: │ * 49. Built-in Audio Analog Stereo [vol: 1.00] Set the volume to a comfortable level: bashwpctl set-volume @DEFAULT_SINK@ 0.80 Test audio playback (plays a sine wave through the hardware): bashspeaker-test -D hw:0,0 -c 2 -t sine -f 1000 -l 1 Test recording: basharecord -D hw:0,0 -d 3 -f cd /tmp/test.wav && ls -la /tmp/test.wav
Why This Happens The 78-sound-card.rules udev rule sets SOUND_INITIALIZED=1 on card* sysfs devices (e.g., /sys/class/sound/card0) by triggering a change event from the controlC* device's add event. This chain relies on the correct ordering of kernel udev events at boot. On the iMac 19.1, PipeWire checks controlC* character devices in /dev/snd/ rather than the card* sysfs entries, and the property is not propagated to those nodes by the stock rules. The custom rule in Step 1 ensures the property is always present on the right device nodes. The UCM issue is straightforward: Apple hardware UCM profiles simply do not exist in the upstream alsa-ucm-conf package. Until someone writes and contributes them, disabling UCM and falling back to direct ALSA configuration is the correct workaround.
Files Modified / Created Ubuntu 24.04 (WirePlumber 0.4.x) FilePurpose/etc/udev/rules.d/91-sound-initialized.rulesSets SOUND_INITIALIZED=1 on sound control devices at boot~/.config/wireplumber/main.lua.d/51-disable-ucm.luaDisables UCM requirement for all ALSA cards in WirePlumber Ubuntu 26.04 (WirePlumber 0.5.x) FilePurpose/etc/udev/rules.d/91-sound-initialized.rulesSets SOUND_INITIALIZED=1 on sound control devices at boot (same as above)~/.config/wireplumber/wireplumber.conf.d/51-disable-ucm.confDisables UCM requirement for all ALSA cards in WirePlumber These changes are minimal, targeted, and do not affect other audio hardware. The udev rule is system-wide and identical across both Ubuntu releases. The WirePlumber rule is per-user — for a system-wide effect place it in /usr/share/wireplumber/main.lua.d/ (0.4.x) or /usr/share/wireplumber/wireplumber.conf.d/ (0.5.x).
Ubuntu 26.04 / WirePlumber 0.5.x Ubuntu 26.04 ships WirePlumber 0.5.13, which uses a completely different configuration format from 0.4.x. The key differences relevant to this fix are:
Lua scripting (main.lua.d/*.lua) is removed — .lua config files are silently ignored Configuration now uses .conf files in wireplumber.conf.d/ with JSON/SPA syntax Monitor rules use a new monitor.alsa.rules key instead of the alsa_monitor.rules Lua table
The udev rule (Step 1) is identical for both Ubuntu 24.04 and 26.04 — no changes needed there. If you are upgrading from Ubuntu 24.04 to 26.04, you should:
Remove the old Lua file (it will be ignored but may cause confusion):
bashrm ~/.config/wireplumber/main.lua.d/51-disable-ucm.lua
Create the new conf file:
bashmkdir -p ~/.config/wireplumber/wireplumber.conf.d cat > ~/.config/wireplumber/wireplumber.conf.d/51-disable-ucm.conf << 'EOF' monitor.alsa.rules = [ { matches = [ { device.name = "~alsa_card.*" } ] actions = { update-props = { api.alsa.use-ucm = false } } } ] EOF
Reboot.
Note: The conf format shown above for WirePlumber 0.5.13 has not yet been independently verified on iMac 19.1 hardware. If you have tested this on Ubuntu 26.04, please report your results.
Troubleshooting wpctl status hangs indefinitely (Ubuntu 24.04 / WirePlumber 0.4.x): Check for stale config files in the wrong format: bashls ~/.config/wireplumber/wireplumber.conf.d/ Any .conf files here will break WirePlumber 0.4.x. Remove them. The correct location for 0.4.x config is main.lua.d/ with Lua files only. Devices appear but no Sinks/Sources: The UCM rule may not have been applied. Verify the Lua file exists and has correct syntax: bashcat ~/.config/wireplumber/main.lua.d/51-disable-ucm.lua SOUND_INITIALIZED not set after reboot: bashudevadm info /dev/snd/controlC0 | grep SOUND_INITIALIZED If empty, reload udev rules manually: bashsudo udevadm control --reload-rules sudo udevadm trigger --subsystem-match=sound
References
PipeWire project WirePlumber documentation ALSA UCM configuration Cirrus Logic CS8409 codec — confirmed working with HDA Intel PCH driver (snd_hda_intel) on Linux 6.x





