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!