[Pkg-alsa-devel] Restoring mixer levels via module loader

Thomas Hood jdthood@aglu.demon.nl
Fri, 03 Sep 2004 22:40:24 +0200


(revised from a message I sent to some people earlier)

The changelog in CVS says:

    - Sleep for five seconds before running alsactl restore

This change will not really fix bug #268221.  Furthermore, ALSA users
will not appreciate having their boot times increased by five seconds.

The solution I submitted in #268221 is to invoke "alsactl restore"
from the module loader after it finishes installing the driver for the
sound card.  Doing this is necessary so that _any_ _time_ the modules
get loaded the mixer settings are restored.  (Modules can get loaded
at times other than when the initscript gets run.)  Doing this is
also sufficient to solve problem #268221.  It works.

When I worked on the initscript I left the five second delay there in
case it is actually helping some users to avoid lost races.  However,
I think we should move to the module-loader-does-the-restore solution
ASAP.  Then we can remove the "alsactl restore" from the initscript.
I am not sure how best to implement it in the package, however.  In
my own /etc/modprobe.d/ directory I added the following "alsa_LOCAL"
file:

install snd_cs46xx /sbin/modprobe --ignore-install snd_cs46xx && /usr/sbin/alsactl restore

This works for my case.  We could include lines like these for each of
the sound card drivers whose loading allows a "alsactl restore"
to be done.  Or perhaps we could make alsaconf write the appropirate
line(s).  What do you think?
--
Thomas