Skip to content

Enable speakers on Late 2015 21.5-inch iMacs - #10458

Open
inspiretelapps wants to merge 2 commits into
omacom:quattrofrom
inspiretelapps:fix-imac16-cs4208-speakers
Open

inspiretelapps wants to merge 2 commits into
omacom:quattrofrom
inspiretelapps:fix-imac16-cs4208-speakers

Conversation

@inspiretelapps

Copy link
Copy Markdown

Summary

Late 2015 21.5-inch iMacs (iMac16,1 / iMac16,2) drive four digital CS4208 speaker channels. Analog Stereo is the headphone DAC and HDMI is the internal display, so both look like valid outputs while the speakers stay silent. Master hardware volume also does not change speaker loudness, so the Omarchy output slider moves with no audible change.

This installs a DMI-gated WirePlumber drop-in that:

  • selects Analog Surround 4.0 on the CS4208 card
  • uses software volume (api.alsa.soft-mixer)
  • deprioritizes HDMI so it does not steal the default sink

Same shape as the ASUS ROG audio mixer quirk. Does not overlap with the CS8409 DKMS work for 2016–2019 Macs.

Hardware

Verified on iMac16,2 (Cirrus Logic CS4208, codec subsystem 0x106b8100) on linux 7.1.9 / Omarchy 4.0.2: YouTube silent on Analog Stereo and HDMI, plays on Analog Surround 4.0; system volume slider works after software volume.

Test plan

  • bash test/shell.d/imac-cs4208-speakers-test.sh
  • ./test/cli
  • On iMac16,1 or iMac16,2: install / migrate → omarchy restart audio → speakers play, output slider changes loudness
  • Other hardware: hook and migration no-op

iMac16,1 and iMac16,2 drive four digital CS4208 speaker channels.
Analog Stereo is the headphone DAC and HDMI is the internal display,
so both look like valid outputs while the speakers stay silent, and
Master hardware volume does not change speaker loudness.

Select Analog Surround 4.0, use software volume, and deprioritize HDMI
on those machines. Verified on iMac16,2.
Migrations run under bash -euo pipefail, so when aplay -l lists no CS4208 card (no seat ACL over SSH, or the codec not enumerated yet) the card lookup fails, the assignment aborts the migration, and it stays pending, blocking every later one. The mixer writes are already best-effort; the lookup now is too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed on a disposable Omarchy VM (WirePlumber 0.5.17, PipeWire 1.6.8), with a second review by Codex Medium. ./test/cli and test/shell.d/imac-cs4208-speakers-test.sh pass. The VM has no CS4208, so the speakers themselves could not be tested here. Two things still need fixing on the iMac, and I pushed a fix for a third.

