Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 259271 - alsasound init.d script not loading OSS devices
Summary: alsasound init.d script not loading OSS devices
Status: RESOLVED DUPLICATE of bug 258930
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-16 20:04 UTC by dswhite42
Modified: 2009-02-16 21:15 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dswhite42 2009-02-16 20:04:51 UTC
I'm running a Gentoo box (kernel 2.6.28-gentoo-r1) with ALSA (and ALSA OSS emulation) with 2 soundcards.  Here is a section from my /etc/modprobe.d/alsa

alias snd-card-0 snd-intel8x0
alias snd-card-1 snd-au8830
alias sound-slot-0 snd-card-0
alias sound-slot-1 snd-card-1

alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss


Here is a modprobe command:

> modprobe -c | grep snd-card
alias snd-card-0 snd-intel8x0
alias snd-card-1 snd-au8830
alias snd-card-0 snd-intel8x0
alias snd-card-1 snd-au8830
alias sound-slot-0 snd-card-0
alias sound-slot-1 snd-card-1

and so when /etc/init.d/alsasound gets to line 18 and runs the following command:
    local DRIVERS="$(modprobe -c | sed -n -e 's/^alias \(snd-card-[[:digit:]]\+\) .*/\1/p')"
the command will produce this:
    snd-card-0
    snd-card-1
    snd-card-0
    snd-card-1

That's fine - alsa will proceed to load the modules for both cards.  However, here is a portion of modprobe -l:

> modprobe -l | grep snd.*oss
kernel/sound/core/oss/snd-mixer-oss.ko
kernel/sound/core/oss/snd-pcm-oss.ko

So when /etc/init.d/alsasound gets to line 31 and runs the following command:
    DRIVERS="${DRIVERS} $(modprobe -l | sed -n -e '/snd.*oss/ s:\/.*\/\(.*\).ko:\1:p')"
the command will produce this:
    kernelsnd-mixer-oss
    kernelsnd-pcm-oss

Obviously the sed script has something wrong with it.  It should be producing "snd-mixer-oss" and "snd-pcm-oss".  Because of the error, /etc/init.d/alsasound will try and fail to load the OSS mixer and pcm modules.

Changing the regex from this:

    /snd.*oss/ s:\/.*\/\(.*\).ko:\1:p

to this

    /snd.*oss/ s:.*/\(.*\).ko:\1:p

fixed it for me, but I don't know if that would break things for anyone else.
Comment 1 Rafał Mużyło 2009-02-16 21:15:12 UTC

*** This bug has been marked as a duplicate of bug 258930 ***