diff options
Diffstat (limited to '')
-rw-r--r-- | source/ap/alsa-utils/rc.alsa | 30 | ||||
-rw-r--r-- | source/ap/alsa-utils/rc.alsa-oss | 24 |
2 files changed, 35 insertions, 19 deletions
diff --git a/source/ap/alsa-utils/rc.alsa b/source/ap/alsa-utils/rc.alsa index 2a984a512..077966da1 100644 --- a/source/ap/alsa-utils/rc.alsa +++ b/source/ap/alsa-utils/rc.alsa @@ -1,5 +1,5 @@ #!/bin/sh -# Load the mixer settings and OSS compatibility for ALSA. +# Load the mixer settings and OSS compatibility (if enabled) for ALSA. # (the Advanced Linux Sound Architecture) # A function to load the ALSA mixer settings: @@ -13,7 +13,7 @@ load_alsa_mixer() { if [ ! -r /var/lib/alsa/no.asound.state ]; then echo "Setting default ALSA mixer settings." # set default mixer volumes for ALSA - # Taken from the alsaconfig script. + # Taken from the alsaconf script. amixer -s -q <<EOF set Master 75% unmute set Master -12dB @@ -59,23 +59,13 @@ EOF fi } -# A function to load the ALSA OSS compat modules: -load_alsa_oss_modules() { - if modprobe -c | tr _ - | grep -wq snd-pcm-oss ; then - if ! cat /proc/modules | tr _ - | grep -wq snd-pcm-oss ; then - echo "Loading OSS compatibility modules for ALSA." - modprobe snd-pcm-oss - modprobe snd-seq-oss - modprobe snd-mixer-oss - fi - fi -} - -# If hotplug or something else has loaded the ALSA modules, then +# If udev or something else has loaded the ALSA modules, then # simply load the mixer settings and make sure the OSS compat -# modules are loaded: +# modules are loaded (if enabled): if [ -d /proc/asound ]; then - load_alsa_oss_modules + if [ -x /etc/rc.d/rc.alsa-oss ]; then + sh /etc/rc.d/rc.alsa-oss + fi load_alsa_mixer else # If there are ALSA modules defined in /etc/modprobe.d/*, but @@ -87,9 +77,11 @@ else modprobe $module done fi - # If ALSA is now up, then load the mixer settings and OSS modules: + # If ALSA is now up, then load the mixer settings and OSS modules (if enabled): if [ -d /proc/asound ]; then - load_alsa_oss_modules + if [ -x /etc/rc.d/rc.alsa-oss ]; then + sh /etc/rc.d/rc.alsa-oss + fi load_alsa_mixer fi fi diff --git a/source/ap/alsa-utils/rc.alsa-oss b/source/ap/alsa-utils/rc.alsa-oss new file mode 100644 index 000000000..cc27b7624 --- /dev/null +++ b/source/ap/alsa-utils/rc.alsa-oss @@ -0,0 +1,24 @@ +#!/bin/sh +# Load the ALSA OSS kernel modules to support OSS applications. +# To use this, set this script as executable (chmod 755 rc.alsa-oss) +# and it will be run from the main rc.alsa script. Unless you know +# that something requires OSS support, it is better to leave this +# script disabled. Some applications will try OSS first even though +# they also support ALSA, and will block other applications from +# using audio I/O. +# +# Many programs that use OSS can be run using the aoss wrapper and +# will then use ALSA in a non-blocking way (and will not require +# loading these kernel modules). Consider trying that before enabling +# these modules. (See "man aoss") + +if modprobe -c | tr _ - | grep -wq snd-pcm-oss ; then + if ! cat /proc/modules | tr _ - | grep -wq snd-pcm-oss ; then + echo "Loading OSS compatibility modules for ALSA." + # Use -b to enable blacklisting these modules: + modprobe -q -b snd-pcm-oss + modprobe -q -b snd-seq-oss + modprobe -q -b snd-mixer-oss + fi +fi + |