Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 167436

Summary: media-sound/alsa-utils-1.0.14_rc2-r1 init script has buggy handling of OSS
Product: Gentoo Linux Reporter: Jakub Moc (RETIRED) <jakub>
Component: New packagesAssignee: Gentoo ALSA team <alsa-bugs>
Status: VERIFIED FIXED    
Severity: normal CC: andre, nesl247
Priority: High    
Version: 2006.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: alsasound initscript patch
/etc/init.d/alsasound

Description Jakub Moc (RETIRED) gentoo-dev 2007-02-18 08:08:18 UTC
This is what you get on every restart:

 * Restoring Mixer Levels ...
/etc/init.d/alsasound: line 191: /proc/asound//var/lib/alsa/oss/card0/pcm0c/oss: No such file or directory
/etc/init.d/alsasound: line 191: /proc/asound//var/lib/alsa/oss/card0/pcm0p/oss: No such file or directory
/etc/init.d/alsasound: line 191: /proc/asound//var/lib/alsa/oss/card0/pcm1c/oss: No such file or directory                              [ ok ]

Boils down to the usage of ${alsastatedir} at:

<snip>
for ossfile in "${alsastatedir}"/oss/card?_pcm??; do
        # We use cat because I'm not sure if cp works properly on /proc
        cat "${ossfile}" > /proc/asound/${ossfile/_/\/}/oss
done
</snip>
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-02-18 08:45:31 UTC
Created attachment 110522 [details, diff]
alsasound initscript patch

Works for me...
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2007-02-18 11:38:57 UTC
Thanks, fixed without revbump as I'm probably going to revbump later on to fix a few more bugs.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-02-18 23:49:29 UTC
*** Bug 167550 has been marked as a duplicate of this bug. ***
Comment 4 André Terpstra 2007-02-24 07:27:25 UTC
I must be doing something wrong.I've applied this patch.Here's teh relevant section:


	push_opts=$(shopt -p nullglob); shopt -s nullglob
	for ossfile in "${alsastatedir}"/oss/card?_pcm??; do
		# We use cat because I'm not sure if cp works properly on /proc
		local procfile=${ossfile##${alsastatedir}/oss}
		cat "${ossfile}" > /proc/asound/${procfile/_/\/}/oss
#		cat "${ossfile}" > /proc/asound/${ossfile/_/\/}/oss
	done
	eval $push_opts


But it still gives errors:

 * Restoring Mixer Levels ...
/etc/init.d/alsasound: line 192: /proc/asound//card0/pcm1p/oss: No such file or directory
/etc/init.d/alsasound: line 192: /proc/asound//card1/pcm0c/oss: No such file or directory
/etc/init.d/alsasound: line 192: /proc/asound//card1/pcm0p/oss: No such file or directory
/etc/init.d/alsasound: line 192: /proc/asound//card1/pcm1c/oss: No such file or directory
/etc/init.d/alsasound: line 192: /proc/asound//card1/pcm1p/oss: No such file or directory                                [ ok ]
PoseidonGentooNew ~ #
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2007-02-24 08:40:28 UTC
Yes, you must be doing something wrong. It's already fixed in CVS, so emerge --sync and re-emerge the ebuild.
Comment 6 André Terpstra 2007-02-25 11:09:28 UTC
(In reply to comment #5)
> Yes, you must be doing something wrong. It's already fixed in CVS, so emerge
> --sync and re-emerge the ebuild.
> 

So I did what you described. Still the error remains:

"
PoseidonGentooNew ~ # /etc/init.d/alsasound restart
 * WARNING:  you are stopping a boot service.
 * Storing ALSA Mixer Levels ...                                                                                                             [ ok ]
 * Killing processes using ALSA ...                                                                                                          [ ok ]
 * Unloading ALSA modules ...                                                                                                                [ ok ]
 * Loading ALSA modules ...
 *   Loading: snd-card-0 ...                                                                                                                 [ ok ]
 *   Loading: snd-pcm-oss ...                                                                                                                [ ok ]
 *   Loading: snd-seq-oss ...                                                                                                                [ ok ]
 * Restoring Mixer Levels ...
/etc/init.d/alsasound: line 192: /proc/asound//card0/pcm1p/oss: No such file or directory
/etc/init.d/alsasound: line 192: /proc/asound//card1/pcm0c/oss: No such file or directory
/etc/init.d/alsasound: line 192: /proc/asound//card1/pcm0p/oss: No such file or directory
/etc/init.d/alsasound: line 192: /proc/asound//card1/pcm1c/oss: No such file or directory
/etc/init.d/alsasound: line 192: /proc/asound//card1/pcm1p/oss: No such file or directory                                                    [ ok ]
PoseidonGentooNew
" 

It may be something else but I do not understand the script well enough to find out myself.Am I the only person having this problem?
Comment 7 André Terpstra 2007-02-25 11:10:45 UTC
To be exact I paste teh relevant section of the script:

"
	push_opts=$(shopt -p nullglob); shopt -s nullglob
	for ossfile in "${alsastatedir}"/oss/card?_pcm??; do
		# We use cat because I'm not sure if cp works properly on /proc
		local procfile=${ossfile##${alsastatedir}/oss}
		cat "${ossfile}" > /proc/asound/${procfile/_/\/}/oss
	done
	eval $push_opts
"

Comment 8 Jakub Moc (RETIRED) gentoo-dev 2007-02-25 11:15:32 UTC
Works just perfectly fine here; if you are missing OSS support in alsa or don't have the needed modules loaded, then there's obviously nothing to restore.
Comment 9 André Terpstra 2007-02-25 20:58:04 UTC
I give up. All modules are loaded and everything used to work. I reverted to alsa-utils-1.0.14_rc2 and there are no more messages. It still seems a bug to me...
Comment 10 Sergiy Borodych 2007-02-27 15:22:20 UTC
same for me

help its:

/etc/init.d/alsasound stop
rm -rf /var/lib/alsa
emerge alsa-utils
/etc/init.d/alsasound start
alsamixer
# unmute what you need
Comment 11 Jimmy.Jazz 2007-03-10 11:32:15 UTC
Created attachment 112786 [details, diff]
/etc/init.d/alsasound

I modify the script a little. It works for me.

Jj