Solution: opensuse 11.3 Intermittent no sound in Amorok after using Firefox

Intermittently after using Firefox for watching You Tube etc, you find that there is no sound from Amarok and probably all other sound applications. Sometimes while using Firefox for multimedia playback ie You Tube the sound gets stuck ie (repeats the same few millseconds of sound ad infinitem) like a stuck record (for those that remember them).

One solution is to reboot the system, however a quicker method is to stop & restart the alsa sound system.

> su
> [Enter root password]

/etc/init.d/alsasound stop

/etc/init.d/alsasound start

exit

> kmix

Hardware spec.
CPU: Intel(R) Core™ i5 CPU 750 @ 2.67GHz
GPU: nVidia Corporation G84 [GeForce 8600 GT] (rev a1)
Audio: Conexant CX8811 ()
Audio: HDA Intel (VT1708S Analog)
Audio: HDA Intel (VT1708S Digital)
Audio: Creative Labs VF0420 Live! Cam Vista IM ()
Audio: Creative Labs VF0420 Live! Cam Vista IM (USB Audio)
Audio: HDA Intel ()
Audio: Conexant CX8811 (CX88 Digital)

Hello steelskin, thanks for the suggestion on using ALSA sound. Boy, you have acquired a heck of a reputation there in such a short time! I like your short terminal command list, so I decided to automate it for you in a script file.

To create the script, Copy and paste this text in the next code block as the file alsarset into your home area bin folder (~/bin/alsarset).

#!/bin/bash

#: 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
echo "Reset (Stop/Start) Alsa Sound Sound System - Start KMIX (For KDE Desktop Systems)"
echo

if  $UID -ne 0 ]]; then
  echo "Root User Permissions are required, Please Enter the ..."
  echo
  sudo $0
  echo
  read -p "Alsa Sound has been Started.  Press <enter> to reload KMIX (CTRL-C to Abort)..."
  echo
  /usr/bin/kmix
  exit 0
fi

echo
read -p "Press <enter> to Stop Alsa Sound System now! (CTRL-C to Abort)..."
echo

/etc/init.d/alsasound stop

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

/etc/init.d/alsasound start

exit 0
# End Of Script
 

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 the command:

alsarset

Thanks for the information there steelskin.

Thank You,

Thanks for the kind words, your script makes it even quicker to fix the problem, however I’ve got one problem with the script when I run it, which so far I’ve not managed to figure out.

kmix should be restarted after alsasound is started and should be started as normal user not root (root to start and stop alsa only), however if you try to start kmix from a script it doesn’t start, start it from konsole and it does work.

I’ve looked at starting your script in interactive mode #!/bin/bash -i and also login mode #!/bin/bash -l and although these do change the envirmonment as seen by putting a printenv in the script, kmix still won’t run. Tried exec kmix, no joy. /var/log/messages gives no clue as to why kmix isn’t starting from a script.

So at the moment I truelly am a puzzled penguin. :slight_smile:

So the script works on my PC. You DO NO RUN the script as root, but a 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.

Thank You,

Hi James,
ah yes I see you recall the script with sudo $0, and you are perfectly correct if I run the script as root it fails to run kmix and if I run as normal user it works as it should do.

So as a relative new user, based only on your message count I can see, I decided to post some additional information on the forum operation, should you have not seen it before.

Fourm Message Counts:

As you start or answer any message thread here in the openSUSE forums.

Puzzled Penguin 0-49 (new users start with this level)
Student Penguin 50-99
Explorer Penguin 100-249
Busy Penguin 250-499
Parent Penguin 500-999
Wise Penguin 1000-1999
Omniscient Penguin 2000 

FYI here are the reputation levels:

As you reward another user for the help they have provided you using 
the reputation icon is in the lower left of any message that you read
and looks like a star. 

REPUTATION LEVELS:

User is infamous around these parts -99999
User can only hope to improve -50
User has a little shameless behaviour in the past -10
User is an unknown quantity at this point 0-9 (new users start with this level)
User is on a distinguished road 10-19
User will become famous soon enough 20-149
User has a spectacular aura about 150-249
User is a jewel in the rough 250-349
User is just really nice 350-449
User is a glorious beacon of light 450-549
User is a name known to all 550-649
User is a splendid one to behold 650-999
User has much to be proud of 1000-1499
User has a brilliant future 1500-1999
User has a reputation beyond repute 2000 

