Skip to main content
Topic: PipeWire & co services (Read 947 times) previous topic - next topic
0 Members and 5 Guests are viewing this topic.

PipeWire & co services

[This was copied over from the mailing list, it looks like my formatting was messed up there for some reason]

Recently, I switched to PipeWire and Wayland. In that process, I noticed that PulseAudio, PipeWire, Wire Plumber, all have not a single service package for init systems. While I can see the argument being that "You don't need one,", I personally think that having one would greatly improve QoL. I generally really dislike having to manually launch commands I want to be launched in every compositor I use, and PulseAudio as well as PipeWire and co usually crash a lot in my experience, and getting them safely up and running again would be made easier if they were put into a service. I'd really like if this was supported.

Re: PipeWire & co services

Reply #1
You can write service files for them if you want, it's not that hard, just look at examples and write one yourself.

>I generally really dislike having to manually launch commands I want to be launched in every compositor I use

Doesn't your login manager, desktop environment or hell even your .xinitrc launch it automatically?

>PulseAudio as well as PipeWire and co usually crash a lot in my experience

Can you tell us more about theses crashes? I have never actually experienced one with pulseaudio

Re: PipeWire & co services

Reply #2
You can write service files for them if you want, it's not that hard, just look at examples and write one yourself.

>I generally really dislike having to manually launch commands I want to be launched in every compositor I use

Doesn't your login manager, desktop environment or hell even your .xinitrc launch it automatically?

>PulseAudio as well as PipeWire and co usually crash a lot in my experience

Can you tell us more about theses crashes? I have never actually experienced one with pulseaudio

I do put pipewire in my RC files to launch it automatically, but as I said, I dislike having it on every compositor/Window Manager I want to use. I personally use wayland though, not Xorg, so there isn't a xinitrc or any centralized way to launch it automatically for every compositor, so I might need to put it in my zshrc.... but the thing is, that just STINKS of manual service management. It sucks, I already have an init system, but I can't use it to launch a service like every other one? And I agree, I can make my own, but my proposition is that it should be included by default into the package repos. `pipewire-s6, pipewire-runit, pipewire-openrc`, and the same for every other audio server. Just because it's easy or because it's manageable manually doesn't mean including a service wouldn't make it easier.

And about the crashes, pipewire for me usually crashes when I connect my bluetooth headphones. And then a lot of the time I forget that it could happen, then get busy trying to debug why my headphones don't work. If there was a service, it would be able to re-launch the service if it ever crashes, and I could use it to query the status of the pipewire service as well as pipewire-pulse and wireplumber.

If you don't want to create the server and add it to the repos, would at least a PR to add it in be accepted?


Re: PipeWire & co services

Reply #4
Thank you so very much! ❤️

Re: PipeWire & co services

Reply #5
A maybe "better" or more "standard" approach, wich is universal to most DE's would maybe to use /etc/xdg/autostart

In there i created a sound.config:

Code: [Select]
[Desktop Entry]
Name=Sound
Icon=
Exec=/usr/bin/pipewire & /usr/bin/pipewire-pulse & /usr/bin/wireplumber
Terminal=false
Type=Application

In the end, there are many ways to rome :-)

Re: PipeWire & co services

Reply #6
A maybe "better" or more "standard" approach, wich is universal to most DE's would maybe to use /etc/xdg/autostart

In there i created a sound.config:

Code: [Select]
[Desktop Entry]
Name=Sound
Icon=
Exec=/usr/bin/pipewire & /usr/bin/pipewire-pulse & /usr/bin/wireplumber
Terminal=false
Type=Application

In the end, there are many ways to rome :-)

Sorry, but I disagree. That isn't any better than just launching those in your .bashrc :)

Creating services for init systems gives a lot of flexibility and power when working the daemons. As I said, allowing restarting the service if it unexpectedly crashes, and also checking the status of the service. This is especially useful if you use pipewire, because you'd need about 3 or more services to worry about, which are easier to manage with init systems.

Re: PipeWire & co services

Reply #7
Well someone has to write those service files, and I might be able to help with pulseaudio, but I have never used pipewire.

Re: PipeWire & co services

Reply #8
I can very much help with pipewire, pipewire-pulse, pipewire-jack, and wireplumber; which I believe are all of the rest, but I'm not sure. They're surely the ones I use currently.
Though, I use s6-rc, but I'm sure implementing them for openrc/dinit/runit would be easy.

Re: PipeWire & co services

Reply #9
Quote
Sorry, but I disagree. That isn't any better than just launching those in your .bashrc :)

Thats why i said "better"  ;)

The Way using /etc/xdg/autostart, is the Way intended to use. Sure anybody can do what they want. I said only how its delivered on the most Distros.

Quote
Creating services for init systems gives a lot of flexibility and power when working the daemons. As I said, allowing restarting the service if it unexpectedly crashes, and also checking the status of the service. This is especially useful if you use pipewire, because you'd need about 3 or more services to worry about, which are easier to manage with init systems.

First, the best way to fix this, is having pipewire/pulseaudio not crashing. If one "service" isnt running, and a application ask to use Audio, the DE should(!) start the needed service for this application him self (dbus etc). Other Problem using daemon for that, that you need to "fix"/edit that daemons correct, because pipewire and co shouldnt run under root user.

Re: PipeWire & co services

Reply #10
> because pipewire and co shouldnt run under root user.

Pulseaudio will drop privileges when run as root, don't think pipewire has the same ability but the solution is to run it as 'nobody'