diff --git a/.cvsignore b/.cvsignore index a8f9d6f..45e9d67 100644 --- a/.cvsignore +++ b/.cvsignore @@ -21,3 +21,4 @@ alsa-utils-1.0.18rc3.tar.bz2 alsa-utils-1.0.18.tar.bz2 alsa-utils-1.0.19.tar.bz2 alsa-utils-1.0.20.tar.bz2 +alsa-utils-1.0.21.tar.bz2 diff --git a/alsa-info.sh b/alsa-info.sh index f1660f8..fe7c08d 100644 --- a/alsa-info.sh +++ b/alsa-info.sh @@ -1,6 +1,6 @@ #!/bin/bash -SCRIPT_VERSION=0.4.56 +SCRIPT_VERSION=0.4.58 CHANGELOG="http://www.alsa-project.org/alsa-info.sh.changelog" ################################################################################# @@ -36,15 +36,17 @@ PASTEBINKEY="C9cRIO8m/9y8Cs0nVs0FraRx7U0pHsuc" #Define some simple functions pbcheck(){ + [[ $UPLOAD = "no" ]] && return + if [[ -z $PASTEBIN ]]; then - [[ $(ping -c1 www.alsa-project.org) ]] || KEEP_FILES="yes" NOUPLOAD="yes" PBERROR="yes" + [[ $(ping -c1 www.alsa-project.org) ]] || KEEP_FILES="yes" UPLOAD="no" PBERROR="yes" else - [[ $(ping -c1 www.pastebin.ca) ]] || KEEP_FILES="yes" NOUPLOAD="yes" PBERROR="yes" + [[ $(ping -c1 www.pastebin.ca) ]] || KEEP_FILES="yes" UPLOAD="no" PBERROR="yes" fi } update() { - SHFILE=`mktemp -p /tmp alsa-info.XXXXXXXXXX` + SHFILE=`mktemp -t alsa-info.XXXXXXXXXX` || exit 1 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 @@ -72,8 +74,7 @@ update() { 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 "ALSA-Info script has been downloaded as $SHFILE." echo "Please re-run the script from new location." fi exit @@ -90,8 +91,7 @@ update() { 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 "ALSA-Info script has been downloaded $SHFILE." echo "Please, re-run it from new location." fi exit @@ -103,8 +103,9 @@ update() { cleanup() { if [ -n "$TEMPDIR" -a "$KEEP_FILES" != "yes" ]; then - rm -r "$TEMPDIR" 2>/dev/null + rm -rf "$TEMPDIR" 2>/dev/null fi + test -n "$KEEP_OUTPUT" || rm -f "$NFILE" } @@ -241,6 +242,26 @@ withsysfs() { fi } +withdmesg() { + echo "!!ALSA/HDA dmesg" >> $FILE + echo "!!------------------" >> $FILE + echo "" >> $FILE + dmesg | grep -C1 -E 'ALSA|HDA|HDMI|sound|hda.codec|hda.intel' >> $FILE + echo "" >> $FILE + echo "" >> $FILE +} + +withall() { + withdevices + withconfigs + withaplay + withamixer + withalsactl + withlsmod + withsysfs + withdmesg +} + get_alsa_library_version() { ALSA_LIB_VERSION=`grep VERSION_STR /usr/include/alsa/version.h 2>/dev/null|awk {'print $3'}|sed 's/"//g'` @@ -287,20 +308,29 @@ SYSFS=$(mount |grep sysfs|awk {'print $3'}); #Check modprobe config files for sound related options SNDOPTIONS=$(modprobe -c|sed -n 's/^options \(snd[-_][^ ]*\)/\1:/p') +KEEP_OUTPUT= +NFILE="" + PASTEBIN="" WWWSERVICE="www.alsa-project.org" -QUESTION="yes" +WELCOME="yes" PROCEED="yes" +UPLOAD="ask" REPEAT="" while [ -z "$REPEAT" ]; do REPEAT="no" case "$1" in --update|--help|--about) - QUESTION="no" + WELCOME="no" PROCEED="no" ;; + --upload) + UPLOAD="yes" + WELCOME="no" + ;; --no-upload) - NOUPLOAD="yes" + UPLOAD="no" + WELCOME="no" ;; --pastebin) PASTEBIN="yes" @@ -313,61 +343,50 @@ case "$1" in ;; --stdout) DIALOG="" - NOUPLOAD="yes" - QUESTION="no" + UPLOAD="no" + WELCOME="no" TOSTDOUT="yes" ;; esac done - -#Script header output. -if [ "$QUESTION" = "yes" ]; then -if [[ -n "$DIALOG" ]] -then -if [ -z "$NOUPLOAD" ]; then - dialog --backtitle "$BGTITLE" --title "ALSA-Info script v $SCRIPT_VERSION" --yesno "\nThis script will collect information about your ALSA installation and sound related hardware, to help diagnose your problem\n\nBy default, this script will AUTOMATICALLY UPLOAD your information to a $WWWSERVICE site.\n\nSee $0 --help for options\n\nDo you want to run this script?" 0 0 -else - dialog --backtitle "$BGTITLE" --title "ALSA-Info script v $SCRIPT_VERSION" --yesno "\nThis script will collect information about your ALSA installation and sound related hardware, to help diagnose your problem\n\nSee $0 --help for options\n\nDo you want to run this script?" 0 0 -fi -DIALOG_EXIT_CODE=$? -if [ $DIALOG_EXIT_CODE != 0 ]; then -echo "Thank you for using the ALSA-Info Script" -exit 0; -fi -else -echo "ALSA Information Script v $SCRIPT_VERSION" -echo "--------------------------------" -echo "" -echo "This script will collect information about your ALSA installation and sound related hardware, to help diagnose your problem." -echo "" -if [ -z "$NOUPLOAD" ]; then -if [[ -n "$TPUT" ]]; then -tput bold -echo "By default, the collected information will be AUTOMATICALLY uploaded to a $WWWSERVICE site." -echo "If you do not wish for this to occur, run the script with the --no-upload argument" -tput sgr0 +#Script header output. +if [ "$WELCOME" = "yes" ]; then +greeting_message="\ + +This script visits the following commands/files to collect diagnostic +information about your ALSA installation and sound related hardware. + + dmesg + lspci + lsmod + aplay + amixer + alsactl + /proc/asound/ + /sys/class/sound/ + ~/.asoundrc (etc.) + +See '$0 --help' for command line options. +" +if [[ -n "$DIALOG" ]]; then + dialog --backtitle "$BGTITLE" \ + --title "ALSA-Info script v $SCRIPT_VERSION" \ + --msgbox "$greeting_message" 20 80 else -echo "By default, the collected information will be AUTOMATICALLY uploaded to a $WWWSERVICE site." -echo "If you do not wish for this to occur, run the script with the --no-upload argument" -fi -echo "" -fi # NOUPLOAD -echo -n "Do you want to run this script? [y/n] : " -read -e CONFIRM -if [ "$CONFIRM" != "y" ]; then -echo "" -echo "Thank you for using the ALSA-Info Script" -exit 0; -fi -fi -fi # question + echo "ALSA Information Script v $SCRIPT_VERSION" + echo "--------------------------------" + echo "$greeting_message" +fi # dialog +fi # WELCOME #Set the output file -TEMPDIR=`mktemp -p /tmp -d alsa-info.XXXXXXXXXX` +TEMPDIR=`mktemp -t -d alsa-info.XXXXXXXXXX` || exit 1 FILE="$TEMPDIR/alsa-info.txt" -NFILE="/tmp/alsa-info.txt" +if [ -z "$NFILE" ]; then + NFILE=`mktemp -t alsa-info.txt.XXXXXXXXXX` || exit 1 +fi trap cleanup 0 @@ -379,9 +398,6 @@ then exit 0 fi -#Create the temporary work dir. -mkdir $TEMPDIR 2>/dev/null - #Fetch the info and store in temp files/variables DISTRO=`grep -ihs "buntu\|SUSE\|Fedora\|PCLinuxOS\|MEPIS\|Mandriva\|Debian\|Damn\|Sabayon\|Slackware\|KNOPPIX\|Gentoo\|Zenwalk\|Mint\|Kubuntu\|FreeBSD\|Puppy\|Freespire\|Vector\|Dreamlinux\|CentOS\|Arch\|Xandros\|Elive\|SLAX\|Red\|BSD\|KANOTIX\|Nexenta\|Foresight\|GeeXboX\|Frugalware\|64\|SystemRescue\|Novell\|Solaris\|BackTrack\|KateOS\|Pardus" /etc/{issue,*release,*version}` KERNEL_VERSION=`uname -r` @@ -400,6 +416,17 @@ 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) +DMIDECODE=$(which dmidecode 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null) + +#Check for DMI data +if [ -d /sys/class/dmi/id ]; then + # No root privileges are required when using sysfs method + DMI_SYSTEM_MANUFACTURER=$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) + DMI_SYSTEM_PRODUCT_NAME=$(cat /sys/class/dmi/id/product_name 2>/dev/null) +elif [ -x $DMIDECODE ]; then + DMI_SYSTEM_MANUFACTURER=$($DMIDECODE -s system-manufacturer 2>/dev/null) + DMI_SYSTEM_PRODUCT_NAME=$($DMIDECODE -s system-product-name 2>/dev/null) +fi cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>$TEMPDIR/alsamodules.tmp cat /proc/asound/cards >$TEMPDIR/alsacards.tmp @@ -431,6 +458,13 @@ echo "" >> $FILE echo $DISTRO >> $FILE echo "" >> $FILE echo "" >> $FILE +echo "!!DMI Information" >> $FILE +echo "!!---------------" >> $FILE +echo "" >> $FILE +echo "Manufacturer: $DMI_SYSTEM_MANUFACTURER" >> $FILE +echo "Product Name: $DMI_SYSTEM_PRODUCT_NAME" >> $FILE +echo "" >> $FILE +echo "" >> $FILE echo "!!Kernel Information" >> $FILE echo "!!------------------" >> $FILE echo "" >> $FILE @@ -527,7 +561,10 @@ echo "!!--------------------------" >> $FILE echo "" >> $FILE for mod in `cat /proc/asound/modules|awk {'print $2'}`;do echo "!!Module: $mod" >> $FILE -for params in `ls $SYSFS/module/$mod/parameters/*`; do /bin/echo -ne "\t";/bin/echo "$params : `cat $params`"|sed 's:.*/::' >> $FILE;done +for params in `echo $SYSFS/module/$mod/parameters/*`; do + echo -ne "\t"; + echo "$params : `cat $params`" | sed 's:.*/::'; +done >> $FILE echo "" >> $FILE done echo "" >> $FILE @@ -564,12 +601,7 @@ fi if [[ -z "$1" ]] then update - withdevices - withconfigs - withaplay - withamixer - withalsactl - withlsmod + withall pbcheck fi @@ -583,49 +615,34 @@ then case "$1" in --pastebin) update - withdevices - withconfigs - withaplay - withamixer - withalsactl - withlsmod - withsysfs + withall pbcheck ;; --update) update exit ;; + --upload) + UPLOAD="yes" + withall + ;; --no-upload) - NOUPLOAD="yes" - withdevices - withconfigs - withaplay - withamixer - withalsactl - withlsmod - withsysfs + UPLOAD="no" + withall + ;; + --output) + shift + NFILE="$1" + KEEP_OUTPUT="yes" ;; --debug) echo "Debugging enabled. $FILE and $TEMPDIR will not be deleted" KEEP_FILES="yes" echo "" - withdevices - withconfigs - withaplay - withamixer - withalsactl - withlsmod - withsysfs + withall ;; --with-all) - withdevices - withconfigs - withaplay - withamixer - withalsactl - withlsmod - withsysfs + withall ;; --with-aplay) withaplay @@ -639,6 +656,9 @@ then --with-devices) withdevices ;; + --with-dmesg) + withdmesg + ;; --with-configs) if [[ -e $HOME/.asoundrc ]] || [[ -e /etc/asound.conf ]] then @@ -668,13 +688,8 @@ then fi ;; --stdout) - NOUPLOAD="yes" - withdevices - withconfigs - withaplay - withamixer - withalsactl - withlsmod + UPLOAD="no" + withall cat $FILE rm $FILE ;; @@ -699,13 +714,16 @@ then echo " --with-configs (includes the output of ~/.asoundrc and" echo " /etc/asound.conf if they exist)" echo " --with-devices (shows the device nodes in /dev/snd/)" + echo " --with-dmesg (shows the ALSA/HDA kernel messages)" echo "" + echo " --output FILE (specify the file to output for no-upload mode)" echo " --update (check server for script updates)" + echo " --upload (upload contents to remote server)" echo " --no-upload (do not upload contents to remote server)" echo " --pastebin (use http://pastebin.ca) as remote server" echo " instead www.alsa-project.org" - echo " --stdout (print alsa information to standard output" - echo " instead of a file)" + echo " --stdout (print alsa information to standard output" + echo " instead of a file)" echo " --about (show some information about the script)" echo " --debug (will run the script as normal, but will not" echo " delete $FILE)" @@ -720,32 +738,54 @@ if [ "$PROCEED" = "no" ]; then exit 1 fi -if [ -n "$NOUPLOAD" ]; then +if [ "$UPLOAD" = "ask" ]; then + if [[ -n "$DIALOG" ]]; then + dialog --backtitle "$BGTITLE" --title "Information collected" --yes-label " UPLOAD / SHARE " --no-label " SAVE LOCALLY " --defaultno --yesno "\n\nAutomatically upload ALSA information to $WWWSERVICE?" 10 80 + DIALOG_EXIT_CODE=$? + if [ $DIALOG_EXIT_CODE != 0 ]; then + UPLOAD="no" + else + UPLOAD="yes" + fi + else + echo -n "Automatically upload ALSA information to $WWWSERVICE? [y/N] : " + read -e CONFIRM + if [ "$CONFIRM" != "y" ]; then + UPLOAD="no" + else + UPLOAD="yes" + fi + fi + +fi + +if [ "$UPLOAD" = "no" ]; then if [ -z "$TOSTDOUT" ]; then - mv $FILE $NFILE || exit 1 + mv -f $FILE $NFILE || exit 1 + KEEP_OUTPUT="yes" fi 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 + dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occurred while contacting the $WWWSERVICE.\n Your information was NOT automatically uploaded.\n\nYour ALSA information is 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 + dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "\n\nYour ALSA information is in $NFILE" 10 60 fi else echo if [[ -n $PBERROR ]]; then - echo "An error occurred while contacting the $WWWSERVICE. Your information was NOT automatically uploaded." + echo "An error occurred while contacting the $WWWSERVICE." + echo "Your information was NOT automatically uploaded." echo "" - echo "Your ALSA information can be seen by looking in $NFILE" + echo "Your ALSA information is in $NFILE" echo "" else if [ -z "$TOSTDOUT" ]; then - 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 "Your ALSA information is in $NFILE" echo "" fi fi @@ -753,7 +793,7 @@ if [ -n "$NOUPLOAD" ]; then exit -fi # noupload +fi # UPLOAD #Test that wget is installed, and supports --post-file. Upload $FILE if it does, and prompt user to upload file if it doesnt. if @@ -836,7 +876,8 @@ echo "" #We couldnt find a suitable wget, so tell the user to upload manually. else - mv $FILE $NFILE || exit 1 + mv -f $FILE $NFILE || exit 1 + KEEP_OUTPUT="yes" if [[ -z $DIALOG ]] then if [[ -z $PASTEBIN ]]; then diff --git a/alsa-utils.spec b/alsa-utils.spec index bffd081..ec8c0d7 100644 --- a/alsa-utils.spec +++ b/alsa-utils.spec @@ -4,7 +4,7 @@ Summary: Advanced Linux Sound Architecture (ALSA) utilities Name: alsa-utils Version: 1.0.21 -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: GPLv2+ Group: Applications/Multimedia URL: http://www.alsa-project.org/ @@ -13,7 +13,7 @@ Source4: alsaunmute Source6: alsa-info.sh Source10: alsa.rules Source11: alsactl.conf -Patch1: alsactl-init-fix-headphone.patch +Patch1: alsactl-init-fix-headphone2.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: alsa-lib-devel >= %{version} BuildRequires: ncurses-devel @@ -95,6 +95,13 @@ fi %changelog * Thu Sep 3 2009 Jaroslav Kysela 1.0.21-2 +- fixed patch name + +* Thu Sep 3 2009 Jaroslav Kysela 1.0.21-1 +- updated to 1.0.21 final +- updated alsa-info.sh script to 0.4.58 + +* Thu Sep 3 2009 Jaroslav Kysela 1.0.21-2 - added missing patch file * Fri May 15 2009 Jaroslav Kysela 1.0.20-2 diff --git a/alsactl-init-fix-headphone.patch b/alsactl-init-fix-headphone.patch deleted file mode 100644 index dece760..0000000 --- a/alsactl-init-fix-headphone.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0d3aeb969592134f7749bd21fd2f641eb13d7090 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Fri, 15 May 2009 12:37:48 +0200 -Subject: [PATCH] alsactl: fixed Headphone Playback Volume setting in default rules - -Signed-off-by: Jaroslav Kysela ---- - alsactl/init/default | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/alsactl/init/default b/alsactl/init/default -index c9aa7cc..af0f94f 100644 ---- a/alsactl/init/default -+++ b/alsactl/init/default -@@ -46,7 +46,7 @@ CTL{name}="Front Playback Switch",PROGRAM=="__ctl_search", \ - CTL{values}="on" - - CTL{reset}="mixer" --CTL{name}="Headphone Playback Volume",PROGRAM=="__ctl_search",GOTO="headphone0_end" -+CTL{name}="Headphone Playback Volume",PROGRAM!="__ctl_search",GOTO="headphone0_end" - # if master volume control is present, turn headphone volume to max - ENV{has_pmaster_vol}=="true",CTL{values}="0dB",RESULT=="0",GOTO="headphone0_end" - ENV{has_pmaster_vol}=="true",CTL{values)="100%",GOTO="headphone0_end" -@@ -101,7 +101,7 @@ CTL{name}="DAC Playback Switch",PROGRAM=="__ctl_search", \ - CTL{values}="on" - - CTL{reset}="mixer" --CTL{name}="Synth Playback Volume",,PROGRAM=="__ctl_search", \ -+CTL{name}="Synth Playback Volume",PROGRAM=="__ctl_search", \ - CTL{values}="$env{pvolume}",RESULT!="0",CTL{values}="$env{ppercent}" - CTL{name}="Synth Playback Switch",PROGRAM=="__ctl_search", \ - CTL{values}="on" --- -1.5.5.1 - diff --git a/alsactl-init-fix-headphone2.patch b/alsactl-init-fix-headphone2.patch new file mode 100644 index 0000000..c2ce86e --- /dev/null +++ b/alsactl-init-fix-headphone2.patch @@ -0,0 +1,27 @@ +From 2cbf39749cd71a2b892b6006ae69283576176d17 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Sep 2009 14:31:49 +0200 +Subject: [PATCH] alsactl init: Fix typo "(" -> "{" in Headphone default rule + +Reported-by: Philipp Jocham +Signed-off-by: Jaroslav Kysela +--- + alsactl/init/default | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/alsactl/init/default b/alsactl/init/default +index 8653ec6..f2c0539 100644 +--- a/alsactl/init/default ++++ b/alsactl/init/default +@@ -49,7 +49,7 @@ CTL{reset}="mixer" + CTL{name}="Headphone Playback Volume",PROGRAM!="__ctl_search",GOTO="headphone0_end" + # if master volume control is present, turn headphone volume to max + ENV{has_pmaster_vol}=="true",CTL{values}="0dB",RESULT=="0",GOTO="headphone0_end" +-ENV{has_pmaster_vol}=="true",CTL{values)="100%",GOTO="headphone0_end" ++ENV{has_pmaster_vol}=="true",CTL{values}="100%",GOTO="headphone0_end" + CTL{values}="$env{pvolume}",RESULT!="0",CTL{values}="$env{ppercent}" + LABEL="headphone0_end" + CTL{name}="Headphone Playback Switch",PROGRAM=="__ctl_search", \ +-- +1.5.5.1 + diff --git a/sources b/sources index ad6f8d1..d0d11cb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6837e673ef19da96d8bd2f9e18cd9574 alsa-utils-1.0.20.tar.bz2 +3672287c2608040d111ce45495ba7602 alsa-utils-1.0.21.tar.bz2