Bookmark and Share

April 22, 2009 by Ivan  

[TIPS] Solving Ubuntu Sound Problem Without Restart

Ads by Google

Ubuntu Logo Have you ever had the sound problem in Ubuntu, especially in Ubuntu 8.10 Interpid Ibex? And to fix it you need to restart your computer, and if the sound stop working again then restart again… it’s so frustrating, isn’t it?

Now i would like to share with about how to fix it, but not really fix it, at least you don’t need to restart your computer if the sound stop working. This is based on my experience using Ubuntu 8.10 Interpid Ibex with Intel x86 processor, the sound occasionally stop working, and i don’t know why. After i tried to search what is the trigger why the sounds stop working, i found that Rhytm Box or Totem Media Player doesn’t like to play together with Mozilla Firefox 3.0.8 with Flash Media Player.


In my computer the sound will stop working if i play my songs in Totem or Rhtym Box and open Youtube site. Once again, this is based on my experience on my machine, so correct me if i’m wrong. And if you know what is the real problem, please leave me a comment.

Ok, this is how i fix the sound problem with out restart:
1. Open your shell and find all process that currently using sound with this command:

lsof | grep pcm

2. After you get all proceess with the proceess id, kill all that process with this command:

kill -9

3. Restart ALSA (Advanced Linux Sound Architecture) driver with this command:

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

4. That’s it

How to avoid that sound problem (once again based on my experience), use banshee media player instead and you can freely watch youtube :)

Will this problem or “bugs” fix in Ubuntu 9.04 Jaunty Jackalope? Let’s see then… (red: This post was publish 1 day before new Ubuntu release).

If you find this tips is useful, please leave any comment. Thanks and have a nice day…

What people search:

Reader Comments

  1. Me says:

    I am having the exact same problem with Ubuntu 9.04. The sound will stop working after watching a few videos on youtube. I skipped your first two steps, and just entered:

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

    into the command line, and that seems to fix the problem. I do appreciate your help with not having to restart the computer every time I want the sound to work. Please, does anyone know how to fix this problem? I don’t have a doctorate in Linux and Ubuntu, so dumb down the answer, please.

  2. Sam says:

    Why kill -9? If you’re trying to avoid a restart, why orphan all of those shared memory segments? You don’t like using your RAM?

  3. Ivan says:

    i’m using “-9″ because to kill the process immediately and cannot be blocked. Do you have a better idea?

  4. Dan Stiverson says:

    The conflict between devices sounds like a lack of disconnect at the end of the previous use, and without the disconnect command there is no way for the sound device to release from your you tube site so that the sound device can reset. In doing the kill command what you are doing is providing a release of the previous connection and idling the device so that it can be reset and reused. I am not a coding expert so I cannot help resolve the issue but maybe an expert will make note of this idea and provide code to add the kill command to the buffer that connects the sound card to the website.

  5. Ivan says:

    Hi Dan,
    thanks for the idea, to be honest i’m not a coding expert too. I just try to solve the problem with my ubuntu machine.
    I hope the next release can do better.

  6. Klaas says:

    Actually, I was not viewing any videos at all, did not have a Youtube tab open in firefox and _still_ my sound system suddenly stopped working in the middle of a Coldplay song. I tried all the steps you explained, but none of them work _at all_. I just don’t have any sound anymore. Seems like I have to restart my system, which actually pisses me off, if you’ll excuse my French, since I am in the middle of a project.
    This is exactly one of the reasons why I left Windows about 6 months ago. I do like Linux (Ubuntu 9.04), but it still is a far cry from _the ideal system_ as so many people claim. It may be better, faster and prettier than Windows in many respects, but being free and open does have its disadvantages as well…
    Off to rebooting my system now (he wrote, angrily typing away… ;-)

  7. Ivan says:

    Hi Klaas,
    Actually restart the ALSA should be enough to solve your problem.
    With this command:
    sudo /etc/init.d/alsa-utils restart
    If the sound still stopped working, please update your Ubuntu kernel to the latest release. Maybe that would help.

  8. cesium62 says:

    Didn’t work for me. Using Karmic Koala 9.10, I get static when playing YouTube videos. Restarting Also didn’t fix the problem.

  9. Ivan says:

    Did you install Karmic from scratch or upgrade from Jaunty?
    I suggest you to install from scratch.
    Cheers.

  10. Zelalem says:

    Hi Ivan, it is very nice. Thank you. I always used to restart and couldn’t get this kind of solution.

    Cheers,

    Zelalem

  11. Stefan says:

    For me it seems like npviewer is usually the culprit. So if you just kill the npviewer process and then reload the youtube page, then everything should work again.

    Since alsa wasn’t killed that way, you don’t need to restart that.

  12. Ivan says:

    Hi Stefan,
    This is new for me.
    Thanks for sharing it with us.
    I’m using Ubuntu Karmic Koala now. And it is pretty stable, no sound and video problem anymore.
    Cheers…

  13. Judson Ruhl says:

    How do you write the following command from your text:lsof | grep pcm I can’t find the vertical line anywhere on my keyboard. It makes a difference because the command won’t work without it.

  14. Ivan says:

    If you are using US-Keyboard it is there. Pay more attention. Or just copy and paste my command.

  15. Tony says:

    I found this same fix elsewhere, and it worked for me… precisely once. Now I get nothing. Even worse, now when I do "sudo lsof | grep pcm", it hangs and I have to Ctrl-C to get out of it. I need to use "sudo" because the problem is always that I have a multi-user laptop and the sound problem ONLY occurs when I switch from my wife's to MY user account.

    I actually don't have to restart the entire computer. I just need to switch users, log out of my wife's account, then switch back to me. But that is still really annoying and shouldn't be that way.

    I have Ubuntu 9.10 on a Dell Inspiron 1525 – it is completely up-to-date, and was installed fresh (not updated from 9.04 or anything). Any ideas?

  16. Ivan says:

    Hi Tony,
    I have the same problem lately when using the latest kernel of ubuntu karmic.
    I will find solution and post on my blog soon.
    Cheers
    Ivan

  17. Tony says:

    Fixed it!

    The "bug" is described here: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/433654/

    Go to comment #47. The fix is described there.

  18. Ivan says:

    Thanks Tony,
    That's what i looking for too.

  19. Jesse says:

    Kudos to you man, thanks for making my life (using Ubuntu anyway) a lot easier. This sound thing was plaguing my big time. Who thinks restarting is a viable option when you've got several windows open and a bunch of work to do? Kudos, kudos.

  20. sunny says:

    awesome thanks man…fixed my problem as well…hated rebooting :) )

  21. Ivan says:

    Hi sunny,
    nice to hear that my article can help you.. :)

  22. used computers says:

    I actually don't have to restart the entire computer. I just need to switch users, log out of my wife's account, then switch back to me. But that is still really annoying and shouldn't be that way.

Please do not add HTML tags in your comments. All comments are moderated.

Add a comment

(required, use real name)
(required, will not be published)
(optional, will not be published)
blog comments powered by Disqus