Posted in How To

PulseAudio is a Toilet Full of Roses

PulseAudio is a Toilet Full of Roses Posted on May 6, 20167 Comments

Freedom Penguin’s founder & talking head – Matt has over a decade working with Linux desktops, his operating system experience consists of both Windows and Linux operating platforms. In addition to writing articles on Linux and open source technology for Datamation.com and OpenLogic.com/wazi, Matt also once served as a co-host for a popular Linux-centric podcast.

Matt has written about various software titles, such as Moodle, Joomla, WordPress, openCRX, Alfresco, Liferay and more. He also has additional Linux experience working with Debian based distributions, openSUSE, CentOS, and Arch Linux.

(Last Updated On: February 24, 2017)

Before I even begin, allow me to save you some time. If you’re convinced that PulseAudio is going to ruin your Linux experience, then you can try the tips in this article to disable it in Ubuntu. Should you try to remove it, good luck. Yes, it’s “possible“, but it’s not something I recommend. For everyone else, keep reading.

I can honestly say with a straight face that I’ve never, ever had any real show-stopping issues with PulseAudio. Yeah, I know – you have. And so have many others. I guess this means I’m blessed by the Linux audio gods, as my PulseAudio experience has never been anything other than mundane and functional.

Now, before we go any further, there is something you must understand. Most of the issues you read about in forums regarding PulseAudio are nonsense. (Edited for clarification) It’s been my experience that 99% of the time the issue is how the end user interacts with PulseAudio. PulseAudio is not there to teach folks how to use it correctly, that’s a matter for the end user and their distro of choice.

My USB headset doesn’t play any sound.

That’s because it’s still routed to your PC’s sound card.

I plugged in USB speakers and they’re not being detected.

Sometimes it helps if you re-spawn the PulseAudio server by killing it.

My audio sounds really quiet, even though I have the volume turned way up.

Blame the volume controls that came with your desktop, not the sound server. Install pavucontrol and you will likely see that the issue is at the application volume level, not the sound card volume itself.

PulseAudio crashes whenever I try to use a media player or watch a video.

Running the application in question from the terminal might give you an idea as to what’s actually happening. Might also be worth it to check dmesg as well. Often this is an ALSA/application issue, not the sound server itself.

When I play games, PulseAudio never plays the audio!

Using pavucontrol, make sure the desired sound card is set to the default. Also, verify the game settings are set to the desired sound card or to PulseAudio as the default audio device.

When I play audio to my Bluetooth speakers, there is lot of latency!

(Edited for clarification) First, the latency in this case is due to Bluetooth, not the sound server (by itself). Anyone telling you different is misinformed. Bluetooth audio latency is real, proven, and a demonstrable fact of life. While PulseAudio can add some latency to the mix, understand that it’s nothing compared to what Bluetooth shoves down your ear holes. Second, because you’re using PulseAudio, you can use pavucontrol to adjust the latency from the desired sound card’s latency menu. So even though Bluetooth is dropping the ball, the sound server you’re griping about provides a GUI solution.

latency

When I record audio with my video in software like Cheese, the audio playback is delayed from the video.

See latency fix mentioned above. Another option is to consider a real-time kernel and perhaps using the JACK audio server instead of PulseAudio. JACK provides a lower latency and may be a better fix if you do not wish to compensate for the latency delay found in routing ALSA audio through the PulseAudio server.

Stop comparing ALSA to PulseAudio

If I had one request of the Linux community, it would be this: Please stop comparing ALSA vs PulseAudio. Continuing to do so is like comparing the Linux kernel to Apache. The comparison simply doesn’t fit. ALSA is what makes your sound card play audio. Just like OSS (the Open Sound System for Linux) before it. PulseAudio is a sound server that allows casual users to send audio streams from specific applications to different audio playback devices like sound cards or USB solutions. PulseAudio offers the same benefits with input manipulation.

Point being, PulseAudio isn’t usually the problem most people are dealing with. Historically, most issues I’ve seen are user error or worse, the Linux audio stack itself. Let’s face facts – Linux audio is a mess and it’s only showing signs of further decay with each passing year.

I know, let’s add yet another pointless layer to it!” – This needs to stop.

PulseAudio

PulseAudio doesn’t know JACK

