summaryrefslogtreecommitdiffstats
path: root/source/ap/alsa-utils
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/alsa-utils')
-rwxr-xr-xsource/ap/alsa-utils/alsa-utils.SlackBuild6
-rw-r--r--source/ap/alsa-utils/doinst.sh21
-rw-r--r--source/ap/alsa-utils/rc.alsa30
-rw-r--r--source/ap/alsa-utils/rc.alsa-oss24
4 files changed, 60 insertions, 21 deletions
diff --git a/source/ap/alsa-utils/alsa-utils.SlackBuild b/source/ap/alsa-utils/alsa-utils.SlackBuild
index 3e642d084..2540cc685 100755
--- a/source/ap/alsa-utils/alsa-utils.SlackBuild
+++ b/source/ap/alsa-utils/alsa-utils.SlackBuild
@@ -85,8 +85,10 @@ make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG
mkdir -p $PKG/etc/rc.d
-zcat $CWD/rc.alsa.gz > $PKG/etc/rc.d/rc.alsa
-chmod 0755 $PKG/etc/rc.d/rc.alsa
+zcat $CWD/rc.alsa.gz > $PKG/etc/rc.d/rc.alsa.new
+chmod 0755 $PKG/etc/rc.d/rc.alsa.new
+zcat $CWD/rc.alsa-oss.gz > $PKG/etc/rc.d/rc.alsa-oss.new
+chmod 0644 $PKG/etc/rc.d/rc.alsa-oss.new
find $PKG | xargs file | grep -e "executable" -e "shared object" \
| grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
diff --git a/source/ap/alsa-utils/doinst.sh b/source/ap/alsa-utils/doinst.sh
index 0ee741506..8a9b28787 100644
--- a/source/ap/alsa-utils/doinst.sh
+++ b/source/ap/alsa-utils/doinst.sh
@@ -4,3 +4,24 @@ fi
# Better a dangling symlink than for nobody to know where this went:
rm -f etc/asound.state
( cd etc && ln -sf ../var/lib/alsa/asound.state . )
+
+# Duplicate permissions from any existing rc scripts:
+if [ -e etc/rc.d/rc.alsa ]; then
+ if [ -x etc/rc.d/rc.alsa ]; then
+ chmod 755 etc/rc.d/rc.alsa.new
+ else
+ chmod 644 etc/rc.d/rc.alsa.new
+ fi
+fi
+if [ -e etc/rc.d/rc.alsa-oss ]; then
+ if [ -x etc/rc.d/rc.alsa-oss ]; then
+ chmod 755 etc/rc.d/rc.alsa-oss.new
+ else
+ chmod 644 etc/rc.d/rc.alsa-oss.new
+ fi
+fi
+
+# Move the scripts into place:
+mv etc/rc.d/rc.alsa.new etc/rc.d/rc.alsa
+mv etc/rc.d/rc.alsa-oss.new etc/rc.d/rc.alsa-oss
+
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
+