You are not logged in.

#1 2020-05-13 02:38:39

uncanceld
Member
Registered: 2020-05-13
Posts: 9

firefox without pulseaudio

This morning I decided to get rid of pulseaudio.
Started with removing pulseaudio package. This left firefox with no sound. I didn't care much and went on to remove libpulse package except pacman wouldn't let me because firefox had a dependency on it. I tricked pacman and removed it anyway. Surprisingly firefox audio magically started working again. I guess after failing to open libpulse, firefox silently fallback to alsa and it just works.
This left me wondering why firefox has a hard dependency on libpulse in the first place. Is it possible to make it a optional dependency so that I don't have to trick pacman to remove libpulse?

Offline

#2 2020-05-13 03:49:37

Awebb
Member
Registered: 2010-05-06
Posts: 6,271

Re: firefox without pulseaudio

The solution can be found there: https://wiki.archlinux.org/index.php/Firefox

Offline

#3 2020-05-13 10:21:53

uncanceld
Member
Registered: 2020-05-13
Posts: 9

Re: firefox without pulseaudio

That link suggests using apulse for emulating pulseaudio with alsa. I don't want that. If you take the steps I described, firefox uses alsa backend with no configuration needed out of the box.
I was asking If it is possible to make this process painless by removing unnecessary libpulse dependency from firefox.

Offline

#4 2020-05-13 10:56:42

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: firefox without pulseaudio

It may be possible to compile firefox without the libpulse dependency.  Google it.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2020-05-13 10:59:28

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,409

Re: firefox without pulseaudio

Firefox should use ALSA even with libpulse installed as long as you don't have pulseaudio itself as well. What's your about:support during this situation and FWIW a

aplay -lL
pgrep pulseaudio

Last edited by V1del (2020-05-13 11:00:41)

Offline

#6 2020-05-13 12:49:34

uncanceld
Member
Registered: 2020-05-13
Posts: 9

Re: firefox without pulseaudio

I really don't want to compile firefox myself. Even though the firefox is compiled with pulseaudio, when it fails to dynamically load libpulse, falls back to alsa and works fine. So changing that dependency to a optional one makes sense to me. Also isn't it weird that a web browser has a dependency on a sound server, especially when it is not needed? What if I don't have any hardware to playback sound? It would be good to not have firefox pull in a sound server anyway.

V1del wrote:

Firefox should use ALSA even with libpulse installed as long as you don't have pulseaudio itself as well. What's your about:support during this situation and FWIW a

aplay -lL
pgrep pulseaudio

Unfortunately I didn't check about:support in that situation and doing it now would require me to reinstall libpulse. Without libpulse installed, it shows audio backend as alsa.

Offline

#7 2020-05-13 12:54:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: firefox without pulseaudio

I don't use firefox, so I can't test this myself, but it seems like a lot of responses are dancing around the question.  Why is libpulse listed as a dependency if it is not needed?

Apulse is not relevant for this as 1) apparently it's not needed either, and 2) apulse is - according to the wiki - to replace pulseaudio the optional dependency not libpulse the hard dependency.

Rebuilding firefox without the dependency seems odd ... as the current build (according to the OP) works without it.  So there is no need to recompile but just repackage without the (seemingly) incorrect dependency list.

