During the system boot sequence of an Ubuntu desktop or audio workstation, checking systemd logs with systemctl --failed occasionally reveals a failed service alert stating Failed to start Manage Sound Card State. The accompanying service unit is alsa-state.service or alsa-restore.service. While audio playback might continue functioning through modern sound servers like PipeWire or PulseAudio, this ALSA service failure means hardware mixer volumes, equalizer settings, and audio routing fail to persist across reboots, forcing volumes to reset to zero or maximum on startup. Resolving this issue ensures that hardware sound card levels save and restore seamlessly.
Why the ALSA Sound Card State Service Fails
The Advanced Linux Sound Architecture (ALSA) relies on alsactl to store and restore hardware audio mixer states to disk. The service fails during startup due to:
- Missing or Corrupted State File: The configuration database at
/var/lib/alsa/asound.statebeing truncated, containing syntax errors, or failing write operations during unexpected power loss. - Permission Denied on /var/lib/alsa: File permissions or ownership on the ALSA runtime state directory preventing the service from writing updated volume levels.
- Dynamic Sound Card Re-indexing: Multiple audio devices (such as HDMI audio on graphics cards, USB DACs, and motherboard realtek chips) changing numerical indexes (hw:0 vs hw:1) between boots.
- Service Conflicts with alsa-restore: Both
alsa-state.service(daemon mode) andalsa-restore.service(oneshot mode) competing for mixer locks.
Step 1: Inspect Systemd Service Failure Details
Identify the exact error message returned by the ALSA controller:
systemctl status alsa-state.service
journalctl -xeu alsa-state.service
If the error reports No such file or directory or Cannot open /var/lib/alsa/asound.state, the state file is missing. If it reports state daemon already running, duplicate unit files are conflicting.
Step 2: Generate a Fresh ALSA State File
Adjust your audio levels using your preferred mixer and force ALSA to generate a clean, uncorrupted state file:
- Open the ALSA terminal mixer to ensure volumes are unmuted and set appropriately:
(Use the arrow keys to adjust volumes and press M to unmute channels, then press Esc to exit).alsamixer - Store the current sound card states directly to disk:
sudo alsactl store - Verify that the state file was created successfully:
ls -l /var/lib/alsa/asound.state - Ensure the file has proper read/write permissions:
sudo chmod 644 /var/lib/alsa/asound.state sudo chown root:root /var/lib/alsa/asound.state
Step 3: Enable alsa-restore and Mask Conflicting alsa-state
On modern Ubuntu releases, alsa-restore.service is the preferred mechanism because it executes as a clean oneshot unit during boot rather than maintaining a permanent background daemon:
- Disable the legacy state daemon:
sudo systemctl stop alsa-state.service sudo systemctl disable alsa-state.service sudo systemctl mask alsa-state.service - Enable and start the restore service:
sudo systemctl unmask alsa-restore.service sudo systemctl enable alsa-restore.service sudo systemctl restart alsa-restore.service - Check status:
The output should reportsystemctl status alsa-restore.serviceactive (exited)in green text.
Step 4: Lock Sound Card Indexing (If Using Multiple Devices)
If state restoration fails because HDMI audio and motherboard audio swap card numbers on boot, lock card priority in modprobe:
- Edit the sound module configuration file:
sudo nano /etc/modprobe.d/alsa-base.conf - Add priority options to anchor your primary audio controller to index 0:
options snd-hda-intel index=0 model=auto vid=0x8086 - Save and exit (Ctrl + O, then Ctrl + X).
Troubleshooting Reference
| Failure Message | Identified Cause | Remediation Command |
|---|---|---|
| Cannot open /var/lib/alsa/asound.state | State configuration file missing | alsamixer && sudo alsactl store |
| Permission denied writing asound.state | Incorrect directory ownership | sudo chown root:root /var/lib/alsa && chmod 755 |
| alsa-state already active conflict | Daemon competing with oneshot unit | Mask alsa-state.service and enable alsa-restore.service |
| Volume resets to zero every reboot | Missing systemd trigger on shutdown | sudo alsactl store && systemctl enable alsa-restore |
Generating a fresh asound.state file and standardizing on the alsa-restore service permanently eliminates sound card management errors in Ubuntu.