
PulseAudio requirement breaks Firefox on ALSA-only systems - xook
https://bugzilla.mozilla.org/show_bug.cgi?id=1345661
======
jcranmer
Honestly, as a developer, these sorts of vitriolic comments only make me want
to fix these kinds of bugs less.

There is real cost to supporting features, and very often, the decision
basically amounts to having to choose which feature scarce resources is used
for. So you have to be prepared to defend having to divert resources for pet
features--keeping in mind that sometimes the other feature is "making sure it
builds tomorrow."

From what I can tell, the ALSA backend has been poorly maintained for some
time. When the present state of affairs is deficient, and probably retarding
code quality in other areas. If it's in a poor state for a long time, it's
hard to argue that it is necessary to maintain support--or even that
desupporting it will make a huge impact.

If you want to convince me to support something, offering help would be a
great start. It could be as little as offering to test and QA a feature, or as
much as providing an implementation patch and offering to maintain it for the
foreseeable future. Insulting my intelligence and issuing threats for
noncompliance are just going to result in me ignoring you, perhaps after
laughing at you for a bit.

And remember, if you're not familiar with the relevant code, you're not really
qualified to say how hard it is to actually do something. Code architectures
may not be implemented the way you expect them to be, so what seems like it
should be an obvious minor feature may turn out to require thousands of lines
of changes (that was exactly how my first open source contribution turned out
--what I thought should have been a five-line patch or so was really 1000 or
so lines of changes).

~~~
problems
In this case it's just behind a use flag, but regardless it seems to me like
this could be fixed with a relatively simple wrapping library.

SDL for example supports outputting to OSS, ALSA, PulseAudio, ESD and with a
patch, JACK. What you want to output to can be easily configured at runtime.
You as a developer write the least code possible and only have to do the job
once, your users get the benefit of picking any output system they please.

I believe Gstreamer offers a similar system too which Mozilla already uses for
video decoding on Linux.

Additionally the same code can be used across other platforms entirely, not
just Linux.

------
djsumdog
Firefox is cross platform. It has to support Win32/64 sound, Linux
(alsa/pulse), whatever the hell FreeBSD and MacOS use ..

Back in 2013 I had a lot of issues with Steam games not running correctly with
PulseAudio (lots of static instead of sound half the time I tried to start a
game). Sometimes doing a killall on the pulseaudio server would help,
sometimes it would not. On that machine, I added a -pulseaudio USE flag in
Gentoo and removed it entirely.

On my current machines, I do use Bluetooth audio and find PA easier to deal
with. I also no longer play games on my Linux boxes.

I'm also old enough to remember the horrors of ESound and the KDE one
(whatever it was called) and how audio would constantly be out of sync.

Pulse is a lot better and seems to do well today. Still Pulse has some huge
limitations. Run two X servers and use either consolekit or systemd? Good luck
trying to get audio to continue playing on both X servers at the same time. It
won't. Want to run MPD as a system daemon? You'll need to figure out how to
enable TCP in Pulseaudio.

I don't run SystemD, but I do run Pulseaudio. Those are my choices. Gentoo
still gives me that choice, which is why I use it as my home and work distro.
Void is another great Linux distribution that gives you such choice as well.

Like I started with, Firefox has to support a ton of audio backends for
various operating systems. We're not talking about maintaining OSS support.
Pulse still depends on ALSA in the Linux kernel for it to work, so ALSA isn't
going away any time soon. There's no reason for Firefox to need to depend on
that intermediary layer and remove direct access when that already exists.

~~~
RSZC
I do run MPD as a system daemon, can't recall having to do anything crazy with
Pulseaudio...

~~~
djsumdog
Maybe your distro has it configured by default. I had to modify config (you
can change the one in your home directory or the system on in
/etc/pulseaudio/default) to include something like

    
    
        module-native-protocol-tcp auth-ip-acl=127.0.0.1
    

You could also use auth-anonymous=1 but if you're not careful with that,
people can play stuff on your speakers. We use to mess with each other at work
doing that. :-P

------
tedmielczarek
The comments on the bug are exemplary of the kind of crap we deal with when
supporting Linux users, and really go a long way towards making people not
want to spend any time on these issues.

If you actually read the details you'd note that the code to support ALSA
wasn't _removed_ , it was simply put behind a configure option (--enable-
alsa). Most of the people complaining in the bug are running builds from a
distro that provides Firefox builds, doesn't ship PulseAudio, but _didn 't
bother building Firefox with that option_. Their distro shipped them a broken
build so of course they come to complain in Bugzilla.