I just installed firefox (with none of it's deps) to check: neither firefox itself nor any of the .so files in the package link to libpulse.  So there indeed seems no reason to be listed as a dependency.

Namcap also flags it as unneeded (with several others):

firefox W: Dependency included and not needed ('gtk3')
firefox W: Dependency included and not needed ('startup-notification')
firefox W: Dependency included and not needed ('dbus-glib')
firefox W: Dependency included and not needed ('ffmpeg')
firefox W: Dependency included and not needed ('libpulse')

Though some of these are required for firefox to function (I assume it uses dlopen or similar), but if it functions fine without one of those libs, they should not be required depedencies.

Last edited by Trilby (2020-05-13 13:00:58)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2020-05-13 13:06:14

uncanceld
Member
Registered: 2020-05-13
Posts: 9

Re: firefox without pulseaudio

FInally a direct answer. Thank you Trillby.
I also think firefox uses dlopen, ldd shows it linked with libdl. Using libdl is the exact reason to not have libraries as a hard dependency but opt-in. Listing libpulse as one makes no sense. I think changing it to optional dependency definitely would help.

Offline

#9 2020-05-13 13:30:50

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: firefox without pulseaudio


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#10 2020-05-13 14:06:02

uncanceld
Member
Registered: 2020-05-13
Posts: 9

Re: firefox without pulseaudio

Lone_Wolf wrote:

from link

Some packages (like sdl and openal) look for libpulse dynamically and will
still work even though the lib is missing, so they only need an optional
dependency.

It seems firefox is also one of these packages so repacking it with optional libpulse dependency should be good. There are other packages as well suffering from same problem like qemu.
libpulse is not the only one. I had the same thing happen with libcups last year but just hacked pacman, didn't open a issue. After same thing happening with libpulse, decided to open a issue.

Offline

#11 2020-05-13 14:09:08

Awebb
Member
Registered: 2010-05-06
Posts: 6,271

Re: firefox without pulseaudio

What happened to this issue?

Offline

#12 2020-05-13 14:20:06

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,409

Re: firefox without pulseaudio

Well I'd say the best way for this to get traction is to open up bug reports/feature requests for software where it's confirmed to just be an optional dependency that doesn't inherently break the application.

Offline

#13 2020-05-13 14:39:48

uncanceld
Member
Registered: 2020-05-13
Posts: 9

Re: firefox without pulseaudio

Opening bug reports for every package affected by this kinda feels inefficient. Is there anything we can do to fix this once for all? In case we find out for some package making this optional breaks the application inherently, I think it is worthwhile to open bug reports to that applications upstream as it is kinda not supposed to break when dlopen fails. Otherwise why use dlopen?

Offline

#14 2020-05-13 15:10:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: firefox without pulseaudio

uncanceld wrote:

Is there anything we can do to fix this once for all?

Other than changing distros, not likely.

Arch has, for some time and like for quite a bit more time, had the habit of building in almost all optional features to packages in the repo.  The philosophies of minimalism have never really applied to arch's packaging choice - quite the opposite.  Almost everything is --enabled in most packages.  So I doubt many package maintainers are going to be swayed by this argument.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#15 2020-05-13 15:18:25

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,409

Re: firefox without pulseaudio

It's not guaranteed that every application uses dlopen here. Some might actually fail just from trying to load the library if they are compiled with support for it. For some it might not be feasible to adjust to dlopening here. 

That's a potential far more cumbersome approach just for what amounts to personal preference in saving yourself 1.4 (336KB if we just talk the library) MB of diskspace (because again which is why I mentioned this, applications can link to libpulse and load libpulse but still fallback to ALSA if the pulse server isn't started, as does firefox on systems that aren't yours apparently).

Or if you want you can try to open a meta bug report that this situation should be reconsidered (and I mean a real bug report as in one on bugs.archlinux.org rather than here as it isn't guaranteed that the packagers see this here).

But as mentioned by trilby it's unlikely that this will gain large traction in general (I'd assume that the cases like firefox here "might" be considered  but at the end it's up to the discretion of the packagers and they are quite unlikely to effectively double the workload by providing multiple packages because a compiler flag has to differ)

Offline

#16 2020-05-13 15:27:13

uncanceld
Member
Registered: 2020-05-13
Posts: 9

Re: firefox without pulseaudio

Compiler flags aren't the issue, they can stay same. It's purely packages having these libraries as hard dependency. But I get what you are saying. It might be too much effort with little gain for packagers to consider affected packages and check if it works correctly after change. It'd be a nice change though if packages have their hard/soft dependencies sorted out correctly.
Nevertheless thanks everybody for your time.

Offline

#17 2020-05-13 15:33:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: firefox without pulseaudio

V1del wrote:

for what amounts to personal preference...

Yes, but personal preference is what drives someone to use arch in the first place instead of something like Ubuntu where many other packages are just assumed to be installed as part of a base install.  Libpulse is not part of a base arch install, just just assuming people would have it anyways is not wise.  And if we are to just assume people would have it anyways, there's no reaons for it to be listed as a dependency.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#18 2020-05-13 15:52:00

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,409

Re: firefox without pulseaudio

Well I'm not talking about assuming it as part of a base install  in general, but about projects that do.

I do agree and especially in this particular case to make it optional (iirc this is already a special case anyway, if memory serves right it was optional, ALSA got deprecated upstream, libpulse (and in fact pulseaudio) was made mandatory for a while, then we went back to providing the ALSA backend still anyway, and the move of libpulse back to opts didn't happen again) (and it's not like this is that uncommon there are quite a few packages in the repos where this is already  the case), I'm rather talking if one wanted to enforce this across every project which I find to be unfeasible.

But in the end it's up to the maintainers which is why I suggested to make a bug report/feature request/general gripe where I'd consider it a nice courtesy to at least have a verified list at hand on which packages such an "optionalization" is possible without breaking the software's assumptions.

Offline

#19 2020-05-13 16:04:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: firefox without pulseaudio

I'm not sure I follow.  You are talking about if one wanted to enforce what across every project?

Enforcing not requiring libpulse would certainly be silly not just unfeasible.  But enforcing correct listings of dependencies in packages is not only feasible, but it is the standard for packaging.  And I don't mean this to sound critical - noting a bug is not an attack on a packager - we can be as patient and understanding as one could possible be, but that doesn't mean we'd call a packaging bug anything other than what it is.

Last edited by Trilby (2020-05-13 16:05:15)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#20 2020-05-13 16:45:34

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,409

Re: firefox without pulseaudio

Well then we do see eye to eye as my comment mostly addressed my views for

uncanceled wrote:

...I think it is worthwhile to open bug reports to that applications upstream as it is kinda not supposed to break when dlopen fails. Otherwise why use dlopen?

(in fact I had - like so often - failed to hit the preview before the send button, so my reply should primarily be viewed in the context of uncanceled's post, you happened to slip in between)

I totally agree that this can be brought up on a packaging stand point for software where it is already feasible to convert to an opt depends.

Last edited by V1del (2020-05-13 16:46:24)

Offline

#21 2020-05-13 17:00:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: firefox without pulseaudio

Ah, thanks.  I missed the upstream comment.  I second that that part doesn't add up.  This has nothing to do with upstream.  The upstream code clearly does not fail when dlopen can't find libpulse.

Firefox does fail when it (presumably) uses dlopen for a gtk lib which is the result I got when I installed it.  But here it makes sense to fail, and for gtk3 to be a hard dependency.  Whether the binary is linked against gtk3 or just uses dlopen, firefox absolutely requires gtk3 in order to function (which as an OT aside is why I only installed firefox without dependencies).

Last edited by Trilby (2020-05-13 17:03:47)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#22 2020-05-13 17:07:17

uncanceld
Member
Registered: 2020-05-13
Posts: 9

Re: firefox without pulseaudio

You are taking it out of context. I was going on a tangent there. We all can agree on that packages have their hard/soft dependencies listed correctly. This is not trivial thing to achieve. In that part of my post I was thinking out loud how we can achive that.
Listing dependencies correctly is not always easy but it is important. Even the smallest inaccuracies adds up over time and start to spread over whole packaging system like wildfire as we can see in this example. If it was only firefox having buggy package it would be easy to fix but there are other buggy packages. This hurts whole package systems integrity. It makes yesterdays optional library a integral part of todays system. If this trend continues with other packages as well it will become unfixable without breaking someones system.
If we can't trust package manager to handle dependencies correctly then why we use it?

Offline

#23 2020-05-13 17:23:04

uncanceld
Member
Registered: 2020-05-13
Posts: 9

Re: firefox without pulseaudio

Upstream part was just in case application writer intended that feature to be optional but for some reason failing to open that library causes application to behave unexpectedly. It was little bit outside of our current problem. Sorry for causing misunderstanding.

Offline

#24 2020-05-14 09:30:48

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,409

Re: firefox without pulseaudio

Well again, if this is important to you and you want to actively engage the discussion with the people that actually do the packaging open a low priority/feature request/general gripe bug report  or maybe post to the arch-general mailing lists to have this reconsidered, start with firefox, maybe during the discussion this can be expanded to other packages.

If you want help finding out why having libpulse present does not lead to firefox just using ALSA instead anyway, like it should, stay here and try to work with me/us on why that's the case.

Offline

Board footer

Powered by FluxBB