Skip to content

MichStew/MacbookPro2017_14-1_SoundFix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

MP2014 Sound Fix

This repo contains the small boot/login-time script that fixed the internal speaker output on this machine.

The issue

On this MacBookPro14,1, Linux already had the Cirrus Logic CS8409/CS42L83 audio device exposed through a custom snd_hda_codec_cs8409 module, but the speakers were still unreliable after boot/login. The remaining problem was post-boot state:

  • the saved ALSA mixer state was not always restored
  • the hardware PCM level needed to be forced back to a known-good value
  • PipeWire needed the built-in analog sink set as the default output and the speaker port selected

When that state was wrong, the machine would boot with a visible audio device but no usable speaker output.

How it was fixed

fix-macbook-audio.sh does four things:

  1. waits for the PipeWire sink to appear
  2. restores ~/.config/asound.state if it exists
  3. sets the ALSA PCM control on card 0 to 100%
  4. sets the default sink to alsa_output.pci-0000_00_1f.3.analog-stereo and switches the active port to analog-output-speaker

macbook-audio-fix.service runs that script once per user session after PipeWire starts.

Machine Specs

  • Model: Apple MacBookPro14,1
  • Board: Mac-B4831CEBD52A0C4C
  • OS: Ubuntu 24.04.3 LTS
  • Kernel: 6.17.0-20-generic
  • CPU: Intel Core i5-7360U @ 2.30GHz (2 cores / 4 threads)
  • Memory: 7.6 GiB
  • Storage: 113 GiB NVMe
  • Audio controller: Intel Sunrise Point-LP HD Audio [8086:9d71]
  • Audio codec / mixer: Cirrus Logic CS8409/CS42L83
  • Loaded codec module: /lib/modules/6.17.0-20-generic/updates/snd-hda-codec-cs8409.ko
  • PipeWire sink used by this fix: alsa_output.pci-0000_00_1f.3.analog-stereo
  • PipeWire speaker port used by this fix: analog-output-speaker

Clone And Run

gh repo clone MichStew/MP2014_Sound
cd MP2014_Sound
chmod +x fix-macbook-audio.sh
./fix-macbook-audio.sh

If you want it to run automatically on login:

mkdir -p ~/.local/bin ~/.config/systemd/user
cp fix-macbook-audio.sh ~/.local/bin/
cp macbook-audio-fix.service ~/.config/systemd/user/
chmod +x ~/.local/bin/fix-macbook-audio.sh
systemctl --user daemon-reload
systemctl --user enable --now macbook-audio-fix.service

If ~/.config/asound.state does not exist yet, save a known-good mixer state first:

alsactl --file ~/.config/asound.state store 0

Notes

  • This repo only covers the post-boot mixer/routing fix.
  • It assumes the CS8409 driver is already working on the target system.
  • If your sink or speaker port names differ, override SINK_NAME and PORT_NAME when running the script.

About

Post-boot audio state fix for a MacBookPro14,1 running Ubuntu 24.04

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages