5

I have a problem with alsa settings not surviving reboot. I have a headless server running 15.04, using sound for shairport-sync. When I reboot, I get messy alsa settings (volumes). Trying to restore previous configuration gives me strange values. Restoring as super-user works; Restoring as normal user doesn't, unless I specify a file, then it works.

$ alsactl restore
alsactl: state_lock:125: file /var/lib/alsa/asound.state lock error: File exists
alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: File exists
Found hardware: "HDA-Intel" "Realtek ALC892" "HDA:10ec0892,1849d892,00100302" "0x1849" "0xd892"
Hardware is initialized using a generic method

$ sudo alsactl restore
[works]

$ alsactl --file ~/asound.state restore
[works too]

/var/lib/alsa/asound.state and ~/asound.state should be identical.

Also, I just cannot get restoring after rebooting to work; Currently using rc.local, is that not good?

3
  • Apparently, your user (or whoever rc.local is executed as) has no root privileges.
    – CL.
    Jul 14, 2015 at 13:51
  • But all other rc.local-commands work flawlessly…
    – senthor
    Jul 14, 2015 at 13:56
  • Also, I can mute in alsamixer by pressing the "m"-key; But I can't unmute again. Toggles turn back, but no sound returns. I have to unmute via gui in order to get sound back to work.
    – senthor
    Jul 15, 2015 at 9:35

1 Answer 1

2

Well, I didn't find an actual solution to the problem, but a workaround.

  1. Strip the part from rc.local
  2. Save alsa-config to file: alsactl --file ~/.asound.state store
  3. Edit /etc/init.d/shairport-sync by adding /usr/bin/sudo /usr/sbin/alsactl --file /home/[username]/.asound.state restore after do_start() {

Now, everytime shairport-sync is started, volumes will be reset, and since it get's started on boot my goal is achieved. Still, I have no explanation for this strange behaviour.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .