pipewire doesn't install openrc script unlike pulseaudio for system-wide mode
Nor does it install XDG autostart. Something like: cat pipewire.desktop [Desktop Entry] Version=1.0 Name=Pipewire Adudio System Comment=Start the Pipewire Sound System Exec=pipewire Terminal=false Type=Application X-GNOME-Autostart-Phase=Initialization X-KDE-autostart-phase=1
Renaming to a more generic $summary as an init script does not seem to be the way to go.
I'm using script for testing: ( sleep 5; chmod 777 /run/pulse/pulse/native ) & nice -n-10 sudo -u pulse screen -d -m /usr/bin/pipewire with /etc/pulse/client.conf default-server = unix:/run/pulse/pulse/native
complete script: ( sleep 5; chmod 755 /run/pulse/pulse;chmod 777 /run/pulse/pulse/native ) & nice -n-10 sudo -u pulse screen -d -m /usr/bin/pipewire
Niklāvs, do you know the status of this bug?
The statement that system-wide script is not included for OpenRC is technically correct but more importantly we do not provide such a script for systemd either, because: 1) upstream disables installing it by default, only installing the user units 2) there is no documentation on how or why this would be used 3) even with media-sound/pulseaudio the ebuild is very explicit that system-wide is only supported by PulseAudio upstream and [in my understanding] by Gentoo, too, only when running on embedded platforms (and even there, I think, many were running pulseaudio as regular non-system user rather than system-wide under the "pulse" system account). So the real question is first and foremost - do we even support running PipeWire system-wide? If not this bug can be closed as INVALID or similar. ;)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f788f389419678d2f2399eeb65fd2eedd7956196 commit f788f389419678d2f2399eeb65fd2eedd7956196 Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2021-04-24 21:13:26 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2021-04-24 21:15:54 +0000 media-video/pipewire: bump to v0.3.26 Closes: https://bugs.gentoo.org/775386 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> media-video/pipewire/Manifest | 1 + media-video/pipewire/files/pipewire-launcher.sh | 6 + media-video/pipewire/files/pipewire.desktop | 12 ++ media-video/pipewire/pipewire-0.3.26.ebuild | 243 ++++++++++++++++++++++++ 4 files changed, 262 insertions(+)
Because it's a user daemon, an OpenRC service like we had for pulseaudio is impossible. With commit f788f389419678d2f2399eeb65fd2eedd7956196 we added pipewire to /etc/xdg/autostart which should trigger pipewire launch for any DE respecting XDG defaults via wrapper script. Wrapper script is necessary because pipewire daemon will not exit on logout but cannot be re-used on login. Let's see how this will work. Feedback appreciated.
(In reply to Thomas Deutschmann from comment #8) > Let's see how this will work. Feedback appreciated. I have to log out of plasma, restart /etc/init.d/display-manager (SDDM) and re-login into plasma several times after a reboot of my laptop, before pipewire is active. $ ps xfa | grep wire shows nothing at all. When it works (1 out of 4 logins, ps then shows wireplumber and pipewire) everything is solid and works perfectly. But the relogins are quite nasty.
(In reply to Sven Eden from comment #9) > (In reply to Thomas Deutschmann from comment #8) > > Let's see how this will work. Feedback appreciated. > > I have to log out of plasma, restart /etc/init.d/display-manager (SDDM) and > re-login into plasma several times after a reboot of my laptop, before > pipewire is active. > > $ ps xfa | grep wire > shows nothing at all. > > When it works (1 out of 4 logins, ps then shows wireplumber and pipewire) > everything is solid and works perfectly. But the relogins are quite nasty. Please file a new bug given that we've changed approaches somewhat since. This sounds kind of odd given it should be started via the XDG mechanism within Plasma now...
In the new bug please also include output of `ps aux | grep pulse` (especially when it's not working).
it seems system wide daemon mode works with systemd https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1610
It is not a Gentoo supported configuration (and we do not enable installing the system units for that reason). Someone could force their way via a custom ebuild or by simply specifying the right flag via MYMESONARGS but they are doing that on their own. And similarly OpenRC users can write their own init.d scripts that let them run PipeWire system wide but that does not mean that it's an officially supported or recommended way to run things. And for that matter it was never really supported on PulseAudio either (unless it's an embedded use case but I doubt many Gentoo deployments would in good faith qualify for the PulseAudio's embedded exemption).
I'm still not convinced at this point that we actually need this. The XDG solution already covers OpenRC (and works well here). Funnily enough, it's actually smoother than on systemd right now, as it works without having to enable any services manually.
app started as other user with: sudo -i -u other can't probably connect
In case previous statements have not been clear enough, running PipeWire as anything but the current non-root user is not a [currently] supported Gentoo setup/deployment. If (if!) upstream makes it possible to daisy-chain PipeWire daemons without risks associated with sharing memory across users, perhaps it will be worth revisiting this topic. But as things stand this is not supported on Gentoo. You can try running PW system-wide or via sudo as another user yourself but please stop asking for official support for this, because right now apart from "technically" possible it's not a reasonable or a good way to do things. And, no, there is no ongoing work to support daisy-chaining PipeWire daemons right now, that I'm aware of. It's just something that may or may not happen sometime in unknown future.