Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 775386 - media-video/pipewire-0.3.22: no openrc script
Summary: media-video/pipewire-0.3.22: no openrc script
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 744622
  Show dependency tree
 
Reported: 2021-03-11 07:49 UTC by wbrana
Modified: 2021-12-22 20:06 UTC (History)
9 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 wbrana 2021-03-11 07:49:39 UTC
pipewire doesn't install openrc script unlike pulseaudio for system-wide mode
Comment 1 Joakim Tjernlund 2021-03-11 11:46:39 UTC
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
Comment 2 Andreas Sturmlechner gentoo-dev 2021-03-25 19:36:47 UTC
Renaming to a more generic $summary as an init script does not seem to be the way to go.
Comment 3 wbrana 2021-03-25 19:52:22 UTC
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
Comment 4 wbrana 2021-03-25 19:59:15 UTC
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
Comment 5 Matt Turner gentoo-dev 2021-04-18 12:18:58 UTC
Niklāvs, do you know the status of this bug?
Comment 6 Niklāvs Koļesņikovs 2021-04-18 13:42:39 UTC
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. ;)
Comment 7 Larry the Git Cow gentoo-dev 2021-04-24 21:15:58 UTC
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(+)
Comment 8 Thomas Deutschmann (RETIRED) gentoo-dev 2021-04-24 21:18:15 UTC
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.
Comment 9 Sven Eden 2021-11-18 06:10:42 UTC
(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.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-18 06:13:17 UTC
(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...
Comment 11 Niklāvs Koļesņikovs 2021-11-18 06:16:04 UTC
In the new bug please also include output of `ps aux | grep pulse` (especially when it's not working).
Comment 12 wbrana 2021-12-01 20:01:29 UTC
it seems system wide daemon mode works with systemd
https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1610
Comment 13 Niklāvs Koļesņikovs 2021-12-01 20:16:45 UTC
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).
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-22 05:46:12 UTC
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.
Comment 15 wbrana 2021-12-22 05:51:47 UTC
app started as other user with: sudo -i -u other
can't probably connect
Comment 16 Niklāvs Koļesņikovs 2021-12-22 17:15:48 UTC
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.