summaryrefslogtreecommitdiff
path: root/alsa-info/alsa-info.sh
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2020-12-09 18:35:49 +0100
committerTakashi Iwai <tiwai@suse.de>2020-12-09 18:35:49 +0100
commit5812f37d877c12bc594b9ffddc493d305991963a (patch)
tree3494eb349913b5393b3feecace8b5862247f3367 /alsa-info/alsa-info.sh
parentc1b92db5ef01311e5fc983f3134caa00826d0c2d (diff)
downloadalsa-utils-5812f37d877c12bc594b9ffddc493d305991963a.tar.gz
alsa-info: Add lsusb and stream outputs
We need more detailed information for USB-audio devices, at least the lsusb -v output and the contents of stream* proc files. Let's add them to alsa-info.sh output. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'alsa-info/alsa-info.sh')
-rwxr-xr-xalsa-info/alsa-info.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/alsa-info/alsa-info.sh b/alsa-info/alsa-info.sh
index f179bfa..3871b97 100755
--- a/alsa-info/alsa-info.sh
+++ b/alsa-info/alsa-info.sh
@@ -476,6 +476,18 @@ cat /proc/asound/card*/codec\#* > $TEMPDIR/alsa-hda-intel.tmp 2> /dev/null
cat /proc/asound/card*/codec97\#0/ac97\#0-0 > $TEMPDIR/alsa-ac97.tmp 2> /dev/null
cat /proc/asound/card*/codec97\#0/ac97\#0-0+regs > $TEMPDIR/alsa-ac97-regs.tmp 2> /dev/null
+#Check for USB descriptors
+if [ -x /usr/bin/lsusb ]; then
+ for f in /proc/asound/card[0-9]*/usbbus; do
+ test -f "$f" || continue
+ id=$(sed 's@/@:@' $f)
+ lsusb -v -s $id >> $TEMPDIR/lsusb.tmp 2> /dev/null
+ done
+fi
+
+#Check for USB stream setup
+cat /proc/asound/card*/stream[0-9]* > $TEMPDIR/alsa-usbstream.tmp 2> /dev/null
+
#Check for USB mixer setup
cat /proc/asound/card*/usbmixer > $TEMPDIR/alsa-usbmixer.tmp 2> /dev/null
@@ -649,6 +661,27 @@ if [ -s "$TEMPDIR/alsa-ac97.tmp" ]; then
echo "" >> $FILE
fi
+if [ -s "$TEMPDIR/lsusb.tmp" ]; then
+ echo "!!USB Descriptors" >> $FILE
+ echo "!!---------------" >> $FILE
+ echo "--startcollapse--" >> $FILE
+ cat $TEMPDIR/lsusb.tmp >> $FILE
+ echo "--endcollapse--" >> $FILE
+ echo "" >> $FILE
+ echo "" >> $FILE
+fi
+
+if [ -s "$TEMPDIR/lsusb.tmp" ]; then
+ echo "!!USB Stream information" >> $FILE
+ echo "!!----------------------" >> $FILE
+ echo "--startcollapse--" >> $FILE
+ echo "" >> $FILE
+ cat $TEMPDIR/alsa-usbstream.tmp >> $FILE
+ echo "--endcollapse--" >> $FILE
+ echo "" >> $FILE
+ echo "" >> $FILE
+fi
+
if [ -s "$TEMPDIR/alsa-usbmixer.tmp" ]; then
echo "!!USB Mixer information" >> $FILE
echo "!!---------------------" >> $FILE