This commit is contained in:
parent
f4ff244ef6
commit
49a504cf87
348
alsa-info.sh
348
alsa-info.sh
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT_VERSION=0.4.51
|
||||
SCRIPT_VERSION=0.4.56
|
||||
CHANGELOG="http://www.alsa-project.org/alsa-info.sh.changelog"
|
||||
|
||||
#################################################################################
|
||||
@ -26,6 +26,9 @@ CHANGELOG="http://www.alsa-project.org/alsa-info.sh.changelog"
|
||||
# 1. Remove the need for the devs/helpers to ask several questions before we can easily help the user.
|
||||
# 2. Allow newer/inexperienced ALSA users to give us all the info we need to help them.
|
||||
|
||||
#Set the locale (this may or may not be a good idea.. let me know)
|
||||
export LC_ALL=C
|
||||
|
||||
#Change the PATH variable, so we can run lspci (needed for some distros)
|
||||
PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin
|
||||
BGTITLE="ALSA-Info v $SCRIPT_VERSION"
|
||||
@ -41,35 +44,67 @@ pbcheck(){
|
||||
}
|
||||
|
||||
update() {
|
||||
wget -O /tmp/alsa-info.sh "http://www.alsa-project.org/alsa-info.sh" >/dev/null 2>&1
|
||||
REMOTE_VERSION=`grep SCRIPT_VERSION /tmp/alsa-info.sh |head -n1 |sed 's/.*=//'`
|
||||
SHFILE=`mktemp -p /tmp alsa-info.XXXXXXXXXX`
|
||||
wget -O $SHFILE "http://www.alsa-project.org/alsa-info.sh" >/dev/null 2>&1
|
||||
REMOTE_VERSION=`grep SCRIPT_VERSION $SHFILE |head -n1 |sed 's/.*=//'`
|
||||
if [ "$REMOTE_VERSION" != "$SCRIPT_VERSION" ]; then
|
||||
if [[ -n $DIALOG ]]
|
||||
then
|
||||
dialog --yesno "Newer version of ALSA-Info has been found\n\nDo you wish to install it?" 0 0
|
||||
DIALOG_EXIT_CODE=$?
|
||||
OVERWRITE=
|
||||
if [ -w $0 ]; then
|
||||
dialog --yesno "Newer version of ALSA-Info has been found\n\nDo you wish to install it?\nNOTICE: The original file $0 will be overwritten!" 0 0
|
||||
DIALOG_EXIT_CODE=$?
|
||||
if [[ $DIALOG_EXIT_CODE = 0 ]]; then
|
||||
OVERWRITE=yes
|
||||
fi
|
||||
fi
|
||||
if [ -z "$OVERWRITE" ]; then
|
||||
dialog --yesno "Newer version of ALSA-Info has been found\n\nDo you wish to download it?" 0 0
|
||||
DIALOG_EXIT_CODE=$?
|
||||
fi
|
||||
if [[ $DIALOG_EXIT_CODE = 0 ]]
|
||||
then
|
||||
cp /tmp/alsa-info.sh $0
|
||||
echo "ALSA-Info script has been updated to v $REMOTE_VERSION"
|
||||
echo "Newer version detected: $REMOTE_VERSION"
|
||||
echo "To view the ChangeLog, please visit $CHANGELOG"
|
||||
echo "Please re-run the script"
|
||||
if [ "$OVERWRITE" = "yes" ]; then
|
||||
cp $SHFILE $0
|
||||
echo "ALSA-Info script has been updated to v $REMOTE_VERSION"
|
||||
echo "Please re-run the script"
|
||||
rm $SHFILE 2>/dev/null
|
||||
else
|
||||
mv $SHFILE /tmp/alsa-info.sh || exit 1
|
||||
echo "ALSA-Info script has been downloaded as /tmp/alsa-info.sh."
|
||||
echo "Please re-run the script from new location."
|
||||
fi
|
||||
exit
|
||||
else
|
||||
rm $SHFILE 2>/dev/null
|
||||
fi
|
||||
else
|
||||
cp /tmp/alsa-info.sh $0
|
||||
echo "Newer version detected: $REMOTE_VERSION"
|
||||
echo "To view the ChangeLog, please visit $CHANGELOG"
|
||||
echo "ALSA-Info script has been updated. Please re-run it."
|
||||
|
||||
if [ -w $0 ]; then
|
||||
echo "The original file $0 will be overwritten!"
|
||||
echo -n "If you do not like to proceed, press Ctrl-C now.." ; read inp
|
||||
cp $SHFILE $0
|
||||
echo "ALSA-Info script has been updated. Please re-run it."
|
||||
rm $SHFILE 2>/dev/null
|
||||
else
|
||||
mv $SHFILE /tmp/alsa-info.sh || exit 1
|
||||
echo "ALSA-Info script has been downloaded as /tmp/alsa-info.sh."
|
||||
echo "Please, re-run it from new location."
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
else
|
||||
rm $SHFILE 2>/dev/null
|
||||
fi
|
||||
rm /tmp/alsa-info.sh 2>/dev/null
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
rm -r $TEMPDIR 2>/dev/null
|
||||
if [ -n "$TEMPDIR" -a "$KEEP_FILES" != "yes" ]; then
|
||||
rm -r "$TEMPDIR" 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@ -101,7 +136,7 @@ withamixer() {
|
||||
echo "!!-------------" >> $FILE
|
||||
echo "" >> $FILE
|
||||
for i in `grep "]: " /proc/asound/cards | awk -F ' ' '{ print $1} '` ; do
|
||||
CARD_NAME=`grep "^ *$i " /tmp/alsainfo/alsacards.tmp|awk {'print $2'}`
|
||||
CARD_NAME=`grep "^ *$i " $TEMPDIR/alsacards.tmp|awk {'print $2'}`
|
||||
echo "!!-------Mixer controls for card $i $CARD_NAME]" >> $FILE
|
||||
echo "" >>$FILE
|
||||
amixer -c$i info>> $FILE 2>&1
|
||||
@ -125,9 +160,9 @@ withalsactl() {
|
||||
if [ -z "$exe" ]; then
|
||||
exe=`whereis alsactl | cut -d ' ' -f 2`
|
||||
fi
|
||||
$exe -f /tmp/alsainfo/alsactl.tmp store
|
||||
$exe -f $TEMPDIR/alsactl.tmp store
|
||||
echo "--startcollapse--" >> $FILE
|
||||
cat /tmp/alsainfo/alsactl.tmp >> $FILE
|
||||
cat $TEMPDIR/alsactl.tmp >> $FILE
|
||||
echo "--endcollapse--" >> $FILE
|
||||
echo "" >> $FILE
|
||||
echo "" >> $FILE
|
||||
@ -263,15 +298,18 @@ fi
|
||||
fi # question
|
||||
|
||||
#Set the output file
|
||||
TEMPDIR="/tmp/alsainfo/"
|
||||
FILE="/tmp/alsa-info.txt"
|
||||
TEMPDIR=`mktemp -p /tmp -d alsa-info.XXXXXXXXXX`
|
||||
FILE="$TEMPDIR/alsa-info.txt"
|
||||
NFILE="/tmp/alsa-info.txt"
|
||||
|
||||
trap cleanup 0
|
||||
|
||||
if [ "$PROCEED" = "yes" ]; then
|
||||
|
||||
if [[ -z "$LSPCI" ]]
|
||||
then
|
||||
then
|
||||
echo "This script requires lspci. Please install it, and re-run this script."
|
||||
exit 0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#Create the temporary work dir.
|
||||
@ -287,19 +325,25 @@ KERNEL_OS=`uname -o`
|
||||
ALSA_DRIVER_VERSION=`cat /proc/asound/version |head -n1|awk {'print $7'} |sed 's/\.$//'`
|
||||
ALSA_LIB_VERSION=`grep VERSION_STR /usr/include/alsa/version.h 2>/dev/null|awk {'print $3'}|sed 's/"//g'`
|
||||
ALSA_UTILS_VERSION=`amixer -v |awk {'print $3'}`
|
||||
VENDOR_ID=`lspci -vn |grep 040[1-3] | awk -F':' '{print $3}'|awk {'print substr($0, 2);}' >/tmp/alsainfo/vendor_id.tmp`
|
||||
DEVICE_ID=`lspci -vn |grep 040[1-3] | awk -F':' '{print $4}'|awk {'print $1'} >/tmp/alsainfo/device_id.tmp`
|
||||
VENDOR_ID=`lspci -vn |grep 040[1-3] | awk -F':' '{print $3}'|awk {'print substr($0, 2);}' >$TEMPDIR/vendor_id.tmp`
|
||||
DEVICE_ID=`lspci -vn |grep 040[1-3] | awk -F':' '{print $4}'|awk {'print $1'} >$TEMPDIR/device_id.tmp`
|
||||
LAST_CARD=$((`grep "]: " /proc/asound/cards | wc -l` - 1 ))
|
||||
cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>/tmp/alsainfo/alsamodules.tmp
|
||||
cat /proc/asound/cards >/tmp/alsainfo/alsacards.tmp
|
||||
lspci |grep -i "multi\|audio">/tmp/alsainfo/lspci.tmp
|
||||
|
||||
ESDINST=$(which esd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
|
||||
PAINST=$(which pulseaudio 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
|
||||
ARTSINST=$(which artsd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
|
||||
JACKINST=$(which jackd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
|
||||
|
||||
cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>$TEMPDIR/alsamodules.tmp
|
||||
cat /proc/asound/cards >$TEMPDIR/alsacards.tmp
|
||||
lspci |grep -i "multi\|audio">$TEMPDIR/lspci.tmp
|
||||
|
||||
#Check for HDA-Intel cards codec#*
|
||||
cat /proc/asound/card*/codec\#* > /tmp/alsainfo/alsa-hda-intel.tmp 2> /dev/null
|
||||
cat /proc/asound/card*/codec\#* > $TEMPDIR/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
|
||||
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
|
||||
|
||||
#Fetch the info, and put it in $FILE in a nice readable format.
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
@ -311,7 +355,7 @@ echo "!!################################" >> $FILE
|
||||
echo "!!ALSA Information Script v $SCRIPT_VERSION" >> $FILE
|
||||
echo "!!################################" >> $FILE
|
||||
echo "" >> $FILE
|
||||
echo "!!Script ran on: `LANG=C date`" >> $FILE
|
||||
echo "!!Script ran on: `LANG=C TZ=UTC date`" >> $FILE
|
||||
echo "" >> $FILE
|
||||
echo "" >> $FILE
|
||||
echo "!!Linux Distribution" >> $FILE
|
||||
@ -341,19 +385,55 @@ echo "" >> $FILE
|
||||
echo "!!Loaded ALSA modules" >> $FILE
|
||||
echo "!!-------------------" >> $FILE
|
||||
echo "" >> $FILE
|
||||
cat /tmp/alsainfo/alsamodules.tmp >> $FILE
|
||||
cat $TEMPDIR/alsamodules.tmp >> $FILE
|
||||
echo "" >> $FILE
|
||||
echo "" >> $FILE
|
||||
echo "!!Sound Servers on this system" >> $FILE
|
||||
echo "!!----------------------------" >> $FILE
|
||||
echo "" >> $FILE
|
||||
if [[ -n $PAINST ]];then
|
||||
[[ `pgrep '^(.*/)?pulseaudio$'` ]] && PARUNNING="Yes" || PARUNNING="No"
|
||||
echo "Pulseaudio:" >> $FILE
|
||||
echo " Installed - Yes ($PAINST)" >> $FILE
|
||||
echo " Running - $PARUNNING" >> $FILE
|
||||
echo "" >> $FILE
|
||||
fi
|
||||
if [[ -n $ESDINST ]];then
|
||||
[[ `pgrep '^(.*/)?esd$'` ]] && ESDRUNNING="Yes" || ESDRUNNING="No"
|
||||
echo "ESound Daemon:" >> $FILE
|
||||
echo " Installed - Yes ($ESDINST)" >> $FILE
|
||||
echo " Running - $ESDRUNNING" >> $FILE
|
||||
echo "" >> $FILE
|
||||
fi
|
||||
if [[ -n $ARTSINST ]];then
|
||||
[[ `pgrep '^(.*/)?artsd$'` ]] && ARTSRUNNING="Yes" || ARTSRUNNING="No"
|
||||
echo "aRts:" >> $FILE
|
||||
echo " Installed - Yes ($ARTSINST)" >> $FILE
|
||||
echo " Running - $ARTSRUNNING" >> $FILE
|
||||
echo "" >> $FILE
|
||||
fi
|
||||
if [[ -n $JACKINST ]];then
|
||||
[[ `pgrep '^(.*/)?jackd$'` ]] && JACKRUNNING="Yes" || JACKRUNNING="No"
|
||||
echo "Jack:" >> $FILE
|
||||
echo " Installed - Yes ($JACKINST)" >> $FILE
|
||||
echo " Running - $JACKRUNNING" >> $FILE
|
||||
echo "" >> $FILE
|
||||
fi
|
||||
if [[ -z "$PAINST" && -z "$ESDINST" && -z "$ARTSINST" && -z "$JACKINST" ]];then
|
||||
echo "No sound servers found." >> $FILE
|
||||
echo "" >> $FILE
|
||||
fi
|
||||
echo "" >> $FILE
|
||||
echo "!!Soundcards recognised by ALSA" >> $FILE
|
||||
echo "!!-----------------------------" >> $FILE
|
||||
echo "" >> $FILE
|
||||
cat /tmp/alsainfo/alsacards.tmp >> $FILE
|
||||
cat $TEMPDIR/alsacards.tmp >> $FILE
|
||||
echo "" >> $FILE
|
||||
echo "" >> $FILE
|
||||
echo "!!PCI Soundcards installed in the system" >> $FILE
|
||||
echo "!!--------------------------------------" >> $FILE
|
||||
echo "" >> $FILE
|
||||
cat /tmp/alsainfo/lspci.tmp >> $FILE
|
||||
cat $TEMPDIR/lspci.tmp >> $FILE
|
||||
echo "" >> $FILE
|
||||
echo "" >> $FILE
|
||||
echo "!!Advanced information - PCI Vendor/Device/Susbsystem ID's" >> $FILE
|
||||
@ -386,27 +466,27 @@ done
|
||||
echo "" >> $FILE
|
||||
fi
|
||||
|
||||
if [ -s "/tmp/alsainfo/alsa-hda-intel.tmp" ]
|
||||
if [ -s "$TEMPDIR/alsa-hda-intel.tmp" ]
|
||||
then
|
||||
echo "!!HDA-Intel Codec information" >> $FILE
|
||||
echo "!!---------------------------" >> $FILE
|
||||
echo "--startcollapse--" >> $FILE
|
||||
echo "" >> $FILE
|
||||
cat /tmp/alsainfo/alsa-hda-intel.tmp >> $FILE
|
||||
cat $TEMPDIR/alsa-hda-intel.tmp >> $FILE
|
||||
echo "--endcollapse--" >> $FILE
|
||||
echo "" >> $FILE
|
||||
echo "" >> $FILE
|
||||
fi
|
||||
|
||||
if [ -s "/tmp/alsainfo/alsa-ac97.tmp" ]
|
||||
if [ -s "$TEMPDIR/alsa-ac97.tmp" ]
|
||||
then
|
||||
echo "!!AC97 Codec information" >> $FILE
|
||||
echo "!!---------------------------" >> $FILE
|
||||
echo "--startcollapse--" >> $FILE
|
||||
echo "" >> $FILE
|
||||
cat /tmp/alsainfo/alsa-ac97.tmp >> $FILE
|
||||
cat $TEMPDIR/alsa-ac97.tmp >> $FILE
|
||||
echo "" >> $FILE
|
||||
cat /tmp/alsainfo/alsa-ac97-regs.tmp >> $FILE
|
||||
cat $TEMPDIR/alsa-ac97-regs.tmp >> $FILE
|
||||
echo "--endcollapse--" >> $FILE
|
||||
echo "" >> $FILE
|
||||
echo "" >> $FILE
|
||||
@ -450,7 +530,6 @@ then
|
||||
;;
|
||||
--no-upload)
|
||||
NOUPLOAD="yes"
|
||||
KEEP_FILES="yes"
|
||||
withdevices
|
||||
withconfigs
|
||||
withaplay
|
||||
@ -525,7 +604,6 @@ then
|
||||
echo " gnubien - Various script ideas / Testing"
|
||||
echo " GrueMaster - HDA Intel specific items / Testing"
|
||||
echo " olegfink - Script update function"
|
||||
cleanup
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
@ -546,7 +624,6 @@ then
|
||||
echo " --about (show some information about the script)"
|
||||
echo " --debug (will run the script as normal, but will not"
|
||||
echo " delete $FILE)"
|
||||
cleanup
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
@ -554,127 +631,123 @@ then
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$PROCEED" = "yes" ]; then
|
||||
if [ "$PROCEED" = "no" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "$NOUPLOAD" ]; then
|
||||
|
||||
mv $FILE $NFILE || exit 1
|
||||
|
||||
if [[ -n $DIALOG ]]
|
||||
then
|
||||
if [[ -n $PBERROR ]]; then
|
||||
dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occurred while contacting the $WWWSERVICE. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $NFILE" 10 100
|
||||
else
|
||||
dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the $WWWSERVICE\n\nYour ALSA information can be seen by looking in $NFILE" 10 100
|
||||
fi
|
||||
else
|
||||
echo
|
||||
|
||||
if [[ -n $PBERROR ]]; then
|
||||
echo "An error occurred while contacting the $WWWSERVICE. Your information was NOT automatically uploaded."
|
||||
echo ""
|
||||
echo "Your ALSA information can be seen by looking in $NFILE"
|
||||
echo ""
|
||||
else
|
||||
echo "You requested that your information was NOT automatically uploaded to the $WWWSERVICE"
|
||||
echo ""
|
||||
echo "Your ALSA information can be seen by looking in $NFILE"
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
|
||||
exit
|
||||
|
||||
fi # noupload
|
||||
|
||||
#Test that wget is installed, and supports --post-file. Upload $FILE if it does, and prompt user to upload file if it doesnt.
|
||||
if
|
||||
WGET=$(which wget 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null); [[ -n "${WGET}" ]] && [[ -x "${WGET}" ]] && [[ `wget --help |grep post-file` ]]
|
||||
then
|
||||
if [[ -n "$DIALOG" ]]
|
||||
|
||||
if [[ -n $DIALOG ]]
|
||||
then
|
||||
if [[ -z $NOUPLOAD ]]; then
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
wget -O - --tries=5 --timeout=60 --post-file=/tmp/alsa-info.txt "http://www.alsa-project.org/cardinfo-db/" &>/tmp/alsainfo/wget.tmp || echo "Upload failed; exit"
|
||||
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
wget -O - --tries=5 --timeout=60 --post-file=$FILE "http://www.alsa-project.org/cardinfo-db/" &>$TEMPDIR/wget.tmp || echo "Upload failed; exit"
|
||||
{ for i in 10 20 30 40 50 60 70 80 90; do
|
||||
echo $i
|
||||
sleep 0.2
|
||||
done
|
||||
echo; } |dialog --backtitle "$BGTITLE" --guage "Uploading information to www.alsa-project.org ..." 6 70 0
|
||||
else
|
||||
wget -O - --tries=5 --timeout=60 --post-file=/tmp/alsa-info.txt "http://pastebin.ca/quiet-paste.php?api=$PASTEBINKEY&encrypt=t&encryptpw=blahblah" &>/tmp/alsainfo/wget.tmp || echo "Upload failed; exit"
|
||||
else
|
||||
wget -O - --tries=5 --timeout=60 --post-file=$FILE "http://pastebin.ca/quiet-paste.php?api=$PASTEBINKEY&encrypt=t&encryptpw=blahblah" &>$TEMPDIR/wget.tmp || echo "Upload failed; exit"
|
||||
{ for i in 10 20 30 40 50 60 70 80 90; do
|
||||
echo $i
|
||||
sleep 0.2
|
||||
done
|
||||
echo; } |dialog --backtitle "$BGTITLE" --guage "Uploading information to www.pastebin.ca ..." 6 70 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dialog --backtitle "$BGTITLE" --title "Information uploaded" --yesno "Would you like to see the uploaded information?" 5 100
|
||||
DIALOG_EXIT_CODE=$?
|
||||
if [ $DIALOG_EXIT_CODE = 0 ]; then
|
||||
grep -v "alsa-info.txt" $FILE >$TEMPDIR/uploaded.txt
|
||||
dialog --backtitle "$BGTITLE" --textbox $TEMPDIR/uploaded.txt 0 0
|
||||
fi
|
||||
|
||||
clear
|
||||
|
||||
# no dialog
|
||||
else
|
||||
|
||||
if [[ -z $NOUPLOAD ]]; then
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
echo -n "Uploading information to www.alsa-project.org ... "
|
||||
wget -O - --tries=5 --timeout=60 --post-file=/tmp/alsa-info.txt http://www.alsa-project.org/cardinfo-db/ &>/tmp/alsainfo/wget.tmp &
|
||||
else
|
||||
wget -O - --tries=5 --timeout=60 --post-file=$FILE http://www.alsa-project.org/cardinfo-db/ &>$TEMPDIR/wget.tmp &
|
||||
else
|
||||
echo -n "Uploading information to www.pastebin.ca ... "
|
||||
wget -O - --tries=5 --timeout=60 --post-file=/tmp/alsa-info.txt http://pastebin.ca/quiet-paste.php?api=$PASTEBINKEY &>/tmp/alsainfo/wget.tmp &
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
#Progess spinner for wget transfer.
|
||||
if [[ -z "$DIALOG" ]]
|
||||
then
|
||||
i=1
|
||||
sp="/-\|"
|
||||
echo -n ' '
|
||||
while pgrep wget &>/dev/null
|
||||
do
|
||||
echo -en "\b${sp:i++%${#sp}:1}"
|
||||
done
|
||||
wget -O - --tries=5 --timeout=60 --post-file=$FILE http://pastebin.ca/quiet-paste.php?api=$PASTEBINKEY &>$TEMPDIR/wget.tmp &
|
||||
fi
|
||||
|
||||
#Progess spinner for wget transfer.
|
||||
i=1
|
||||
sp="/-\|"
|
||||
echo -n ' '
|
||||
while pgrep wget &>/dev/null
|
||||
do
|
||||
echo -en "\b${sp:i++%${#sp}:1}"
|
||||
done
|
||||
|
||||
echo -e "\b Done!"
|
||||
echo ""
|
||||
|
||||
fi #dialog
|
||||
|
||||
#See if tput is available, and use it if it is.
|
||||
if [[ -z $NOUPLOAD ]]; then
|
||||
if [[ -n "$TPUT" ]]
|
||||
then
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
FINAL_URL=`tput setaf 1; grep "SUCCESS:" /tmp/alsainfo/wget.tmp | cut -d ' ' -f 2 ; tput sgr0`
|
||||
else
|
||||
FINAL_URL=`tput setaf 1; grep "SUCCESS:" /tmp/alsainfo/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p';tput sgr0`
|
||||
fi
|
||||
if [[ -n "$TPUT" ]]
|
||||
then
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
FINAL_URL=`tput setaf 1; grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2 ; tput sgr0`
|
||||
else
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
FINAL_URL=`grep "SUCCESS:" /tmp/alsainfo/wget.tmp | cut -d ' ' -f 2`
|
||||
else
|
||||
FINAL_URL=`grep "SUCCESS:" /tmp/alsainfo/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p'`
|
||||
fi
|
||||
FINAL_URL=`tput setaf 1; grep "SUCCESS:" $TEMPDIR/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p';tput sgr0`
|
||||
fi
|
||||
else
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
FINAL_URL=`grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2`
|
||||
else
|
||||
FINAL_URL=`grep "SUCCESS:" $TEMPDIR/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p'`
|
||||
fi
|
||||
fi
|
||||
|
||||
#Output the URL of the uploaded file.
|
||||
if [[ -z $DIALOG ]]
|
||||
then
|
||||
echo -e "\b Done!"
|
||||
echo ""
|
||||
if [[ -z $NOUPLOAD ]]; then
|
||||
echo "Your ALSA information is located at $FINAL_URL"
|
||||
echo "Please inform the person helping you."
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
if [[ -n $DIALOG ]]
|
||||
then
|
||||
if [[ -n $NOUPLOAD ]]; then
|
||||
if [[ -n $PBERROR ]]; then
|
||||
dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occured while contacting the $WWWSERVICE. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $FILE" 10 100
|
||||
else
|
||||
dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the $WWWSERVICE\n\nYour ALSA information can be seen by looking in $FILE" 10 100
|
||||
fi
|
||||
else
|
||||
dialog --backtitle "$BGTITLE" --title "Information uploaded" --yesno "Would you like to see the uploaded information?" 5 100
|
||||
DIALOG_EXIT_CODE=$?
|
||||
if [ $DIALOG_EXIT_CODE = 0 ]; then
|
||||
grep -v "alsa-info.txt" /tmp/alsa-info.txt >/tmp/alsainfo/uploaded.txt
|
||||
dialog --backtitle "$BGTITLE" --textbox /tmp/alsainfo/uploaded.txt 0 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
clear
|
||||
if [[ -n $NOUPLOAD ]]; then
|
||||
if [[ -n $PBERROR ]]; then
|
||||
echo "An error occured while contacting the $WWWSERVICE. Your information was NOT automatically uploaded."
|
||||
echo ""
|
||||
echo "Your ALSA information can be seen by looking in $FILE"
|
||||
echo ""
|
||||
else
|
||||
echo "You requested that your information was NOT automatically uploaded to the $WWWSERVICE"
|
||||
echo ""
|
||||
echo "Your ALSA information can be seen by looking in $FILE"
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
if [[ -z $NOUPLOAD ]]; then
|
||||
echo "Your ALSA information is located at $FINAL_URL"
|
||||
echo "Please inform the person helping you."
|
||||
echo ""
|
||||
fi
|
||||
#We posted the file , so we dont need it anymore. delete it.
|
||||
if [ -z $KEEP_FILES ]
|
||||
then
|
||||
rm $FILE
|
||||
fi
|
||||
|
||||
#We couldnt find a suitable wget, so tell the user to upload manually.
|
||||
else
|
||||
mv $FILE $NFILE || exit 1
|
||||
if [[ -z $DIALOG ]]
|
||||
then
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
@ -684,7 +757,7 @@ else
|
||||
echo " 1. Couldnt find 'wget' in your PATH"
|
||||
echo " 2. Your version of wget is less than 1.8.2"
|
||||
echo ""
|
||||
echo "Please manually upload $FILE to http://www.alsa-project.org/cardinfo-db/ and submit your post."
|
||||
echo "Please manually upload $NFILE to http://www.alsa-project.org/cardinfo-db/ and submit your post."
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
@ -693,23 +766,16 @@ else
|
||||
echo " 1. Couldnt find 'wget' in your PATH"
|
||||
echo " 2. Your version of wget is less than 1.8.2"
|
||||
echo ""
|
||||
echo "Please manually upload $FILE to http://www.pastebin.ca/upload.php and submit your post."
|
||||
echo "Please manually upload $NFILE to http://www.pastebin.ca/upload.php and submit your post."
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
if [[ -n $DIALOG ]]
|
||||
then
|
||||
else
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.alsa-project.org.\nPossible reasons are:\n\n 1. Couldn't find 'wget' in your PATH\n 2. Your version of wget is less than 1.8.2\n\nPlease manually upload $FILE to http://www.alsa-project,org/cardinfo-db/ and submit your post." 25 100
|
||||
dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.alsa-project.org.\nPossible reasons are:\n\n 1. Couldn't find 'wget' in your PATH\n 2. Your version of wget is less than 1.8.2\n\nPlease manually upload $NFILE to http://www.alsa-project,org/cardinfo-db/ and submit your post." 25 100
|
||||
else
|
||||
dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.pastebin.ca.\nPossible reasons are:\n\n 1. Couldn't find 'wget' in your PATH\n 2. Your version of wget is less than 1.8.2\n\nPlease manually upload $FILE to http://www.pastebin.ca/upload.php and submit your post." 25 100
|
||||
dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.pastebin.ca.\nPossible reasons are:\n\n 1. Couldn't find 'wget' in your PATH\n 2. Your version of wget is less than 1.8.2\n\nPlease manually upload $NFILE to http://www.pastebin.ca/upload.php and submit your post." 25 100
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
#Clean up the temp files
|
||||
if [ -z $KEEP_FILES ]
|
||||
then
|
||||
cleanup
|
||||
fi
|
||||
|
||||
fi # proceed
|
||||
|
||||
|
@ -324,7 +324,7 @@ index 74d1d1a..209c5bb 100644
|
||||
*/
|
||||
int snd_pcm_set_params(snd_pcm_t *pcm,
|
||||
diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c
|
||||
index 82823a0..6ddf14f 100644
|
||||
index 82823a0..bfa1cc8 100644
|
||||
--- a/src/pcm/pcm_file.c
|
||||
+++ b/src/pcm/pcm_file.c
|
||||
@@ -29,6 +29,7 @@
|
||||
@ -440,7 +440,7 @@ index 82823a0..6ddf14f 100644
|
||||
+
|
||||
+ case BWIDTH_KEY:
|
||||
+ snprintf(value, sizeof(value), "%d",
|
||||
+ pcm->frame_bits/(8 * pcm->channels));
|
||||
+ pcm->frame_bits/pcm->channels);
|
||||
+ err = snd_pcm_file_append_value(&new_fname,
|
||||
+ &new_index_ch, &new_len, value);
|
||||
+ if (err < 0)
|
||||
@ -688,7 +688,7 @@ index 82823a0..6ddf14f 100644
|
||||
+ # real values corresponding to the stream:
|
||||
+ # %r rate (replaced with: 48000)
|
||||
+ # %c channels (replaced with: 2)
|
||||
+ # %b bytes per sample (replaced with: 2)
|
||||
+ # %b bits per sample (replaced with: 16)
|
||||
+ # %f sample format string
|
||||
+ # (replaced with: S16_LE)
|
||||
+ # %% replaced with %
|
||||
@ -763,3 +763,214 @@ index abd3d43..967cf46 100644
|
||||
return 0;
|
||||
#else
|
||||
return -EINVAL;
|
||||
diff --git a/src/seq/seq.c b/src/seq/seq.c
|
||||
index feb9733..7b777a1 100644
|
||||
--- a/src/seq/seq.c
|
||||
+++ b/src/seq/seq.c
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
/*! \page seq Sequencer interface
|
||||
|
||||
-\section seq_general Genral
|
||||
+\section seq_general General
|
||||
|
||||
The ALSA sequencer interface is designed to deliver the MIDI-like
|
||||
events between clients/ports.
|
||||
@@ -76,10 +76,10 @@ A client can have one or more <i>ports</i> to communicate between other
|
||||
clients. A port is corresponding to the MIDI port in the case of MIDI device,
|
||||
but in general it is nothing but the access point between other clients.
|
||||
Each port may have capability flags, which specify the read/write
|
||||
-accessbility and subscription permissions of the port.
|
||||
+accessibility and subscription permissions of the port.
|
||||
For creation of a port, call #snd_seq_create_port()
|
||||
-with the appropirate port attribute specified in #snd_seq_port_info_t
|
||||
-reocrd.
|
||||
+with the appropriate port attribute specified in #snd_seq_port_info_t
|
||||
+record.
|
||||
|
||||
For creating a port for the normal use, there is a helper function
|
||||
#snd_seq_create_simple_port(). An example with this function is like below.
|
||||
@@ -102,7 +102,7 @@ Here, input and output mean
|
||||
input (read) from other clients and output (write) to others, respectively.
|
||||
Since memory pool of each client is independent from others,
|
||||
it avoids such a situation that a client eats the whole events pool
|
||||
-and interfere other clients' responce.
|
||||
+and interfere other clients' response.
|
||||
|
||||
The all scheduled output events or input events from dispatcher are stored
|
||||
on these pools until delivered to other clients or extracted to user space.
|
||||
@@ -171,7 +171,7 @@ the MIDI events like program, velocity or chorus effects.
|
||||
This application can accept arbitrary MIDI input
|
||||
and send to arbitrary port, just like a Unix pipe application using
|
||||
stdin and stdout files.
|
||||
-We can even connect several filter applictions which work individually
|
||||
+We can even connect several filter applications which work individually
|
||||
in order to process the MIDI events.
|
||||
Subscription can be used for this purpose.
|
||||
The connection between ports can be done also by the "third" client.
|
||||
@@ -199,7 +199,7 @@ All the sequencer events are stored in a sequencer event record,
|
||||
#snd_seq_event_t type.
|
||||
Application can send and receive these event records to/from other
|
||||
clients via sequencer.
|
||||
-An event has several stroage types according to its usage.
|
||||
+An event has several storage types according to its usage.
|
||||
For example, a SYSEX message is stored on the variable length event,
|
||||
and a large synth sample data is delivered using a user-space data pointer.
|
||||
|
||||
@@ -227,7 +227,7 @@ The type field contains the type of the event
|
||||
(1 byte).
|
||||
The flags field consists of bit flags which
|
||||
describe several conditions of the event (1 byte).
|
||||
-It includes the time-stamp mode, data storage type, and scheduling prority.
|
||||
+It includes the time-stamp mode, data storage type, and scheduling priority.
|
||||
The tag field is an arbitrary tag.
|
||||
This tag can used for removing a distinct event from the event queue
|
||||
via #snd_seq_remove_events().
|
||||
@@ -240,7 +240,7 @@ The data field is a union of event data.
|
||||
An event can be delivered either on scheduled or direct dispatch mode.
|
||||
On the scheduling mode, an event is once stored on the priority queue
|
||||
and delivered later (or even immediately) to the destination,
|
||||
-whereas on the direct disatch mode, an event is passed to the destination
|
||||
+whereas on the direct dispatch mode, an event is passed to the destination
|
||||
without any queue.
|
||||
|
||||
For a scheduled delivery, a queue to process the event must exist.
|
||||
@@ -284,7 +284,7 @@ The time stored in an event record is a union of these two different
|
||||
time values.
|
||||
|
||||
Note that the time format used for real time events is very similar to
|
||||
-timeval struct used for unix system time.
|
||||
+timeval struct used for Unix system time.
|
||||
The absurd resolution of the timestamps allows us to perform very accurate
|
||||
conversions between songposition and real time. Round-off errors can be
|
||||
neglected.
|
||||
@@ -299,7 +299,7 @@ counted from the moment when the queue started.
|
||||
An client that relies on these relative timestamps is the MIDI input port.
|
||||
As each sequencer queue has it's own clock the only way to deliver events at
|
||||
the right time is by using the relative timestamp format. When the event
|
||||
-arrives at the queue it is normalised to absolute format.
|
||||
+arrives at the queue it is normalized to absolute format.
|
||||
|
||||
The timestamp format is specified in the flag bitfield masked by
|
||||
#SND_SEQ_TIME_STAMP_MASK.
|
||||
@@ -320,7 +320,7 @@ fill the port id of source.port and
|
||||
both client and port of dest field.
|
||||
|
||||
If an existing address is set to the destination,
|
||||
-the event is simplly delivered to it.
|
||||
+the event is simply delivered to it.
|
||||
When #SND_SEQ_ADDRESS_SUBSCRIBERS is set to the destination client id,
|
||||
the event is delivered to all the clients connected to the source port.
|
||||
|
||||
@@ -346,7 +346,7 @@ an announcement is sent to subscribers from this port.
|
||||
|
||||
Some events like SYSEX message, however, need larger data space
|
||||
than the standard data.
|
||||
-For such events, ALSA sequencer provides seveal different data storage types.
|
||||
+For such events, ALSA sequencer provides several different data storage types.
|
||||
The data type is specified in the flag bits masked by #SND_SEQ_EVENT_LENGTH_MASK.
|
||||
The following data types are available:
|
||||
|
||||
@@ -359,7 +359,7 @@ A macro #snd_seq_ev_set_fixed() is provided to set this type.
|
||||
\par Variable length data
|
||||
SYSEX or a returned error use this type.
|
||||
The actual data is stored on an extra allocated space.
|
||||
-On sequecer kernel, the whole extra-data is duplicated, so that the event
|
||||
+On sequencer kernel, the whole extra-data is duplicated, so that the event
|
||||
can be scheduled on queue.
|
||||
The data contains only the length and the
|
||||
pointer of extra-data.
|
||||
@@ -430,7 +430,7 @@ Note that PPQ cannot be changed while the queue is running.
|
||||
It must be set before the queue is started.
|
||||
|
||||
On the other hand, in the case of <i>realtime</i> queue, the
|
||||
-time resolution is fixed to nanosecononds. There is, however,
|
||||
+time resolution is fixed to nanoseconds. There is, however,
|
||||
a parameter to change the speed of this queue, called <i>skew</i>.
|
||||
You can make the queue faster or slower by setting the skew value
|
||||
bigger or smaller. In the API, the skew is defined by two values,
|
||||
@@ -488,7 +488,7 @@ special settings.
|
||||
In the above example, the tempo is changed immediately after
|
||||
the buffer is flushed by #snd_seq_drain_output() call.
|
||||
You can schedule the event in a certain queue so that the tempo
|
||||
-change happes at the scheduled time, too.
|
||||
+change happens at the scheduled time, too.
|
||||
|
||||
\subsection seq_ev_start Starting and stopping a queue
|
||||
|
||||
@@ -515,7 +515,7 @@ Each ALSA port can have capability flags.
|
||||
The most basic capability flags are
|
||||
#SND_SEQ_PORT_CAP_READ and #SND_SEQ_PORT_CAP_WRITE.
|
||||
The former means that the port allows to send events to other ports,
|
||||
-whereas the latter capability menas
|
||||
+whereas the latter capability means
|
||||
that the port allows to receive events from other ports.
|
||||
You may have noticed that meanings of \c READ and \c WRITE
|
||||
are permissions of the port from the viewpoint of other ports.
|
||||
@@ -536,7 +536,7 @@ Obviously, these flags have no influence
|
||||
if \c READ or \c WRITE> capability is not set.
|
||||
|
||||
Note that these flags are not necessary if the client subscribes itself
|
||||
-to the spcified port.
|
||||
+to the specified port.
|
||||
For example, when a port makes READ subscription
|
||||
to MIDI input port, this port must have #SND_SEQ_PORT_CAP_WRITE capability,
|
||||
but no #SND_SEQ_PORT_CAP_SUBS_WRITE capability is required.
|
||||
@@ -610,7 +610,7 @@ if #SND_SEQ_PORT_CAP_NO_EXPORT capability is set in either sender or receiver po
|
||||
|
||||
Assume MIDI input port = 64:0, application port = 128:0, and
|
||||
queue for timestamp = 1 with real-time stamp.
|
||||
-The application port must have capabilty #SND_SEQ_PORT_CAP_WRITE.
|
||||
+The application port must have capability #SND_SEQ_PORT_CAP_WRITE.
|
||||
\code
|
||||
void capture_keyboard(snd_seq_t *seq)
|
||||
{
|
||||
@@ -633,7 +633,7 @@ void capture_keyboard(snd_seq_t *seq)
|
||||
\subsection seq_subs_ex_out Output to MIDI device
|
||||
|
||||
Assume MIDI output port = 65:1 and application port = 128:0.
|
||||
-The application port must have capabilty #SND_SEQ_PORT_CAP_READ.
|
||||
+The application port must have capability #SND_SEQ_PORT_CAP_READ.
|
||||
\code
|
||||
void subscribe_output(snd_seq_t *seq)
|
||||
{
|
||||
@@ -790,7 +790,7 @@ void event_filter(snd_seq_t *seq, snd_seq_event_t *ev)
|
||||
/**
|
||||
* \brief get identifier of sequencer handle
|
||||
* \param seq sequencer handle
|
||||
- * \return ascii identifier of sequencer handle
|
||||
+ * \return ASCII identifier of sequencer handle
|
||||
*
|
||||
* Returns the ASCII identifier of the given sequencer handle. It's the same
|
||||
* identifier specified in snd_seq_open().
|
||||
@@ -1610,7 +1610,7 @@ void snd_seq_client_info_event_filter_del(snd_seq_client_info_t *info, int event
|
||||
* \param event_type event type to be checked
|
||||
* \return 1 if the event type is present, 0 otherwise
|
||||
*
|
||||
- * Test if the event type is in the filter bitamp of this client_info container.
|
||||
+ * Test if the event type is in the filter bitmap of this client_info container.
|
||||
*
|
||||
* \sa snd_seq_get_client_info(),
|
||||
* snd_seq_set_client_info(),
|
||||
diff --git a/src/seq/seqmid.c b/src/seq/seqmid.c
|
||||
index 3b0960d..86a4970 100644
|
||||
--- a/src/seq/seqmid.c
|
||||
+++ b/src/seq/seqmid.c
|
||||
@@ -317,7 +317,7 @@ int snd_seq_set_client_pool_input(snd_seq_t *seq, size_t size)
|
||||
* \param seq sequencer handle
|
||||
* \return 0 on success or negative error code
|
||||
*
|
||||
- * So far, this works ideically like #snd_seq_drop_output().
|
||||
+ * So far, this works identically like #snd_seq_drop_output().
|
||||
*/
|
||||
int snd_seq_reset_pool_output(snd_seq_t *seq)
|
||||
{
|
||||
@@ -329,7 +329,7 @@ int snd_seq_reset_pool_output(snd_seq_t *seq)
|
||||
* \param seq sequencer handle
|
||||
* \return 0 on success or negative error code
|
||||
*
|
||||
- * So far, this works ideically like #snd_seq_drop_input().
|
||||
+ * So far, this works identically like #snd_seq_drop_input().
|
||||
*/
|
||||
int snd_seq_reset_pool_input(snd_seq_t *seq)
|
||||
{
|
||||
|
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 4 11:27:27 CET 2009 - tiwai@suse.de
|
||||
|
||||
- alsa-lib git as of 2009.03.03:
|
||||
* fix typos in documents
|
||||
* change "%b" semantics for PCM file plugin
|
||||
- updated alsa-info.sh to ver.0.4.56
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 17 17:02:38 CET 2009 - tiwai@suse.de
|
||||
|
||||
|
@ -34,7 +34,7 @@ Obsoletes: alsa-64bit
|
||||
#
|
||||
Summary: Advanced Linux Sound Architecture
|
||||
Version: 1.0.18
|
||||
Release: 17
|
||||
Release: 18
|
||||
Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2
|
||||
Source8: 40-alsa.rules
|
||||
Source11: alsasound
|
||||
@ -244,6 +244,11 @@ exit 0
|
||||
%{_datadir}/alsa
|
||||
|
||||
%changelog
|
||||
* Wed Mar 04 2009 tiwai@suse.de
|
||||
- alsa-lib git as of 2009.03.03:
|
||||
* fix typos in documents
|
||||
* change "%%b" semantics for PCM file plugin
|
||||
- updated alsa-info.sh to ver.0.4.56
|
||||
* Tue Feb 17 2009 tiwai@suse.de
|
||||
- set the ctl numids properly with external plugins (bnc#462032)
|
||||
- fix oxygen driver config (removal of softfloat again)
|
||||
|
Loading…
x
Reference in New Issue
Block a user