[Pkg-alsa-devel] Bug#451244: Bug#451244: Bug#451244: Bug#451244: alsa-utils: init script should call alsactl restore with -F option

Elimar Riesebieter riesebie at lxtec.de
Wed Nov 14 18:11:36 UTC 2007


On Wed, 14 Nov 2007 the mental interface of
Frans Pop told:

> On Wednesday 14 November 2007, you wrote:
[...] 
> > -F is only used if alsactl restore failes and returns nonzero
> 
> If you want to discuss the appropriate or not appropriate use of the -F 
> flag, please do so with the upstream alsa people.
> I'm only forwarding you what they told me: the -F flag should be used by 
> default in the init script to avoid such errors.
> 
> AFAICT this seems to match the text in the manpage:
>        -F, --force
>               Used  with restore command.  Try to restore the matching
>               control elements as much as possible.

Frans, please have a look at the initscript:

restore_levels()
{
    [ -f /var/lib/alsa/asound.state ] || return 1
    CARD="$1"
    [ "$1" = all ] && CARD=""
    # Assume that if alsactl prints a message on stderr
    # then it failed somehow.  This works around the fact
    # that alsactl doesn't return nonzero status when it
    # can't restore settings for the card
    if MSG="$(alsactl restore $CARD 2>&1 >/dev/null)" && [ ! "$MSG" ] ; then
        return 0
    else
        # Retry with the "force" option.  This restores more levels
        # but it results in much longer error messages.
        alsactl -F restore $CARD >/dev/null 2>&1
        log_action_cont_msg "warning: 'alsactl restore${CARD:+ $CARD}' failed with error message '$MSG'"
        return 1
    fi
}

Thanks for your engagement. Anyway, I'll close the bug now.

Elimar

-- 
  Learned men are the cisterns of knowledge, 
  not the fountainheads ;-)





More information about the Pkg-alsa-devel mailing list