Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 867277 - media-libs/libpulse-16.1 hard-depends on either PulseAudio or PipeWire sound servers (should cater to media-sound/apulse somehow)
Summary: media-libs/libpulse-16.1 hard-depends on either PulseAudio or PipeWire sound ...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Igor V. Kovalenko
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-29 06:04 UTC by Róbert Čerňanský
Modified: 2024-05-17 17:21 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Róbert Čerňanský 2022-08-29 06:04:03 UTC
Following dependency was added to media-libs/libpulse-16.1 compared to previous version 16.0:

PDEPEND="
	|| (
		media-video/pipewire[sound-server(+)]
		media-sound/pulseaudio-daemon
		media-sound/pulseaudio[daemon(+)]
	)
"

This causes to pull in either of the sound servers unconditionally.  It is however not necessary to have a sound server in setups using media-sound/apulse.

It would make sense to control the dependency with daemon and sound-server use flags which would be in line with other PulseAudio and PipeWire ebuilds.

Suggested patch:

--- libpulse-16.1.ebuild	2022-08-29 07:27:33.318867057 +0200
+++ libpulse-16.1-r1.ebuild	2022-08-29 07:35:52.827721630 +0200
@@ -24,7 +24,7 @@
 LICENSE="LGPL-2.1+"

 SLOT="0"
-IUSE="+asyncns dbus doc +glib gtk selinux systemd test valgrind X"
+IUSE="+asyncns daemon dbus doc +glib gtk selinux sound-server systemd test valgrind X"
 RESTRICT="!test? ( test )"

 # NOTE: libpcre needed in some cases, bug #472228
@@ -68,10 +68,12 @@
 	doc? ( app-doc/doxygen )
 "
 PDEPEND="
-	|| (
-	        media-video/pipewire[sound-server(+)]
-	        media-sound/pulseaudio-daemon
-	        media-sound/pulseaudio[daemon(+)]
+	sound-server? ( media-video/pipewire[sound-server(+)] )
+	daemon? (
+	        || (
+		                media-sound/pulseaudio-daemon
+		                media-sound/pulseaudio[daemon(+)]
+	        )
 	)
 "
Comment 1 Mart Raudsepp gentoo-dev 2022-08-29 06:33:06 UTC
We want to guarantee a working setup, so someone needs to do the work in apulse packaging to tie into all this, so it could be an option within the || deps or something.
Comment 2 Róbert Čerňanský 2022-08-29 08:04:42 UTC
Yes, adding apulse to the PDEPEND is also a suitable solution.  No changes to apulse packaging are necessary.

PDEPEND="
	|| (
		media-video/pipewire[sound-server(+)]
		media-sound/pulseaudio-daemon
		media-sound/pulseaudio[daemon(+)]
+		media-sound/apulse
	)
"

In general, I am not sure that in the Gentoo world, which promotes flexibility and control over the system configuration, it is wise to try to guarantee something.  These are conflicting requirements.  Instead, providing sane defaults (enable corresponding USE flags) which leads to a working setup is the right thing to do.  But if user explicitly says -sound-server and 'media-sound/pulseaudio -daemon' then such configuration should be respected if technically possible.  Perhaps give a warning at most.
Comment 3 Igor V. Kovalenko 2022-08-29 23:13:47 UTC
I believe adding this dependency might work though I never tried it myself.
On the other hand, media-sound/apulse[sdk] looks like a better alternative to media-libs/libpulse for apulse use case at higher dependency level. At least this way parts that will not work with apulse (e.g. pactl.) will not be installed too, reducing confusion a bit.
Comment 4 Nick Bowler 2023-08-30 14:04:39 UTC
Adding apulse as an alternative is not sufficient.  libpulse supports connections to pulseaudio servers running on different computers via the network.  If the local machine does not have its own audio equipment it is silly to require an unusable server package to be installed.

Putting media-sound/pulseaudio-daemon-0 in package.provided is an OK workaround, but a USE flag would be better so we don't need to lie to the package manager.
Comment 5 Igor V. Kovalenko 2023-08-30 19:06:20 UTC
(In reply to Nick Bowler from comment #4)
> Adding apulse as an alternative is not sufficient.  libpulse supports
> connections to pulseaudio servers running on different computers via the
> network.  If the local machine does not have its own audio equipment it is
> silly to require an unusable server package to be installed.

I'd say this is irrelevant, the user wanting to utilize media-sound/apulse instead of one of proper servers should be already aware of limitations.
Comment 6 Zentoo 2024-05-15 11:28:52 UTC
I hope to not be out of topic here but I wonder if apulse as a potential dependency of libpulse could permit to use firefox-bin with apulse ?

Actually www-client/firefox with USE=pulseaudio can use apulse but www-client/firefox-bin can't as respecting USE description tell explicitly:

firefox - Add sound server support via media-libs/libpulse (may be PulseAudio or Pipewire, or apulse if installed)
firefox-bin - pulseaudio : Add sound server support via media-libs/libpulse (may be PulseAudio or PipeWire)

If apulse could be a potentiel libpulse PDEPEND, is the USE FLAG sdk necessary ?
If yes, the warning is already there: 

"sdk : Install PulseAudio headers and pkg-config files. Be aware apulse is not a full PulseAudio replacement by design and some functionality may be missing."
Comment 7 Niklāvs Koļesņikovs 2024-05-17 10:38:17 UTC
Just my two cents: www-client/firefox-bin[alsa,-pulseaudio] already results in use of apulse in a rather grotesque fashion. Isn't that already what you want [a rhetorical question from a passer by]?
Comment 8 Zentoo 2024-05-17 17:21:16 UTC
(In reply to Niklāvs Koļesņikovs from comment #7)
> Just my two cents: www-client/firefox-bin[alsa,-pulseaudio] already results
> in use of apulse in a rather grotesque fashion. Isn't that already what you
> want [a rhetorical question from a passer by]?

OMG you're right and I need to RTFM USE descriptions ! :D

So to use alsa:
- www-client/firefox [-pulseaudio]
- www-client/firefox-bin [alsa -pulseaudio]

So to use apulse:
- www-client/firefox [pulseaudio]
- www-client/firefox-bin [alsa -pulseaudio]

Not really intuitive... but it is explains:

www-client/firefox
- pulseaudio: Add sound server support via media-libs/libpulse (may be PulseAudio or Pipewire, or apulse if installed)

www-client/firefox-bin
- alsa: When pulseaudio isn't set, this prefers apulse
- pulseaudio: Add sound server support via media-libs/libpulse (may be PulseAudio or PipeWire)