[SLUG] Saving/Restoring System/User Mixer Settings At Boot/Shutdown ...

From: Bryan J. Smith (b.j.smith@ieee.org)
Date: Sat Nov 20 2004 - 21:26:45 EST


This is very easy to do. In fact, some distros (e.g., RHL/FC) even set
this up for you.

In a nutshell, whenever the driver loads (e.g., shutdown or user login),
have it to load the last mixer settings save. Whenever the driver is
unloaded (e.g., shutdown), have it save save those current mixer
settings.

Also note whenever a user makes changes to their mixer, those settings
are also saved to the user mixer settings. It's up to you if you would
like to make the last user's settings the system default or not. I will
discuss this later.

Okay, here are the lines. These lines should work with either ALSA or
OSS, as long as your sound card is aliased as "sound-slot-0" and your
system-wide mixer is in /etc/[.]aumixrc while the user is ~/.aumixrc.

--- Kernel 2.4 (e.g., /etc/modules.conf) ---

pre-remove sound-slot-0 /bin/aumix -f /etc/aumixrc -S
post-install sound-slot-0 /bin/aumix -L

--- Kernel 2.6 (e.g., /etc/modprobe.conf) ---

  remove sound-slot-0 /bin/aumix -f /etc/aumixrc -S && /sbin/modprobe
-r sound-slot-0
  install /sbin/modprobe sound-slot-0 && sound-slot-0 /bin/aumix -L

--- Further discussion ---

Now note the "remove" lines. Those save the _system-wide_ mixer
settings (/etc/[.]aumixrc, depending on your distro) whenever the driver
is unloaded (e.g., init 0/6). If you do _not_ want the last settings to
be saved as "system-wide," then do _not_ include those lines. I.e., if
you have some smart-@$$ user who turns up the sound very loud before he
shuts down. ;->

Otherwise the "install" lines are what load the mixer settings upon
first load. This could be sometime during boot or, more likely, after
the first user logs into X and their KDE, GNOME, etc... mixer comes up.
As noted in the man-page, the user ~/.aumixrc file is tried first (the
user logging into X), and it if doesn't exist, then the system-wide
/etc/[.]aumixrc (depending on your distro) is loaded instead.

-- 
Bryan J. Smith                                    b.j.smith@ieee.org 
-------------------------------------------------------------------- 
Subtotal Cost of Ownership (SCO) for Windows being less than Linux
Total Cost of Ownership (TCO) assumes experts for the former, costly
retraining for the latter, omitted "software assurance" costs in 
compatible desktop OS/apps for the former, no free/legacy reuse for
latter, and no basic security, patch or downtime comparison at all.

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:50:57 EDT