Skip to main content
Topic: Missing Service in Runit (Read 403 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

Missing Service in Runit

Hi,

Since (just like wayland replaced X11) pipewire replaced pulseaudio. More and more things require it by default and those various workarounds are accumulating very quickly (...). Here MPV defaults now to pipewre. If someone installs it then they will have silence on Artix and they will wander why you broke it. MPV and libmpv are also backends for many GTK and Qt players. It would be nice to have a service pipewire-runit available in the repository (run/finish/check) with all the necessary hooks you know of. As far as my knowledge goes the void pipewire-media-session has been deprecated and wireplumber should be used. So I assume we have:

a) run + finish + check (runit)
b) pipewire
c) wireplumber
d) pipewire-pulseaudio
e) pipewire-jack

Will you write the service?

I also wander how it will behave on KDE (volume control, startup of the system/login) and SDDM (it has play/pause of media while locked).

Thanks.

Re: Missing Service in Runit

Reply #1
pipewire has to be run as the local user. There's no real way to provide this in the repo. You just have to set it up yourself.

Re: Missing Service in Runit

Reply #2
Quote
Will you write the service?

User-facing nonroot services have been discussed before, they are being prepared for every init apart from OpenRC (so far) but right now it's recommended to just start pipewire simply, it works perfectly fine (and in regards to jack you don't need to start anything for it to work, pw-jack prefix is for some legacy programs). https://forum.artixlinux.org/index.php/topic,4984.0.html. Search the forum for more.

Quote
I also wander how it will behave on KDE (volume control, startup of the system/login) and SDDM (it has play/pause of media while locked).
KDE still only has pulse volume control, pipewire support for that wasn't rushed since it works in pipewire-pulse, but they already began making a library called kpipewire so it should come soon.
AFAIK it is planned for Plasma 6 release this autumn.

Re: Missing Service in Runit

Reply #3
I use the below script to start pipewire/wireplumber when I log in, feel free to adapt as needed (I host the script with my dotfiles which are licensed MIT No Attribution)

Code: [Select]
#!/bin/bash

# Kill any running pipewire processes
killall -q wireplumber & killall -q pipewire-pulse & killall -q pipewire

# Wait for processes to stop
while pgrep -u $UID -x wireplumber >/dev/null; do sleep 1; done
while pgrep -u $UID -x pipewire >/dev/null; do sleep 1; done
while pgrep -u $UID -x pipewire-pulse >/dev/null; do sleep 1; done

# Wait for xdg-desktop-portal to start
until pgrep -u $UID -f /usr/lib/xdg-desktop-portal >/dev/null; do sleep 1; done

# Launch pipewire
echo "---" | tee -a /tmp/{wireplumber.log,pipewire.log,pipewire-pulse.log}
/usr/bin/wireplumber 2>&1 | tee -a /tmp/wireplumber.log & disown
/usr/bin/pipewire 2>&1 | tee -a /tmp/pipewire.log & disown
/usr/bin/pipewire-pulse 2>&1 | tee -a /tmp/pipewire-pulse.log & disown

"killall" isn't exactly the POSIX way of cleaning up processes, but it works just fine. Edit: some programs do still expect pulseaudio to be on PATH, in this event I just symlink /usr/bin/true to /somewhere/on/path/pulseaudio, i.e., "ln -s /bin/true /usr/local/bin/pulseaudio"