With last week’s release of PipeWire 3, and Mutter’s subsequent adaptation to depend on it, I decided to revive something I have started to work on a few months ago. The results can be found in this merge request.
PipeWire 0.3 brings one very interesting and important feature to the game: it can import DMA-Buf file descriptors, and share it with clients. On the client side, one easy way to make use of this feature is simply by using the pipewiresrc source in GStreamer.
The key aspect of DMA-Buf sharing is that we avoid copying images between GPU and CPU memory. On a 4K monitor, which is what I’m using these days, that means it avoids needlessly copying almost 2GB of pixels every second.
Explaining the intrinsics of DMA-Buf sharing, and how the interactions between Mutter and PipeWire work, is hard! Even though I’ve wrote about complicated topics before, nowadays we have a better venue for this type of article: the Mutter & GNOME Shell development blog. Stay tuned!
For now, I’ve done a quick recording using OBS Studio, and the obs-xdg-portal plugin that I wrote about a few months ago:
This is a Wayland-only feature, and only when sharing monitors. Window sharing may come in the future, but that’s a bit trickier to implement. I personally don’t care about X11 enough to implement it for X11 as well.
Enjoy!
Awesome work! Does this have any impact on the ability to share a screen through google hangouts in Chrome?
LikeLike
I don’t know. I don’t use Chrome. I think Chrom(e|ium) have an optional flag for using PipeWire. If that’s true, it probably works.
LikeLike
You are the true hero! Just got myself a fresh new wide 49′, gonna give it a whirl when this magic lands.
LikeLike
Not worked for us. 😦
LikeLike
I notice there is skipping every few seconds which is actually also present in your showcase. Is this something you’ve noticed and are planning to fix?
LikeLike
It’s nice to see screen sharing moving forward but, sadly, pipewire 3 is not compatible with chromium pipewire support, so it breaks the only precary support for WebRTC we had in Wayland 😦
LikeLike