Closed Bug 1489870 Opened 6 years ago Closed 6 years ago

No sound on Debian stable (ALSA vs PulseAudio packaging)

Categories

(Core :: Audio/Video: Playback, defect, P5)

60 Branch
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: vesely, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Build ID: 20180907092132

Steps to reproduce:

https://www.youtube.com/watch?v=cj_kwmBpFaA


Actual results:

mute


Expected results:

music!


This is possibly a duplicate of bug #1345661.  That bag is too old.  I smashed onto the bug today, with stock Debian updates.  Too bad wontfix.  As a workaroud, I'm gonna play that with chromium.
Another workaround is to install apulse:
https://forums.linuxmint.com/viewtopic.php?t=257818
https://github.com/i-rinat/apulse
https://www.youtube.com/watch?v=cj_kwmBpFaA

it works nicely, and the tune is good!

Please consider suggesting or adopting apulse

Best
A
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
One problem is that apulse is in unstable/testing only, while Firefox got changed in stable from working-sound 52 to no-sound 60.  Needs at the very least a backport.
Does the Debian stable desktop not carry Pulseaudio by default?

If they won't backport apulse they should consider making it a dependency.
>Does the Debian stable desktop not carry PulseAudio by default?

https://wiki.debian.org/PulseAudio

This claims PulseAudio is shipped by default in all Debian stable desktops except LXDE and XFCE and can be installed in LXDE and XFCE as well.

I'm not sure ALSA support is actually broken. I mean, we don't support it, but this being an open source browser, some patches did make it in to keep it working. 

