restart sound ubuntu 8.10 Intrepid

ubuntu is apparently switching to pulse audio in 8.10 and future releases. Till they get it correct, some fixes for when sound stalls:


sudo /etc/init.d/alsa-utils restart

But sometimes this won’t work if something is really holding on to the sound so do:

#############################################
The Fix
#############################################
## List open files; search for pcm using sudo to search all directories!!
name@comp:~$ sudo lsof | grep pcm
## shows the process id(s) of any sound processes .
## kill them:
name@comp:~$ kill -9 5079
name@comp:~$ kill -9 5080
## restart alsa sound:
sudo /etc/init.d/alsa-utils restart

clears any locked audio usage and allows to restart ubuntu sound with no reboot!

The output of the “sudo lsof | grep pcm” command above may look something like this:

lsof: WARNING: can’t stat() fuse.gvfs-fuse-daemon file system /home/gare/.gvfs
Output information may be incomplete.
pulseaudi 6961 gare mem CHR 116,5 13126 /dev/snd/pcmC0D0p
pulseaudi 6961 gare 43u CHR 116,5 13126 /dev/snd/pcmC0D0p

This fix is based on the locked Ubuntu forum thread here. The key difference is to use “sudo” to get all sound usages.

If this post was helpful to you, please consider clicking an ad below!

6 Comments »

RSS feed for comments on this post. TrackBack URI

  1. Comment by Georges Djonga — 26-Jan-2009 #

    Thanks you very much.

    Just for that little annoyance, I was to ready to switch to another linux distro.

    I wrote a little shell script based on your solution.


    #!/bin/sh


    for pid in `sudo lsof 2>/dev/null | grep pcm | grep pulseaudio | cut -d ' ' -f 3-3 | uniq`
    do
    kill -9 $pid
    done
    sudo /etc/init.d/alsa-utils restart

  2. Comment by gare — 26-Jan-2009 #

    Hi Georges -

    Glad post was helpful.

    Thanks for posting your shell script.

    I am having better luck over time with Intrepid as they release updates to pulseaudio – though I still have to use this solution for 1 machine occasionally – on those occasions have noticed that firefox has locked the sound.

  3. Comment by haet @ Linux annoyances.. — 26-Jan-2009 #

    Thanks for this solution! The crashing audio in Linux is driving me nuts, at least with this I don’t need to reboot if it messes itself up.

  4. Comment by harrykar — 12-Mar-2009 #

    Thank you very much ;-)

  5. Comment by Trey — 28-Apr-2009 #

    big help thank you much!

  6. Comment by Jesse — 1-Apr-2010 #

    Hey man, thanks for making this available and without a crazy amount of jargon. Worked like a dream without having to pull my hair out (like I did for the past 1.5hrs). Cheers mate

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress RSS XMLRSS Feed - Syndicate this Site and comments feed
linux GNUpowered by Apache tomcatMySQL ABPHP - The Language the Web Runs on

^Top^ Gare CalhounGare CalhounGare CalhounGare CalhounGare Calhoun