Ubuntu – Why does sound stop working after a while

10.10soundtroubleshooting

I don't know how to reproduce this problem, because I don't regularly play music or sound. All I know is that, sometimes, I'll load a video (from youtube or from a local file) and there will be no sound.

Everything looks fine software wise:

  • Rebooting always fixes.
  • aplay, paplay and pals give no error message
  • I'm not in the audio group, as advised
  • The device exists and appears in use:

    $ lsof /dev/snd/by-path/pci-0000\:00\:1b.0
    COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    pulseaudi 17313 badp   23u   CHR 116,10      0t0 7628 /dev/snd/by-path/../controlC0
    pulseaudi 17313 badp   30u   CHR 116,10      0t0 7628 /dev/snd/by-path/../controlC0
    
  • Restarting pulseaudio or alsa seems to do no good.

What is wrong here?

Best Answer

An interesting tool I hadn't seen from https://wiki.ubuntu.com/DebuggingSoundProblems :

ubuntu-bug audio

It attempts to do some interactive checks. If you haven 't, try running that when the issue occurs. But the checks are worth running any time. I believe the bug information generated will provide the information that the next links ask for. (For example, giving the equivalent of the alsa-info.sh from fedora. EDIT: Actually, you can find alsa-info.sh here.)

That page has some other good info as well. I think most of the fixes are for constant problems, though, not intermittent ones like you are having.

Two Fedora-Linux wikis have some troubleshooting tips that could be extracted: https://fedoraproject.org/wiki/Bug_info_kernel_sound
https://fedoraproject.org/wiki/Bug_info_PulseAudio

From the fedora pages:

The output of pulseaudio -vvvvv, run on the command line, is often helpful. To provide this correctly, first configure PulseAudio not to respawn itself automatically when it dies, by creating a file ~/.pulse/client.conf with this content:

autospawn = no

Then kill the existing server, with the command pulseaudio -k. Now launch pulseaudio -vvvvv from a console, and reproduce your problem. Provide the whole set of messages from the console where you ran pulseaudio.

The output of pacmd ls can also provide a snapshot of the audio system's state.

Application-wise, here's a post (from 2009) mentioning that Skype caused problems for him:

[...] I ran into some problems with skype (bug filed). PulseAudio asserts and goes away probably because of something Skype does wrong (although one could argue that PulseAudio shouldn’t break down completely because of one bad client).

Of course, there are lot of possible culprits, but knowing that one of your apps has in the past caused problems is at least encouraging (or discouraging, if you want).

Long shot -- check your CPU time for the pulseaudio process -- noticed this from the manpage:

--no-cpu-limit[=BOOL]    

Do not install CPU load limiter on platforms that support it. By default, PulseAudio will terminate itself when it notices that it takes up too much CPU time. This is useful as a protection against system lockups when real-time scheduling is used [....]

Related Question