------
kuschku
Well, what did anyone expect?

Mozilla has complained for quite a while that their ALSA backend hasn’t been
supported or updated in years, and they don’t have the manpower to do so.
(Especially with their marketshare falling below 8%).

So, after calls for people to support it, this is the end result.

It’d be delusional to expect them to support two audio backends, and
completely rewrite both of them for multiprocess support, when ALSA is used by
less than 1% of users (as seen by the Mozilla hardware survey results), and
the work can be used better for the other 99% of users.

~~~
Twirrim
> Mozilla has complained for quite a while that their ALSA backend hasn’t been
> supported or updated in years, and they don’t have the manpower to do so.
> (Especially with their marketshare falling below 8%).

What an utterly ridiculous argument. You're implying that everyone using
software has to keep track of every single upstream project, their mailing
lists and requests. That doesn't even remotely scale on a personal level.
There just aren't enough hours in a day to be able to read all those mailing
lists, and that's assuming every end user even remotely has the skills to
understand what is being discussed anyway.

As an argument, this makes no more sense than "Well it's an open source
project, fix it yourself".

This kind of scenario is always going to end up happening.

~~~
digi_owl
As with anything else, devs only know their own insular world of mailing lists
and bug trackers. If it is not showing up on either, it does not exist.

------
shmerl
Without going into the whole "to use or not to use PulseAudio" debate, the
problem seems to be the fact, that backend which Firefox uses for audio
doesn't have anyone who maintains pure ALSA case. So either they need drop
pure ALSA support, to find a maintainer or to change the backend. The last two
are clearly harder.

~~~
thehardsphere
Why is it hard to find a maintainer? I mean, is it just a reflection of
Firefox's declining popularity or is there some additional difficulty?

~~~
digi_owl
Welcome to the concept of CADT. Everyone is off chasing the latest shiny so
they can pad their resume (and maybe do a bit of virtue signaling on the
side). Its the same crap that has been going on in the Linux GUI world since
the formation of Gnome.

------
CaptSpify
Honestly, I get it. Alsa is not the future, unless someone steps up and
maintains it. And it looks like that's not going to happen. I firmly believe
that we should move on.

