Even better screencast with GNOME on Wayland

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!


11 responses to “Even better screencast with GNOME on Wayland”

  1. Awesome work! Does this have any impact on the ability to share a screen through google hangouts in Chrome?

    1. 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.

  2. You are the true hero! Just got myself a fresh new wide 49′, gonna give it a whirl when this magic lands.

  3. Not worked for us. 🙁

  4. 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?

  5. Carlos Avatar

    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 🙁

  6. […] that, the next step was teaching OBS Studio how to create textures from DMA-BUF information. I wrote about this in the past, but the tl;dr is that implementing a monitor or window capture using DMA-BUFs means we […]

  7. […] that, the next step was teaching OBS Studio how to create textures from DMA-BUF information. I wrote about this in the past, but the tl;dr is that implementing a monitor or window capture using DMA-BUFs means we […]

  8. […] anden perdidos, DMA-BUF está relacionado con la captura de la pantalla desde Wayland y como bien explica Georges Stavracas es un búfer que se encarga de evitar la copia de “imágenes entre la GPU y la memoria de la […]

  9. […] anden perdidos, DMA-BUF está relacionado con la captura de la pantalla desde Wayland y como bien explica Georges Stavracas es un búfer que se encarga de evitar la copia de “imágenes entre la GPU y la memoria de la […]

  10. […] I think we have come a long way already; after adding Wayland support for OBS Studio, improving screencasting on GNOME, allowing screencast sessions to be restored by applications, enabling Elgato Stream Deck devices, […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.