LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Changing volume/mute status permanently? (https://www.linuxquestions.org/questions/linux-newbie-8/changing-volume-mute-status-permanently-463870/)

Krelian 07-13-2006 10:49 PM

Changing volume/mute status permanently?
 
Distribution: Mandriva 2006
Sound card: Aureal vortex au8820 (vortex 1)

When I turn on my computer, I get no sound in Linux. However, if I run alsamixer and unmute the "Master" and "PCM" controls, then I get sound. However, the changes to these are only temporary; they disappear if I turn off the computer. How can I change these sound settings permanently?

Thanks.

zhangmaike 07-13-2006 11:50 PM

Run, as root:
Code:

alsactl store
To load the settings, run:
Code:

alsactl restore
but chances are that is run automatically with each boot. If it isn't, making it run automatically with every boot isn't difficult.

Krelian 07-14-2006 07:43 PM

Thanks, that does work, except it doesn't appear to run "alsactl restore" on startup. How can I make this happen?

Thanks again for your help.

masonm 07-14-2006 07:46 PM

If your running KDE use the KDE mixer (volume control), edit the settings to restore on startup.

FreeDoughnut 07-14-2006 11:09 PM

Edit one of the init scripts.

Krelian 07-15-2006 10:54 AM

Can you give me an example of "one of these init scripts" and where they are located?

FreeDoughnut 07-18-2006 07:41 PM

Put
Quote:

#!/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() {
if ! cat /proc/modules | tr _ - | grep -wq snd-pcm-oss ; then
echo "Loading OSS compatibility modules for ALSA."
modprobe snd-pcm-oss
modprobe snd-mixer-oss
modprobe snd-seq-oss
fi
}

# 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
in /etc/rc.d/rc.alsa and make it executable.


All times are GMT -5. The time now is 11:15 AM.