Radix cross Linux

The main Radix cross Linux repository contains the build scripts of packages, which have the most complete and common functionality for desktop machines

452 Commits   2 Branches   1 Tag
     5         kx #!/bin/sh
     5         kx # Load the mixer settings and OSS compatibility (if enabled) for ALSA.
     5         kx # (the Advanced Linux Sound Architecture)
     5         kx 
     5         kx # A function to load the ALSA mixer settings:
     5         kx load_alsa_mixer() {
     5         kx   if [ -r /var/lib/alsa/asound.state ]; then
     5         kx     echo "Loading ALSA mixer settings:  /usr/sbin/alsactl restore"
     5         kx     /usr/sbin/alsactl restore
     5         kx   else
     5         kx     # It's possible a user might not want to set a default sound state.
     5         kx     # In that case, do this:  touch /var/lib/alsa/no.asound.state
     5         kx     if [ ! -r /var/lib/alsa/no.asound.state ]; then
     5         kx       echo "Setting default ALSA mixer settings."
     5         kx       # set default mixer volumes for ALSA
     5         kx       # Taken from the alsaconf script.
     5         kx       amixer -s -q <<EOF
     5         kx set Master 75% unmute
     5         kx set Master -12dB
     5         kx set 'Master Mono' 75% unmute
     5         kx set 'Master Mono' -12dB
     5         kx set Front 75% unmute
     5         kx set Front -12dB
     5         kx set PCM 90% unmute
     5         kx set PCM 0dB
     5         kx mixer Synth 90% unmute
     5         kx mixer Synth 0dB
     5         kx mixer CD 90% unmute
     5         kx mixer CD 0dB
     5         kx # mute mic
     5         kx set Mic 0% mute
     5         kx # ESS 1969 chipset has 2 PCM channels
     5         kx set PCM,1 90% unmute
     5         kx set PCM,1 0dB
     5         kx # Trident/YMFPCI/emu10k1
     5         kx set Wave 100% unmute
     5         kx set Music 100% unmute
     5         kx set AC97 100% unmute
     5         kx # CS4237B chipset:
     5         kx set 'Master Digital' 75% unmute
     5         kx # Envy24 chips with analog outs
     5         kx set DAC 90% unmute
     5         kx set DAC -12dB
     5         kx set DAC,0 90% unmute
     5         kx set DAC,0 -12dB
     5         kx set DAC,1 90% unmute
     5         kx set DAC,1 -12dB
     5         kx # some notebooks use headphone instead of master
     5         kx set Headphone 75% unmute
     5         kx set Headphone -12dB
     5         kx set Playback 100% unmute
     5         kx # turn off digital switches
     5         kx set "SB Live Analog/Digital Output Jack" off
     5         kx set "Audigy Analog/Digital Output Jack" off
     5         kx EOF
     5         kx       echo "Storing default ALSA mixer settings:  /usr/sbin/alsactl store"
     5         kx       /usr/sbin/alsactl store
     5         kx     fi
     5         kx   fi
     5         kx }
     5         kx 
     5         kx # If udev or something else has loaded the ALSA modules, then
     5         kx # simply load the mixer settings and make sure the OSS compat
     5         kx # modules are loaded (if enabled):
     5         kx if [ -d /proc/asound ]; then
     5         kx   if [ -x /etc/rc.d/rc.alsa-oss ]; then
     5         kx     sh /etc/rc.d/rc.alsa-oss
     5         kx   fi
     5         kx   load_alsa_mixer
     5         kx else
     5         kx   # If there are ALSA modules defined in /etc/modprobe.d/*, but
     5         kx   # ALSA is not yet loaded, then load the modules now:
     5         kx   DRIVERS=$(modprobe -c | grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | tr -s "[[:blank:]]" " " | cut -d " " -f 3)
     5         kx   if [ ! "$DRIVERS" = "" ]; then
     5         kx     echo "Loading ALSA kernel modules."
     5         kx     for module in $DRIVERS; do
     5         kx       modprobe $module
     5         kx     done
     5         kx   fi
     5         kx   # If ALSA is now up, then load the mixer settings and OSS modules (if enabled):
     5         kx   if [ -d /proc/asound ]; then
     5         kx     if [ -x /etc/rc.d/rc.alsa-oss ]; then
     5         kx       sh /etc/rc.d/rc.alsa-oss
     5         kx     fi
     5         kx     load_alsa_mixer
     5         kx   fi
     5         kx fi