: alsactl does not report error status when it can't restore levels for all cards
A NOTE has been added to this issue.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=843>
======================================================================
Reported By: jdthood
Assigned To:
======================================================================
Project: ALSA - utils Issue ID: 843 Category: alsactl Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 01-23-2005 11:23 CET Last Modified: 02-01-2005 10:32 CET
======================================================================
Summary: alsactl does not report error status when it can't
restore levels for all cards
Description:
# modprobe snd-dummy # alsactl restore Dummy No state is present for card Dummy # echo $? 0
It would be helpful if alsactl returned a nonzero status in the event that it is unable to restore settings for the specified card (or, in case it's just "alsactl restore", for one of the cards).
It would be especially helpful if this status were other than 1 so that "No state is present" could be distinguished from "No such device".
# alsactl restore 2 alsactl: set_controls:1119: snd_ctl_open error: No such device # echo $? 1 ======================================================================
----------------------------------------------------------------------
jdthood - 02-01-05 10:32
----------------------------------------------------------------------
On second thought, it would be even nicer if both "no state" and "no device" could be distinguished from other kinds of errors (e.g., illegal option). You could use values 2, 3, ... or you could try to conform to the "errno" encodings (/usr/include/asm-generic/errno-base.h on my Debian sarge system) so that, e.g., "no device" returned status 19 (ENODEV). (Just a thought.)
What is most important, though, is that we have a distinctive nonzero exit status for the case where alsactl fails to restore all mixer levels. Our scripts need to know about this case so that they can know when to fall back to using amixer.
Signature · 17 lines
Thomas Issue History Date Modified Username Field Change ====================================================================== 01-23-05 11:23 jdthood New Issue 02-01-05 10:32 jdthood Note Added: 0003461 ====================================================================== ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl