Discussion:
Firefox doesn't want to see Pulseaudio
(too old to reply)
Stefan Monnier
2024-08-14 19:40:01 UTC
Permalink
I have a machine here running a freshly updated and rebooted Debian
testing where I can't get Firefox (more specifically `firefox-esr`) to
use audio. E.g. I go to

https://tekeye.uk/html/html5-video-test-page

and none of the videos give me any audio output.

I'm using pipewire and it generally works fine with other applications.
E.g. `paplay` successfully plays my music files, and `chromium` on the
same web page gives me audio output just fine.

When I have `pavucontrol` open, I can "see" that Firefox does not appear
in the "Playback" tab, contrary to `paplay` and `chromium`.

When I try `firefox -P` and use a fresh new profile, the same
problem occurs. Also I can see errors in the output such as:

[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe182f6a100 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe182875800 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797300 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797300 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for video/avc: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797c00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181796a00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797c00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for video/avc: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181796a00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for video/avc: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797f00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797f00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for video/avc: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, BackgroundThreadPool #1] WARNING: 7fe1838484c0 OpenCubeb() failed to init cubeb: file ./dom/media/AudioStream.cpp:281
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe17c60cd00 [OnMediaSinkAudioError]: file ./dom/media/MediaDecoderStateMachine.cpp:4604

The last two lines occur when I click on the "unmute" button in the
video (on the above web page) which is muted by default.

Any idea what might be going on and/or how to track it down further?


Stefan
Felix Miata
2024-08-14 19:50:01 UTC
Permalink
Post by Stefan Monnier
I have a machine here running a freshly updated and rebooted Debian
testing where I can't get Firefox (more specifically `firefox-esr`) to
use audio.
Check if installing apulse helps. It's supposed to make obstinate apps like
Firefox act as though pulseaudio is installed, dead technology, which is not
needed when pipewire and wireplumber are working.
--
Evolution as taught in public schools is, like religion,
based on faith, not based on science.

Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata
Stefan Monnier
2024-08-14 20:50:02 UTC
Permalink
Post by Felix Miata
Post by Stefan Monnier
I have a machine here running a freshly updated and rebooted Debian
testing where I can't get Firefox (more specifically `firefox-esr`) to
use audio.
Check if installing apulse helps. It's supposed to make obstinate apps like
Firefox act as though pulseaudio is installed, dead technology, which is not
needed when pipewire and wireplumber are working.
Hmm... let's see.
Hmm... no, didn't make a difference: after installing `apulse` the same
`firefox -P` still behaves identically (with the same error messages),
and so does `apulse firefox -P`.


Stefan
songbird
2024-08-14 22:40:01 UTC
Permalink
Post by Stefan Monnier
Post by Felix Miata
Post by Stefan Monnier
I have a machine here running a freshly updated and rebooted Debian
testing where I can't get Firefox (more specifically `firefox-esr`) to
use audio.
i'm running the unstable firefox (otherwise the rest is
testing) with no issues that i've noticed so far on audio.

i do have pulseaudio installed along with pipewire-pulse.
Post by Stefan Monnier
Post by Felix Miata
Check if installing apulse helps. It's supposed to make obstinate apps like
Firefox act as though pulseaudio is installed, dead technology, which is not
needed when pipewire and wireplumber are working.
Hmm... let's see.
Hmm... no, didn't make a difference: after installing `apulse` the same
`firefox -P` still behaves identically (with the same error messages),
and so does `apulse firefox -P`.
hmmm...


songbird
t***@tuxteam.de
2024-08-15 04:40:01 UTC
Permalink
Post by Felix Miata
Post by Stefan Monnier
I have a machine here running a freshly updated and rebooted Debian
testing where I can't get Firefox (more specifically `firefox-esr`) to
use audio.
Check if installing apulse helps. It's supposed to make obstinate apps like
Firefox act as though pulseaudio is installed, dead technology, which is not
needed when pipewire and wireplumber are working.
Apulse won't reconcile Firefox with pulseaudio, it just does a LD_PRELOAD trick
to convince Firefox it's talking to pulseaudio while it is actually talking
(through a shim) to ALSA.

I've been using it successfully with oldstable. With stable and Firefox ESR
(115.12.0esr-1~deb12u1) I haven't succeeded, alas.

So I doubt it'll work with apulse if it refuses to work with pulseaudio.

And -- don't forget: you have to call the browser "through" apulse, i.e.
"apulse firefox <params>" to let apulse do its LD_PRELOAD trick.

Cheers
--
t
Max Nikulin
2024-08-15 02:20:01 UTC
Permalink
Post by Stefan Monnier
Error no decoder found for audio/mp4a-latm
It relies on non-free AAC codec that you likely do not have installed.
Perhaps chromium has a built-in implementation.
t***@tuxteam.de
2024-08-15 05:00:01 UTC
Permalink
Post by Max Nikulin
Post by Stefan Monnier
Error no decoder found for audio/mp4a-latm
It relies on non-free AAC codec that you likely do not have installed.
Perhaps chromium has a built-in implementation.
Max, you rock.

Cheers
--
t
Stefan Monnier
2024-08-15 12:00:01 UTC
Permalink
Post by Max Nikulin
Post by Stefan Monnier
Error no decoder found for audio/mp4a-latm
It relies on non-free AAC codec that you likely do not have installed.
That's a side-issue: the web page I pointed to has various videos in
various formats and none of them work (hence the error messages
mentioning other "decoder not found" mime types).


Stefan
t***@tuxteam.de
2024-08-15 12:00:01 UTC
Permalink
Post by Stefan Monnier
Post by Max Nikulin
Post by Stefan Monnier
Error no decoder found for audio/mp4a-latm
It relies on non-free AAC codec that you likely do not have installed.
That's a side-issue: the web page I pointed to has various videos in
various formats and none of them work (hence the error messages
mentioning other "decoder not found" mime types).
Darn.

Cheers
--
t
Max Nikulin
2024-08-15 12:10:01 UTC
Permalink
Post by Stefan Monnier
Post by Max Nikulin
Post by Stefan Monnier
Error no decoder found for audio/mp4a-latm
It relies on non-free AAC codec that you likely do not have installed.
That's a side-issue: the web page I pointed to has various videos in
various formats and none of them work (hence the error messages
mentioning other "decoder not found" mime types).
If you have libavcodec installed (from "Recommends") then it might be
some testing issue. There is no problem in bookworm. Firefox exposes
some codec info in about:support#media
Stefan Monnier
2024-08-15 14:00:02 UTC
Permalink
If you have libavcodec installed (from "Recommends") then it might be some
testing issue. There is no problem in bookworm.
I do have it installed. I also tried to install `libavcodec-extra` at
some point (when I saw that `mp4a-latm` 🙂), but it made no difference
of course.
Firefox exposes some codec info in about:support#media
Thanks. When I "disable sandboxing" (by setting the three vars
I mentioned in my answer to Tomas) it says:

Audio Backend: alsa
Max Channels: 0
Preferred Sample Rate: 44100
Roundtrip latency (standard deviation): ...
Codec Support Information:
VP8 SW
VP9 SW
AV1 SW
Theora SW
FLAC SW
MP3 SW
Opus SW
Vorbis SW
Wave SW

with no input nor output devices.

So it looks like the codecs are found in that case, but the audio
backend is wrong (it should be Pulse, AFAIK) and the max channels shows
that there's really no output.

If I leave the sandboxing options at their default setting, then I get
a similar result except that the list of codecs is empty.


Stefan
Max Nikulin
2024-08-16 02:40:01 UTC
Permalink
Post by Stefan Monnier
I do have it installed. I also tried to install `libavcodec-extra` at
some point (when I saw that `mp4a-latm` 🙂), but it made no difference
of course.
You do not have AAC in the list of supported codecs and I am unsure if
it is due to alsa backend or due to a missed package (libfdk-aac2,
gstreamer1.0-fdkaac?).
Post by Stefan Monnier
Firefox exposes some codec info in about:support#media
Thanks. When I "disable sandboxing" (by setting the three vars
I would revert these settings to defaults unless you have confirmed that
they are really necessary.
Post by Stefan Monnier
Audio Backend: alsa
I have pulse-rust here. If you still have motivation to debug i386 vs.
amd64 issue, have you tried to start firefox with a clean profile
(--profile /some/dir)? Firefox may save at least some parameters related
to video hardware (prefs.js, about:config). I have no idea if
pipewire/pulse works reliably in mixed amd64/i386 environment.
Post by Stefan Monnier
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797300 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for video/avc: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
I would check if there are earlier messages related to audio backend,
maybe during firefox startup. Perhaps verbosity of some component should
be increased

https://firefox-source-docs.mozilla.org/xpcom/logging.html
Stefan Monnier
2024-08-16 13:30:01 UTC
Permalink
Post by Stefan Monnier
I do have it installed. I also tried to install `libavcodec-extra` at
some point (when I saw that `mp4a-latm` 🙂), but it made no difference
of course.
You do not have AAC in the list of supported codecs and I am unsure if it is
due to alsa backend or due to a missed package (libfdk-aac2,
gstreamer1.0-fdkaac?).
I'm not too worried about that for now. The lack of audio device was the
more pressing concern 🙂
Post by Stefan Monnier
Firefox exposes some codec info in about:support#media
Thanks. When I "disable sandboxing" (by setting the three vars
I would revert these settings to defaults unless you have confirmed that
they are really necessary.
Of course.
Post by Stefan Monnier
Audio Backend: alsa
I have pulse-rust here.
Same for me when things work 🙂
If you still have motivation to debug i386 vs. amd64 issue, have you
tried to start firefox with a clean profile (--profile /some/dir)?
Yup, no difference.
I would check if there are earlier messages related to audio backend, maybe
during firefox startup. Perhaps verbosity of some component should be
increased
https://firefox-source-docs.mozilla.org/xpcom/logging.html
Thanks for the pointer!


Stefan

t***@tuxteam.de
2024-08-15 04:50:01 UTC
Permalink
Post by Stefan Monnier
I have a machine here running a freshly updated and rebooted Debian
testing where I can't get Firefox (more specifically `firefox-esr`) to
use audio. E.g. I go to
https://tekeye.uk/html/html5-video-test-page
and none of the videos give me any audio output.
I'm using pipewire and it generally works fine with other applications.
E.g. `paplay` successfully plays my music files, and `chromium` on the
same web page gives me audio output just fine.
Aha -- so you are using pipewire's pulseaudio emulation?

Search engineering (hah) turns up some noises like this [1] which at
least suggest to tinker with sandbox settings. They might have painted
themselves again into a corner by not allowing some processes to see
some paths in the file system. Granted, this is just a thin thing to
go by, sorry.

I hate browsers. Both of them. Bah.

Cheers

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1839852
--
t
Stefan Monnier
2024-08-15 11:50:01 UTC
Permalink
Post by t***@tuxteam.de
Aha -- so you are using pipewire's pulseaudio emulation?
Yes.
Post by t***@tuxteam.de
Search engineering (hah) turns up some noises like this [1] which at
least suggest to tinker with sandbox settings. They might have painted
themselves again into a corner by not allowing some processes to see
some paths in the file system. Granted, this is just a thin thing to
go by, sorry.
I have no idea what sandbox settings you're referring to.
How/where can I find those to "tinker" with?


Stefan
t***@tuxteam.de
2024-08-15 12:00:01 UTC
Permalink
Post by Stefan Monnier
Post by t***@tuxteam.de
Aha -- so you are using pipewire's pulseaudio emulation?
Yes.
Post by t***@tuxteam.de
Search engineering (hah) turns up some noises like this [1] which at
least suggest to tinker with sandbox settings. They might have painted
themselves again into a corner by not allowing some processes to see
some paths in the file system. Granted, this is just a thin thing to
go by, sorry.
I have no idea what sandbox settings you're referring to.
How/where can I find those to "tinker" with?
Mozilla sandboxes [1] its subprocesses in very baroque and fanciful ways (not
saying it shouldn't -- rather musing we shouldn't be here at all).

The sandbox keeps subprocesses from "seeing" things in the file system [2],
thus also unable to load shared objects. But ISTR that audio subprocesses
are allowed more as of late (i only half-know those things from banging my
head against apulse: take with two grains of salt).

That said, I thin Max's observation elsewhere in this thread is far more
relevant than mine. Some (perhaps non-free) codec might be missing.

Cheers

[1] https://wiki.mozilla.org/Security/Sandbox
[1a] also: about:config -> security.sandbox.*
[2] and system calls and things
--
t
Stefan Monnier
2024-08-15 13:50:01 UTC
Permalink
Post by t***@tuxteam.de
Post by Stefan Monnier
I have no idea what sandbox settings you're referring to.
How/where can I find those to "tinker" with?
[1a] also: about:config -> security.sandbox.*
Hmm... I set both `security.sandbox.socket.process.level` and
`security.sandbox.content.level` to 0 as well as `media.cubeb.sandbox`
to false (and restarted Firefox) but it didn't help.

My current test is to open

firefox file:///my/music/storage/

and click on an Ogg file.

[Child 17314, MediaDecoderStateMachine #1] WARNING: 7f92bdd47ee0 OpenCubeb() failed to init cubeb: file ./dom/media/AudioStream.cpp:281
[Child 17314, MediaDecoderStateMachine #1] WARNING: Decoder=7f92beb9cf00 [OnMediaSinkAudioError]: file ./dom/media/MediaDecoderStateMachine.cpp:4604
[Child 17314, MediaDecoderStateMachine #1] WARNING: Decoder=7f92beb9cf00 Decode error: NS_ERROR_DOM_MEDIA_MEDIASINK_ERR (0x806e000b) - OnMediaSinkAudioError: file ./dom/media/MediaDecoderStateMachineBase.cpp:164


- Stefan
Stefan Monnier
2024-08-15 14:30:01 UTC
Permalink
I have not found the real source of the problem, but I have found out
why it worked on other machines and not on this one: some months
(years?) ago I made this i386 machine use `firefox-esr:amd64` because
Firefox tabs kept crashing (even for fairly simple pages).

[ I've been using the i386 version of `firefox-esr` without problem on
other machines, so I don't know why it crashed on this one, but
switching to the amd64 version did "solve" the problem back then.
My crystal ball told me that it was probably due to the relatively
large about of RAM (24G) available in this machine confusing Firefox
into the illusion that it can allocate a lot more memory than the i386
architecture really allows, and thus getting memory allocation
failure. ]

I had completely forgotten about this detail.

I have now switched back to `firefox-esr:i386` and the audio works again
(and it looks like the old problem I had with it has disappeared in the
mean time). I guess it's time I switch this machine to an amd64-only install.

Thank you all for your help.


Stefan
Post by Stefan Monnier
I have a machine here running a freshly updated and rebooted Debian
testing where I can't get Firefox (more specifically `firefox-esr`) to
use audio. E.g. I go to
https://tekeye.uk/html/html5-video-test-page
and none of the videos give me any audio output.
I'm using pipewire and it generally works fine with other applications.
E.g. `paplay` successfully plays my music files, and `chromium` on the
same web page gives me audio output just fine.
When I have `pavucontrol` open, I can "see" that Firefox does not appear
in the "Playback" tab, contrary to `paplay` and `chromium`.
When I try `firefox -P` and use a fresh new profile, the same
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe182f6a100 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe182875800 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797300 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797300 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for video/avc: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797c00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181796a00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797c00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for video/avc: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181796a00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for video/avc: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797f00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe181797f00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for video/avc: file ./dom/media/MediaDecoderStateMachineBase.cpp:164
[Child 13905, BackgroundThreadPool #1] WARNING: 7fe1838484c0 OpenCubeb() failed to init cubeb: file ./dom/media/AudioStream.cpp:281
[Child 13905, MediaDecoderStateMachine #1] WARNING: Decoder=7fe17c60cd00 [OnMediaSinkAudioError]: file ./dom/media/MediaDecoderStateMachine.cpp:4604
The last two lines occur when I click on the "unmute" button in the
video (on the above web page) which is muted by default.
Any idea what might be going on and/or how to track it down further?
Stefan
t***@tuxteam.de
2024-08-15 14:40:02 UTC
Permalink
Post by Stefan Monnier
I have not found the real source of the problem,
It's a browser, after all ;-D
\o/
Post by Stefan Monnier
some months
(years?) ago I made this i386 machine use `firefox-esr:amd64` because
Firefox tabs kept crashing (even for fairly simple pages).
[ I've been using the i386 version of `firefox-esr` without problem on
other machines, so I don't know why it crashed on this one, but
switching to the amd64 version did "solve" the problem back then.
My crystal ball told me that it was probably due to the relatively
large about of RAM (24G) available in this machine confusing Firefox
into the illusion that it can allocate a lot more memory than the i386
architecture really allows, and thus getting memory allocation
failure. ]
Congrats :-)

Cheers
--
t
Loading...