Sound settings not remembered after reboot

This was something dumb that I did late in 2011. Thanks to broomdodger for bringing this to my attention. Fixed.

if you go here and do an anonymous login, you can download the latest /etc/init.d/10alsa:
http://bkhome.org/fossil/woof2.cgi/finfo?name=woof-code/rootfs-skeleton/etc/init.d/10alsa


Posted on 22 Feb 2012, 10:57


Comments:

Posted on 23 Feb 2012, 9:02 by shinobar
testing asound.state
The issue is not there.
The file /etc/asound.state should be created at initial only when the audio setup succeeded, and be checked before saving. Otherwise, asound.state is always broken once audio setup failed and no chance to recover unless manually run the alsaconf.
From line 60-
set Playback 100% unmute
set "SB Live Analog/Digital Output Jack" off
set "Audigy Analog/Digital Output Jack" off
set Speaker 75 % unmute
EOF
[ $? -eq 0 ] && alsactl -f /etc/asound.state store # shinobar
else
alsactl -f /etc/asound.state restore #from /etc/asound.state.
fi



Posted on 23 Feb 2012, 9:04 by shinobar
Full diff
# diff 10alsa-barry 10alsa-shinobar

9c9
< #111229 add test file /etc/asound.state exists.
---
> # 7dec2011 shinobar: wait loading modules, conditional saving asound.state (merged form the Quickset Wary, wary-511-01q)
11d10
< #120222 revert 111229.
17a17,23
> # shinobar: wait sound drivers loaded
> GOOD=""
> for I in $(seq 8); do
> [ "`lsmod | grep '^snd_'`" != "" ] && GOOD="yes" && break
> sleep 1
> done
> [ "$GOOD" != "" ] || exit
23,26c29,37
< for I in $(seq 4); do #110111 shinobar: for reliable sound detection on HP Compac nc4010.
< sleep 0.5 #110113 reduce 1 to 0.5. 110216 move up.
< [ -c /dev/mixer ] && break #note, /dev/mixer is deleted in /etc/rc.d/rc.sysinit.
< done
---
> #110111 shinobar: for reliable sound detection on HP Compac nc4010.
> #110113 reduce 1 to 0.5. 110216 move up.
> GOOD=""
> for I in $(seq 8); do
> [ -c /dev/mixer ] && GOOD="yes" && break
> sleep 0.5
> done
> [ "$GOOD" != "" ] || exit
> touch /tmp/rc_d_rc_services_alsa_ok # shinobar: delayedrun may use it (precaution/compatibility)
65c76
<
---
> [ $? -eq 0 ] && alsactl -f /etc/asound.state store # shinobar
72c83
< alsactl -f /etc/asound.state store #saves to /etc/asound.state. 111229 add test file exists. 120222 revert.
---
> [ -f /etc/asound.state ] && alsactl -f /etc/asound.state store #saves to /etc/asound.state. # shinobar




Posted on 23 Feb 2012, 9:34 by BarryK
Re testing asound.state
shinobar,
Yes, much better solution! I have put that into Woof.



Posted on 23 Feb 2012, 9:39 by BarryK
Extra space?
This line was provided by pemasu:

set Speaker 75 % unmute

But, shouldn't it be like the others:

set Speaker 75% unmute