4

Recently, I have been experiencing some audio problems with the pulseaudio server that seem very difficult to resolve, for example see this question. I am increasingly disliking the way it is designed, particularly the way that it relies on 'per-user' instances of the pulseaudio daemon and the root user seems to be heavily restricted from starting/accessing a server, which is affecting my ability to access audio with sandboxed applications (to me, that goes against the unix ethos - the root user should have access to everything, no exceptions).

So, I have decided I want to purge pulse from my Linux environment and just use ALSA directly. I am wondering how inconvenient/debilitating that will be? Pulseaudio seems to have become something of a de-facto standard for Linux audio, and I have the impression that quite a few applications assume it is going to be there.

So, if I ditch Pulseaudio, how much 'breakage' is that going to cause? Are there any widely-used applications that I won't be able to use without it? Audio applications that I most frequently use are: Rhythmbox, Steam, Skype, Firefox.

I use Parabola (libre distro based on Arch) with LXDE/Mate on x86.

Time4Tea
  • 2,366

2 Answers2

2

I gave it a try yesterday and uninstalled pulseaudio, pulseaudio-alsa and pavucontrol. As far as I can tell, the audio seems to work absolutely fine with every application I have tried (i.e. the ones I mentioned in my question), with no further tweaking or setup required . I am not missing pulseaudio at all and quite happy that I removed it. I have to say, based on my experience so far, it seems to be rather unnecessary (at least, for what I need).

Update: user Uncle Billy suggested in their answer that audio in firefox wouldn't work correctly without pulseaudio. However, I have tried various sites in icecat (security-focused derivative of firefox) and I am not experiencing any problems with audio.

It is also worth noting that an apulse program also exists, which allows applications that require pulseaudio to use ALSA directly.

Time4Tea
  • 2,366
  • Most applications are able to use ALSA, and are actually using Pulseaudio via an ALSA plugin. That's the reason why it works. Pulseaudio used not to work on my previous machine, so I did the same thing you did and didn't miss it, but it works fine on my current machine, and there are some situations where it's nice to have (if you have multiple speakers, multiple mics, and also want to deal with sound on remote computers around the house, for example). So I'd replace "superflous" with "not necessary". – dirkt Mar 25 '20 at 12:12
  • @dirkt ok, I will re-phrase, as you suggest. However, if you have a more complex situation, transferring sound between different machines and multiple mics, wouldn't JACK be a higher-quality alternative to pulseaudio? – Time4Tea Mar 26 '20 at 12:04
  • Jack excels at realtime audo with short latency, and uses a single audiocard as timebase. So that's the use case for it (sound recording and editing). Pulseaudio helps when you've lots of sound cards (including remote ones), lots of applications, and have to juggle their behaviour. – dirkt Mar 26 '20 at 19:33
  • @dirkt I haven't used JACK extensively; however, I get the impression a bit part of its design focus is in redirecting audio streams between different devices (which is often required in profesional audio situations). – Time4Tea May 08 '20 at 12:10
  • Jack can redirect audio streams between different (virtual) "devices", but it is designed to use a single soundcard as master clock. Pulseaudio resamples (Jack doesn't), so if you want to redirect audio streams between different devices, and you don't care about latency, Pulseaudio is the better choice. Yes, Jack is aimed at professional audio situations (where you have one big "soundcard" with many channels as your main device). – dirkt May 09 '20 at 04:31
1

Not very viable, unfortunately.

firefox has removed support for alsa, and while Debian still seems to compile its in-distro firefox with alsa support, it's quite broken: often, the sound stops working in firefox, and will not come back until the tab processes are killed or firefox is restarted. I haven't debugged that yet, but it seems to happen on sites which will stop a <video> element when it's scrolled out of view.

I have also tried a config where pulseaudio is only started on demand, and while it works fine for testing, it isn't working reliably with firefox either.

Of course, many other libraries/applications (SDL, qemu, mplayer, ffmpeg, etc) don't need and never needed pulseaudio, and will work fine with alsa.

  • I haven't had any problems with using Firefox with ALSA on either of my machines (x86 desktop and armv7 laptop). – Time4Tea May 08 '20 at 01:28
  • I'm very happy to hear that. Seriously, it happens with a lot of sites, including dailymail.co.uk or 9gag.com. I had a lot of people complaining about it. But fixing firefox isn't my job, and I wasn't very eager to untangle the mix of webworkers, websockets and tracking widgets which lead to that. Just trying to reproduce it with a simple <video> element doesn't work. (IMHO) The accepted answer is not doing the people a service by pretending that everything's OK. –  May 08 '20 at 06:23
  • I just tried both of those sites and the audio in the videos seems to work fine to me. This is in icecat, which is a security-focused derivative of firefox. – Time4Tea May 08 '20 at 11:54
  • Also sound card management without pulse is a real pain. Examples include: Waking up from stand-by (pulseaudio remembers volume settings, with alsa it depends on the hardware or driver). Switching from mainboard-sound to headset to bluetooth speaker on the fly (cumbersome without pulse). – Hermann May 08 '20 at 12:19
  • Mozilla doesn't ship the alsa backend by default but it's still in the codebase; I compiled FF 84 with --enable-alsa --disable-pulseaudio and have working sound. Also, apulse is a thing. – Wyatt Ward Jan 20 '21 at 21:05