Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 80196 - /etc/init.d/alsasound will fail on first start
Summary: /etc/init.d/alsasound will fail on first start
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-31 05:11 UTC by Heinrich Wendel (RETIRED)
Modified: 2005-01-31 13:45 UTC (History)
2 users (show)

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 Heinrich Wendel (RETIRED) gentoo-dev 2005-01-31 05:11:20 UTC
When starting /etc/init.d/alsasound, it checks for /etc/asound.state to restore mixer settings. But this file won't exist if alsasound is started for the first time, so /etc/init.d/alsasound will fail. The mixer settings aren't saved on shutdown then, because rc will complain, that alsasound is not started.
Comment 1 Roland Bär 2005-01-31 05:33:50 UTC
Can't reproduce this with both 
- alsa-utils 1.0.6
- alsa-utils 1.0.8
on amd64. What's your version?

Maybe alsasound doesn't start for other reasons (sound card not configured?)
Comment 2 Heinrich Wendel (RETIRED) gentoo-dev 2005-01-31 06:06:32 UTC
I'm using alsa-utils-1.0.6, it fails because /etc/alsasound.state doesn't exist, i created it via alsactl store and now everything works fine.
Comment 3 Heinrich Wendel (RETIRED) gentoo-dev 2005-01-31 06:08:21 UTC
from /etc/init.d/alsasound
-----
    if [ ! -r $asoundcfg ]; then
        ewarn "No mixer config in $asoundcfg, you have to unmute your card!"
        return 1
-----
If alsasoundcfg doesn't exist, a warning is raised, but an error returned, so rc will mark the init script as failed. removing the return 1 should be enough.
Comment 4 Roland Bär 2005-01-31 06:17:01 UTC
I have seen this, but at
  restore_mixer() 
there is only ewarn (not eerror) and the return value of that function is not used.
What do you get back to shell:
ferrari etc # /etc/init.d/alsasound start
 * Loading ALSA drivers...
 * Using ALSA OSS emulation
 * Loading: snd-mixer-oss
 * Loading: snd-pcm-oss
 * Loading: snd-via82xx
 * Loading: snd-seq
 * Running card-dependent scripts
 * Restoring Mixer Levels
 * No mixer config in /etc/asound.state, you have to unmute your card!    [ ok ]
ferrari etc # echo $?
0
ferrari etc # 
Comment 5 Heinrich Wendel (RETIRED) gentoo-dev 2005-01-31 06:35:45 UTC
it returns 1, maybe the problem is here:

 elif [ -x $alsactl ]; then
        CARDS="$(cat /proc/asound/cards | awk '/: / { print $1 }')"
        for CARDNUM in ${CARDS}

CARDS will be empty, my /proc/asound/cards

:0 [V8237          ]: VIA8237 - VIA 8237
                     VIA 8237 with AD1980 at 0xc800, irq 22
Comment 6 Jeremy Huddleston (RETIRED) gentoo-dev 2005-01-31 13:45:13 UTC
fixed in cvs.  pleasse copy over the new /usr/portage/media-sound/alsa-utils/files/alsasound init script.