Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: S.T.A.R.T. - SuSE Terminal Audio Reporting Tool

  1. #1
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Lightbulb S.T.A.R.T. - SuSE Terminal Audio Reporting Tool

    OK, here is yet another script, but designed to check out your Audio Setup. What I would love to hear is any suggestions for added tests or if you think something is worthless, let me know and it can be removed from the test script. In order to create S.T.A.R.T. copy and past the text in the following code section into your favorite text editor and save it into your home area bin folder as the file start (~/bin/start):

    Code:
    #!/bin/bash
    
    #: Title       : /home/james/bin/start
    #: Date Created: Sun Oct 31 14:21:01 CDT 2010
    #: Last Edit   : Sun Oct 31 20:26:01 CDT 2010
    #: Author      : J. McDaniel
    #: Version     : 1.00
    #: Description : Check Your Audio Sound Setup
    #: Options     : none
    
    # Written for the openSUSE forums on Sunday October 31, 2010
    
    # Copy and paste this text as the file start into the ~/bin folder.
    # Run the terminal command: chmod +x ~/bin/start, to make the file executable
    # Open up a terminal session and type: start, to start the program
    
    PROG="S.T.A.R.T. - V1.00 - SuSE Terminal Audio Reporting Tool -"
    
    # Determine program user, save home folder location
    
    USER="$HOME"
    
    # Menu Disply System function
    # Display up to $3 menu items and <enter> is always Exit 
    # Menu should have at least two choices plus exit
    
    function print_menu {
    
    # You can adjust the starting position of the start menu.  
    # Using s_line=0 & s_col=0 would place the menu in the top left corner of your screen"
    
    # Starting Terminal Line Number for menu
    s_line=0
    # Starting Terminal Column Number for Menu
    s_col=0
    
    # Determine SuSE Version
    suse=$(cat /etc/SuSE-release)
    num=${#suse}
    version="${suse:0:$((num - 15))}"
    
    # Display Program Title
    tput clear
    tput cup $(( s_line )) $(( s_col ))
    tput setf 7
    tput setb 2
    tput bold
    echo "$1" $version 
    
    # Determine Kernel Version
    kernel=$(uname -r)
    
    # Display Menu, Present User home, kernel version
    tput sgr0
    tput cup $(( s_line + 2 )) $(( s_col ))
    tput setf 7
    tput setb 1
    tput bold
    echo "$2" "USER:$USER" "  Kernel:$kernel " 
    tput sgr0
    
    # Display All Menu Options 1 through $3
    maxnum=$3
    counter=0
    
    while [ $(( counter )) -lt $(( maxnum + 1 )) ] ; do
      let counter=counter+1
      tput cup $(( s_line + 3 + counter )) $(( s_col ))
      echo "$4"
      shift
    done
    
    # Display menu option request and get user input
    tput setf 2
    tput bold
    tput cup $(( s_line + 4 + counter )) $(( s_col ))
    read -p "Enter Your Choice [1-"$maxnum"] or Just Press <enter> to Quit S.T.A.R.T. : " CHOICE
    return $CHOICE
    }
    
    #
    # Main Program Loop starts here ...
    #
    
    while true ; do
    
    # Setup Menu string Fields displayed for your menu
    
    MENU="Audio and Sound Testing  -  M E N U "
    TOTL="12"
    TST1=" 1 . Verify your Alsa Packages are installed for Operational Testing ...        "
    TST2=" 2 . Simple Left/Right Speaker Test Number One ...                              "
    TST3=" 3 . Simple Left/Right Speaker Test Number Two ...                              "
    TST4=" 4 . Test Sound using aplay to play Left, Right or Test Stereo wav files ...    "
    TST5=" 5 . Checking your audio setup in four steps for detailed information  ...      "
    TST6=" 6 . Run ALSA setup script as a ROOT User (Run Once) Update if Newer Exists ... "
    TST7=" 7 . Run ALSA setup script as a Normal User. Please Upload your information ... "
    TST8=" 8 . Stop ALSA, Restart ALSA and then Reload Kmix (For KDE Users) ...           "
    TST9=" 9 . Check your Pulseaudio package Installation ...                             "
    TSTA=" 10. Enable your Pulseaudio Sound System ...                                    "
    TSTB=" 11. Disable your Pulseaudio Sound System ...                                   "
    TSTC=" 12. Determining which application is using sound device ...                    "
    
    # Call Menu and get user input selection
    
    print_menu "$PROG" "$MENU" "$TOTL" "$TST1" "$TST2" "$TST3" "$TST4" "$TST5" "$TST6" "$TST7" "$TST8" "$TST9" "$TSTA" "$TSTB" "$TSTC"
    CHOICE="$?"
    
    # Execute User Command Here
    
    case "$CHOICE" in
    
     "1") 
      tput clear
      tput bold
      tput setf 7
      tput setb 4
      echo $TST1
      echo
      tput setf 7
      tput setb 1
      tput bold 
      echo "rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}\n' alsa alsa-utils alsa-firmware 'libasound2*'"
      tput sgr0
      echo
      rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}\n' alsa alsa-utils alsa-firmware 'libasound2*'
      echo
      echo "You should expect to have at least four Alsa Packages Installed."
      echo "32 bit files are not required when using 64bit openSUSE install."
      echo
      echo "called ----> alsa-utils <--------- from the openSUSE Repository."
      echo "called ----> libasound2-32bit <--- from the openSUSE Repository."
      echo "called ----> alsa <--------------- from the openSUSE Repository."
      echo "called ----> libasound2 <--------- from the openSUSE Repository."
      echo "called ----> alsa-firmware <------ from the openSUSE Repository."
      echo
      read -p "Press <enter> to continue..." ;; 
    
      "2") 
      tput clear
      tput bold
      tput setf 7
      tput setb 4
      echo $TST2
      echo
      tput setf 7
      tput setb 1
      tput bold
      echo "Command: speaker-test -Dplug:front -c2 -l5 -twav"
      tput sgr0
      echo
      echo "Note you should check your mixer settings (kmix if using KDE, and alsamixer"
      echo "if using Gnome) to ensure that PCM and Master Volume are set high. If no" 
      echo "sound initially, try around 95%and back off the levels once basic sound" 
      echo "is established. Note the test for surround sound is different." 
      speaker-test -Dplug:front -c2 -l5 -twav
      echo
      read -p "Press <enter> to continue..." ;;
    
      "3") 
      tput clear
      tput bold
      tput setf 7
      tput setb 4
      echo $TST3
      echo
      tput setf 7
      tput setb 1
      tput bold
      echo "Command: speaker-test -c2 -l5 -twav"
      tput sgr0
      echo
      echo "Note you should check your mixer settings (kmix if using KDE, and alsamixer"
      echo "if using Gnome) to ensure that PCM and Master Volume are set high. If no" 
      echo "sound initially, try around 95%and back off the levels once basic sound" 
      echo "is established. Note the test for surround sound is different." 
      speaker-test -c2 -l5 -twav
      echo
      tput bold
      tput setf 7
      tput setb 1
      echo "If you did not hear any sound, you might need to add yourself to the audio user"
      echo "group. Would you like to add yourself to the audio user group right now? (Yes or No)"
      tput sgr0
      echo
      read -p "Enter your choice [y/N] " CHOICE
      if [ "$CHOICE" == "y" ] || [ "$CHOICE" == "Y" ] ; then
        sudo usermod -A audio $(basename $USER)
        usermod_exit_value=$?
        if [ "${usermod_exit_value}" -eq "0" ] ; then
          echo
          echo "User "$USER" Was added to the Audio User Group as Requested."
          echo
          fi    
      fi
      echo
      read -p "Press <enter> to continue..." ;;
    
      "4") 
      while [ "$choice" != "q" ] ; do
        tput clear
        tput bold
        tput setf 7
        tput setb 4
        echo $TST4
        echo
        tput setf 7
        tput setb 1
        tput bold 
        echo "Using aplay -vv to play Front_Left.wav, Front_Right.wav or Test.wav sound files"
        tput sgr0
        echo
        read -p "Enter <L>eft, <R>ight, <T>est or <Q>uit. Enter your choice [l/r/t/q]" choice
        if [ "$choice" == "l" ] || [ "$choice" == "L" ] ; then
          aplay -vv /usr/share/sounds/alsa/Front_Left.wav
          echo
          read -p "Press <enter> to continue..."
        fi
        if [ "$choice" == "r" ] || [ "$choice" == "R" ] ; then
          aplay -vv /usr/share/sounds/alsa/Front_Right.wav
          echo
          read -p "Press <enter> to continue..."
        fi
        if [ "$choice" == "t" ] || [ "$choice" == "T" ] ; then
          aplay -vv /usr/share/sounds/alsa/test.wav
          echo
          read -p "Press <enter> to continue..."
        fi
        if [ "$choice" == "Q" ] ; then
          choice="q"
        fi
      done
      choice="" ;;
    
      "5") 
      tput clear
      tput bold
      tput setf 7
      tput setb 4
      echo $TST5
      echo
      tput setf 7
      tput setb 1
      tput bold
      echo "Command: cat /proc/asound/version"
      tput sgr0
      echo
      cat /proc/asound/version
      echo
      tput setf 7
      tput setb 1
      tput bold
      echo "Command: cat /proc/asound/modules"
      tput sgr0
      echo
      cat /proc/asound/modules
      echo
      tput setf 7
      tput setb 1
      tput bold
      echo "Command: cat /proc/asound/cards"
      tput sgr0
      echo
      cat /proc/asound/cards
      echo
      tput setf 7
      tput setb 1
      tput bold
      echo "Command: cat /etc/modprobe.d/50-sound.conf"
      tput sgr0  
      cat /etc/modprobe.d/50-sound.conf
      echo
      echo "If this does not provide the required info, then another approach to obtain more "
      echo "information on your hardware and your sound configuration, is to run the ALSA script." 
      echo
      read -p "Press <enter> to continue..." ;;
     
      "6") 
      tput clear
      tput bold
      tput setf 7
      tput setb 4
      echo $TST6
      echo
      tput setf 7
      tput setb 1
      tput bold
      echo "Command: sudo /usr/sbin/alsa-info.sh"
      tput sgr0
      echo
      sudo /usr/sbin/alsa-info.sh
      echo
      read -p "Press <enter> to continue..." ;;
    
      "7") 
      tput clear
      tput bold
      tput setf 7
      tput setb 4
      echo $TST7
      echo
      tput setf 7
      tput setb 1
      tput bold
      echo "Command: /usr/sbin/alsa-info.sh"
      tput sgr0
      echo
      /usr/sbin/alsa-info.sh
      echo
      read -p "Press <enter> to continue..." ;;
    
      "8") 
      tput clear
      tput bold
      tput setf 7
      tput setb 4
      echo $TST8
      echo
      tput setf 7
      tput setb 1
      tput bold
      echo "Command: /etc/init.d/alsasound stop - /etc/init.d/alsasound start - /usr/bin/kmix"
      tput sgr0
      echo
      sudo /etc/init.d/alsasound stop 
      sudo /etc/init.d/alsasound start
      /usr/bin/kmix
      echo
      echo "Just Answer NO to removing any Audio Devices if Asked."
      echo
      read -p "Press <enter> to continue..." ;;
    
      "9") 
      tput clear
      tput bold
      tput setf 7
      tput setb 4
      echo $TST9
      echo
      tput setf 7
      tput setb 1
      tput bold
      echo "Command:    rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}\n' '*pulseaudio*'"
      tput sgr0
      echo
      rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}\n' '*pulseaudio*'
      echo
      echo "You need the several programs (around 8) installed to use Pulse Audio from openSUSE"
      echo
      read -p "Press <enter> to continue..." ;;
    
      "10") 
      tput clear
      tput bold
      tput setf 7
      tput setb 4
      echo $TSTA
      echo
      tput setf 7
      tput setb 1
      tput bold
      echo "Command: sudo setup-pulseaudio --enable"
      tput sgr0
      echo
      sudo setup-pulseaudio --enable
      echo
      read -p "Press <enter> to continue..." ;;
    
      "11") 
      tput clear
      tput bold
      tput setf 7
      tput setb 4
      echo $TSTB
      echo
      tput setf 7
      tput setb 1
      tput bold 
      echo "Command: sudo setup-pulseaudio --disable"
      tput sgr0
      echo
      sudo setup-pulseaudio --disable
      echo
      read -p "Press <enter> to continue..." ;;
    
     "12")
      tput clear
      tput bold
      tput setf 7
      tput setb 4
      echo $TSTC
      echo
      tput setf 7
      tput setb 1
      tput bold
      echo "Command: lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*"
      tput sgr0
      echo
      lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*
      echo
      echo "Sometimes, when one has basic sound functioning, but then it appears to stop in"
      echo "the middle of a session (to be restored after a reboot) it may be because an "
      echo "application has seized your audio device, and the application is not sharing nor"
      echo "letting go the audio device. To determine what application is using one's sound"
      echo "simple run this command from the S.T.A.R.T. script or use the CLI command above."
      echo "If one runs this command at different times, when one's sound is working and not"
      echo "working, one can learn better as to what the output means, and be better able to"
      echo "point one's finger at the offending application that has seized the audio device."
      echo 
      read -p "Press <enter> to continue..." ;;
    
      "0")
      tput clear
      tput sgr0
      echo
      exit 0 ;;
    
      *) ;;
    
    esac
    
    done 
    
    exit 0
    
    # End of Bash File
    In order to use the start script, it must be marked executable. So, open up a terminal session and enter the following command:

    Code:
    chmod +x ~/bin/start
    Once you have marked it executable, to use start, simply open up a terminal session and type the command:

    Code:
    start
    If you have any questions or suggestions, please let me know.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,853

    Default Re: S.T.A.R.T. - SuSE Terminal Audio Reporting Tool

    You better stop talking about SuSE here, these Forums are about openSUSE. And even the S in SLED/SLES means SUSE.
    Henk van Velden

  3. #3
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,644
    Blog Entries
    14

    Default Re: S.T.A.R.T. - SuSE Terminal Audio Reporting Tool

    Quote Originally Posted by hcvv View Post
    You better stop talking about SuSE here, these Forums are about openSUSE. And even the S in SLED/SLES means SUSE.
    That would be o.A.R.T.A, the openSUSE Audio Reporting Terminal Application
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  4. #4
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: S.T.A.R.T. - SuSE Terminal Audio Reporting Tool

    You better stop talking about SuSE here, these Forums are about openSUSE. And even the S in SLED/SLES means SUSE.
    hcvv, I could revise the name to oS.T.A.R.T if you like (or o.A.R.T.A as suggested by Knurpht), but you know that everyone could save the file as any name they like. The script even includes the source code! At least our name is not Fedora, else the Program could have been called the Fedora Audio Report Tool.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  5. #5
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,517
    Blog Entries
    37

    Default Re: S.T.A.R.T. - SuSE Terminal Audio Reporting Tool

    I like the idea of the script. It looks neat.

    I sent you a PM with some initial comments. I could post them here too, as my comments may not be valid, and an open discussion may be worthwhile.

    I also note, to better understand/improve on the script, it needs to be run on KDE, Gnome, Xfce, and LXDE plus run on various hardware.

    I'm heading off from Europe to Canada on Friday morning, so I don't have much time to look at this (as I have a lot to do between now and Friday).

    But great idea and I like the 1st version.

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,853

    Default Re: S.T.A.R.T. - SuSE Terminal Audio Reporting Tool

    I did not comment on the name you gave to the script. I know everybody can give it a name (s)he likes. I did not comment on the fact you start that name with an S meaning SUSE as short for openSUSE.

    I comment on the usage of SuSE as this is a specific indication of something that does not exist anymore and creates misunderstanding among newcomers. Novell and the openSUSE people value it as much as you when the correct name of their product is used. I have seen another thread mentioning the same wrong name starting yesterday. I hope this was a coincidence and not the spreading of a plague.
    Henk van Velden

  7. #7
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,517
    Blog Entries
    37

    Default Re: S.T.A.R.T. - SuSE Terminal Audio Reporting Tool

    Quote Originally Posted by oldcpu View Post
    I sent you a PM with some initial comments. I could post them here too, as my comments may not be valid, and an open discussion may be worthwhile.
    I decided to include my PM contents here (which was in reply to a PM of yours asking I look at this):

    Quote Originally Posted by oldcpu
    It looks pretty neat. ... It needs to be tested on different hardware and different desktops. I can try that but I may not get that done for a while. Early Friday morning this week I fly from Europe to Canada for 10 days, and I've got a lot to do between now and then.

    Some 'off the cuff' suggestions:

    step-1: for certain at least 3 of packages are: alsa, alsa-utils, libasound2. You could mention those 3 (I've seen cases where users did not have alsa, or did not have alsa-utils or did not have libasound2).

    step-3: for the add to group audio, I would not initially do that, but rather I recommend some other tests first.

    Typically it is more difficult for a developer to get sound working in speakers than in headsets. Hence there could be a suggestion to run steps 2, 3, and 4 again with headsets on if there is no sound. Also, if there is still no sound, then the equivalent of steps 2, 3, and 4 could be run again with root permissions.

    If steps 2, 3, 4 do not give sound as a regular user, but any one of those steps give sound as user root, then there is a permissions problem. In that case it would make sense to add user's to group audio. The most common occurrence I have seen of users needing to be added to group audio has been after the installation of a proprietary nVidia graphic driver ! (where the driver installation script has inappropriately impacted audio permissions).

    I don't know if that logic is scriptable. It may not be.

    Step-8 is major. I did not yet test it (no time - I have to run to work). KDE4 users typically get a dialog box (from KDE) after asking if they wish to delete some configurations. IMHO they should say YES to that. It may be worthwhile in the sub-menu to note that (note I have not yet run step-8).

    Step-12 - to fully understand the output of step-12, one needs to run this when sound is working and when sound is not working, copy and paste the output to a text file, and compare later. Not sure if it worthwhile to recommend that (or even send output to a text file with a time associated or something else to indicate condition when it was sent to a text file ??? then possibly open the text file ??? BUT this would be a major enhancement for some future version of the script. I would NOT recommend hacking at this now ... instead script needs to be run on different desktops (KDE, Gnome, Xfce, LXDE) and on different hardware.

    Nicely done.

  8. #8
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,517
    Blog Entries
    37

    Default Re: S.T.A.R.T. - SuSE Terminal Audio Reporting Tool

    Quote Originally Posted by oldcpu View Post
    I decided to include my PM contents here (which was in reply to a PM of yours asking I look at this):

    step-1: for certain at least 3 of packages are: alsa, alsa-utils, libasound2. You could mention those 3 (I've seen cases where users did not have alsa, or did not have alsa-utils or did not have libasound2).
    I am quickly running the script on my 32-bit openSUSE-11.3 PC (I had no time last night to do this) and first thing I note, I only have 3 and not 4 alsa versions as reported by that test, and I note sound works fine ! on that PC. What I do not have on that PC is alsa-firmware.

    Not all users' PC's need alsa firmware.

    Hence you could change:
    You should expect to have at least four Alsa Packages Installed.
    32 bit files are not required when using 64bit openSUSE install
    to
    You should expect to have at least three or four Alsa Packages Installed.
    Essential are alsa, alsa-utils, libasound2. Some PCs require alsa-firmware.
    32 bit files are not required when using 64bit openSUSE install
    Last edited by oldcpu; 03-Nov-2010 at 00:06.

  9. #9
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,517
    Blog Entries
    37

    Default Re: S.T.A.R.T. - SuSE Terminal Audio Reporting Tool

    With respect to using pulse audio, that may be a bit misleading for openSUSE-11.3 KDE users (and earlier) as KDE does not use pulse. Hence you could change (to clarify):

    You need the several programs (around 8) installed to use Pulse Audio from openSUSE
    to
    Typically KDE on openSUSE-11.3 and earlier does not use Pulse Audio.
    openSUSE Gnome does use Pulse Audio.
    You need the several programs (around 8) installed to use Pulse Audio from openSUSE
    I don't have a current Gnome install, so I can't check the "around 8" assertion easily.

  10. #10
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: S.T.A.R.T. - SuSE Terminal Audio Reporting Tool

    Typically KDE on openSUSE-11.3 and earlier does not use Pulse Audio.
    openSUSE Gnome does use Pulse Audio.
    You need the several programs (around 8) installed to use Pulse Audio from openSUSE
    I have determined that there is something going on with respect to KDE & Pulseaudio, though I have not figured it out. In particular respect to HDA Intel audio. When viewing iTunes movies, no audio is achived unless the Pulseaudio system is enabled and pulse seems to be installed by default. This has seemed to be true on several laptops with built-in Intel Audio, but I don't understand just why that is under KDE. Even so, I have found that disabling pulse audio on Creative Sound Blaster cards seems to work better under KDE. Since this appears to be hardware specific and not due to openSUSE version or KDE version I felt the ability to enable or disable pulse would be the thing to do.

    I continue to collect suggestions on start, to see what the best revision will be.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •