Re: Saving device driver state during shutdown

David Woodhouse (
Tue, 03 Aug 1999 16:27:41 +0100 said:
> Just make the driver initialize the device with 0 levels so that it
> cannot make any noise until the proper mixer levels have been loaded
> from userspace. Is this too simple?

That's better than the current situation, but the ideal (IMO) is for the levels
to remain exactly as they were before the driver was loaded.

Consider the following case, which is quite common where people feed their
music through the computer to the amp:
1. Switch on CD player.
2. Set sound levels.
3. Exit mixer program.
4. Sound module auto-unloads.
5. Something opens /dev/audio. Sound module reloads.
--> Mixer settings are reset, however briefly.

We shouldn't see even a momentary glitch in the mixer levels when the sound
module is reloaded. Likewise for warm boots.

This shouldn't all be done in kernel-space, but by passing the initial mixer
levels as arguments to the module, and providing some way of getting them back
to user-space before unloading the module, we should be able to manage it quite

The former is fairly simple. The latter involves some thought - the preremove
scripts don't get executed for auto-cleaned modules, and having a daemon to
periodically record the settings will just mean that the module _never_ gets
unloaded, because it's never idle. Perhaps a printk just before unloading, or
perhaps the module itself can exec() a process to grab the levels.

---- ---- ----
David Woodhouse Office: (+44) 1223 810302
Project Leader, Process Information Systems Mobile: (+44) 976 658355
Axiom (Cambridge) Ltd., Swaffham Bulbeck, Cambridge, CB5 0NA, UK.
finger for PGP key.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at