config_mixer: ignore "Console" devices for amixer
authorMichael Prokop <mika@grml.org>
Tue, 4 Feb 2014 11:15:55 +0000 (12:15 +0100)
committerMichael Prokop <mika@grml.org>
Tue, 4 Feb 2014 11:16:36 +0000 (12:16 +0100)
Strings like 'Console,0' indicate a device where "amixer ... unmute"
results in:

| amixer: Invalid command!

So ignore such devices.

autoconfig.functions

index 04bdc80..7fdb4be 100755 (executable)
@@ -1317,6 +1317,9 @@ config_mixer () {
             IFS='
 '
             for CONTROL in ${=CONTROLS} ; do
+               # such devices can not be controlled with amixer ... unmute
+               [[ "$CONTROL" == *Console* ]] && continue
+
                if ! echo "${CONTROL}" | grep -q -i "mic" ; then
                    if amixer -c $card sget "${CONTROL}" | grep -q 'Capabilities:.*pswitch' ; then
                       amixer -c $card -q set "${CONTROL}" unmute