Skip to contentSkip to conversation

Patch for alsa-info.sh - AC97 including regs

PATCH Applied Travis Place 2 participants 3 messages Feb 25, 2008

lore
Share & tools
lore
#0 lore raw

Ok, ive added the +regs file aswell, but decided to store its output in a seperate tmp file (before being added to the complete output).

This way, we can change how its output if we'd like, with less stuffing around (and all tmp files are cleaned up after each run, anyway).

Signature · 2 lines
Happiness is like peeing your pants. Everyone can see it, but only you can 
feel its warmth 
alsa-info.sh +20 -1
diff -r 93cc5f0a20f1 alsa-info.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-SCRIPT_VERSION=0.4.38
+SCRIPT_VERSION=0.4.39
 CHANGELOG="http://hg.alsa-project.org/alsa/log/tip/alsa-info.sh"
 
 #################################################################################
@@ -270,6 +270,10 @@ lspci |grep -i "multi\|audio">/tmp/alsai
 #Check for HDA-Intel cards codec#*
 cat /proc/asound/card*/codec\#* > /tmp/alsainfo/alsa-hda-intel.tmp 2> /dev/null
 
+#Check for AC97 cards codec
+cat /proc/asound/card*/codec97\#0/ac97\#0-0 > /tmp/alsainfo/alsa-ac97.tmp 2> /dev/null
+cat /proc/asound/card*/codec97\#0/ac97\#0-0+regs > /tmp/alsainfo/alsa-ac97-regs.tmp 2> /dev/null
+
 #Fetch the info, and put it in $FILE in a nice readable format.
 echo "name=$USER&type=33&description=/tmp/alsa-info.txt&expiry=&s=Submit+Post&content=" > $FILE
 echo "!!################################" >> $FILE
@@ -362,6 +366,21 @@ then
 	echo "" >> $FILE
 	echo "" >> $FILE
 fi
+
+if [ -s "/tmp/alsainfo/alsa-ac97.tmp" ]
+then
+        echo "!!AC97 Codec information" >> $FILE
+        echo "!!---------------------------" >> $FILE
+        echo "--startcollapse--" >> $FILE
+        echo "" >> $FILE
+        cat /tmp/alsainfo/alsa-ac97.tmp >> $FILE
+        echo "" >> $FILE
+        cat /tmp/alsainfo/alsa-ac97-regs.tmp >> $FILE
+        echo "--endcollapse--" >> $FILE
+	echo "" >> $FILE
+	echo "" >> $FILE
+fi
+
 
 #If no command line options are specified, then run as though --with-all was specified
 if [[ -z "$1" ]]

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Applied
#1 lore raw

At Tue, 26 Feb 2008 02:05:50 +1000,

Quoted 3 lines · Travis Place

Ok, ive added the +regs file aswell, but decided to store its output in a seperate tmp file (before being added to the complete output).

Thanks, applied now to HG tree.

Quoted 2 lines

This way, we can change how its output if we'd like, with less stuffing around (and all tmp files are cleaned up after each run, anyway).

Apropos about tmp files: let's use mktemp for temporary files. Using the fixed tmp directory could be a possible security hole.

Takashi

#2 lore raw
Quoted 15 lines · Takashi Iwai

At Tue, 26 Feb 2008 02:05:50 +1000,

Quoted 2 lines · Travis Place

Ok, ive added the +regs file aswell, but decided to store its output in a seperate tmp file (before being added to the complete output).

Thanks, applied now to HG tree.

Quoted 2 lines

This way, we can change how its output if we'd like, with less stuffing around (and all tmp files are cleaned up after each run, anyway).

Apropos about tmp files: let's use mktemp for temporary files. Using the fixed tmp directory could be a possible security hole.

Quoted 5 lines

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Good call.. ill fix that up, and post the patch when ready.. getting rather late/early for me (2:30am).

Signature · 2 lines
Happiness is like peeing your pants. Everyone can see it, but only you can 
feel its warmth