Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 32045 - alsasound tries to install some modules twice on boot under 2.6
Summary: alsasound tries to install some modules twice on boot under 2.6
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL:
Whiteboard:
Keywords:
: 14553 38024 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-26 09:28 UTC by giggles1
Modified: 2004-02-17 05:03 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
alsasound quick fix (alsasound,4.63 KB, application/octet-stream)
2003-10-30 05:03 UTC, xlyz
Details
alsanound (alsasound,4.99 KB, text/plain)
2004-02-08 13:44 UTC, Jeremy Huddleston (RETIRED)
Details
Modified alsasound to handle multiple hyphen/underscore conversions (alsasound,4.99 KB, text/plain)
2004-02-11 17:59 UTC, James Roberts-Thomson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description giggles1 2003-10-26 09:28:09 UTC
When my new 2.6.0-test8 kernel boots, alsasound generates several messages about
attempting to load modules already present in the kernel. Specifically,
snd_ens1371, snd_seq_oss, and snd_seq_midi.

I noticed

please root # modprobe -l | grep "snd.*oss" | sed -e "s:\/.*\/::" -e "s:\..*::"
snd-seq-oss
snd-pcm-oss
snd-mixer-oss

please root # cut -d"," -f1 /proc/asound/seq/drivers
snd-seq-midi
snd-seq-oss

So, snd-seq-oss at least shows up in both ${DRIVERS} and ${SEQUENCERS} which
would certainly explain why it is being loaded twice.  I don't know why
snd-ens1371 and snd-seq-midi also are getting loaded twice.

This is not a big problem at all of course, soudn still works fine, but it's
nice to have a clean boot if possible. :)



Reproducible: Always
Steps to Reproduce:
1.
2.
3.




please root # emerge info
Portage 2.0.49-r15 (default-x86-1.4, gcc-3.3.1, glibc-2.3.2-r6, 2.6.0-test8)
=================================================================
System uname: 2.6.0-test8 i686 AMD Athlon(tm) MP 2000+
Gentoo Base System version 1.4.3.11
ccache version 2.3 [disabled]
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-mp -O2 -ftracer -ffast-math -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/local/portage/distfiles"
FEATURES="sandbox autoaddcvs fixpackages"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/usr/local/portage"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/ebuilds"
SYNC="rsync://rsync.samerica.gentoo.org/gentoo-portage"
USE="x86 oss apm cups foomaticdb mad mikmod nls xml2 gdbm slang bonobo ruby
libwww motif cdr nptl X 3dnow mmx directfb sse dga opengl xv fbcon kde qt qtmt
arts tcltk aalib imlib ncurses readline sdl svga lcms gif jpeg png tiff gd avi
mpeg quicktime esd gtk gtk2 -gnome alsa ggi dvd xmms oggvorbis encode pam ssl
crypt tcpd mozilla spell truetype xml pdflib plotutils tetex guile perl python
libg++ atlas pic berkdb mysql postgres odbc samba gpm zlib java threads"
Comment 1 xlyz 2003-10-30 04:48:05 UTC
same problem here

it seems that snd_seq_oss make several others modules automagically loaded
(among those snd_intel8x0) so that when the script try to load the sound
card module, this is already there

then snd-seq-oss got modprobed again as described by giggles

emerge info
Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.6.0-test9)
=================================================================
System uname: 2.6.0-test9 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Gentoo Base System version 1.4.3.10p1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer -fprefetch-loop-arrays
-fforce-addr  -falign-functions=4"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config
/usr/kde/3/share/config /usr/X11R6/lib/X11/xkb"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer -fprefetch-loop-arrays
-fforce-addr  -falign-functions=4"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://gentoo.linux.no/ http://gentoo.oregonstate.edu/ http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 oss apm avi gpm jpeg libwww mad gdbm perl python esd cdr X gtk -gnome
alsa -3dnow -arts -berkdb crypt cups dvd encode foomaticdb gif gtk2 imlib
java -kde -libg++ -mikmod mmx motif mozilla mpeg ncurses nls oggvorbis opengl
pam pdflib png -qt -quicktime -readline sdl -slang -spell sse ssl svga tcpd
truetype usb xml2 xmms xv zlib"
Comment 2 xlyz 2003-10-30 05:03:35 UTC
Created attachment 19972 [details]
alsasound quick fix


here a quick alsasound fix

it works fine on my sustem (alsa 0.9.8, kernel 2.6.0-test9)
Comment 3 Jyrki Muukkonen 2003-11-03 05:21:27 UTC
This "double loading" might be because in 2.6 series the "autoload kernel
modules" is on. This causes all(?) snd_* modules to load when one of them
is modprobed. The easiest and prettiest way to fix this is to use "modprobe
-q" instead of "modprobe" in init.d/alsasound script. Also the SEQUENCER="..."
line in alsasound can be fixed a little bit, but that just adds yet another
grep to the bl0ated script.

