Pipewire support #2023
Replies: 15 comments 30 replies
-
This is an early stage discussion. Some of the information I'm presenting below may not be entirely correct, and there may be other options which I haven't even though of yet. I'm making no apologies for this - I'd rather start the discussion going as soon as possible. Please feel free to jump in and move this discussion forward. A summary of the situation as I see it is as follows. Audio support in xrdp (v0.9.17 is the current version as I write this) is provided for Pulseaudio (PA) by a combination of the pulseaudio-xrdp-module and functionality in the xrdp-chansrv executable. There are actually two pulseaudio xrdp modules, for incoming and outgoing data streams. For expeciency these are both referred to as 'the PA module' below. When this works, it works reasonably well. However, over time the following disadvantages of this approach have become clearer:-
To support other audio systems, we can either continue with the existing design (i.e. write other modules), or re-think how the audio is processed. The problem with writing yet more modules is the maintenance effort scales with the number of modules. PA isn't going away any time soon, and we do not yet know how successful Pipewire will be over time. If we wrote a Pipewire module we'd still have to support the existing PA module for many years yet. A better solution might be to explore using sound protocols over the network (e.g. RDP/SDP/SAP) to provide access to xrdp sound devices. I haven't researched this in any detail yet - comments from people who know about such things would be extremely welcome! |
Beta Was this translation helpful? Give feedback.
-
Would it be possible to use a local loopback network connection that works for both Pipewire-Pulseaudio (https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-PulseAudio#network-support) and Pulseaudio itself (https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/, likely using https://roc-streaming.org/toolkit/docs/running/pulseaudio_modules.html as Pipewire-Pulse does not support RTP for Network sink/source yet)? The new xrdp audio module would have to simply provide the interfaces (auth protocol/source/sink) expected and supported by both of the network modules of Pipewire-Pulseaudio and Pulseaudio itself (probaly the ROC variants) and XRDP would only have to set up those sources/sinks at session startup. Advantage: Would support any Backend that supports the chosen network audio protocol and also remove the really complicated step of having to compile a version-dependent PA module using PA sources, which would be simpler and easier to package even if it would require an additional package providing ROC support for native PulseAudio. Just a thought that came to mind when looking at the Pipewire-PulseAudio docs unfortunately I'm lacking the abilty to implement this myself, otherwise i'd probably just draft up a pull request. Hope it helps anyone planning to pick this up. |
Beta Was this translation helpful? Give feedback.
-
Hi, I was wondering if the current pipewire will ever be backported to debian buster? Thanks very much |
Beta Was this translation helpful? Give feedback.
-
One possible option I've seen applications use (noson) that need to provide an output and input is to spawn a null sink and receive or send audio through it. This should be compatible with both pulse and pipewire. In practice, this would mean a client would start and register 2 null sinks. One sink is for audio playback, and the client listens on the monitor output for audio to transmit through RDP. The other sink will receive the audio from RDP and the user of the desktop can select that monitor to capture audio. I do have to note that the ergonomics might not be great with this, especially for the RDP source, as I think monitor capture endpoints are usually filtered out by clients. Although a quick test with pipewire and teams shows that it does support taking the monitor source as mic input. |
Beta Was this translation helpful? Give feedback.
-
From 22.10, Ubuntu no longer seems to support PA modules at all - neutrinolabs/pulseaudio-module-xrdp#89 |
Beta Was this translation helpful? Give feedback.
-
I tried to support pipewire in two ways. 1. I wrote pipewire module. This approach is close to module-xrdp-sink.c/module-xrdp-source.c.Attached module-xrdp-pipewire.tar.gz includes four files.
I picked "unix domain socket" related portion from module-xrdp-sink.c and module-xrdp-source.c here, built and installed on Ubuntu 22.10, Debian 12 and Pop_OS! 22.04.Following steps are to compile/link and install them.
If installed pipeware version is 0.3.58(Ubuntu 22.10 is the case at this moment), following three steps are necessary.
Thats all. Works on both Ubuntu 22.10, Denbian 12 and Pop_OS! 22.04. This is modification of the file(module-pipe-tunnel.c) in pipewire tree. Fedora37:
== Following steps are mostly same as Ubuntu
2. use GStreamer approach.GStreamer supports pulseaudio with plugin named pulsesrc. Ubuntu: Fedora: If module-xrdp-sink / unload-module module-xrdp-source are working, stop them as follows. Then, just run xrdp_appsink_test.
work on Disadvantage of this approach is: 3. RTP/SAPPulseaudio has a rtp send module: module-rtp-send. on xrdp server:PULSEAUDIO:
PIPEWIRE: version 0.3.60 and after
on xrdp client:Using VLC: see this url: Using ffplay: Using gstreamer: When worked for video applicatios, lip sync does not work well. As a result, I think it is the best way to write a pipewire module to support full function. |
Beta Was this translation helpful? Give feedback.
-
Great work, @Hiero32! In particular I appreciate your analysis of the approaches available. I'll have a look at this in more detail when I've got more time - at the moment I'm trying to get sesman is a reasonable state for the next major xrdp release, and that's got to be a priority. In the meantime, if anyone else cares to look at this, please add your experiences here. |
Beta Was this translation helpful? Give feedback.
-
Would you like to propose the xrdp module in PipeWire upstream? |
Beta Was this translation helpful? Give feedback.
-
@Hiero32 - I've started looking at making this a distributable module. When I've got something worth sharing I'll let you know. |
Beta Was this translation helpful? Give feedback.
-
All, Here's an initial repo with @Hiero32's module in it:- https://github.com/matt335672/pipewire-module-xrdp I've built the module on Ubuntu 22.10 and Fedora 38. I've done no other testing yet, but I'm out of time today. Comments/Issues/PRs, etc welcome. |
Beta Was this translation helpful? Give feedback.
-
@metalefty - given the feedback above, I think we should make this repo sit under https://github.com/neutrinolabs rather than my account, and maybe make a release. What do you think? |
Beta Was this translation helpful? Give feedback.
-
I've been following this for a while. Happy to hear that sound is coming back to xrdp with pipewire. Any idea what future version of xrdp will have this pipewire support or when it will be coming to distros like openSUSE Tumbleweed ? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi @JoeSalmeri Sorry - I 've got no news on that. @metalefty - are you in a position to copy https://github.com/matt335672/pipewire-module-xrdp to https://github.com/neutrinolabs/pipewire-module-xrdp ? I don't have permissions to do that. Once we've got an official release, it will be up to the distros how they package the driver up and distribute it. |
Beta Was this translation helpful? Give feedback.
-
I've just added you as a collaborator. I think you'll get an email. Then I should be able to make you an admin. |
Beta Was this translation helpful? Give feedback.
-
Will the new pipewire module be part of the base XRDP package or will it be a separate package ? Thanks! |
Beta Was this translation helpful? Give feedback.
-
I'm starting this discussion as it's inevitable that it will come up in issues, now that Fedora 34 has moved to native pipewire support.
Beta Was this translation helpful? Give feedback.
All reactions