Hello fellow Artix users. My current pipewire setup uses wireplumber (not relevant I think but I figured to mention it) among other things. Nothing too fancy that I am aware of, just noise suppression. I am inexperienced with bash scripts and have tried seeking out a solution for a pipewire runit service through Github, Reddit, this forum, etc. None have successfully shut down and turned back on pipewire. Is there a way to do this via runit as a service? My thanks.
Note: this is the best I could find online, and it doesn't work: https://github.com/madand/runit-services
one way is that you install pipewire-media-session.
other way is that replace occurrence of pipewire-media-mession with wireplumer, that may or may not work
Can you explain how I can create a working pipewire runit service with this? I already have wireplumber installed.
you need to have the service running as your normal user (e.g. not as root e.g. a "user service")
i know that because i tried doing one with OpenRC, pipewire starts but it seems to depend on the dbus socket file, which i had been unable to find reliably without ugly hacks.
i will find a solution at least for some inits
LE: well actually hold that thought i might've got it to work
Can you share how you got it to work? I'm assuming you got it working some kind of alternative init system?
Pipewire and pulseaudio shouldn't require init services
Simply start them from autostart directory in ho.e .config autostart
Have you read this https://wiki.artixlinux.org/Site/PipewireInsteadPulseaudio ?
That explains that how you start pipewire is dependent on how you start X (or Wayland) not your init system.
I use startx not a display manager like sddm so I have a ~/.xinitrc containing (amongst other things personal to me)
/usr/bin/pipewire &
/usr/bin/pipewire-pulse &
/usr/bin/pipewire-media-session &
#/usr/bin/wireplumber &
exec dbus-launch --exit-with-session startplasma-x11
Which starts pipewire, pipewire-pulse & pipewire-media-session then KDE / Plasma
With sddm you'd want to put this into ~/.xprofile instead
/usr/bin/pipewire &
/usr/bin/pipewire-pulse &
/usr/bin/pipewire-media-session &
#/usr/bin/wireplumber &
https://wiki.archlinux.org/title/xprofile
You'll notice I have wireplumber commented out and I'm using pipewire-media-session instead. (So adjust according to which you use.)
<rant>Well I keep trying wireplumber again, and each time it's more broken than the last time. Last attempt with wireplumber a couple off days ago was abandoned as every time I started X kmix reverted to using my GPU's HDMI audio as the master channel instead of the sound card. And 'playback streams' would show current audio streams but the sliders had no effect.
So back to pipewire-media-session again which works better but is not stable. I frequently have audio disappear on me and have to run
/usr/bin/pipewire-media-session &
again. But sometimes that doesn't work (all the pipewire processes show as 'zombies) and I have to run all three commands again. But sometimes that doesn't work and I have to remove the sound kernel module, delete a lock file and a socket file, reinsert the kernel module and run the three pipewire commands again!
And it's no more stable using wireplumber. It just add more bugs to the lack of stability.
Very tempted to just go back to alsa only sound
</rant>TLDR
Start pipewire with ~/.xintrc , ~/.xprofile or a script in ~/.config/autostart . Whichever is suitable. You don't need a service.
When I first intsalled Artix (openrc), I started pipewire as per the Artix Wiki, but every now and then one of the pipewire executables would crash and I would loose audio.
One way I have found that
always works is to start wireplumber and pipewire-pulse in the pipewire config. Start them in the
"context.exec" block
Then run just the pipewire executable by whatever method you choose.
context.exec = [
{ path = "/usr/bin/wireplumber" args = "" }
{ path = "/usr/bin/pipewire-pulse" args = "" }
]
I currently use
dinit and run them seperatly as user services, but I found the above method to always work .