Firefox builds to support ALSA potentially need to disable audio remoting for multiprocess (as I'm not sure that has an ALSA backend?), and compile with ALSA flags enabled so the appropriately huge holes get poked in the sandbox for it. 

But the default Debian build of Firefox is meant for PulseAudio, so for that apulse is probably the easiest solution. Aside from installing PulseAudio, obviously ¯\_(ツ)_/¯
glandium, should the Debian package ssuggest or require pulseaudio | apulse or something?

It looks right now that you could use XFCE and LXDE and not have any sound in Firefox without it being obvious why.
Flags: needinfo?(mh+mozilla)
My understanding of bug 1345661 is that it was about turning off ALSA by default and reducing its maintenance status to something like a Tier-3 platform (see also: https://developer.mozilla.org/en-US/docs/Mozilla/Supported_build_configurations ).

If ALSA support is broken when built with --enable-alsa, that is a bug.  Right now we have a report that it's broken, but not enough information to triage it to either sandboxing or media.  Also, I don't know if anyone has volunteered to be the ALSA maintainer (cf. the maintainers for the Tier-3 OSes).

The simplest test for whether it's sandboxing is to temporarily turn sandboxing off: set security.sandbox.content.level to 0 in about:config and restart, or set MOZ_DISABLE_CONTENT_SANDBOX=1 in the environment, and try again.  (Finding the lowest level where it's broken can be informative.  Also, some operations rejected by sandboxing are reported in about:support in the sandboxing section.)
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: DUPLICATE → ---
(In reply to Gian-Carlo Pascutto [:gcp] from comment #6)
> glandium, should the Debian package ssuggest or require pulseaudio | apulse
> or something?

Probably.

> It looks right now that you could use XFCE and LXDE and not have any sound
> in Firefox without it being obvious why.

This would also be a problem for Firefox builds downloaded from mozilla.org, and Firefox should display something on its own when it's trying to output sound but can't.
Flags: needinfo?(mh+mozilla)
Debian's package of ESR60 doesn't seem to be built with --enable-alsa, according to about:buildconfig.  (Also, no --enable-alsa in debian/browser/mozconfig.in, like there is in the ESR52 branch of the Debian repo.)  I just assumed that it would be, given the package's dependencies.  If it's neither doing --enable-alsa nor depending on PulseAudio then there seems to be a bug in the Debian packaging, and (hopefully?) no bug in Firefox itself.

(And if it really is built with --enable-alsa, then there's a bug in about:buildconfig.)

(In reply to Mike Hommey [:glandium] from comment #8)
> This would also be a problem for Firefox builds downloaded from mozilla.org,
> and Firefox should display something on its own when it's trying to output
> sound but can't.

In theory, there's UI for this: https://searchfox.org/mozilla-central/rev/9e7995b3c384945740985107a4de601b27904718/browser/locales/en-US/chrome/browser/browser.properties#920

In practice, I downloaded the official 62 build to a Debian 8 VM without pulseaudio and it doesn't show an error to the user (but does return an error to content).  So that looks like a bug.
Seems like a bug in Debian packaging. This should be opened on the Debian BTS and not here!
(In reply to Jed Davis [:jld] (⏰UTC-6) from comment #9)
> 
> In practice, I downloaded the official 62 build to a Debian 8 VM without
> pulseaudio and it doesn't show an error to the user

It said the following on the terminal it started from:

Child 7341, MediaPlayback #2] WARNING:
7f969c4ea1c0 OpenCubeb() failed to init cubeb:
file /build/firefox-esr-QYWh35/firefox-esr-60.2.0esr/dom/media/AudioStream.cpp, line 388

[Child 7341, MediaPlayback #1] WARNING:
Decoder=7f968b3d8c00 [OnMediaSinkAudioError]:
file /build/firefox-esr-QYWh35/firefox-esr-60.2.0esr/dom/media/MediaDecoderStateMachine.cpp, line 3750

[Child 7341, MediaPlayback #1] WARNING:
Decoder=7f968b3d8c00 Decode error: NS_ERROR_DOM_MEDIA_MEDIASINK_ERR (0x806e000b) - OnMediaSinkAudioError:
file /build/firefox-esr-QYWh35/firefox-esr-60.2.0esr/dom/media/MediaDecoderStateMachine.cpp, line 3445


Yeah, I should have reported this as a Debian bug, but Google brought me to  bug #1345661...
Summary: PulseAudio requirement breaks Firefox on ALSA-only systems → No sound on Debian stable (ALSA vs PulseAudio packaging)
Let's morph the description so people can find this one and we can keep an eye on it.
Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
Marking P5 as we'd accept patches for alsa support. Apart from that I don't see much reason to keep this open. Feel free to adjust if I missed something.
Priority: -- → P5
This is a bug in Debian's packaging; the package should either build with --enable-alsa or add a dependency (at least Recommends) on PulseAudio.  (If --enable-alsa is broken, please file a bug.)  There are already some downstream bug reports about this:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853987
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=827059
Status: REOPENED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → INVALID
The core problem comes from Firefox insisting on PulseAudio.  If you want it so much, it needs to be selected at _runtime_ rather than compile time.  We can't really have multiple Firefox packages differing only by this detail.

Standardizing on PulseAudio would be reasonable only if PA worked everywhere.  As it fails to work entirely, or works unacceptably (example: https://angband.pl/misc/clem/) on a non-negligible part of machines, there must be a way to get sound without PulseAudio.

PA emulation (such as apulse) might be a way but the only current implementation is not really fit for this task: requires complex steps for the user, conflicts with sandboxing, has been reported to produce pops and other artifacts, etc.
(In reply to Adam Borowski from comment #15)
> it needs to be selected at _runtime_ rather than compile time.

It *is* selected at runtime, which is why Firefox still works if you don't have it. You just end up without sound.
(In reply to Adam Borowski from comment #15)
> it needs to be selected at _runtime_ rather than compile time.

It's selected at runtime[1][2], but the set of available backends is fixed at compile time[3].  See also bug 837564.  (I don't work on media, so I can't comment on what might be required in the way of fixes/maintenance to re-enable ALSA in Mozilla's builds.)

Also, for what it's worth, apulse shouldn't conflict with sandboxing anymore as of bug 1434156, which is in release 60.


[1] https://searchfox.org/mozilla-central/rev/dd965445ec47fbf3cee566eff93b301666bda0e1/media/libcubeb/src/cubeb.c#169-185
[2] https://searchfox.org/mozilla-central/rev/dd965445ec47fbf3cee566eff93b301666bda0e1/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_funcs.rs#184
[3] https://searchfox.org/mozilla-central/rev/dd965445ec47fbf3cee566eff93b301666bda0e1/toolkit/moz.configure#58-76
FWIW, Ubuntu doesn't build with --enable-alsa either, and doesn't have a recommends/suggests on libpulse/pulseaudio. It also looks Fedora is in the same situation.
It looks like the Debian bug has been filed as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853987.
You need to log in before you can comment on or make changes to this bug.