But part of moving on requires that we look at PA's problems. Everytime a PA
thread comes up, people disregard and yell at everyone who has a problem with
PA. PA has a bad reputation for a reason, and it's not just Pottering hate
(though that's likely part of it). It's that PA is _not good software_. It
needs to be fixed. And until it is, you'll have people wanting to go back to
software that "just worked".

~~~
AstralStorm
Wrong. ALSA is the main Linux audio backend. PulseAudio cannot output to sound
devices without it. (only to network)

So not supporting it is akin to not supporting audio output on Linux.

Dropping PulseAudio is fine if they want to reduce maintenance load, as it is
optional, unlike ALSA.

~~~
majewsky
Have you looked at the actual APIs? After last week's announcement, I talked
to a friend who has, and apparently the PulseAudio API is much more straight-
forward than the ALSA one. He voiced understanding for Firefox supporting
PulseAudio instead of ALSA.

EDIT: Also, arguing that Firefox needs to support ALSA instead of PulseAudio
because "PulseAudio cannot output to sound devices to ALSA" is similar to
saying Firefox should be able to issue SATA commands directly because
filesystems would not work without that.

~~~
AstralStorm
No, VFS is a valid kernel interface, as is ALSA. Your analogy is wrong and
pointless.

This is more similar to removing all support for files and requiring everyone
to install MySQL.

~~~
majewsky
My argument still stands. There is no law against using user-level interfaces
and abstractions that wrap those provided by the kernel.

------
passive
I had a brief panic at just reading ALSA. I haven't used the linux desktop in
years, but audio was always such a pain. I hope things have improved.

~~~
widdma
PulseAudio is pretty good these days and typically works out of the box for
most need. Per app volume is an amazing feature and switching sinks is a
breeze. I often play music on my stereo (mobo sound card) and game audio on
some headphones (audio over hdmi through monitor). Being able to switch them
around live is great.

However, like systemd, PulseAudio large and opinionated so it's not everyone's
cup-of-tea.

~~~
CaptSpify
> PulseAudio is pretty good these days and typically works out of the box for
> most need.

Ehh...... I'll disagree with that. I have ~50% success rate of it working on
my devices in the past 5 years.

~~~
paulfurtado
A 50% success rate is pretty bad. May I ask what distributions you're using
and which devices you've had trouble on? Are you using any special
configuration?

Most modern distros come with pulseaudio by default, which means I'd guess
that over 90% of linux users use pulseaudio successfully. I've run workshops
helping people install linux on their machines and I've never run into a
system where pulseaudio did not work that alsa did.

~~~
pdkl95
> come with pulseaudio by default

Which means they almost certainly include libasound.so, because PA still
depends on ALSA in the kernel. Even in the case of distros that only use the
ALSA emulation interface for PA, the traditional ALSA interface is still
provided. Lots of software would break without that support.

It's more accurate to say most distros support _both_ PA _and_ ALSA by
default.

> use pulseaudio successfully

Note that "successfully" doesn't imply "enjoyably" or "preferentially". I
still hear complaints regularly from people that _hate_ newer (PA-focused)
distros that introduced a lot of latency problems. Movie audio sync became
inconsistent (hundreds of ms latency, very high variability), and UI audio
cues playing up to 3s (3000ms) after the visual changes.

------
journey2
On top of the ideological issues I see with things like PulseAudio, it has
always given me headaches in practice. I've never had issues with ALSA, but
now I need to install an audio server so it can talk to ALSA? These are
strange, unfortunate times. I feel linux will eventually succeed at becoming
Windows and it makes me sad.

~~~
rexicus
> I've never had issues with ALSA

You haven't been acquainted with asoundrc/dmix/alsamixer. ALSA is to Pulse as
XFree86 is to Xorg, I feel no nostalgia for it at all.

~~~
kasabali
> ALSA is to Pulse as XFree86 is to Xorg, I feel no nostalgia for it at all.

No it is not. X.org is a fork of XFree86. Pulseaudio is a sound daemon built
_on top of_ ALSA.

~~~
digi_owl
And there are times i wish i could roll back the clock to the XFree86 days. At
least then you didn't need to herd a stampede of sub-projects to get a working
X11 compiled.

------
dkbrk
My system had been ALSA-only for many years, until this change forced me to
install PulseAudio. About once a week the audio starts crackling and hissing,
and I have to restart the Pulse server. Regardless of how old and unmaintained
the ALSA backend was in firefox, it worked, and worked well; I never had a
single problem with it.

~~~
Laforet
One major factor is security, everything that isn't being actively maintained
is passively accumulating exploits.

For example, debian switched from ffmpeg to libav and eventually back to
ffmpeg again because the libav maintainers have consistently slow to act on
bugs and security holes whereas ffmpeg was anything but despite having a much
smaller team looking after it. Debian's own security team called the switch
because it is not worth the manpower to maintain both codecs.

~~~
AstralStorm
ALSA itself is better maintained than PulseAudio actually.

If they cannot find a developer to maintain ALSA backend, they must really be
out of money and skill. Yes, pure ALSA is harder, but not that much harder.

~~~
kuschku
> they must really be out of money and skill

A browser dropping below 8% (except for Germany, which is the only country
where Firefox is still leading at 43%) surely has different problems than
catering to the 1% pure ALSA users of their Linux users, when the Linux users
are already 1% of their overall user share.

Especially when funding is dependent on market share...

------
thehardsphere
Question for people who are successfully avoiding having to use PulseAudio: is
there any particular distro that you are using that you trust not to go down
this road?

I haven't used Linux as my daily driver for years but I've been looking at
switching back recently. It seems a lot harder to avoid PA than it used to be.

~~~
badsock
It's not for everyone, but try a BSD. When PulseAudio first started showing up
everywhere, I thought it was an anomaly, but it was really a harbinger. Since
then Linux has been getting more like Windows every year (unpredictable
behaviour, resource-hungry, lots of churn, tons of complexity for little
benefit). The FreeBSD audio driver is in the kernel, it's tiny, and I never
think about because it's never once caused me problems (and I'm quick to
notice latency, etc. issues).

As someone mentioned elsewhere in the thread, by being an ALSA user you're
already in a tiny minority of the Linux world. You might as well be using an
OS where your values in are the majority - it's nice to not have to fight
against the defaults.

~~~
thehardsphere
I've been thinking about BSDs. I used to run a FreeBSD server a long time ago
and I tend to like copies of the ports system that I've used on other OSes.

How hard is it to upgrade major versions? I seem to remember that this was a
pain at some point, but this was so long ago that my memory is fuzzy.

