Problem with sound driver as a module

Mike Bremford (Mike.Bremford@mail.bl.uk)
Mon, 23 Sep 1996 15:11:05 +0100


Hi all.

This is a bit of a nitpick really, but there is a minor problem with
the Sound card driver when loaded as a module.

Every time the driver is loaded, the volume levels on the mixer are
reset. OK, its not the end of the world, but the default levels as set
in the kernel source are loud enough to scare the shit out of me when
I don't expect it - I almost had a heart attack the other day when the
computer suddenly screamed "YOU HAVE NEW MAIL!!" at me...

Obviously storing the mixer levels in the module code is not on, since
the code gets unloaded when the module autocleaner does its thing. The
only way around this I can think of (other than not modularising sound
or modifying the kernel source to initialise with acceptable values -
which is cheating really...) is to store the mixer levels in a file
somewhere - maybe /etc/mixer0-levels or something. I know its not very
pretty... Although it does mean everytime you reboot your machine the
mixer settings would be the same.

Another possibility is not setting the values at all. I don't know a
thing about soundcards, but AFAIK that would mean the card starts up
with random mixer settings on boot, which could easily be set with a
command in /etc/rc.d/rc.local... and every time the module is loaded
the mixer settings are left untouched.

Either way, I feel something should be done, even if it is just a note
in the documentation saying ***Watch out for this***. As it is it's a
bit of a trap for new players, as the implication when using modules
is that everything acts the same as a module as it does if its
compiled in.

If there is a solution which is within my abilities to code, I'd be
happy to write a patch, although the kernels not really my thing...

Have a nice day.


Cheers... Mike