wl-mirror will soon support XDG Portal screencasts and thus KDE and Gnome!

With all of the talk around explicit sync I tried to test the old broken xdg-portal branch again and apparently it now works?!

I plan on cleaning this up soon so that wl-mirror finally works on other compositors.

#wlmirror #xdgportal #pipewire #kde #gnome

I think I have announced XDG Portal support for #wlmirror "real soon now" a whole bunch of times now and often haven't made much progress after that. Work on that feature is somehow really exhausting, likely because of the large amount of code involved and the cryptic failure cases without any easily understandable way to debug them.

I think that with enough time I will eventually find a solution, but I can't say when that is.

I'm currently in the process of rewriting the core #wlmirror code, at least the Wayland protocol parts.

Adding a new protocol to wl-mirror and wiring it up was previously 6 changes in 3 different files, 2 of those changes were multi-line boilerplate.

This is now reduced to 3 changes in 3 files, each single-line changes (adding the protocol to CMake, adding the struct member, and adding an entry in a constant global array).

The design goal is making things less coupled and harder to screw up.

I tried working on a few rather simple feature requests to #wlmirror and I've noticed the project has probably outgrown its initial structure. Many files are approaching or have already surpassed 1000 lines of code, and just adding a new wayland protocol extension (without even using it yet!) requires adding it in 6 (!) places. CLI options have a similar issue.

All of this is making wl-mirror dev hard to approach (for both me and contributors) and this all needs a cleanup.

1/2

Now, I have hacked that code into #wlmirror and basically frankenstein'd it into the XDG Portal backend and it does import and render the DMA-BUF correctly! (just in a separate window, see screenshots)

3/x

It's time for some #wlmirror development insights!

I've been having a weird issue with the experimental XDG Portal backend for almost a year now: When importing DMA-BUFs from the XDG Portal backend, the screen stays black. No idea what the issue is.

1/x

Today two years ago I created #wlmirror because I was fed up with the fact that #sway did not support screen mirroring. I expected the project to be a small one-off application to let myself hack my way through doing presentations as a teaching assistant while still using sway.

Now, two years later, quite a bunch has changed! 24 Releases, Packages in 12 Distros, 200 Stars on GitHub, and quite a few users.

1/x

I found an unusual new way to debug issues in #wlmirror, especially relating to debugging texture contents and DMABUF handling. Send them to another known-good application that does only one thing: receive and display the DMABUF. That should allow me to eliminate other variables, like GL issues, wayland issues, libpipewire issues, etc. I hope this lets me get to the bottom of why the stuff I receive over pipewire screen share is black
I hope this #OliverBook detour makes me learn a bit more about how the Linux graphics stack works, maybe even enough to finally get #pipewire screencasts working with #wlmirror.

#wlmirror news: The Debian package for wl-mirror has been uploaded to the NEW queue; with some luck (🤞) this means wl-mirror will appear in unstable soon and will probably end up in the next Debian release (13 / trixie)

Thanks to Simon Quigley for sponsoring the upload!