[Pkg-alsa-devel] Bug#295640: alsa-base: cannot remove and re-autoload OSS emulation

Sergei Ivanov Sergei Ivanov <svivanov@pdmi.ras.ru>, 295640@bugs.debian.org
Thu, 17 Feb 2005 08:19:36 +0300


Package: alsa-base
Version: 1.0.8-4
Severity: normal
Tags: patch

Hello,
There is a couple of problems with autoloading ALSA modules.

I have one sound card, it works with the ens1371 driver. The kernel
here is compiled from Debian kernel-source-2.6.18-13, with ALSA and
OSS emulation in modules, and the real OSS not compiled at all.
I am not using udev.

On boot, no sound modules are loaded. This is good.

If I then run mpg123-oss, ALSA and OSS emulation are loaded,
and the mp3 plays. This is how it should be.

If I run alsaplayer instead, the same set of modules is loaded,
despite that OSS is not used. This is not good, unneeded stuff 
should not autoload.

Furthermore, if I remove the unused OSS emulation
(modprobe -r snd_pcm_oss) and run mpg123-oss again, it does not
work any more - `modprobe sound-slot-0' does not load the module.
This is bad - if something is auto-loaded and then removed,
I suppose it should be loadable the same way again.

I had a working auto-loading setup. It was a file (now removed)
under /etc/modprobe.d, with the following two lines:
	alias sound-slot-0 snd-ens1371
	alias snd-card-0 snd-ens1371
Installing alsa-base broke it. I don't understand why (and don't
understand why it worked, I just copied it from the kernel docs).

Anyway, the following change to /etc/modprobe.d/alsa-base fixed it.
(I still don't understand the modprobe magic involved, maybe it breaks 
something else).

--- alsa-base.orig	2005-01-31 11:51:57.000000000 +0300
+++ /etc/modprobe.d/alsa-base	2005-02-17 05:44:23.000000000 +0300
@@ -6,18 +6,14 @@
 install sound-service-0-3 modprobe snd-card-0 snd-pcm-oss
 install sound-service-0-8 modprobe snd-card-0 snd-seq-oss
 install sound-service-0-12 modprobe snd-card-0 snd-pcm-oss
-install sound-slot-0 modprobe snd-card-0
-install sound-slot-1 modprobe snd-card-1
-install sound-slot-2 modprobe snd-card-2
-install sound-slot-3 modprobe snd-card-3
-install sound-slot-4 modprobe snd-card-4
-install sound-slot-5 modprobe snd-card-5
-install sound-slot-6 modprobe snd-card-6
-install sound-slot-7 modprobe snd-card-7
-# Load optional modules above their base modules
-install snd-pcm modprobe --ignore-install snd-pcm && { modprobe snd-pcm-oss ; : ; }
-install snd-mixer modprobe --ignore-install snd-mixer && { modprobe snd-mixer-oss ; : ; }
-install snd-seq modprobe --ignore-install snd-seq && { modprobe snd-seq-oss ; modprobe snd-seq-midi ; : ; }
+install sound-slot-0 modprobe snd-card-0 && modprobe snd-pcm-oss
+install sound-slot-1 modprobe snd-card-1 && modprobe snd-pcm-oss
+install sound-slot-2 modprobe snd-card-2 && modprobe snd-pcm-oss
+install sound-slot-3 modprobe snd-card-3 && modprobe snd-pcm-oss
+install sound-slot-4 modprobe snd-card-4 && modprobe snd-pcm-oss
+install sound-slot-5 modprobe snd-card-5 && modprobe snd-pcm-oss
+install sound-slot-6 modprobe snd-card-6 && modprobe snd-pcm-oss
+install sound-slot-7 modprobe snd-card-7 && modprobe snd-pcm-oss
 # Cause a script to be run after snd-emu8000-synth module initialization
 install snd-emu8000-synth modprobe --ignore-install snd-emu8000-synth && /lib/alsa/modprobe-post-install snd-emu8000-synth
 # Cause a script to be run after card driver module initialization


-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-s1
Locale: LANG=C, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)

Versions of packages alsa-base depends on:
ii  alsa-utils                    1.0.8-1    ALSA utilities
ii  debconf                       1.4.30.11  Debian configuration management sy
ii  debianutils                   2.8.4      Miscellaneous utilities specific t
ii  lsof                          4.71-1     List open files.
ii  module-init-tools             3.2-pre1-2 tools for managing Linux kernel mo
ii  modutils                      2.4.26-1.2 Linux module utilities

-- debconf information:
  alsa-base/alsactl_store_on_shutdown: never autosave