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?
Well, I didn't find an actual solution to the problem, but a workaround.
rc.local
alsactl --file ~/.asound.state store
/etc/init.d/shairport-sync
by adding/usr/bin/sudo /usr/sbin/alsactl --file /home/[username]/.asound.state restore
afterdo_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.