[WIP] pkgs: pulseaudio -> pressureaudio; nixos: override when running a daemon#35374
[WIP] pkgs: pulseaudio -> pressureaudio; nixos: override when running a daemon#35374oxij wants to merge 26 commits intoNixOS:masterfrom
Conversation
|
@GrahamcOfBorg Hooray! I wonder what gets rebuilt on darwin. Is pulseaudio even supposed to work on darwin? |
|
Ah. It's all those packages that do `config.pulseaudio or true` instead of `config.pulseaudio or stdenv.isLinux`.
|
50d255f to
f4c0a02
Compare
f4c0a02 to
698b9ce
Compare
This satisfies both people that want to purge every single bit of PulseAudio from their systems for ethical, religious, and/or security reasons and those who want to run the daemon for convenience reasons. This also significantly reduces closure size when not running PulseAudio daemon since `pressureaudio` (`apulse`) is tiny in comparison to `pulseaudioLib` and requires only `alsaLib` and `glib`.
44d2d67 to
fe9eb72
Compare
|
I've set |
|
System-wide |
|
System-wide `LD_LIBRARY_PATH` turned out to be a fragile approach, IMHO, and we'd like to get rid of it for OpenGL.
And replace it with what? Whatever you replace it with, this can use the same mechanism.
I think most of `config.pulseaudio` patches from this branch should be squashed and merged into master with some cleanups (will do later).
As to the general idea, it works well, but the whole thing together doesn't work as well as I want because many apps start using `apulse` instead of pure ALSA, which is tolerable, but is not what I want. I'm working on a better thing ATM.
|
|
Probably replace it with glvnd, as that provides indirection to load the right libGL anyway. (We may still need some custom hacks, e.g. to find libGL on non-nixos, etc.) |
|
I can see the reasoning behind glvnd - you can have multiple screens and LD_LIBRARY_PATH is not per-screen.
Note, however, that we will still need an out-of-band way to provide vendor libGLs to glvnd (or else setting it up will cause only-for-your-system mass-rebuild, so no determinism added here) and it will still do the same thing internally (I mean, all it does is just dynamically links those functions).
What is the reasoning behind your argument against this? You can't run two PulseAudio daemons at the same time.
Also not that GL and this PR are not the two users of the mechanism. "sane" module in NixOS does this for the same reason.
|
|
I think the problem with |
|
That was discussed at length in #31263. I'm not aware of any counterarguments to my arguments there.
In short: most things have to be fixed anyway. Things that can't be fixed can be hacked around with simple ld hacks like always appending some static paths to the end of LD_LIBRARY_PATH in ld itself or adding them to /etc/ld-nix.so.cache.
|
|
I think Steam alone disproves the numerical bound you give. I mean, if no one would want to either write or use garbage software, we wouldn't have the current discussion. Also. there are setuid applications. |
|
Well, okay, point taken.
However, in any case, that discussion is orthogonal to this discussion. Any solution applicable there can be transferred here.
As long as there's no solution there I would prefer to solve problems one at a time.
|
|
Status report. As I said in #35292 (comment)
I switched this to On v4 even official freedesktop PA tools gracefully fail as they should, so it's time to get excited. Will publish after I confirm Xfce and KDE work. |
|
Status: Done. See #36881 for the version with |
|
Can this be closed in favor of #36881? |
|
I think most changes here are useful irrespective of #36881, but I'm a bit burned out on the issue to rebase them ATM.
|
|
Closing, due to the same reasons as expressed in #36881 (comment). This is a controversial change, and needs to go through an RFC. Keeping this PR open doesn't really help, it has bitrotten and doesn't apply cleanly anyhow. |
Motivation for this change
An idea that struck me when writing #35292 (comment) (see #35355 (comment) for in-depth explanation of the motivation behind every part of that comment).
With this we link against pressureaudio by default to provide
libpulseAPI over pure ALSA to apps that refuse to properly work over ALSA themselves (e.g. Firefox).NixOS then overrides this with
pulseaudioLibviaLD_LIBRARY_PATHwhen user enables the daemon service (pressureaudioandpulseaudioLibare link-time-compatible).This way users that don't run PulseAudio daemon and don't want to link against
pulseaudioLibfor religious and/or security reasons don't need to make any overrides, while PulseAudio daemon users stay happy.This also significantly reduces closure size when not running PulseAudio daemon since
pressureaudio(apulse) is tiny in comparison topulseaudioLiband requires onlyalsaLibandglib.It is a mass rebuild, but none of my PRs to
staginggot merged this month, so.Things not done
hardware.pulseaudio.enableset. I refuse to set it for ethical reasons. But the change seems trivial enough that it should work.Things done
build-use-sandboxinnix.confon non-NixOS)nix-shell -p nox --run "nox-review wip"Seems to work.