Thank You,

Thanks, James. Good advice. It very easy to miss that star at the bottom of the posts. Duly rewarded.

You are very welcome and thanks for the rating. By the way, I created a new script to attempt to check out your audio setup and I included your Alsa reset command. The script is located here, check it out:

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

Thank You,

I usually just restart kill the KDE apps using sound (Amarok, Minitube) and restart firefox. If I want to listen to music in Amarok I just kill the npviewer.bin (seems to be responsible for sound in firefox) and restart Amarok (or Minitube).

My question is. Is this really necessary? We realty need scrips and workarounds for this? Is there to make firefox and KDE to use the same sound server?

I have audio output from laptop speakers but the sound is echoing thrice. Tried too many steps including stoping/starting alsasound but the problem remain same. Alsa also update to latest version, however same problem exists. i am getting a message regarding forgetting the sound device once i login and snapshot is attached below:-
http://www.freeimagehosting.net/uploads/th.8b1aec68f8.png](http://www.freeimagehosting.net/image.php?8b1aec68f8.png)

sundar_ima, normally it is OK to allow devices to removed that are not there. You can get such thing for instance when stopping and starting also, so it is OK, they come back when restarted. I suggest you run through my start script and post info such as created by the alsa test here for us to see:

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

Thank You,

here is the out put:-


1 . Verify your Alsa Packages are installed for Operational Testing ...                           
 rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' alsa alsa-utils alsa-firmware 'libasound2*'                                                                                                          
 alsa-firmware-1.0.23-1.2-noarch -> openSUSE                                                                           
alsa-utils-1.0.23-1.8-i586 -> openSUSE                                                                                
alsa-1.0.23-78.1-i586 -> obs://build.opensuse.org/multimedia:libs                                                     
libasound2-1.0.23-2.12-i586 -> openSUSE                                                                               
                                                                                                                      
You should expect to have at least four Alsa Packages Installed.                                                      
32 bit files are not required when using 64bit openSUSE install.                                                      
                                                                                                                      
called ----> alsa-utils <--------- from the openSUSE Repository.                                                      
called ----> libasound2-32bit <--- from the openSUSE Repository.                                                      
called ----> alsa <--------------- from the openSUSE Repository.                                                      
called ----> libasound2 <--------- from the openSUSE Repository.                                                      
called ----> alsa-firmware <------ from the openSUSE Repository.                                                      
                                                                                                                      
Press <enter> to continue...                                                                                          
                                       
Enter Your Choice [1-12] or Just Press <enter> to Quit S.T.A.R.T. : 2


2 . Simple Left/Right Speaker Test Number One ...                                                                     
                                                                                                                      
Command: speaker-test -Dplug:front -c2 -l5 -twav                                                                      
                                                                                                                      
Note you should check your mixer settings (kmix if using KDE, and alsamixer                                           
if using Gnome) to ensure that PCM and Master Volume are set high. If no                                              
sound initially, try around 95%and back off the levels once basic sound                                               
is established. Note the test for surround sound is different.                                                        
                                                                                                                      
speaker-test 1.0.23                                                                                                   
                                                                                                                      
Playback device is plug:front                                                                                         
Stream parameters are 48000Hz, S16_LE, 2 channels                                                                     
WAV file(s)                                                                                                           
Playback open error: -16,Device or resource busy                                                                      
Playback open error: -16,Device or resource busy                                                                      
Playback open error: -16,Device or resource busy                                                                      
Playback open error: -16,Device or resource busy                                                                      
Playback open error: -16,Device or resource busy                                                                      
Playback open error: -16,Device or resource busy                                                                      
Playback open error: -16,Device or resource busy                                                                      
Playback open error: -16,Device or resource busy                                                                      
Playback open error: -16,Device or resource busy                                                                      
Playback open error: -16,Device or resource busy                                                                      

