Bienvenido! - Willkommen! - Welcome!

Bitácora Técnica de Tux&Cía., Santa Cruz de la Sierra, BO
Bitácora Central: Tux&Cía.
Bitácora de Información Avanzada: Tux&Cía.-Información
May the source be with you!

Friday, November 26, 2010

OpenSUSE -audio report scripts

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

To create the following script, Copy and paste the text  at bottom as the file alsarset into your home area bin folder (~/bin/alsarset).
Run the following terminal command to make the file executable:

$ chmod +x ~/bin/alsarset
To use the alsarset program, open another terminal session and type
$ alsarset

DO NO RUN the script as root, but as normal user. The script, when it sees you are not root, reruns itself, with the sudo command, asking for the root password. The script then runs the Alsa Stop and then the Alsa Start and completes. As the script exists the second run, it drops back as a normal user and runs kmix. It does work, if done right.

#: Title : /home/james/bin/alsarset
#: Date Created: Sat Oct 30 09:45:27 CDT 2010
#: Last Edit : Sat Oct 30 10:12:27 CDT 2010
#: Author : J. McDaniel
#: Version : 1.00
#: Description : Stop/Start Alsa, reload kwin
#: Options : none
# Written for the openSUSE forums on Saturday October 30, 2010
# Copy and paste this text as the file alsarset into the ~/bin folder.
# Run the terminal command: chmod +x ~/bin/alsarset, to make the file executable
# Open up a terminal session and type: alsarset, to start the program
# Check to see if we are root, Do not run as root since we need to run kmix as a normal user
tput clear
echo "Reset (Stop/Start) Alsa Sound Sound System - Start KMIX (For KDE Desktop Systems)"

if [[ $UID -ne 0 ]]; then
echo "Root User Permissions are required, Please Enter the ..."
sudo $0
read -p "Alsa Sound has been Started. Press to reload KMIX (CTRL-C to Abort)..."
exit 0
read -p "Press to Stop Alsa Sound System now! (CTRL-C to Abort)..."

/etc/init.d/alsasound stop

echo "Alsa Sound has been Stopped. Just Select NO to Removed Sound Devices Window."
read -p "Press to restart Alsa (CTRL-C to Abort)..."

/etc/init.d/alsasound start
exit 0
# End Of Script

No comments: