Elegantly Disabling PulseAudio in Ubuntu 10.04/10.10
Update: As of Ubuntu 11.04, Alsa + PulseAudio is working fine on my hardware, so I won't be maintaining this guide, but you can find support for 11.04 in the comments below.
PulseAudio is a controversial addition to Ubuntu. PulseAudio is a userspace sound daemon that brings many benefits to users, but it is also problematic for others as well. For instance, many experience audio latency issues and stuttering with it. I've opted to disable it in Ubuntu. The longer I've been around, the more I've discovered that there really is no truly elegant way of disabling PulseAudio in Ubuntu, but I hope that this guide is one of the more elegant.
By the time you've finished this guide, you'll have disabled the PulseAudio server and made gstreamer unaware of PulseAudio in Ubuntu 10.04 or 10.10. This is sufficient for almost all applications—certainly everything that I've ever used—but some may have other ways of detecting PulseAudio that might require additional steps to disable that are not in this guide.
To disable the PulseAudio server and gstreamer's awareness of it, we are going to do two things:
- Tell the packaging system to always rename any file in a package named /usr/bin/pulseaudio to /usr/bin/pulseaudio.ubuntu and /usr/lib/gstreamer-0.10/libgstpulse.so to /usr/lib/gstreamer-0.10/libgstpulse.so.ubuntu. This prevents the pulseaudio daemon from running and gstreamer applications from being aware of it.
- Put in our own dummy /usr/bin/pulseaudio file
To do that, we can run the following four commands:
sudo dpkg-divert --add --divert /usr/lib/gstreamer-0.10/libgstpulse.so.ubuntu --rename /usr/lib/gstreamer-0.10/libgstpulse.so sudo dpkg-divert --add --divert /usr/bin/pulseaudio.ubuntu --rename /usr/bin/pulseaudio sudo sh -c 'echo '\''#!/bin/sh'\'' > /usr/bin/pulseaudio' sudo chmod a+x /usr/bin/pulseaudio
Note that there are no double quotes in the above—they are all single quotes, sometimes adjacent.
Now we need to make sure that gstreamer uses ALSA instead of PulseAudio. Run:
gstreamer-properties
and set everything from PulseAudio to ALSA.
As of Ubuntu 10.04, the ubuntu-desktop metapackage also depends on libsdl1.2debian-pulseaudio, but we want libsdl applications (games, typically) to use alsa instead. To do this, we can trick the package management system into thinking we have libsdl1.2debian-pulseaudio installed by installing the following dummy package: libsdl1.2debian-pulseaudio-dummy_1.0_all.deb. You can save it somewhere and double-click it to install it or, in a terminal, type
sudo dpkg -i libsdl1.2debian-pulseaudio-dummy_1.0_all.deb
...in the directory where you saved it.
After you have installed the dummy package, now type the following:
sudo apt-get install libsdl1.2debian-all
This should automatically remove the real libsdl1.2debian-pulseaudio package, keeping the dummy, and installing a libsdl library that includes alsa support.
If you want to restore the ALSA volume controls in gnome-panel, use a third party repository (not maintained by myself) by adding the following lines to your /etc/apt/sources.list file, replacing lucid with maverick, as necessary:
deb http://ppa.launchpad.net/dtl131/ppa/ubuntu lucid main deb-src http://ppa.launchpad.net/dtl131/ppa/ubuntu lucid main
Add the key for the repository by running this command:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com F76FFEBE
Then update to the newer packages:
sudo apt-get update && sudo apt-get upgrade
The volume applet in the indicator applet will no longer work. Remove it:
sudo apt-get remove indicator-sound
To add the regular volume applet back, right click on your panel, click "Add to panel...", and select "Volume Control."
Undo
If this guide doesn't help or makes your problems worse, you can perform the following to undo what we did here.
To undo the file renamings, you can type:
sudo rm /usr/bin/pulseaudio sudo dpkg-divert --rename --remove /usr/bin/pulseaudio sudo dpkg-divert --rename --remove /usr/lib/gstreamer-0.10/libgstpulse.so
Run
gstreamer-properties
and switch everything from ALSA back to PulseAudio.
To restore the original packages, you can type:
sudo apt-get install libsdl1.2debian-pulseaudio indicator-sound ppa-purge sudo ppa-purge dtl131
Thankz, great article since
Thankz, great article
since from ubuntu 10.10 I had a problem configuring my 5.1 audio, 5.1 audio works but rear right and front center channels are jammed. I am just scared to play with audio cuz last time it didn't go as i thought and i have to reinstall ubuntu. my alsa mixer also doesn't save settings and if you could help me to fix this problem, it'll be nice. i am a newbie to linux world from windows world and love ubuntu more than windows, how ever now i am going to follow your article... wish me luck, another comment will be right here in some time. thanks anyway
Hello !! Thanks too for these
Hello !!
Thanks too for these useful tips !!!
On my toshiba satellite T130-11U, running Mint 12, the microphone start working after that command:
echo "options snd_hda_intel model=auto" >> /etc/modprobe.d/alsa-base.conf
then restart
Bye
Hi everybody, Sound quality
Hi everybody,
Sound quality in my Ubuntu 11.10 is terrible, both with Rhythmbox and Banshee; it is jumpy and sort of crashes with every Chrome tab opened or folder/file activity. Plus, it seems to get worse every time I run updates.
I'd like to know if the solution given in this page works flawlessly on Ubuntu 11.10, or if it causes side effects.
Thank you very much!
You can temporarily suspend
You can temporarily suspend PulseAudio access while a program is running. To do this run the program in question from the terminal, and prepend "pasuspender" to the command name. Example:
pasuspender /usr/local/games/etqw/etqw-rthread
hi! thx for the great blog,
hi! thx for the great blog, saved my day! pulseaudio sucks (at least in the configuration installed with ubuntu 10.10). all my (FLAC and 320kbitMP3 as well)music sounds like 96kbit-MP3-crap with it. after following your guide, music definetly is music again.
you should add the "reboot your machine" as the last task, at least my machine did no correct ALSA-job without a fresh start. unix/linux-users are not familiar with unnecessary reboots ;)
Hey, great guide! It worked
Hey, great guide! It worked for me with Linux Mint 12. I'm so glad I can use Wine again without a crashing pulseaudio! :)
I took the time to translate this article into German and put it on my blog, giving credit to you and your site. I hope that's okay for you.
If not, I'll of course remove the article from my blog.
PulseAudio absolutely
PulseAudio absolutely atrociously sucks. I bloody hate it, especially how hard it is to get rid of once its gotten its ugly claws on an otherwise good distribution, like Linux Mint 12.
I followed your guide and it broke sound.
Tried all the way suggested,
Tried all the way suggested, still my mic & headphone doesn't work. Any help would be highly appreciated. Struggling on this for last 3 days :(
OK, so I fixed my problem in
OK, so I fixed my problem in 11.10 with a simple "sudo apt-get remove pulseaudio". No more Skype issues. Why don't you consider this elegant?
I have found that PulseAudio
I have found that PulseAudio still isn't perfect in Ubuntu 11.04 and 11.10, and disabling it in 11.04 using this method allowed me to use Skype in Ubuntu with good call quality. However, having upgraded to 11.10, your instructions now seem to cause Skype and a number of other packages to have more serious running problems. So it now seems to be a choice between poor quality or no Skype calls. It's a shame, as this solution worked like a charm before!
Thanks so much! Skype issues
Thanks so much! Skype issues resolved!
One issue: You write
[[To add the regular volume applet back, right click on your panel, click "Add to panel...", and select "Volume Control."]]
When I right-click on the panel (Ubuntu 10.04), I get "About" and three greyed-out options ("Remove from Panel," "Move," and "Lock to Panel"). If I click on a couple particular spaces on the panel, I can also get either "Preferences" (which only has one toggle-box: "Show windows from all workspaces") or "Help" (which, when I search it for how to add the Volume control applet, tells me the same thing you did - right-click on the panel and click "add to panel..." which doesn't show up on my system.
Any other guesses of how to add the volume applet? I guess it's not that big of a deal; I can use alsamixer. Nice that the laptops volume shortcut keys work!
Thanks again,
~Tinker George
It works! Thanks for telling
It works!
Thanks for telling us how to disable PulseAudio, since I have PulseAudio disabled I don't have any problems with Quake Live sound.
Before the removal of PulseAudio, the sound in Quake Live was choppy and it had gotten a very big delay (1 or 2 seconds), but now it works great!
This page will go directly to my bookmarks, if I need disable again PulseAudio in Ubuntu 10.10, I will know how to do.
Would this work with Debian
Would this work with Debian Squeeze as well?
I don't know. Some of the
I don't know. Some of the steps, like dealing with the libsdl package, might be unnecessary on debian squeeze. It might not be a good idea to use the Ubuntu PPA for getting the Alsa volume controls either.
Okay... what is the point of
Okay... what is the point of doing something so unnecessary complicated instead of just removing pulseaudio? Am I missing the point?
It's a tradeoff... if you
It's a tradeoff... if you remove the pulseaudio package, then you get to avoid some of the pulseaudio package tomfoolery above, but then you also have to remove the ubuntu-desktop meta-package, which can cause its own difficulties down the line. Either way, most of this guide, like modifying gstreamer settings and restoring Alsa volume controls, you'll have to do regardless.
Thanks a lot ! finally i get
Thanks a lot ! finally i get rid of the buffers underrun :-)
you can also add the following lines at the end of your ~/.asoundrc so that everything using alsa (like the flashplayer) is redirected to jack :
# http://jackaudio.org/routing_alsa
pcm.rawjack {
type jack
playback_ports {
0 system:playback_1
1 system:playback_2
}
capture_ports {
0 system:capture_1
1 system:capture_2
}
}
pcm.jack {
type plug
slave { pcm "rawjack" }
hint {
description "JACK Audio Connection Kit"
}
}
You can also set jackaudiosink and jackaudiousource in gstreamer-properties as mentioned here:
http://www.goplexian.com/2010/02/setting-up-jack-audio-for-gstreamer.html
(this page contains also tips about enabling realtime capabilities for application needing it)
add this too If you wanted to
add this too
If you wanted to make all ALSA applications use this device by default (i.e. even when no explicit name is given)
pcm.!default {
type plug
slave { pcm "rawjack" }
}
Thank you very much!
Thank you very much! Yesterday I unplugged my USB headset, and today when I plugged it back in, I couldn't get it to work properly with Skype. (I'm using Ubuntu 10.04.) After much fiddling around I reached a point where the microphone worked, but the audio output would only come through my speakers, not the headset. Finally I encountered this webpage, followed the instructions, and, presto! I can now use my headset with Skype again.
pusle audio sucks!!! period!!
pusle audio sucks!!! period!! alsa was easier to configure and use as a server in by itself until everyone decided to adopt pulse auddio and shove it down our throats!!
Hallo I thank you so much !!!
Hallo
I thank you so much !!! Solved a big problem with Skype and external webcam logitech C200 in Ubuntu 11.04 Natty that never worked properly. Now everything is allright. Special boy !!!
Alsa doesn't switch Speakers<>Headphones nor Keybrd volume ctrl!
Hi Jeff and everyone!
The solution is great, and the comments gave me more info about the differences between Pulseaudio and Alsaaudio, GREAT!
I've been working with Ubuntu from karmic, but this is the 1st time I run it in a laptop netbook. Its an Acer One 722 (may 2011 model). I have lucid installed because of the installation problem of maverick and natty, just block the pc before ending OS install.
I want to ask you about my Alsa (I guess) sound problems:
1) From the 1st moment working in lucid speakers never mute when I plug headphones, just keep sounding at the same time. For me is a major problem cause I can't work in my degree investigation in public places (when transcribing, most part of the time), or have some privacy when watching videos or listening to music or else. I thought it was a Pulse problem, so I followed Jeff solution steps, but it just still the same.
2) Since I disabled Pulse following Jeff solution steps, I can't control volume level with netbook keyboard keys, those which you can increase or decrease volume level with, pressing "Fn" + Up/Down arrow key. It was obvious to happen, but anyway I don't know how to enable or configure that function again.
PLEASE HELP ME!! I couldn't find any solutions in other forums.
I don't know if I'm clear about my Ubuntu OS issues, forgive my mistakes, english is not my mother tongue, I'm from Colombia.
Many Thanks!!
re: Alsa doesn't switch
Unfortunately, I don't know how to fix issue 1). I'd conjecture that this is an Alsa bug. It's unfortunate that later versions of Ubuntu won't install for you because I'd normally recommend trying a later version where the bug may be fixed. But it seems we've ruled out the issue being related to PulseAudio.
Given that removing PulseAudio didn't fix your issue in 1) and that it actually caused an extra issue in 2), I'd first recommend that you follow my undo instructions and restore PulseAudio so that you at least fix issue 2).
Afterwards, if you want to pursue a fix for issue 1) and haven't tried this already, you might try upgrading to Ubuntu 10.10 or 11.04 from Lucid. An upgrade might work even though a direct install didn't. Unfortunately, I can't be of more help here.
Absolutely brilliant stuff!
It is working for me on 11.04. I just replaced "lucid" with "natty" and also had to log-out and log back in for the volume controls to work. You are marvelous. I never thought I will be able to get audio to work on Ubuntu 11.04 or lesser.
In fact, today morning I installed Linux Mint "Katya" and I didn't have to do anything else for audio to work. It just worked out of the box. No freakin' idea about what's wrong with Ubuntu. But, thanks Jeff, you are a savior.
Hip, Hip, Hurray! Linux, here I come. I will slowly move from Windows to Linux except for gaming.
Regards,
Devang
And your comment saved my
And your comment saved my day, hah!
Works in 11.04
Jeff,
It works perfectly also in Ubuntu 11.04. By the way, this is the ONLY guide to remove PulseAudio that works flawless and, as you say, elegantly. Thank you!!
One contribution: the dtl131 repository can be added through "apt-add-repository", which is a more generic and simple way (should work across different releases as long as the correspondent PPA repo exists):
apt-add-repository ppa:dtl131/ppa
Best regards from Brazil,
Dorian Bolivar
It Worked...With One Exception
Hi Jeff,
Thanks for this fantastic post! I have spent 4 days looking through the Ubuntu Forums to find SOME way in which to switch to Alsa. My reason was that I could not get Skype to work. Microphone would work for 3 minutes and then cut off. I could hear others but they could not hear me. Rebooting was the only option.
Anyway, this post fixed everything with the exception of the volume icon (applet). There is no icon showing BUT there is a space there and I can left click on the space to get to "Sound Preferences". I know it is a small issue but I was wondering if you had a fix for it. Again, no icon (applet) is visible but there is a space for it and you can click on it.
I am using Ubuntu 10.10 and I changed the third party repository lines you have listed from this:
deb http://ppa.launchpad.net/dtl131/ppa/ubuntu lucid main
deb-src http://ppa.launchpad.net/dtl131/ppa/ubuntu lucid main
To this:
deb http://ppa.launchpad.net/dtl131/ppa/ubuntu maverick main
deb-src http://ppa.launchpad.net/dtl131/ppa/ubuntu maverick main
Also, with your permission, I would like to post this solution over in the Ubuntu forums or at least link to it, giving you credit, of course. I could not find a contact email address on this website or I would have emailed this request in private.
Thanks again for a solution that actually works!
re: It Worked...With One Exception
My email address is on the bottom of this page (an image so as to avoid email harvesters).
About the volume applet issue, I still don't have any Maverick boxes, so I don't have any firsthand experience with that version. My only suggestion is to try removing the volume applet and then adding it again by right-clicking on the panel and selecting "Add to panel..." You should see "Volume Control" in the list of applets to add.
About copying, that's fine as long as you link back, as I do occasionally update the guide. For instance, if we get your volume applet issue worked out, I would like to include Maverick instructions. Also, make sure you copy it in its entirety, including disclaimers and undo instructions. I want people to know that even though this works for most people and their applications, it still isn't a magic bullet, and I would like for them to have a way to go back to their original configuration if things don't work out.
RE: re: It Worked...With One Exception
The removing and adding of the volume applet worked. Actually there are two volume applets now, the one you can see and the one you cannot see. If I remove from panel the one I cannot see, it removes the indicator applet. Somehow the non-showing volume applet is linked to the indicator applet as it shows up along with the envelope icon when I add the indicator applet back onto the panel.
The bad news is that I jumped the gun on celebrating this as the solution for my Skype microphone problems. However, instead of only having pulseaudio(local) listed in the microphone sound preferences within Skype, now I have a ton of options showing up in the drop down box.
The problem is that the mic only works temporarily, just like it did with pulseaudio. If I try downloading something or opening up another program that uses sound software (smplayer, for example) it shuts the mic down and the only solution is rebooting the computer. I now have a new issue when the mic shuts down and I go to youtube and try to watch a video, it will put the sound on constant repeat and nothing can stop the repeating noise without rebooting the computer.
The main problem is that I see no mic volume slider within Alsa. I am using a headset combo that is plugged into the microphone and headphone inputs in the front of my Toshiba Satellite A100 laptop. In the Gnome Alsa Mixer it gives me PCM, CD, Beep, Capture, Digital but no Microphone. There is a "Input Source" with a box I can put a check mark in but whenever I close it down and reopen, the check mark is gone.
In "Mixer-HDA ATI SB (Alsa Mixer)", under the options tab, it does give me a choice of "Mic" or "Cd", however, no volume slide.
In Skype, I leave the mic input as "default" which works for awhile. There are so many choices listed that I'm not quite sure what the correct one is.
Anyway, the Skype/PulseAudio/No Mic issue seems to be an ongoing problem. I have seen TONS of threads in the ubuntu forums with no permanent solutions. At least yours doesn't go the route of "kill pulseaudio" which I tried and it messed up my computer.
For now, I will just have to use Skype without surfing the web or having anything else opened. The good news is that the quality of sound coming out of my mic has improved.
I just hope in the next version of Ubuntu, someone takes the time to work out the microphone issues that have been going on for over 2 years now (based on the message threads I have seen posted).
re: RE: re: It Worked...With One Exception
I've since tried this on a fresh Maverick/10.10 box (although this issue may apply to Lucid/10.04 as well). It looks like the blank volume applet is in the indicator applet. To remove it, you can remove the indicator-sound package:
I'll update my guide to cover this shortly.
Follow Up
A quick follow up as I might have corrected the problem. I forgot that I had also followed this person's instructions prior to yours:
http://www.webupd8.org/2010/03/how-to-switch-to-alsa-or-oss-instead-of.html
Once I reversed what I did in his post, double checked in gconf-editor that it was back to the original settings and set Microphone, Speakers and Ringing to "Default device" under Sound Devices in Skype, I was able to use the microphone successfully without rebooting my computer.
The microphone recording had a lot of crackling noise and the quality sounded awful so I right clicked on the volume applet, chose "Open Volume Control", the "Recording Tab" and lowered the "Capture" and "Digital" volume. I am assuming these are my microphone volume controls as I tried another test call in Skype and the crackling noise was gone and the quality was good.
Crossing my fingers that this does the trick.
IT'S WORKING
Thank You very much!
I have Baltix (Ubuntu 10.04 modified for Lithuania), and I have a problem with sound in Skype, it's hearing like scratching noise and make unavailable voice chatting. In new version of Skype in Ubuntu you can't choice any device, just PulseAudio, it's very strange because in Lubuntu, in the same version of Skype, you can choice any device and sound card.
But now, after your upgrade, I can select devices and sound cards in my distro, and sound in Skype voice chatting are clear!
Thank You very much for your job!
Good luck and best wishes!
p.s.: sorry for my English :)
Disable Pulseaudion in Ubuntu 10.10
Hi
Thanks for this guide.It is the easiest guide to disable Pulseaudio I have found.
I just upgraded from Ubuntu 10.04 to Ubuntu 10.10.
I want to ask you if it is possible to use the guide for 10.04 to disable Pulseaudio in 10.10.
If not, then please write a guide on how to disable Pulseaudio in 10.10.
re: Ubuntu 10.10
I've only tested it with the Ubuntu 10.10 Live CD, as I don't have any boxes with Ubuntu 10.10 on them at the moment. It seems like the 10.04 instructions work with the exception that when you're adding the third party repository to your /etc/apt/sources.list file, you should replace both occurrences of "lucid" with "maverick", but that's to be expected. If you give it a try, please let us know how it works.
Thank you!
Thank you very much! This worked like a charm!
By default Ubuntu 8.10 comes
By default Ubuntu 8.10 comes with Pulse Audio and most users start complaining about pulse audio so if you don’t want to use Pulse Audio. Packaging Machinery
THANK YOU!
I'm going to do this, but after the semester is over. I've had all kinds of sound compatibility problems and my brother has had to switch Linux distros because of this issue. The problems have the solution, which is "uninstall pulseaudio".
I've tried doing this before and it always resulted with a system with no sound or one that won't boot up. So, recently I just avoid applications that have problems with pulseaudio, which is a real drag.
I also don't fully understand the whole Ubuntu sound setup, which uses ALSA with Pulseaudio and other applications which I can't remember now. But if those have problems you can use Jack audio, which is another layer of sound management. The whole thing is a confusing rube goldberg machine which looks more complicated than it needs to be. Especially if you're coming from the Windows XP world of video and sound editing, where the worst problems were solved by just reinstalling or upgrading a driver.
Thanks for the post, but I'll have to come back and try this in a few weeks.
Old dog, new tricks, etc.
PulseAudio is not a controversial decision to Ubuntu.
PulseAudio is the natural decision for sound services in Ubuntu.
If you have issues with PulseAudio, the first step is to figure out what is the source of the issues. In many cases ('Oh, I got this new laptop and something related to sound does not work') the issue is ironically with Alsa audio support in the Linux kernel. Issues such as the mic not muting when you connect a headset, the mic not working, sound not working at all are likely to be Alsa issues.
In this case, you need to extract the full details of your sound hardware, with
wget -O alsa-info.sh http://alsa-project.org/alsa-info.sh && bash ./alsa-info.sh
(select to send to alsa-project.org and write down the URL)
and ask politely at ubuntuforums.org for help.
If sound does not work well on your system, complain to your computer manufacturer. Rubbishing Pulseaudio make you sound silly.
Lubuntu is the way Ubuntu
Lubuntu is the way Ubuntu should be: quick, light, and pulseaudio-free.
Everything works. Did you try configuring a USB phone keeping the ringing sound on your headphones? It's impossible in Ubuntu.
Pulseaudio IS the problem!
Saying that "Rubbishing Pulseaudio make you sound silly." is silly.
To create music with low latency in linux requires alsa and jack. With pulseaudio installed and active the latency is crazy long. So... why the grudge? Are you a developer of pulseaudio or just a fan???
Post new comment