Alsa crashes - please help

My sound system works fine as long as I am not connected to the internet. If connected and playing anything online, it will play for a short time then shut it down. It also locks the browswer until alsa is reset.

Running >rcalsasound restart will bring it back. Audio CDs and DVDs crash periodically as well. The CD I am listening to now crashed the first time after a minute. I restarted alsa, it is now on the 5th track and working fine. Been fighting this since 11.3.

Below is the data from also-info.sh
http://www.alsa-project.org/db/?f=6f57956e615043db8ca34aa16e7ddac8debf17ba

Is there a test / debug that could be run that would catch the error?
Is there an alternative sound system I could try. I thought there was one years ago, but I can’t remember the name.

Kernel release: 2.6.37.6-0.9-desktop
Operating System: GNU/Linux
Architecture: x86_64
LXDE

Hoping someone out there can diagnose this pitb. thanks

That does not read like a ‘crash’. Rather it reads like an application has seized the audio device and is refusing to share it with other applications. In the past I have read of cases when an application closed, it was so misbehaved that it left the audio device locked such that other devices could not access it.

Did you disable pulse audio ? Pulse audio is supposed to solve this so my recommendation is to NOT disable pulse.

You can typically determine which application is using the audio device by looking at the open files associated with the audio device. The command for doing that is ‘lsof’ (list open files) with the appropriate directories with audio device files as the arguments:


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