Playback open error: -16,Device or resource busy                                                                      
Playback open error: -16,Device or resource busy                                                                      
Playback open error: -16,Device or resource busy                                                                      
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
^[Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
^C

Enter Your Choice [1-12] or Just Press <enter> to Quit S.T.A.R.T. : 3


3 . Simple Left/Right Speaker Test Number Two ...                                                                     
                                                                                                                      
Command: speaker-test -c2 -l5 -twav                                                                                   
                                                                                                                      
Note you should check your mixer settings (kmix if using KDE, and alsamixer                                           
if using Gnome) to ensure that PCM and Master Volume are set high. If no                                              
sound initially, try around 95%and back off the levels once basic sound                                               
is established. Note the test for surround sound is different.                                                        
                                                                                                                      
speaker-test 1.0.23                                                                                                   
                                                                                                                      
Playback device is default                                                                                            
Stream parameters are 48000Hz, S16_LE, 2 channels                                                                     
WAV file(s)                                                                                                           
Rate set to 48000Hz (requested 48000Hz)                                                                               
Buffer size range from 2048 to 16384                                                                                  
Period size range from 1024 to 1024                                                                                   
Using max buffer size 16384                                                                                           
Periods = 4                                                                                                           
was set period_size = 1024                                                                                            
was set buffer_size = 16384                                                                                           
 0 - Front Left                                                                                                       
^C                                                
Enter Your Choice [1-12] or Just Press <enter> to Quit S.T.A.R.T. : 4


4 . Test Sound using aplay to play Left, Right or Test Stereo wav files ...                                           
                                                                                                                      
Using aplay -vv to play Front_Left.wav, Front_Right.wav or Test.wav sound files                                       
                                                                                                                      
Enter <L>eft, <R>ight, <T>est or <Q>uit. Enter your choice [l/r/t/q]l                                                 
Playing WAVE '/usr/share/sounds/alsa/Front_Left.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono               
Plug PCM: Route conversion PCM (sformat=S32_LE)                                                                       
  Transformation table:                                                                                               
    0 <- 0                                                                                                            
    1 <- 0                                                                                                            
Its setup is:                                                                                                         
  stream       : PLAYBACK                                                                                             
  access       : RW_INTERLEAVED                                                                                       
  format       : S16_LE                                                                                               
  subformat    : STD                                                                                                  
  channels     : 1                                                                                                    
  rate         : 48000                                                                                                
  exact rate   : 48000 (48000/1)                                                                                      
  msbits       : 16                                                                                                   
  buffer_size  : 16384                                                                                                
  period_size  : 1024                                                                                                 
  period_time  : 21333                                                                                                
  tstamp_mode  : NONE                                                                                                 
  period_step  : 1                                                                                                    
  avail_min    : 1024                                                                                                 
  period_event : 0                                                                                                    
  start_threshold  : 16384                                                                                            
  stop_threshold   : 16384                                                                                            
  silence_threshold: 0                                                                                                
  silence_size : 0                                                                                                    
  boundary     : 1073741824                                                                                           
Slave: Soft volume PCM                                                                                                
Control: PCM Playback Volume                                                                                          
min_dB: -51
max_dB: 0
resolution: 256
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
Slave: Direct Stream Mixing PCM
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
Hardware PCM card 0 'HDA ATI SB' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : ENABLE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 1073741824
  silence_threshold: 0
  silence_size : 1073741824
  boundary     : 1073741824
  appl_ptr     : 0
  hw_ptr       : 372159
#                         +                        | 50%^C
Aborted by signal Interrupt...

Press <enter> to continue...
4 . Test Sound using aplay to play Left, Right or Test Stereo wav files ...

Using aplay -vv to play Front_Left.wav, Front_Right.wav or Test.wav sound files

Enter <L>eft, <R>ight, <T>est or <Q>uit. Enter your choice [l/r/t/q]^C

However for 3 and four it was only saying front, front, ffront…and keep on continuing even after i terminated the script.

So test 2 is using the command: “speaker-test -Dplug:front -c2 -l5 -twav” which seems to have a problem, perhaps your speaker setup does not have a “front” per say? I will also say I found on one setup that no sound was coming out of the front right speaker due to a plug/cable problem. It might be best if you posted the pointer to your alsa output you get when you run that test.

Thank You,

It might be best if you posted the pointer to your alsa output you get when you run that test.

how do i do that?

Run option 6 of Start and update your alsa file if a newer version exists. Once the alsa program finished, you can save the file locally or Upload - Share the program. You pick Upload / Share and when you go to exit, a URL is listed at the top of the screen you can copy and past into a message here. For instance, here is my upload from alsa.

http://www.alsa-project.org/db/?f=d2e576ff7fa79b8d975af21aa0adfa00f5b94f36

Thank You,

Thank you for your kind reply. Her is the uploaded content:-

http://www.alsa-project.org/db/?f=307b560216d64c8fce058affdc5c7b98e24e21a7

It seems your driver version is older that utils. I would go into YaST, search on alsa and make sure everything is updated to 1.0.23:

!!ALSA Version
!!------------

Driver version:     1.0.22.1
Library version:    
Utilities version:  1.0.23

Reboot after the update and rerun alsa test and see if the versions are then the same.

Thank You,

updated also and its dependencies to the latest version. However after re-running the test it shows the same driver version. The latest alsa version is located here :-
http://www.alsa-project.org/db/?f=2b8ea2a097415036dbee64f51220c8c098a2fe58

I thought it might be player fault so i installed VLC player but for my shock there is no audio at all from VLC player. Any help is appreciated.

Thank you.

I have not read the entire thread, so I do not understand your problem. Is it you get no sound at all, no matter what you do ?

I took a look at the script file output, and I note your PC has an ALC861-VD.

When I did a search for the ALC861 on the alsa (driver) web site, I note this: Search results for ALC861 search - AlsaProject

and that suggests an update to the ALC861 between the 1.0.22 and 1.0.23 versions of alsa (mainly to do with capture). So if you wish you could consider updating your alsa version (which has 1.0.22.1 as the driver) following the guidance here: SDB:Alsa-update from developer’s special repository - openSUSE … note that page is a bit out of date reference kernel versions, but the general update philosophy applies.

Note that every practically every multimedia application gives you the opportunity to tune your output audio mode, and the one you select to a certain extent should be dictated by whether you are a KDE or Gnome user, by whether you have replaced the crippled SuSE-GmbH applications with Packman packaged applications, and whether you have taken the time (if using KDE) to tune the settings in the xine backend by running ‘xine’ after having installed ‘xine-ui’.

Note restarting alsa should not be necessary unless one has changed something making it necessary.

But note also that many Linux apps are not friendly, and they will seize the sound device and not share the device. One can tell which application has seized and is not letting go of the sound device by following the advice here: SDB:Audio troubleshooting - openSUSE - how to determine what application is using the sound device

i.e. To determine what application is using one’s sound device, copy and paste the following into a terminal or a konsole:

lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*

If one runs the above line at different times, when one’s sound is working and not working, one can learn better as to what the output means, and be better able to " point one’s finger " at the offending application that has seized the audio device.

Note you need to run that at different times under different circumstances, save the output and annotate what was happening (in terms of running applications) at the time. Just running it once and posting the output here is not helpful (at least it is not to me). It needs to be run multiple times with different circumstances/media-apps running to understand it.

Hi, Have you still got this echo problem ?. Is it 100% all the time or does it occasionally work ok. Does it happen with a particular application ?

The only time I’ve come across an echo like this is if you double click a media file in Dolphin/konqueror and two or more instances of the application start-up on top of one another (so it’s not obvious that more than one instance has started) except for the fact you get a echo (sound from the two or more instances is a split second apart giving you an echo effect).

This may not be you problem but if you are used to working in a windows environment and double click everything rather than the one click in Linux then it’s easy for this to happen.

I use xine, with the xine-ui front end (my preferred player) and can reproduce this echo effect with ease by double clicking a media file. (KDE on my system is configured to use xine for most media types)

Please accept my apologies if you are an experienced user but I’ve seen people new to Linux come across this problem before.

Oh and the forgetting sound device message, I too have seen that lately, I tend to click on the box that says don’t forget device. My sound works fine anyway)

Regards
Nick :slight_smile: