iMac CS4208: GNOME-Lautstärkeschieberegler macht nichts? So reparieren Sie ihn! [Translation: iMac CS4208: GNOME Volume Slider doesn't work? Here is how You can fix it!]

Das Problem

Auf Apple iMacs (Late 2012–2013) mit Cirrus Logic CS4208 Codec unter Zorin OS / Ubuntu / GNOME / PipeWire funktioniert der Lautstärkeschieberegler nicht — er bewegt sich, aber die Lautstärke ändert sich nicht.

Root Cause (Ursache gefunden)

Der CS4208 Codec hat zwei Lautstärkeregelungen im ALSA-Mixer:

Regler NumID Bereich Regelt die Lautsprecher?
PCM 24 0–255 :white_check_mark: JA
Master 13 0–127 :cross_mark: NEIN

Der GNOME-Schieberegler über PipeWire mappt den Lautstärkewert standardmäßig auf den Master-Regler (wegen flat-volumes=true). Da Master die Lautsprecher nicht kontrolliert, passiert nichts.

# Beweis: nur PCM ändert die Lautstärke!
amixer -c 1 get PCM        # Ändert die Lautstärke ✓
amixer -c 1 get Master     # Keine Wirkung ✗

Lösung: volume-sync.sh

Ein kleines Skript, das den Schieberegler auf den funktionierenden PCM-Regler mappt:

#!/bin/bash
# Maps GNOME/Zorin slider (Pulse volume) → ALSA PCM (drives speakers)
# CS4208 Master (numid=13) doesn't drive speakers; PCM (numid=24) does.

SINK="alsa_output.pci-0000_00_1b.0.analog-surround-40"
CARD=1
LAST=""

# Hardware auf Max setzen (einmalig beim Start)
amixer -c "$CARD" set PCM 255 >/dev/null 2>&1
amixer -c "$CARD" set Master 100% unmute >/dev/null 2>&1

# Hauptloop: Pulse→PCM syncen (Master NICHT im Loop anrühren!)
while true; do
    CUR=$(pactl get-sink-volume "$SINK" 2>/dev/null | head -1 | grep -oP '\d+(?=%)' | head -1)
    if [ -n "$CUR" ] && [ "$CUR" != "$LAST" ]; then
        let PCM="CUR * 255 / 100"
        amixer -c "$CARD" set PCM "$PCM" >/dev/null 2>&1
        LAST="$CUR"
    fi
    sleep 0.2
done

Installation

mkdir -p ~/.local/bin ~/.config/autostart

# 1. Skript speichern
cat > ~/.local/bin/volume-sync.sh << 'EOF'
#!/bin/bash
# ... (code von oben)
EOF
chmod +x ~/.local/bin/volume-sync.sh

# 2. Autostart-Eintrag
cat > ~/.config/autostart/volume-sync.desktop << 'EOF'
[Desktop Entry]
Type=Application
Name=Volume Sync (CS4208)
Exec=/home/martin/.local/bin/volume-sync.sh
X-GNOME-Autostart-enabled=true
EOF

# 3. Sofort starten
~/.local/bin/volume-sync.sh &

:warning: Wichtige Anpassungen

  • Sink-Name anpassen: pactl list short sinks → deinen Sink-Namen verwenden
  • Card-Nummer: cat /proc/asound/cards → CS4208 ist typischerweise Karte 1
  • HDMI-Sink deaktivieren (optional): pactl set-card-profile alsa_card.pci-0000_00_03.0 off
  • Master im Loop entfernen: Wenn Master im Loop gesetzt wird, springt der Schieberegler auf 100%!

System-Details

  • OS: Zorin OS 18.1 (Ubuntu 24.04 Basis, GNOME 46, Wayland)
  • Hardware: iMac12,1 (Intel i5-5575R, CS4208, 4-Lautsprecher-System)
  • Audio-Stack: PipeWire 1.0.5 + WirePlumber 0.4.17
  • Profil: analog-surround-40+input:analog-stereo

Welcome to the Forum!

Did You used AI to create this? If yes, please add add AI was used to create this. This belongs to the Forum Guidelines.

Also some Stuff, You could change:

You could change this to:

PCM=$(( CUR * 255 / 100 )) [ "$PCM" -gt 255 ] && PCM=255

And in Your Autostart Entry, You have:

Not every User is ''martin''. You could change that to:

Exec=%h/.local/bin/volume-sync.sh

To be transparent here: These Ideas are not mine. I talked with @Aravisian about this Post because of the Script (I can#t read Scripts) and he brought this up to adjust that.

2 Likes