" > $FILE echo "###############################" >> $FILE echo "ALSA Information Script v $SCRIPT_VERSION" >> $FILE echo "###############################" >> $FILE echo "" >> $FILE echo "" >> $FILE echo "Linux Distribution" >> $FILE echo "------------------" >> $FILE echo "" >> $FILE echo $DISTRO >> $FILE echo "" >> $FILE echo "" >> $FILE echo "Kernel Information" >> $FILE echo "------------------" >> $FILE echo "" >> $FILE echo "Kernel release: $KERNEL_VERSION" >> $FILE echo "Operating System: $KERNEL_OS" >> $FILE echo "Architecture: $KERNEL_MACHINE" >> $FILE echo "Processor: $KERNEL_PROCESSOR" >> $FILE echo "SMP Enabled: $KERNEL_SMP" >> $FILE echo "" >> $FILE echo "" >> $FILE echo "ALSA Version" >> $FILE echo "------------" >> $FILE echo "" >> $FILE echo "Driver version: $ALSA_DRIVER_VERSION" >> $FILE echo "Library version: $ALSA_LIB_VERSION" >> $FILE echo "Utilities version: $ALSA_UTILS_VERSION" >> $FILE echo "" >> $FILE echo "" >> $FILE echo "Loaded ALSA modules" >> $FILE echo "-------------------" >> $FILE echo "" >> $FILE cat /tmp/alsainfo/alsamodules.tmp >> $FILE echo "" >> $FILE echo "" >> $FILE echo "Soundcards recognised by ALSA" >> $FILE echo "-----------------------------" >> $FILE echo "" >> $FILE cat /tmp/alsainfo/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 echo "" >> $FILE echo "" >> $FILE echo "Advanced information - PCI Vendor/Device/Susbsystem ID's" >> $FILE echo "--------------------------------------------------------" >> $FILE echo "" >> $FILE lspci -vvn |grep -A1 040[1-3] >> $FILE echo "" >> $FILE echo "" >> $FILE if [ -e "/tmp/alsainfo/alsa-hda-intel.tmp" ] then echo "HDA-Intel Codec information" >> $FILE echo "---------------------------" >> $FILE echo "" >> $FILE cat /tmp/alsainfo/alsa-hda-intel.tmp >> $FILE echo "" >> $FILE echo "" >> $FILE fi #If no command line options are specified, then run as though --with-all was specified if [[ -z "$1" ]] then withdevices withconfigs withaplay withamixer withlsmod fi #loop through command line arguments, until none are left. if [[ -n "$1" ]] then until [ -z "$1" ] do case "$1" in --update) update ;; --debug) echo "Debugging enabled. $FILE and $TEMPDIR will not be deleted" KEEP_FILES="yes" echo "" ;; --with-all) withdevices withconfigs withaplay withamixer withlsmod ;; --with-aplay) withaplay ;; --with-amixer) withamixer ;; --with-devices) withdevices ;; --with-configs) if [[ -e $HOME/.asoundrc ]] || [[ -e /etc/asound.conf ]] then echo "ALSA configuration files" >> $FILE echo "------------------------" >> $FILE echo "" >> $FILE #Check for ~/.asoundrc if [[ -e $HOME/.asoundrc ]] then echo "User specific config file ($HOME/.asoundrc)" >> $FILE echo "" >> $FILE cat $HOME/.asoundrc >> $FILE echo "" >> $FILE echo "" >> $FILE fi #Check for /etc/asound.conf if [[ -e /etc/asound.conf ]] then echo "System wide config file (/etc/asound.conf)" >> $FILE echo "" >> $FILE cat /etc/asound.conf >> $FILE echo "" >> $FILE echo "" >> $FILE fi fi ;; --about) echo "Written/Tested by the following users of #alsa on irc.freenode.net:" echo "" echo " wishie - Script author and developer / Testing" echo " crimsun - Various script ideas / Testing" echo " gnubien - Various script ideas / Testing" echo " GrueMaster - HDA Intel specific items / Testing" echo " olegfink - Script update function" cleanup exit 0 ;; *) echo "" echo "Available options:" echo " --with-aplay (includes the output of aplay -l)" echo " --with-amixer (includes the output of amixer)" echo " --with-configs (includes the output of ~/.asoundrc and /etc/asound.conf if they exist)" echo " --with-devices (shows the device nodes in /dev/snd/)" echo "" echo " --update (check server for script updates)" echo " --about (show some information about the script)" echo " --debug (will run the script as normal, but will not delete $FILE)" cleanup exit 0 ;; esac shift 1 done fi #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}" ]]