[alsa-devel] Patch for alsa-info.sh
Travis Place
wishie at wishie.net
Mon Feb 25 06:18:10 CET 2008
The below patch should stop alsa-info.sh from running amixer on cards that
dont exist (ie, if the user has no card0, but has a card1)
I realise its a generally a rare case, and cards are _usually_ consecutive,
but we might aswell cover all bases if we can.
diff -r 7907cfbab11c alsa-info.sh
--- a/alsa-info.sh Mon Feb 18 12:13:23 2008 +0100
+++ b/alsa-info.sh Mon Feb 25 15:16:16 2008 +1000
@@ -1,6 +1,6 @@
#!/bin/bash
-SCRIPT_VERSION=0.4.37
+SCRIPT_VERSION=0.4.38
CHANGELOG="http://hg.alsa-project.org/alsa/log/tip/alsa-info.sh"
#################################################################################
@@ -98,7 +98,7 @@ withamixer() {
echo "!!Amixer output" >> $FILE
echo "!!-------------" >> $FILE
echo "" >> $FILE
- for i in `seq 0 $LAST_CARD`;do
+ for i in `grep "]: " /proc/asound/cards | awk -F ' ' '{ print $1} '` ; do
CARD_NAME=`grep "^ $i" /tmp/alsainfo/alsacards.tmp|awk {'print $2'}`
echo "!!-------Mixer controls for card $i $CARD_NAME]" >> $FILE
echo "" >>$FILE
--
Happiness is like peeing your pants. Everyone can see it, but only you can
feel its warmth
More information about the Alsa-devel
mailing list