[mythtv-users] ALSA Mixer muting after reboot!

Darrick Hartman ricko73 at yahoo.com
Mon Dec 29 11:49:24 EST 2003


--- K Chaloupka <hopdog at swbell.net> wrote:
> where do you use alsactl? Is it a function??

alsactl is a commandline program that is a part of the
alsa utilities.  Most distros have a script that
executes at startup that recalls the stored settings
from a file.  The command at boot to recall the
settings is 'alsactl restore'  

Here is the script that Slackware uses.  You may be
able to modify this to use with your distro.

Darrick

---------

root at fire:/etc/rc.d# cat rc.alsa
#!/bin/sh
# Load the mixer settings and OSS compatibility for
ALSA.
# (the Advanced Linux Sound Architecture)
 
# A function to load the ALSA mixer settings:
load_alsa_mixer() {
  if [ -r /etc/asound.state ]; then
    echo "Loading ALSA mixer settings: 
/usr/sbin/alsactl restore"
    /usr/sbin/alsactl restore
  else
    echo "ALSA warning:  No mixer settings found in
/etc/asound.state."
    echo "  Sound may be muted.  Use 'alsamixer' to
unmute your sound card,"
    echo "  and then 'alsactl store' to save the
default ALSA mixer settings"
    echo "  to be loaded at boot."
  fi
}
 
# A function to load the ALSA OSS compat modules:
load_alsa_oss_modules() {
  echo "Loading OSS compatibility modules for ALSA."
  modprobe snd-pcm-oss
  modprobe snd-mixer-oss
}
 
# If hotplug or something else has loaded the ALSA
modules, then
# simply load the mixer settings and make sure the OSS
compat
# modules are loaded:
if [ -d /proc/asound ]; then
  load_alsa_mixer
  load_alsa_oss_modules
else
  # If there are ALSA modules defined in
/etc/modules.conf, but
  # ALSA is not yet loaded, then load the modules now:
  DRIVERS=`modprobe -c | grep -E
"^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" |
awk '{ print $3 }'`
  if [ ! "$DRIVERS" = "" ]; then
    echo "Loading ALSA kernel modules."
    for module in $DRIVERS; do
      modprobe $module
    done
  fi
  # If ALSA is now up, then load the mixer settings
and OSS modules:
  if [ -d /proc/asound ]; then
    load_alsa_mixer
    load_alsa_oss_modules
  fi
fi



__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/


More information about the mythtv-users mailing list