Pushed: f9ee539. Migrations run under bash -euo pipefail. On a matching iMac where aplay -l lists no CS4208 card (for example, an update run over SSH without the seat's device access), the card=$(aplay -l | grep … ) pipeline in install/user/hardware/apple/fix-imac-cs4208-speakers.sh:12 failed and aborted migrations/1788673159.sh. The migration then stayed pending and blocked every migration after it. I reproduced this on the VM: the migration exited 1. The lookup now ends in || true, the same as the amixer calls below it, and the test file has a case for it that fails without the change.

Open: software volume is never enabled. The first rule in default/wireplumber/wireplumber.conf.d/imac-cs4208-speakers.conf:10-23 matches alsa.mixer_name under monitor.alsa.rules. WirePlumber applies that rule to the card's enumeration properties, before the ALSA device is built, and alsa.mixer_name only exists afterwards. So the rule never matches, and api.alsa.soft-mixer is never set. On the VM I loaded snd-dummy (mixer name Dummy Mixer). A rule matching alsa.mixer_name = "Dummy Mixer" changed nothing. The same rule matching device.name = "~alsa_card.*snd_dummy.*" or api.alsa.card.name = "Dummy" applied. On the iMac this probably leaves the output slider moving the hardware Master control with no audible change, which is the problem the PR sets out to fix. The device.profile.priority.rules block matching alsa.mixer_name does work: on the VM it moved the dummy card to the requested profile. So Analog Surround 4.0 should still be selected. The ASUS drop-in matches on device.name. Matching this card by a property it has at enumeration, checked with wpctl inspect on the iMac, should fix it. A confirmation would help: with the new head installed, wpctl inspect <card id> showing api.alsa.soft-mixer = true, and the slider changing loudness.

Open: the manual's fallback. manual/45-troubleshooting.md says to pick Analog Surround 4.0 in the volume popup. The popup switches between sinks and does not change card profiles. While the Analog Stereo profile is active, there is no Analog Surround 4.0 sink to pick. The fallback needs a method that actually switches the profile, such as wpctl set-profile.

Codex Medium raised the soft-mixer mechanism and the manual problem, and I confirmed both as described above. It agreed with the migration fix after I described it, so that agreement is not an independent check. Draft #12689 carries the same iMac files inside a larger Cirrus audio bundle, has the same lookup failure, and has not been tested on hardware. For this bug, this PR is the focused fix. Waiting on the author for the matcher and the manual, then on a test of the new head on an iMac16,1 or iMac16,2.

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Audio hardware quirk for a specific iMac model.

The PR should not merge until the migration handles an existing HDMI default that can keep the speakers silent.

Findings

  1. P1 Saved HDMI default survives ▶
  2. P2 Unrelated audio routes are erased ▶
  3. P2 Popup cannot change profiles ▶

Summary

The PR adds an iMac16,1/iMac16,2 detector, installs a CS4208 WirePlumber speaker and software-volume configuration for new and existing users, and adds tests and troubleshooting guidance. Existing HDMI defaults can survive the migration, and the documented profile-recovery step does not match the volume popup’s controls.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[iMac detector] --> B[Install or migrate drop-in]
  B --> C[WirePlumber loads profile and priority rules]
  D[Saved default-nodes sink] --> E[Default output selection]
  C --> E
  E --> F[Speaker or HDMI playback]
Loading

Reviews (1) · Last reviewed commit: "Keep the iMac speaker migration from abo..."

mkdir -p ~/.config/wireplumber/wireplumber.conf.d/
cp "$OMARCHY_PATH/default/wireplumber/wireplumber.conf.d/imac-cs4208-speakers.conf" \
~/.config/wireplumber/wireplumber.conf.d/
rm -rf ~/.local/state/wireplumber/default-routes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Saved HDMI default survives. If an existing iMac has HDMI saved as its default output, deleting default-routes leaves that choice in default-nodes. The saved choice can still take precedence over the new sink priorities after audio restarts, so the migration may leave playback on silent HDMI instead of the speakers.

Knowledge Base Used: Hardware profiles and device controls

mkdir -p ~/.config/wireplumber/wireplumber.conf.d/
cp "$OMARCHY_PATH/default/wireplumber/wireplumber.conf.d/imac-cs4208-speakers.conf" \
~/.config/wireplumber/wireplumber.conf.d/
rm -rf ~/.local/state/wireplumber/default-routes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unrelated audio routes are erased. This removes the entire default-routes file, including saved choices for other sound cards on the iMac. Users may have to set those outputs up again even though only the CS4208 needs adjustment.

Knowledge Base Used: Hardware profiles and device controls


### No sound from the built-in speakers on a Late 2015 21.5-inch iMac

Those machines (iMac16,1 and iMac16,2) drive four digital speaker channels on the CS4208 codec. Analog Stereo is the headphone DAC, and HDMI is the internal display — both look like valid outputs but stay silent. Omarchy selects Analog Surround 4.0 and software volume automatically. If you still hear nothing, pick Analog Surround 4.0 in the volume popup rather than Analog Stereo or HDMI.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Popup cannot change profiles. If the card remains on Analog Stereo, the volume popup cannot perform the suggested recovery step. It selects output sinks, not card profiles, so users cannot switch the card to Analog Surround 4.0 there.

Knowledge Base Used: Hardware profiles and device controls

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants