After upgrading no more audio in firefox

I did pkg upgrade and now I have no audio in firefox.

I do have it with chrome, the problem seems to be firefox.

Any hint?

Thanks
 
Do you use a soundserver like sndiod or pulseaudio ?
Verify media.cubeb.backend setting.
When you start firefox from the commandline do you see errors.
 
Is "media.cubeb.backend = oss" set in firefox?

I suspect something pulled in pulseaudio as a dependency, which causes nothing but trouble...
 
IIRC you have to create it the way Alain De Vos already explained.

To prevent pulseaudio from actually being started if something (unnecessarily) pulls it as a dependency, I usually just (re)move the binary from /usr/local/bin and 'ln -s /bin/true /usr/local/bin/pulseaudio'.
 
You type media.cubeb.backend in the url and press + button and string and set it the value to the soundserver you use.
Thanks. I still do not understand.

I put "media.cubeb.backend+" in the URL bar, and then? What do you mean with "string"?
 
I put "media.cubeb.backend+" in the URL bar, and then? What do you mean with "string"?
you don't put that in the address bar - you should add it to the configuration firefox hides under "about:config".
- open "about:config" (via the url bar)
- in the appearing search bar enter "media.cubeb.backend"
- choose 'string' from the menu that appears under the searchbar and klick the "+ (add)" on the right side
- set the value to "oss"
 
This worked. But how should one come to a solution (without asking here)?

And I have no idea what is pulseaudio and what pooled it in as dependency.
 
Nag the Firefox devs - those backend options once were directly accessible via the preferences menu (before it was crippled into a "special tab"), but since a few years they remove more and more options and usability from the whole UI...
 
And I have no idea what is pulseaudio and what pooled it in as dependency.
PulseAudio is a sound server, basically an optional intermediate layer between the OSS sound system (or ALSA on Linux) and applications. It was primarily designed to work around the limitations of ALSA, and is not very useful on FreeBSD because OSS is more powerful than ALSA and has most of the features PulseAudio offers built in. In some cases you have to run it because it's the only audio backend supported by a few programs, but otherwise it's a wise idea not to add useless complexity and therefore to avoid running PulseAudio when it's not necessary.

It was recently added as a dependency of audio/alsa-plugins in its default build configuration, this is probably what made it appear on your system. I had this with the recent quarterly upgrade.

It is typically automatically started by desktop environments if it's installed, but you can easily disable it in the autostart or session settings.

Unless media.cubeb.backend is manually set, Firefox will automatically choose the backend it considers the most relevant. Besides OSS, ALSA and PulseAudio, it can also output sound to JACK and sndio. If PulseAudio is running, it will use it as a primary choice over OSS, therefore if PA's output is muted, or is set to a wrong channel/device, you'll get no sound although another program using OSS directly will play fine. You solved it by telling Firefox to use OSS although PA is running, but stopping PA or setting it up properly would have worked the same way, so black magic in about:config is not an absolute must in this context (but a good idea anyway) :)

I'm regularly annoyed by ports which pull PulseAudio as a runtime dependency for no reason (a program featuring PulseAudio support doesn't mean it requires it to work fine). I think it's time for me to have a look at their makefiles and submit patches when possible.
 
If PulseAudio is running, it will use it as a primary choice over OSS,
Code:
ps ax | grep pulse
942  -  S     0:14.08 /usr/local/bin/pulseaudio --start --log-target=syslog
1132  1  S+    0:00.00 grep pulse

Indeed it is running. Why?! Only because some program I do not run downloaded it as dependence?

I have no "desktop", I am running twm.

UPDATE: the answer to above question seems to be yes.
This hateful behaviour is typical from debian/ubuntu (you
install, it runs without configuration and without asking).

Code:
% pkg info -rx pulseaudio
pulseaudio-14.2:
        speech-dispatcher-0.10.2
% pkg info -rx speech-disp
speech-dispatcher-0.10.2:
        chromium-91.0.4472.114_1

pulseaudio is running, although I did not start chromium after booting,
only firefox.
 
IIRC you have to create it the way Alain De Vos already explained.

To prevent pulseaudio from actually being started if something (unnecessarily) pulls it as a dependency, I usually just (re)move the binary from /usr/local/bin and 'ln -s /bin/true /usr/local/bin/pulseaudio'.

Hello, the best way to disable pulseaudio do it is through the offered settings.

Always work with the system and not against.

Open /usr/local/etc/pulse/client.conf and uncomment the line with
Code:
autospawn=yes
and set it to no.

Then relog or restart and pulseaudio should now no longer appear.
 
sadly this still won't stop some programs from starting the pulseaudio-daemon. This messed up my sound setup several times, especially the ability to easily switch between default sound devices, so I reverted to just 'kill it with fire' - i.e. renaming or removing the /usr/local/bin/pulseaudio binary.
 
This does not anwser my above question: why the hell it is being started?

Case 1: You have a desktop environment that starts pulseaudio automatically and can possibly be turned off as well like for this mate desktop
example.
1626163293978.png


Case 2: One of your programs that you use, is compiled with pulseaudio support and starts pulseaudio automatically too.
 
Case 2: One of your programs that you use, is compiled with pulseaudio support and starts pulseaudio automatically too.
Probably firefox is doing it, although it is configured as recommended above for not using it.
It does it probably just because it was compiled with pulseaudio support.
 
sko said:
i.e. renaming or removing the /usr/local/bin/pulseaudio binary.

If you do that, you might as well remove it completely with pkg delete -f pulseaudio. After that, look for applications that do not work correctly or seem to hang sometimes. These likely were the applications that started it. If you install using packages, try to solve it with the app's config file. If that won't work you might consider a reinstall from ports where you disabled pulseaudio with make config.
 
pkg info -r pulseaudio should show the packages on your system which require pulseaudio.
Just see, what I wrote above:

(1) I did pkg info -r, pulseaudio is demanded by speech-dispatcher-0.10.2 and chromium-91.0.4472.114_1
(2) I did not start chromium, also not speech-dispatcher (not even know what that is).

Hence, something else, just because it was compiled with pulseaudio, just because pulseaudio was
downloaded, is starting pulseaudio. Logic?

I find this behaviour awful.

Next boot I will do "ps -ax" immediately before and immediately after starting firefox.
 
Just see, what I wrote above:

(1) I did pkg info -r, pulseaudio is demanded by speech-dispatcher-0.10.2 and chromium-91.0.4472.114_1
(2) I did not start chromium, also not speech-dispatcher (not even know what that is).

Hence, something else, just because it was compiled with pulseaudio, just because pulseaudio was
downloaded, is starting pulseaudio. Logic?

I find this behaviour awful.

Next boot I will do "ps -ax" immediately before and immediately after starting firefox.
It won't matter whether or not you start chromium -- pulseaudio was installed as a software dependency, just because chromium was installed. pkg info -r can also be used to find the requirements of chromium and speech-dispatcher, and so on, all the way up the software dependency chain.

I don't like pulseaudio either, but don't know what to do about it, other than try to uninstall it. If I uninstall it, I only want to do so if I can do it without breaking any dependency chains. Once installed, pulseaudio is going to start itself automatically, and respawn itself. Maybe some of the other measures mentioned above will help, I don't know. Recently I installed the latest quarterly version of plasma5 desktop, and it also requires pulseaudio. I don't want it, and the previous quarterly version of plasma5 desktop didn't require it. So it looks like I'll be using the Mate desktop instead for awhile. That's my workaround.

I don't think you'll find Firefox in the dependency chain for pulseaudio, because I have Firefox on my Mate desktop, and it didn't pull in pulseaudio.
 
It won't matter whether or not you start chromium -- pulseaudio was installed as a software dependency, just because chromium was installed. pkg info -r can also be used to find the requirements of chromium and speech-dispatcher, and so on, all the way up the software dependency chain.

You must not forget that speecher dispatcher brings pulseaudio and not chromium. Chromium does not have pulseaudio enabled by default and dont start it automatically.

1626171220156.png
 
Back
Top