Note the syntax of that last entry is /dev/snd/* and NOT /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. Don’t just post the output here with one example as it will mean nothing to me. One needs to look at it on different occasions (noting what multimedia application is running at the time) in order to learn what the output means.

Also, another tack / approach … Is this with both mp4 and flv files streamed over the Internet ? What version of flash player are you using ? Is it both when you go full screen (with your browser) and when you do not go full screen ?

Have you tried a different browser ? ie for example, do you see this behaviour with both Firefox and Chrome ?

oldcpu,
Thanks. I have been doing some testing using the lsof /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*. Both browsers were in window mode. Flash version 11.1.102.55-0.6.1(10.2.159.1-0.2.1)

Below are some of the results.

audio cd using vlc working clean -
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
vlc 23975 dad 13w CHR 14,3 0t0 652315 /dev/dsp
audio cd using vlc after sound stopped, application still playing -
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
vlc 23975 dad 13w CHR 14,3 0t0 652315 /dev/dsp

youtube using opera browser working clean -
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
operaplug 26166 dad 10u CHR 116,7 0t0 416093 /dev/snd/pcmC0D0p
operaplug 26227 dad 12u CHR 116,7 0t0 416093 /dev/snd/pcmC0D0p
youtube using opera browser after sound stopped, application still playing -
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
operaplug 12598 dad 13u CHR 116,7 0t0 466544 /dev/snd/pcmC0D0p
gmixer 12629 dad 10r CHR 116,9 0t0 466546 /dev/snd/controlC0
operaplug 13218 dad 10u CHR 116,7 0t0 466544 /dev/snd/pcmC0D0p

youtube using firefox browser working clean -
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
npviewer. 4745 dad 13u CHR 116,7 0t0 320169 /dev/snd/pcmC0D0p
youtube using firefox browser after sound stopped, application still playing -
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
npviewer. 4745 dad 13u CHR 116,7 0t0 320169 /dev/snd/pcmC0D0p

audio cd using xine working clean -
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
xine 4150 dad 6u CHR 14,0 0t0 665949 /dev/mixer
xine 4150 dad 8r CHR 14,3 0t0 665958 /dev/dsp
audio cd using xine after sound stopped, application still playing -
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
xine 4150 dad 6u CHR 14,0 0t0 665949 /dev/mixer
xine 4150 dad 8r CHR 14,3 0t0 665958 /dev/dsp

between each sound stoppage:
00-19-db-4a-4c-e9:/home/dad # rcalsasound restart
Shutting down sound driver done
Starting sound driver: au8830 done

Is there any way to create a debug report from alsa to see what is happening in it?

Thanks for that. But I can not tell when you restarted sound in between each test. If it was after each case, then you should test more. Try closing the application and then playing sound in an application …

ie … When sound stops working with browser, I can not tell which case (if any) has you close the browser (which should then ‘free’ / ‘close’ the open files) and then you play (or attempt to play) a multimedia file with a multimedia application (ie with no alsa restart in between). It would be of interest there to see what files if any are left open by the browser or by the application when sound stopped.

Of the results you provided, the only one that shows something different and requires an explanation is the one with opera, where when sound is NOT working for some reason the application gmixer has an open file. Why is gmixer running later (but was not running initially) ? Were you doing more surfing while flash player was playing ?

Also, I do not see pulse audio mentioned in the open file listing ? That suggests you have the applications xine and possibly vlc configured wrong, as they should be configured to use pulse. Why ? Have you removed or disabled pulse audio ?

With pulse audio enabled did you install the application pulse audio volume control (pavucontrol) and with it configure each application to properly use pulse ?

If you removed or disabled pulse audio, then I need to move to lurk mode in this thread, as there is likely little I can do. Both openSUSE-11.4 and 12.1 were tested with pulse enabled, and NOT tested with it disabled. From my perspective, running 11.4 and 12.1 with pulse removed or disabled, while a solution some users swear by, is not a solution I will provide support on. I don’t disable pulse myself, and hence I have no experience to offer there. So please advise wrt the status of pulse, as there is no point in us wasting each other’s time here. The users who swear by removing or disabling pulse audio need to help here. Not me. Sorry.

What was the answer to that query of mine ? (again, the status of pulse audio is relevant here).

I do not know that answer to this.

I restarted alsa before each test, and after each failure, then re-tested each. Basically everywhere the notes were in bold there was an alsa restart.

ie … When sound stops working with browser, I can not tell which case (if any) has you close the browser (which should then ‘free’ / ‘close’ the open files) and then you play (or attempt to play) a multimedia file with a multimedia application (ie with no alsa restart in between).

Each player, xine, vlc, totem, etc, shuts down (or crashes) when alsa restarts.
The browsers freeze for nearly a minute and then come back. They don’t crash.
Once the sound goes down, there is no sound throughout the system. No application has sound. The only thing that will bring it back is alsa restart.

It would be of interest there to see what files if any are left open by the browser or by the application when sound stopped.

How would I do this? I would like to see this corrected, and am willing to run any tests, just let me know.

Of the results you provided, the only one that shows something different and requires an explanation is the one with opera, where when sound is NOT working for some reason the application gmixer has an open file. Why is gmixer running later (but was not running initially) ? Were you doing more surfing while flash player was playing ?

Sorry, I may have opened gmixer at that point to be sure the volume on everything was up, nothing was muted.

Also, I do not see pulse audio mentioned in the open file listing ? That suggests you have the applications xine and possibly vlc configured wrong, as they should be configured to use pulse. Why ? Have you removed or disabled pulse audio ?

This is a clean (with exception of updates and installations) of 11.4 x64. I have not uninstalled pulse.

With pulse audio enabled did you install the application pulse audio volume control (pavucontrol) and with it configure each application to properly use pulse ?

I have not configured anything in pulse. I just installed pavucontrol. Can you walk me through the pulse set-up?

If you removed or disabled pulse audio, then I need to move to lurk mode in this thread, as there is likely little I can do. Both openSUSE-11.4 and 12.1 were tested with pulse enabled, and NOT tested with it disabled. From my perspective, running 11.4 and 12.1 with pulse removed or disabled, while a solution some users swear by, is not a solution I will provide support on. I don’t disable pulse myself, and hence I have no experience to offer there. So please advise wrt the status of pulse, as there is no point in us wasting each other’s time here. The users who swear by removing or disabling pulse audio need to help here. Not me. Sorry.

Should still be good here, as I said, I did not touch pulse. It should be active.

What was the answer to that query of mine ? (again, the status of pulse audio is relevant here).

Which question? The flash plugin? Shockwave Flash 11.1 r102

I do not know that answer to this.

There was an alsa debug that was installable. I did install it, but don’t know how to set the log file or where to find it.

thanks again for the help.

by using the same command as before …


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

In the case of vlc, also install the rpm vlc-aout-pulse . Then go to vlc > tools > preferences > audio > output > output module > pulse audio output …

… if that fails you can fall back to vlc > tools > preferences > audio > output > output module > UNIX OSS audio output , which sometimes works better.

In the case of xine, also install the rpm xine-ui. Then go to xine > right click > settings > setup > gui > experience level > master of the known universe and then apply that, close xine. The start xine again and go to xine > right click > settings > setup > audio > audio driver to use > pulse audio …

… if that fails you you can fall back to xine > right click > settings > setup > audio > audio driver to use > oss

… although with the UNIX OSS audio output or oss setting I suspect you will have same problem.

Then in KMENU > configure desktop > hardware > multimedia > phonon > backend select ‘xine’ or ‘vlc’ and not ‘gstreamer’. You may need to restart KDE for this to have proper effect. Also, the KMENU > Configure desktop settings/path I provided was based on openSUSE-11.4 with KDE-4.4.4. and 12.1 with its KDE-4.7 may be different. IMHO vlc and xine are more stable than the gstreamer backend and this by itself without tuning xine or vlc may be sufficient.

Then when running any multimedia app for the 1st time after this, also run pulse audio volume control (pavucontrol - install it if not already installed) and tune the applications audio with pavucontrol.

I did not think the alsa debug works that way. Instead there is a special debug command that one sends from a terminal in conjunction with the command to start an application and that creates the appropriate log files. And then one needs to be an advanced expert to understand the log files. Its leagues beyond my basic average user expertise.

I forgot to mention with vlc, also install phonon-backend-vlc (if not already installed). A restart of KDE afterward may be needed.

I’ve been doing some checking and testing. Installed as you suggested. Using pulse, but still no success. Nothing showed as hanging, and there were no errors.

The sound card I was using was a Diamond Monster 2. I wondered if it was a hardware issue, so I changed it out with a Sound Blaster pci card I have. The problem went away. I now have sound that doesn’t constantly disappear. It seems to have been a hardware conflict.

There is however another problem with firefox. The sound via the internet is “scratchy” periodically. If I use the Opera browser it is fine. Also, when the video file started, it opened in the browser, and then also opened 3 or 4 other vlc windows, all playing the same file. Not a big deal, my main problem is solved, and I can change to using Opera, but is there a setting that would adjust each of these issues?

Now that I have a working sound system, pulse is a pretty handy app.

thanks

Possibly there is a setting, but I do not know the setting.