Accepting request 126632 from multimedia:libs

- Use a special modprobe config for loading OSS and sequencer
  modules automatically (bnc#768361,bnc#768352,bnc#757484,
  bnc#767738)
- Remove the automatic module loading part from alsasound init
  script since modprobe does it now
- Set LOAD_SEQUENCER=no and LOAD_OSS_EMUL_MODULES=no as default;
  these were already disabled on 12.1 with systemd.
  This is only for new installations.  Users upgrading from old
  distros aren't affected. (forwarded request 126580 from tiwai)

OBS-URL: https://build.opensuse.org/request/show/126632
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/alsa?expand=0&rev=123
This commit is contained in:
Stephan Kulow 2012-07-01 18:58:49 +00:00 committed by Git OBS Bridge
commit 3ffdeeff9b
6 changed files with 65 additions and 32 deletions

3
50-alsa.conf Normal file
View File

@ -0,0 +1,3 @@
install snd /sbin/install-snd-module snd $CMDLINE_OPTS
install snd-pcm /sbin/install-snd-module snd-pcm $CMDLINE_OPTS
install snd-seq /sbin/install-snd-module snd-seq $CMDLINE_OPTS

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Thu Jun 28 17:04:59 CEST 2012 - tiwai@suse.de
- Use a special modprobe config for loading OSS and sequencer
modules automatically (bnc#768361,bnc#768352,bnc#757484,
bnc#767738)
- Remove the automatic module loading part from alsasound init
script since modprobe does it now
- Set LOAD_SEQUENCER=no and LOAD_OSS_EMUL_MODULES=no as default;
these were already disabled on 12.1 with systemd.
This is only for new installations. Users upgrading from old
distros aren't affected.
-------------------------------------------------------------------
Mon Jun 25 23:18:07 CEST 2012 - tiwai@suse.de

View File

@ -50,6 +50,8 @@ Source31: all_notes_off.bin
Source32: all_notes_off.mid
Source33: alsa-info.sh
Source34: alsa-init.sh
Source40: 50-alsa.conf
Source41: install-snd-module
# Patch: alsa-lib-git-fixes.diff
Patch1: 0001-conf-pcm-Add-support-for-Echo3G-devices.-Thanks-to-u.patch
Patch2: 0002-USB-Audio-Blacklist-iec958-for-some-USB-devices.patch
@ -202,6 +204,13 @@ mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d
install -c -m 0644 %{SOURCE8} $RPM_BUILD_ROOT/etc/udev/rules.d
%endif
#
# modprobe config and the module install script for loading OSS-emulation
# and sequencer modules automatically
mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
install -c -m 0644 %{S:40} $RPM_BUILD_ROOT/etc/modprobe.d
mkdir -p $RPM_BUILD_ROOT/sbin
install -c -m 0755 %{S:41} $RPM_BUILD_ROOT/sbin
#
# install template to update rc.config and sysconfig files:
# (updating the actual files is done in the %post-script)
#
@ -243,6 +252,8 @@ exit 0
%defattr(-, root, root)
%doc %{_docdir}/%{name}
/etc/init.d/*
/etc/modprobe.d
/sbin/*
%{_sbindir}/*
%{_bindir}/*
/usr/lib/all_notes_off.*

View File

@ -61,21 +61,6 @@ alsactl=/usr/sbin/alsactl
asoundcfg=/var/lib/alsa/asound.state
aconnect=/usr/bin/aconnect
#
# insert sequencer modules
#
load_sequencer() {
test "$LOAD_SEQUENCER" = "yes" && modprobe -q snd-seq
if [ x"$LOAD_SEQUENCER" = xyes -a -r /proc/asound/seq/drivers ]; then
OLDIFS="$IFS"
IFS=","
while read t x c; do
/sbin/modprobe $t
done < /proc/asound/seq/drivers
IFS="$OLDIFS"
fi
}
get_drivers() {
/sbin/modprobe -c | \
grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | sort -u | \
@ -109,21 +94,11 @@ load_modules() {
#
# rest of start action
#
start_rest() {
load_sequencer
if [ x"$LOAD_OSS_EMUL_MODULES" = xyes ]; then
/sbin/modprobe snd-pcm-oss
test x"$LOAD_OSS_SEQ_MODULE" = xyes && /sbin/modprobe snd-seq-oss
fi
}
# manual load and force to store the status
start_all() {
echo -n "Starting sound driver"
load_modules && start_rest
# hack - in case the mixer isn't restored
# this shouldn't be needed anymore since udev cares
# (sleep 1; $alsactl -F -f $asoundcfg restore >/dev/null 2>&1)
load_modules
rc_status -r
}
@ -196,7 +171,6 @@ case "$1" in
$alsactl -F -f $asoundcfg restore >/dev/null 2>&1
;;
esac
start_rest
else
start_all
fi

33
install-snd-module Normal file
View File

@ -0,0 +1,33 @@
#!/bin/sh
/sbin/modprobe --ignore-install "$@" || exit $?
. /etc/sysconfig/sound
case "$1" in
snd)
/sbin/modprobe --quiet --use-blacklist snd-ioctl32
test "$LOAD_OSS_EMUL_MODULES" = "yes" && \
/sbin/modprobe --quiet --use-blacklist snd-mixer-oss
test "$LOAD_SEQUENCER" = "yes" && \
/sbin/modprobe --quiet --use-blacklist snd-seq
;;
snd-pcm|snd_pcm)
test "$LOAD_OSS_EMUL_MODULES" = "yes" && \
/sbin/modprobe --quiet --use-blacklist snd-pcm-oss
;;
snd-seq|snd_seq)
if [ -r /proc/asound/seq/drivers ]; then
OLDIFS="$IFS"
IFS=","
while read t x c; do
/sbin/modprobe --quiet --use-blacklist $t
done < /proc/asound/seq/drivers
IFS="$OLDIFS"
fi
test "$LOAD_OSS_SEQ_MODULE" = "yes" && \
/sbin/modprobe --quiet --use-blacklist snd-seq-oss
;;
esac
exit 0

View File

@ -8,7 +8,7 @@
# Sequencer modules are necessary only for handling MIDI devices.
# If you don't need MIDI, leave here no.
#
LOAD_SEQUENCER="yes"
LOAD_SEQUENCER="no"
## Type: string
## Default: ""
@ -23,12 +23,11 @@ SOUNDFONT_FILES=""
## Default: yes
#
# Load OSS-emulation modules at boot-up? (yes/no)
# OSS-emulation modules are needed If you use OSS applications
# OSS-emulation modules are needed if you use OSS applications
# with ALSA drivers. This option specifies whether these modules are
# loaded at boot-time by alsasound init script.
# Safe to leave yes here.
# loaded at boot-time.
#
LOAD_OSS_EMUL_MODULES="yes"
LOAD_OSS_EMUL_MODULES="no"
## Type: yesno
## Default: no