File set_default_volume of Package alsa.import4880

#!/bin/sh
#
# set default volumes for playback on ALSA
#
# set_default_mixer [-f] [card#]
#
# written by Takashi Iwai <tiwai@suse.de>
#

if [ -f /var/lib/alsa/asound.state -a x$1 != x-f ]; then
  /usr/sbin/alsactl restore >/dev/null 2>&1
  exit 0
fi

if [ x$1 = x-f ]; then
    shift
fi

if [ -n "$1" ]; then
    case "$1" in
	[0-9]*)
	    card="-D hw:$1";;
	*)
	    card="-D $1";;
    esac
else
    card="-D hw"
fi

amixer -q -s $card <<EOF
set Master 75% unmute
set Master -12dB
set 'Master Mono' 75% unmute
set 'Master Mono' -12dB
set Front 75% unmute
set Front 0dB
set PCM 90% unmute
set PCM 0dB
set Synth 90% unmute
set Synth 0dB
set Speaker 90% unmute
set Speaker 0dB
set CD 90% unmute
set CD 0dB
# mute mic
set Mic 0% mute
# ESS 1969 chipset has 2 PCM channels
set PCM,1 90% unmute
set PCM,1 0dB
# Trident/YMFPCI/emu10k1
set Wave 100% unmute
set Music 100% unmute
set AC97 100% unmute
# CS4237B chipset:
set 'Master Digital' 75% unmute
# Envy24 chips with analog outs
set DAC 90% unmute
set DAC -12dB
set DAC,0 90% unmute
set DAC,0 -12dB
set DAC,1 90% unmute
set DAC,1 -12dB
# some notebooks use headphone instead of master
set Headphone 75% unmute
set Headphone -12dB
set Playback 100% unmute
# turn off digital switches
set "SB Live Analog/Digital Output Jack" off
set "Audigy Analog/Digital Output Jack" off
# VIA82xx
set "VIX DXS" 100%
set "VIX DXS",1 100%
set "VIX DXS",2 100%
set "VIX DXS",3 100%
# capture
set Capture 12dB cap
EOF

exit 0