From 2eea2e9c7357055bc1b5c729b6607dde2334890ee656378623db7d039d22add2 Mon Sep 17 00:00:00 2001 From: Cristian Morales Vega Date: Fri, 29 Jun 2012 14:29:00 +0000 Subject: [PATCH] Accepting request 126580 from home:tiwai:branches: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. OBS-URL: https://build.opensuse.org/request/show/126580 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=107 --- 50-alsa.conf | 3 +++ alsa.changes | 13 +++++++++++++ alsa.spec | 11 +++++++++++ alsasound | 28 +--------------------------- install-snd-module | 33 +++++++++++++++++++++++++++++++++ sysconfig.sound | 9 ++++----- 6 files changed, 65 insertions(+), 32 deletions(-) create mode 100644 50-alsa.conf create mode 100644 install-snd-module diff --git a/50-alsa.conf b/50-alsa.conf new file mode 100644 index 0000000..cc6347a --- /dev/null +++ b/50-alsa.conf @@ -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 diff --git a/alsa.changes b/alsa.changes index ebde36b..a4e1e6e 100644 --- a/alsa.changes +++ b/alsa.changes @@ -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 diff --git a/alsa.spec b/alsa.spec index cfe71b4..b57bae1 100644 --- a/alsa.spec +++ b/alsa.spec @@ -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.* diff --git a/alsasound b/alsasound index 342c125..8a8ad11 100644 --- a/alsasound +++ b/alsasound @@ -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 diff --git a/install-snd-module b/install-snd-module new file mode 100644 index 0000000..9472998 --- /dev/null +++ b/install-snd-module @@ -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 diff --git a/sysconfig.sound b/sysconfig.sound index be3d100..9094055 100644 --- a/sysconfig.sound +++ b/sysconfig.sound @@ -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