Re: Saving device driver state during shutdown

Joe Cotellese (joec@ensoniq.com)
Tue, 3 Aug 1999 14:06:34 -0400


> Not quite.
>
> On bootup, the system is fairly busy, and there can be a large delay between
> initialising the kernel driver, and reloading the mixer levels from user-space.
>
> Even with sound drivers as loadable modules, with a post-install script to fix
> the levels, this has been known to take a few seconds - long enough to wake the
> household at 3am when the module gets reloaded because something tries to make
> a sound, and the default state of the line input is 'bloody loud' :)
>

Agreed.

> While kerneld was still capable of storing persistent data for modules, I
> made the SB driver save and restore mixer settings on load/unload. When it
> first initialised the hardware, the previous mixer levels were restored - at
> no time did it jump to some arbitrarily-chosen 'default' levels.
>

This was the solution I was thinking about. It seems to me that the drivers
should be responsible for saving the hardware persistance. Forgetting the mixer
state for a second, saving off hardware register state is a requirement for
some power managment schemes.

I don't know if this necessarily needs to be built into the core kernel
services. In fact I would argue that the kernel shouldn't be polluted with
state management. However, it seems that if devices are going to need to save
state then some module should exist to provide a common mechansim.

> Since the death of kerneld, I haven't yet come up with a good solution for
> this - perhaps it should be possible to pass the required levels on the
> command line, or as an argument to the module?
>

This brings up another point. I want to save state as a means of getting away
from passing command line parameters. This is a scary prospect for the new
Linux user.

> One thing with which I experimented was reading the current levels back from
> the hardware - on cards which support it, that's quite a nice solution.

Some audio devices have strange power up mixer settings. This might not always
work.

-- 
/*******************************
Joe Cotellese  Software Engineer
Creative Labs, Malvern
610 647 3930(p)  610 647 8908(f)
215 868 0986(m) joec@ensoniq.com
*******************************/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/