Also, have you had any problems with hardware support? The machine I'm
thinking of putting this on doesn't exist yet, so if there is a way I can
avoid stupid hardware problems up front it would be useful to know about.

~~~
pppp
It's gotten much easier to both upgrade and to install software. Example:

To apply security patches:

    
    
      freebsd-update fetch  
    
      freebsd-update install
    

To upgrade to a new version of the operating system:

    
    
      freebsd-update -r 11.0-RELEASE upgrade
    

To install software:

    
    
      pkg install chromium
    

You can still use the ports system if you want to, but pkg is so much easier.

~~~
pppp
FYI, we're a long time Linux shop (mostly Ubuntu server) and are slowing
moving away from it because I don't like the direction it is going (systemd,
etc). I've got more than half of our systems on FreeBSD/OpenBSD now.

------
imode
on arch here. haven't seen the problem yet, and I'm on 52.0. why am I not
affected? I don't have pulseaudio installed (only some client libraries.
lib32-libpulse, to be precise).

this doesn't look good. thanks for the post.

~~~
steanne
arch is compiling it with alsa support, but only for a couple more versions.

[https://bugs.archlinux.org/task/53195](https://bugs.archlinux.org/task/53195)

~~~
imode
thanks. this is pretty scary.

guess I'll be using Chromium when that day comes, as I'd rather not run
PulseAudio.

~~~
kuschku
You could volunteer to rewrite Firefox’s entire ALSA backend to add
multiprocess support.

That’s what caused this, because Mozilla doesn’t have the manpower to rewrite
two backends, and so had to choose one (with the pulse backend being
preferred, as the pulse maintainers help mozilla and fix bugs on their side,
while mozilla reports getting no assistance or anything from the ALSA
maintainers).

~~~
AstralStorm
I would but they'd have to hire me full time. (Yes, I'd be happy to work on
other parts of the browser as well.)

Sad reality is that they are trying to not hire competent people while having
features implemented well. Mozilla is vastly understaffed for the magnitude of
the project.

~~~
tedmielczarek
While I would agree that we are vastly understaffed, we just don't have the
resources to pay people to fix everything. We hire lots of extremely talented
developers, but like all software projects everything is a tradeoff. We could
pay someone to maintain ALSA support, but that would mean other things would
not get fixed. Linux users are already a small fraction of the Firefox
userbase (despite most Firefox developers using Linux as their main
development environment), so how do we justify spending the resources to
maintain an alternate audio backend that's only used by a small fraction of
our Linux users? It's not very compelling.

~~~
AstralStorm
If it is such a problem, why not hide the backend behind a nice library
instead of a sound server? Say, off the top of my head, libao (after getting
Xiph to fix the license), PortAudio, libsoundio, OpenAL and OpenSL come to
mind. There are probably more.

------
digi_owl
So the guy that has been in office barely 3 years throws his arms up and goes
for the latest shiny. More and more i see where JWZ is coming from, though i
can't say i share his fondness for Apple products.

------
ars
I'm in the same boat, Firefox 52 broke ALSA, and Plugins.

I need both. So I'm permanently on 51.

Mozilla: You are making a mistake, revert both of these decisions!

For example see:
[http://www.kongregate.com/forums/1-kongregate/topics/716510-...](http://www.kongregate.com/forums/1-kongregate/topics/716510-announcement-
official-npapi-unity-java-support-ending-in-firefox-on-march-7-2017)

~~~
dublinben
If you refuse to update, you should at least be on their ESR branch, which is
45. Don't run an insecure, out of date version just because of a single
feature.

------
beedogs
I gave up on Firefox at the end of last year, and I don't miss it at all. If I
hadn't already done it, though, this would've sent me over the edge. (I do not
and will never run Pulse on any of my systems.) Currently using a stripped-
down version of Chrome, and web browsing has never been better.

Edit: the downvoting on this site is goddamned baffling sometimes. What about
my comment has you guys offended today?

~~~
chao-
What is the stripped-down version of Chrome you use?

Is it something prepackaged or something you've crafted by stripping yourself?

~~~
adamnemecek
Maybe Chromium? [https://www.chromium.org/Home](https://www.chromium.org/Home)

It's prepackaged but I kind of lost track how it's different. It used to be
that it didn't support flash but that might have changed.

~~~
lallysingh
It doesn't have some plugins or Google login (for bookmark/history sync).

~~~
j_koreth
It has Google sync the different is mostly in branding and in some codec
support

