Skip to main content
Topic: Pipewire runit service (Read 3540 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Pipewire runit service

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

Re: Pipewire runit service

Reply #1
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
Create problems which don't have solution

Re: Pipewire runit service

Reply #2
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.

Re: Pipewire runit service

Reply #3
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

Re: Pipewire runit service

Reply #4
Can you share how you got it to work? I'm assuming you got it working some kind of alternative init system?

Re: Pipewire runit service

Reply #5
Pipewire and pulseaudio shouldn't require init services

Simply start them from autostart directory in ho.e .config autostart
Cat Herders of Linux

Re: Pipewire runit service

Reply #6
Can you share how you got it to work? I'm assuming you got it working some kind of alternative init system?
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)
Code: [Select]
/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
Code: [Select]
/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
Code: [Select]
/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.





 

Re: Pipewire runit service

Reply #7
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.  
 
Code: [Select]
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 .