«

»

Sep
11

System Wide PulseAudio? Sure!

Everybody knows PulseAudio. It’s a really famous piece of software, some love, some hate it, some love to flame about it. I quite like like and I still haven’t flamed about it enough, so this is my turn to flame a little bit…

Why I like it?

I started using PulseAudio few years back. The reason why I gave it a try was a network mode. I used laptop quite a lot and I had big speakers connected to my desktop and I wanted to use them while lying in my bed. That kinda worked for a while but I found it not that interesting in the end. But as I was playing with PulseAudio, I found other interesting features I liked. Like having separate volume control for every application or option to boost the volume. So I started using it and kept on using it.

System Wide mode

To be able to use network attached speakers, I had to use system wide PulseAudio. But today I’m using PulseAudio even on my notebook in system wide mode and I have my reasons to go against upstream recommendation. Let’s take a look at why I ignore recommendation of upstream…

Multiuser, security and daemons?

Number one issue they mention on the web page is security. Everybody who has access to the pulse server have complete control over the sound server! Yes, so what? There is a pulse-access group and I don’t need to put remote users into that group. So only people logged in locally can play around with my audio. And I actually think that it is a really good idea to let people who are actually sitting in front of the computer control the the audio no matter who is playing what. Imagine I’m listening to some music and suspend my laptop while still listening, forget about it and let somebody else use it. Then this other person (who can login) will be stuck with listening to my music without being able to listen to anything else. I believe that if you are sitting in front of computer, you deserve to have a control over the noise it makes. So one part of what is listed as being wrong I consider cool feature.

HotPlug is stated as intentionally not working. That would be nice, but I’m not using it as I don’t have any HotPlug devices. I’m not planning to buy Bluetooth headphones as BlueZ is not working anymore (well, it is supposed to be working only from GUI over D-Bus nowadays, which doesn’t work for me). Hardware switches (for headphones) still work fine without any special software. It would be little bit troublesome with USB devices, but if I wouldn’t plug them in and unplug them too often, it should be possible to work around it using udev scripts.

Now, what do I gain? Maybe situation changed in the past, but what I liked about system wide pulse audio is exactly the fact, that every user that is allowed to do so, can use soundcard at once. Like you are listening to the radio and let somebody else use your guest account to check mails, you can still hear your radio why this somebody else hears mail notification. And if he doesn’t like the radio, he can mute it. Or change the balance between volume of his applications and mine.

Other important use case is MPD. Is is a service that allows you to play your local music and control it remotely. But as it is service, it starts at the boot time and takes over sound card. So you can’t use MPD and desktop with sound effects anymore. So again, as you need two different users to share the same soundcard and both to be able to control it, you probably want system wide pulse audio.

How to get it?

Why am I writing about it now? I sent a submit request in openSUSE to get system wide mode included in distribution. It is simply just a unit file in separate package, everything else is already there and it is not meant to be installed by default, only by people who know what are they doing… If maintainers will accept it ;-) In Gentoo, there is a system-wide use flag that does similar thing for a long time.

3 comments

  1. yac says:

    “Other important use case is MPD. Is is a service that allows you to play your local music and control it remotely. But as it is service, it starts at the boot time and takes over sound card. So you can’t use MPD and desktop with sound effects anymore. ”

    So not true. Alsa’s dmix is default for a long time, so it doesn’t happen that one process just takes the sound card and nothing else can play anymore.

    1. Michal Hrušecký says:

      If you setup alsa mixer correctly… And you will not be able to modify the volume AFAIK. Or at least few years back when I started using pulse audio, it was the case.

      1. yac says:

        > not be able to modify the volume AFAIK.

        Of course you can control the volume, just not separately for each sound source.

        > If you setup alsa mixer correctly

        The mixing works out of the box very long time already. I remember when I had to set up dmix manually and that’s almost a decade ago.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>