mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-09 23:45:43 +01:00
alsa-info.sh: Simplify iteration over cards when calling amixer
Read card names directly from individual procfs files, and pass them to amixer using the '-c' option. Signed-off-by: David Ward <david.ward@ll.mit.edu> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
86b1f80e24
commit
068dd55717
1 changed files with 5 additions and 5 deletions
|
@ -144,12 +144,12 @@ withamixer() {
|
||||||
echo "!!Amixer output" >> $FILE
|
echo "!!Amixer output" >> $FILE
|
||||||
echo "!!-------------" >> $FILE
|
echo "!!-------------" >> $FILE
|
||||||
echo "" >> $FILE
|
echo "" >> $FILE
|
||||||
for i in $(grep "]: " /proc/asound/cards | awk -F ' ' '{ print $1 }') ; do
|
for f in /proc/asound/card*/id; do
|
||||||
CARD_NAME=$(grep "^ *$i " $TEMPDIR/alsacards.tmp | awk '{ print $2 }')
|
[ -f "$f" ] && read -r CARD_NAME < "$f" || continue
|
||||||
echo "!!-------Mixer controls for card $i $CARD_NAME]" >> $FILE
|
echo "!!-------Mixer controls for card $CARD_NAME" >> $FILE
|
||||||
echo "" >>$FILE
|
echo "" >>$FILE
|
||||||
amixer -c$i info >> $FILE 2>&1
|
amixer -c "$CARD_NAME" info >> $FILE 2>&1
|
||||||
amixer -c$i >> $FILE 2>&1
|
amixer -c "$CARD_NAME" >> $FILE 2>&1
|
||||||
echo "" >> $FILE
|
echo "" >> $FILE
|
||||||
done
|
done
|
||||||
echo "" >> $FILE
|
echo "" >> $FILE
|
||||||
|
|
Loading…
Reference in a new issue