As I touched on previously, PulseAudio is a sound server for casual users. It allows folks to route audio from applications and devices to specifically designated sound cards. Then we have another sound server called the Jack Audio Connection Kit or JACK for short. JACK is awesome for routing inputs and outputs with various audio hardware/sound cards. In recent years however, it’s been targeted to a a smaller subset of the Linux community – those needing prosumer and professional audio solutions.

Casual user: PulseAudio is perfect for users looking to simply route software audio from one card to another (such as a USB headset).

Professional audio: JACK wins all day long with its low latency feature set offering full audio control to send various inputs to various outputs.

Note, it’s technically possible to run JACK through PulseAudio. I think it’s a stupid idea, but it’s possible.

So why not run ALSA without a sound server? Unless something has changed since I last tried this myself, you’re going to be hitting the message below when trying to run two audio streams at once:

“Device or resource busy”

Use a mixer you say? That’s not going to work without some additional configuration. Without PulseAudio, you’re going to be playing with your .asoundrcfile and setting up hw=0.0 / hw=0.1 configurations to accomplish what you want for multiple audio streams at the same time. I’m sure this is going to be a “huge hit” when compared to audio architectures from competing operating systems! Yeah, not so much.

To be clear – yes, it’s possible to send two audio streams into two different sound cards without PulseAudio. It’s also possible to compile ones own kernel, too. Unless you’re running Arch or rolling your own distro, the geeky approach is not something most casual users will want to fool with. So for most people, this brings us right back to using PulseAudio!

Ensuring PulseAudio is usable

Remember above when I said most of the time the issue is user error? Here’s a poster child example of such an occurrence: “PulseAudio plays no audio at all.

To deal with this issue, let’s try the following steps before disabling PulseAudio altogether:

1) Is your sound card even detected? Yes? Try the following in a terminal to see if the issue is PulseAudio or the ALSA driver:

pasuspender -- name of problem software

This will run that specific application as if PulseAudio wasn’t installed. Note, no other software will have audio access until you close this application instance. If the application still fails, then it’s not a PulseAudio issue.

2) Now let’s see if the issue is a volume control related one. Install pavucontrol, then run it from the command line or from your menu launcher. Verify that your Output devices have the correct sound card as the default, the volume is turned up. Did this work? No? Keep reading.

3) With pavucontrol open, play the audio file/YouTube/whatever and while it’s playing, visit the Playback tab. Make sure it’s piped through to the correct sound card. Almost 99% of the time, this is the cause and fix to the “No sound” problem you see in Linux forums.

At the beginning of this article, I explained that you’re better off disabling PulseAudio than breaking stuff trying to remove it. I would also suggest that you run through the troubleshooting section of the Arch wiki before doing anything drastic. The reason being that you’re usually better off fixing the issue than throwing the baby out with the bath water.

Closing thoughts

Linux audio is over-engineered and generally “blows chunks.” Not because it’s difficult to use, rather, due to how many moving parts it uses to play audio from different media types to different sound cards.

On the flip side however, reverting your PC’s audio capabilities back to something that is best suited for power users is a deeply personal choice that I simply can’t recommend. If you prefer working with .asoundrc, alsamixer and the limitations that go with that tool set – awesome, go for it. But for those folks who enjoy being able to managed multiple sound cards with something GUI based, then you might want to consider giving PulseAudio another spin.

I promise you, most people struggling with PulseAudio are over-thinking the problem. For everyone else, try the customizations mentioned in the wiki article above. I have set to see an issue that wasn’t either legitimately ALSA driver related or something needed to be reconfigured with PulseAudio.

“PulseAudio, a modern sound server that frustrates folks to point of uninstalling it!”

More great Linux goodness!

Matt Hartley

Freedom Penguin’s founder & talking head – Matt has over a decade working with Linux desktops, his operating system experience consists of both Windows and Linux operating platforms. In addition to writing articles on Linux and open source technology for Datamation.com and OpenLogic.com/wazi, Matt also once served as a co-host for a popular Linux-centric podcast.


Matt has written about various software titles, such as Moodle, Joomla, WordPress, openCRX, Alfresco, Liferay and more. He also has additional Linux experience working with Debian based distributions, openSUSE, CentOS, and Arch Linux.


Leave a Reply

7 Comments on "PulseAudio is a Toilet Full of Roses"

Notify of
Sort by:   newest | oldest | most voted
wpDiscuz