This commit is contained in:
Stephan Raue
2009-03-31 00:33:05 +02:00
parent 620e040bae
commit d756ad8551
20 changed files with 6130 additions and 20 deletions
+115
View File
@@ -0,0 +1,115 @@
#!/bin/sh
#
# setup alsa (especially the mixer config)
#
# runlevels: geexbox, debug, configure
echo "### Setting up sound card ###"
# include audio configuration file
. /etc/audio
[ ! -f /etc/asound.conf ] && echo "" > /etc/asound.conf
mixer() {
parm=${3:-on}
amixer -c $ALSA_CARD sset "$1" "$2" $parm >/dev/null 2>&1
amixer -c $ALSA_CARD sset "$1" $parm >/dev/null 2>&1
}
# set alsa channel mode (6ch, 4ch, 2ch)
mixer 'Channel Mode' "${CHANNELS}ch"
# set common mixer params
mixer Master 100%
mixer Front 100%
mixer PCM 100%
mixer Synth 100%
# mute CD, since using digital audio instead
mixer CD 0% mute
# Only unmute Line and Aux if they are possibly used.
if [ -e /var/use_dxr3 -o -e /var/tvcard -o -e /var/dvbcard -o -e /var/digimatrix ]; then
mixer Line 100%
mixer Aux 100%
else
mixer Line 0% mute
mixer Aux 0% mute
fi
# mute mic
mixer Mic 0% mute
# ESS 1969 chipset has 2 PCM channels
mixer PCM,1 100%
# Trident/YMFPCI/emu10k1
mixer Wave 100%
mixer Music 100%
mixer AC97 100%
mixer Surround 100%
mixer 'Surround Digital' 100%
mixer 'Wave Surround' 100%
if [ "$CHANNELS" = 6 ]; then
mixer 'Duplicate Front' 0% off
else
mixer 'Duplicate Front' 100%
fi
mixer 'Sigmatel 4-Speaker Stereo' 100%
# CS4237B chipset:
mixer 'Master Digital' 100%
# DRC
mixer 'Dynamic Range Compression' 100%
# Envy24 chips with analog outs
mixer DAC 100%
mixer DAC,0 100%
mixer DAC,1 100%
# some notebooks use headphone instead of master
mixer Headphone 100%
mixer 'Internal Speaker' 75%
mixer Playback 100%
mixer Center 100%
mixer LFE 90%
mixer Center/LFE 90%
# Required for newer Via hardware
mixer 'VIA DXS,0' 100%
mixer 'VIA DXS,1' 100%
mixer 'VIA DXS,2' 100%
mixer 'VIA DXS,3' 100%
# Intel P4P800-MX (Ubuntu bug #5813)
mixer 'Master Playback Switch' on
# Required at least for Via 823x hardware on DFI K8M800-MLVF Mobo
mixer 'IEC958 Capture Monitor' 100%
# Required on some notebooks with ICH4:
mixer 'Headphone Jack Sense' 100%
mixer 'Line Jack Sense' 100%
# Required on some Vaio notebooks (B3XP):
mixer 'External Amplifier' 100%
# Required for either Analog or Digital output
mixer 'SB Live Analog/Digital Output Jack' $SBL_AUDIGY
mixer 'Audigy Analog/Digital Output Jack' $SBL_AUDIGY
# set SPDIF mixer params
if [ "$SOUNDCARD_MODE" = SPDIF ]; then
mixer 'IEC958' 100% on
mixer 'IEC958 Output' 100%
mixer 'IEC958 Playback AC97-SPSA' $AC97_SPSA
mixer 'IEC958 Coaxial' 100%
mixer 'IEC958 LiveDrive' 100%
mixer 'IEC958 Optical Raw' 100%
mixer 'SPDIF Out' 100%
mixer 'SPDIF Front' 100%
mixer 'SPDIF Rear' 100%
mixer 'SPDIF Center/LFE' 100%
mixer 'Master Digital' 100%
else
mixer 'SPDIF Out' 100%
mixer 'Analog Front' 100%
mixer 'Analog Rear' 100%
mixer 'Analog Center/LFE' 100%
fi
exit 0
@@ -0,0 +1,13 @@
# Give the audio group ownership of sound devices
SUBSYSTEM=="sound", GROUP="audio"
SUBSYSTEM=="snd", GROUP="audio"
# ALSA Devices
# When a sound device is detected, restore the volume settings
KERNEL=="controlC[0-9]*", NAME="snd/%k", ACTION=="add", RUN+="/usr/sbin/alsactl restore %n"
KERNEL=="hw[CD0-9]*", NAME="snd/%k"
KERNEL=="pcm[CD0-9cp]*", NAME="snd/%k"
KERNEL=="midiC[D0-9]*", NAME="snd/%k"
KERNEL=="timer", NAME="snd/%k"
KERNEL=="seq", NAME="snd/%k"
@@ -0,0 +1,13 @@
# Give the audio group ownership of sound devices
SUBSYSTEM=="sound", GROUP="audio"
SUBSYSTEM=="snd", GROUP="audio"
# ALSA Devices
# When a sound device is detected, restore the volume settings
KERNEL=="controlC[0-9]*", NAME="snd/%k", RUN="/etc/init.d/40_alsa"
KERNEL=="hw[CD0-9]*", NAME="snd/%k"
KERNEL=="pcm[CD0-9cp]*", NAME="snd/%k"
KERNEL=="midiC[D0-9]*", NAME="snd/%k"
KERNEL=="timer", NAME="snd/%k"
KERNEL=="seq", NAME="snd/%k"
+216
View File
@@ -0,0 +1,216 @@
state.VT82xx {
control.1 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
comment.dbmin -4025
comment.dbmax 1400
iface MIXER
name 'Master Front Playback Volume'
value.0 29
value.1 29
}
control.2 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 2
iface MIXER
name 'Master Front Playback Switch'
value.0 true
value.1 true
}
control.3 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 27'
comment.dbmin -4725
comment.dbmax 0
iface MIXER
name 'Front Playback Volume'
value.0 25
value.1 25
}
control.4 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 2
iface MIXER
name 'Front Playback Switch'
value.0 true
value.1 true
}
control.5 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
comment.dbmin -4025
comment.dbmax 1400
iface MIXER
name 'Mic Playback Volume'
value.0 0
value.1 0
}
control.6 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 2
iface MIXER
name 'Mic Playback Switch'
value.0 false
value.1 false
}
control.7 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
comment.dbmin -4025
comment.dbmax 1400
iface MIXER
name 'Front Mic Playback Volume'
value.0 0
value.1 0
}
control.8 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 2
iface MIXER
name 'Front Mic Playback Switch'
value.0 true
value.1 true
}
control.9 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
comment.dbmin -4025
comment.dbmax 1400
iface MIXER
name 'Line Playback Volume'
value.0 29
value.1 29
}
control.10 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 2
iface MIXER
name 'Line Playback Switch'
value.0 false
value.1 false
}
control.11 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 20'
comment.dbmin 0
comment.dbmax 3500
iface MIXER
name 'Capture Volume'
value.0 0
value.1 0
}
control.12 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 2
iface MIXER
name 'Capture Switch'
value.0 true
value.1 true
}
control.13 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 20'
comment.dbmin 0
comment.dbmax 3500
iface MIXER
name 'Capture Volume'
index 1
value.0 0
value.1 0
}
control.14 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 2
iface MIXER
name 'Capture Switch'
index 1
value.0 true
value.1 true
}
control.15 {
comment.access 'read write'
comment.type ENUMERATED
comment.count 1
comment.item.0 'Stereo Mixer'
comment.item.1 Mic
comment.item.2 'Front Mic'
comment.item.3 Line
iface MIXER
name 'Input Source'
value 'Stereo Mixer'
}
control.16 {
comment.access read
comment.type IEC958
comment.count 1
iface MIXER
name 'IEC958 Playback Con Mask'
value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
}
control.17 {
comment.access read
comment.type IEC958
comment.count 1
iface MIXER
name 'IEC958 Playback Pro Mask'
value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
}
control.18 {
comment.access 'read write'
comment.type IEC958
comment.count 1
iface MIXER
name 'IEC958 Playback Default'
value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
}
control.19 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'IEC958 Playback Switch'
value false
}
control.20 {
comment.access 'read write'
comment.type BOOLEAN
comment.count 1
iface MIXER
name 'IEC958 Default PCM Playback Switch'
value true
}
control.21 {
comment.access 'read write user'
comment.type INTEGER
comment.count 2
comment.range '0 - 255'
comment.tlv '0000000100000008ffffec1400000014'
comment.dbmin -5100
comment.dbmax 0
iface MIXER
name 'PCM Playback Volume'
value.0 255
value.1 255
}
}
+11 -12
View File
@@ -6,8 +6,8 @@ $SCRIPTS/install alsa-lib
PKG_DIR=`find $PACKAGES -type d -name $1`
mkdir -p $INSTALL/usr/bin
cp $BUILD/$1*/amixer/amixer $INSTALL/usr/bin
#mkdir -p $INSTALL/usr/bin
#cp $BUILD/$1*/amixer/amixer $INSTALL/usr/bin
mkdir -p $INSTALL/usr/sbin
cp $BUILD/$1*/alsactl/alsactl $INSTALL/usr/sbin
@@ -19,25 +19,24 @@ mkdir -p $INSTALL/etc/udev/rules.d
cp $PKG_DIR/config/rules.d/* $INSTALL/etc/udev/rules.d
mkdir -p $INSTALL/etc
touch $INSTALL/etc/asound.state
cp cp $PKG_DIR/config/asound.state $INSTALL/etc
if [ "$DEVTOOLS" = yes ]; then
cp $BUILD/$1*/alsaconf/alsaconf $INSTALL/usr/bin
chmod +x $INSTALL/usr/bin/alsaconf
# cp $BUILD/$1*/alsaconf/alsaconf $INSTALL/usr/bin
# chmod +x $INSTALL/usr/bin/alsaconf
cp $BUILD/$1*/alsamixer/alsamixer $INSTALL/usr/bin
# cp $BUILD/$1*/alsamixer/alsamixer $INSTALL/usr/bin
cp $BUILD/$1*/aplay/aplay $INSTALL/usr/bin
ln -sf /usr/bin/aplay $INSTALL/usr/bin/arecord
cp $BUILD/$1*/iecset/iecset $INSTALL/usr/bin
cp $BUILD/$1*/speaker-test/speaker-test $INSTALL/usr/bin
mkdir -p $INSTALL/usr/share/alsa/speaker-test
cp $BUILD/$1*/speaker-test/samples/*.csv $INSTALL/usr/share/alsa/speaker-test
mkdir -p $INSTALL/usr/share/sounds/alsa
cp $BUILD/$1*/speaker-test/samples/*.wav $INSTALL/usr/share/sounds/alsa
# cp $BUILD/$1*/speaker-test/speaker-test $INSTALL/usr/bin
# mkdir -p $INSTALL/usr/share/alsa/speaker-test
# cp $BUILD/$1*/speaker-test/samples/*.csv $INSTALL/usr/share/alsa/speaker-test
# mkdir -p $INSTALL/usr/share/sounds/alsa
# cp $BUILD/$1*/speaker-test/samples/*.wav $INSTALL/usr/share/sounds/alsa
fi
exit 0
+1 -1
View File
@@ -9,4 +9,4 @@ $SCRIPTS/install alsa-utils
mkdir -p $INSTALL/etc/modprobe.d
cp $PKG_DIR/config/alsa-base $INSTALL/etc/modprobe.d
#cp $PKG_DIR/config/audio $INSTALL/etc
cp $PKG_DIR/config/audio $INSTALL/etc