You are not logged in.
Basically I copied the pipewire-pulse.conf file:
# cp /usr/share/pipewire/pipewire-pulse.conf /etc/pipewire/pipewire-pulse.conf.d/pipewire-pulse.conf
and tried restarting the pipewire-pulse.service, as it failed I tried running the /usr/bin/pipewire-pulse manually to get more details:
[W][03291.344377] mod.rt | [ module-rt.c: 278 pw_rtkit_check_xdg_portal()] Can't find xdg-portal: (null)
[W][03291.344406] mod.rt | [ module-rt.c: 991 pipewire__module_init()] found session bus but no portal
[W][03291.344767] mod.rt | [ module-rt.c: 297 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
[W][03291.344794] mod.rt | [ module-rt.c: 622 set_nice()] could not set nice-level to -11: No such file or directory
[W][03291.344922] mod.rt | [ module-rt.c: 297 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
[W][03291.346005] mod.rt | [ module-rt.c: 278 pw_rtkit_check_xdg_portal()] Can't find xdg-portal: (null)
[W][03291.346026] mod.rt | [ module-rt.c: 991 pipewire__module_init()] found session bus but no portal
[W][03291.346364] mod.rt | [ module-rt.c: 297 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
[W][03291.346373] mod.rt | [ module-rt.c: 622 set_nice()] could not set nice-level to -11: No such file or directory
[W][03291.346454] mod.rt | [ module-rt.c: 297 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
[W][03291.346471] pw.context | [ context.c: 1360 pw_context_register_export_type()] context 0x557a6b8701f0: duplicate export type PipeWire:Interface:Node
[E][03291.346478] pw.conf | [ conf.c: 594 load_module()] 0x557a6b8701f0: could not load mandatory module "libpipewire-module-client-node": File exists
[E][03291.346655] default | [ pipewire.c: 125 main()] failed to create context: File exists
If I comment the libpipewire-module-client-node, libpipewire-module-metadata and libpipewire-module-protocol-pulse (the latter is because the address is already in use, I think I have to kill something, but I tried killing everything pipewire related and still couldn't start) then I can start pipewire-pulse.service, but I don't know why pavucontrol keeps "establishing connection to pulseaudio" forever and other users doesn't have audio, only the user that started pipewire.
I don't know if these modules are a "must load".
what I'm trying to achieve
Having multi user as the pulseaudio wiki says Allowing multiple users to share a PulseAudio daemon
But the pipewire way:
...
context.modules = [
...
{ name = libpipewire-module-protocol-native }
#{ name = libpipewire-module-client-node }
{ name = libpipewire-module-adapter }
#{ name = libpipewire-module-metadata }
#{ name = libpipewire-module-protocol-pulse
# args = {
# # contents of pulse.properties can also be placed here
# # to have config per server.
# }
#}
]
...
# Extra modules can be loaded here. Setup in default.pa can be moved here
context.exec = [
{ path = "pactl" args = "load-module module-always-sink" }
{ path = "/bin/chgrp" args = "sharepulse /tmp/pulse-socket" }
#{ path = "pactl" args = "load-module module-switch-on-connect" }
#{ path = "/usr/bin/sh" args = "~/.config/pipewire/default.pw" }
]
...
pulse.properties = {
...
# the addresses this server listens on
server.address = [
#"unix:native"
"unix:/tmp/pulse-socket" # absolute paths may be used
...
}
EDIT:
Also tried reading the Migrate PulseAudio but couldn't make sense out of it, the table also says:
module-native-protocol-unix No Yes pipewire-pulse.
Last edited by ltsdw (2022-10-29 19:28:17)
Offline
Wait, so you just need PULSE_SERVER envar? Like, PULSE_SERVER=/tmp/pulse-socket firefox, and it will work?
Also I don't know why, but if the configuration file is in the directory /etc/pipewire/pipewire-pulse.conf.d/pipewire-pulse.conf the /usr/bin/pipewire-pulse will fail to launch, so instead put the configuration file in /etc/pipewire/pipewire-pulse.conf, I think the Arch wiki also says it's this directory.
But I don't know, the error message isn't clear enough, if I shouldn't put the file at pipewire-pulse.conf.d it should say so.
Also apparently, the user that started pipewire-pulse have to specify the PULSE_SERVER envar to access pavucontrol too (but audio on firefox still works though, idk)
So let me do the pipewire multi user 101 for dummies like me (I don't know if this is the best/correct way, but it is what worked for me):
1- copy/paste the /usr/share/pipewire/pipewire-pulse.conf to /etc/pipewire/pipewire-pulse.conf (or to the user's home directory that will start the pipewire-pulse /home/youruser/.config/pipewire/pipewire-pulse.conf)
2- create a "sharepulse" (or any other name) group
3- edit the pipewire-pulse.conf and specify where the socket will be placed (choose some directory where the user that you want to share audio with have access and change the socket permissions (I don't know, maybe you want only specific users to have access, like only those in sharepulse group):
context.exec = [
{ path = "pactl" args = "load-module module-always-sink" }
{ path = "/bin/chgrp" args = "sharepulse /tmp/pulse-socket" }
{ path = "/bin/chmod" args = "660 /tmp/pulse-socket" }
#{ path = "pactl" args = "load-module module-switch-on-connect" }
#{ path = "/usr/bin/sh" args = "~/.config/pipewire/default.pw" }
]
...
pulse.properties = {
...
# the addresses this server listens on
server.address = [
#"unix:native"
"unix:/tmp/pulse-socket" # absolute paths may be used
...
}
3- add the users that should use the audio to the sharepulse (or any other name that you named your group)
4- export the PULSE_SERVER=/tmp/pulse-socket, or run your application specifying the envar every time like PULSE_SERVER=/tmp/pulse-socket yourapplication
Last edited by ltsdw (2022-10-29 19:34:10)
Offline