Here's my diff:

diff -u -0 /usr2/gentoo/portage/media-sound/alsa-utils/files/alsasound /etc/init.d/alsasound
 
--- /usr2/gentoo/portage/media-sound/alsa-utils/files/alsasound 2003-09-16
16:42:38.000000000 +0300
+++ /etc/init.d/alsasound       2003-10-30 21:29:47.000000000 +0200
@@ -72 +72 @@
-                               /sbin/modprobe ${DRIVER}
+                               /sbin/modprobe -q ${DRIVER}
@@ -79 +79 @@
-                       SEQUENCERS="$(cut -d"," -f1 /proc/asound/seq/drivers)"
+                       SEQUENCERS="$(grep -v loaded /proc/asound/seq/drivers
| cut -d"," -f1)"
@@ -83 +83 @@
-                               [ -n "${SEQUENCER}" ] && /sbin/modprobe ${SEQUENCER}
+                               [ -n "${SEQUENCER}" ] && /sbin/modprobe -q
${SEQUENCER}

I think that "grep -v loaded..." line is even uglier than before. And it's
pretty useless too while using modprobe -q.

And what does that -q do? Here's a snippet from man modprobe:
       -q --quiet
                 Normally modprobe will report an error if you try to remove
a
                 module  which doesn't isn't in the kernel, or insert a module
                 which is already in the kernel.   With  this  flag,  modprobe
                 considers such redundant commands to be fine.

As a result, I suggest that we'd use the modprobe -q syntax, since people
might or might not be using the module autoload option in 2.6 kernel series.
Comment 4 Collins Richey 2003-11-04 10:48:59 UTC
I'm not sure whether this is related or a separate problem.  When I start
alsasound (either at boot or default), sound does not work (devfsd does not
build /dev/dsp etc.).  I have to issue '/etc/init.d/alsasound stop' and then
'/etc/init.d/alsasound start' to get sound to work.  After the second start,
all the /dev/dsp... are generated and the sound card works.  If it makes
any difference, I'm using the ens1371 module.  I'm also using 2.6.0-test8.
Comment 5 Martin Holzer (RETIRED) gentoo-dev 2004-01-03 06:44:42 UTC
is this fixed with latest portage tree ?
Comment 6 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-06 20:40:48 UTC
I'm gonna modify the init script to check if a module is loaded already before modprobing it.
Comment 7 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-06 21:02:17 UTC
Ok, I just committed the updated init script... as soon as your portage tree gets it, you can just copy it from portage/media-sound/alsa-utils/files/alsasound to /etc/init.d/alsasound

The change was a [ -z `cut -d' ' -f1 /proc/modules | egrep "^${DRIVER}\$"` ] conditional around the loading (similar for SEQUENCER).
Comment 8 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-06 21:16:03 UTC
*** Bug 38024 has been marked as a duplicate of this bug. ***
Comment 9 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-07 14:45:05 UTC
*** Bug 14553 has been marked as a duplicate of this bug. ***
Comment 10 Jacobo Cabaleiro 2004-02-08 04:55:06 UTC
The fixed introduced is not working for me. The next driver to be loded ($DRIVER variable) is checked against loaded modules by listing them. But (at least) in my gentoo the loaded module names have underscores (snd_ens1371) instead of the '-' of the module ko. The drivers to be loaded are obtained by doing a modprobe -c (that return the names with '-' from modules.conf). String compare then falls.

I've made the following change to the alsasound script:
    DRIVER="$(echo ${DRIVER} | sed 's/-/_/g')"
    if [ ! "${DRIVER}" = off ] &&
       [ -z `cut -d' ' -f1 /proc/modules | egrep "^${DRIVER}\$"` ]; then

adding the sed line also in the sequencer modules part.
Comment 11 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-08 13:44:54 UTC
Created attachment 25213 [details]
alsanound

Can you please try out this one.  I'll commit it as sonn as I get feedback.  It
adds in a check for ${DRIVER/-/_} as well...
Comment 12 James Roberts-Thomson 2004-02-11 17:59:43 UTC
Created attachment 25442 [details]
Modified alsasound to handle multiple hyphen/underscore conversions

Hi, I tried the attached alsasound, and for my machine it didn't entirely fix
the issue.  This is because some module names had more than one
hyphen/underscore conversion required.	I've modified alsasound and reattached
it to resolve this issue.
Comment 13 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-14 19:21:50 UTC
*** Bug 41600 has been marked as a duplicate of this bug. ***