App to App Media Sharing #1141
Replies: 10 comments 21 replies
|
From a UX point of view. For case 1, I think there could be two possible experiences:
There may be an option to share or not share audio from a stream. For case 2, either we display a dialog asking to add the camera (confirming its creation) and it is directly available for other apps in a selector, or it can be the same as in the second experience of case 1 but for a virtual camera. |
|
Could you describe case 3 further? Is it, for example, an app that applies voice effects and then shares the resulting audio stream? |
|
This will used as a sort of changelog if I happen to update my illustrations. Changes to Pseudo-Sequence Diagram for App to App ScreenCast between v1 and v2:
|
|
I'm excited to see this change make get PRed! My use case is under n1 for gamescope and screensharing a game on steamdeck (game-mode) to either Chrome for Jitsi or through the discord client. |
|
The problem I have with the overall architecture is that it's very complex. If we made pipewire available inside the sandbox and let the portals just control the "permissions" for pipewire, we could clients simply have tag their video sources for consumption of other apps and let pipewire session manager make it available to other clients (if they have the permission). |
|
Idea of improvement for case n°1, make xdp behave like an aggregator of providers act as 1 provider with an interface meant for backends. |
|
Just wanted to throw in that I'm also interested, as this change is needed to implement a Spout2-on-Proton/DXVK to PipeWire/OBS bridge reasonably (which would allow the existing Windows Spout2 sender ecosystem to send video to Linux apps when running on Proton). @tytan652 already has some baseline code for the portal/enumeration bits that he shared with me, and I'm building on it to fill in the PipeWire/texture sharing bits to make it work. |
|
This seems like overkill for this problem? Why not just directly interact with PipeWire? Accessing the PipeWire socket and pushing something through it is well-trodden ground (there's even code in Weston to do this with its |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Related to Goal: Peer-to-peer media sharing
Usecases
Case n°1
Applications like SnekStudio want to be able to share a stream (maybe even various) to other applications (e.g. OBS Studio) alike to what Spout2 and Syphon allows to do on respectively Windows and macOS with almost zero-latency, so mostly "PipeWire + DMA-BUF" for Linux.
We can also point out Gamescope that is a Wayland compositor that want to enable sharing in nested scenarios where a xdp implementation is not a solution (obsproject/obs-studio#9607).
Case n°2
Others applications want to be able to provide a virtual camera (e.g. OBS Studio) to be used as a camera in other applications.
Some of them already does by using v4l2-loopback which require kernel space API to be used.
As an example, OBS Studio plans to move features to PipeWire (obsproject/obs-studio#7998), but the actual proposed implementation requires an access to the host PipeWire.
Case n°3
Also some applications might want to act as virtual microphone (device to send their own audio stream) alike to one of Easy Effects features but without requiring direct access to the host PipeWire.
Idea of a solution
Note for the following:
For case n°1
For this use-case, we need to enable applications to provide screen cast sources (
virtual) to the ScreenCast portal of the xdp implementation.So the xdp stack will have to connect to the application point to point D-Bus to make it a screen cast sources provider.
Note: Name in italic are just temporary name
It is also imaginable to simplify the per-application implementation by providing a library that provide most of the basic of the implementation.
Thought about audio on those Screencast
Also related to Goal: Window screencast with audio.
Since the application provide its own video stream, the application could also provide a audio one paired with the latter.
This could improve the Gamescope sub-usecase, and maybe also allow to some power users of OBS Studio to "stream" an OBS session to another locally without having to rely to solution like NDI or DeckLink if implemented in OBS. Yes, chained OBS Studio setup like that do exist.
For case n°2
I didn't give enough thought about it, and like I said earlier I need to dive a little more on how PipeWire works with Portals.
For this one, we need to enable applications to give a video stream to xdp to make it a camera available through the Camera portal.
There is no expectation that the virtual camera can do more than an actual camera, so format-wise it should be like a real camera.
Reminder: Name in italic are just temporary name

For case n°3
This cases is alike to the case n°2 but relies on Goal: Audio portal/#1142.
But unlike case n°2, the naming "virtual microphone" is just used as a figure of speech.
All reactions