Products › lamco-dsi-tools › Interfaces › PipeWire screen cast stream
PipeWire screen capture: The stream behind Wayland screen sharing
PipeWire screen capture on Wayland: The stream the ScreenCast portal hands out, its formats, DMA-BUF and memory buffers, and how to check it delivers frames.
PipeWire screen capture is the video stream a Wayland desktop hands a program after the ScreenCast portal session starts: The compositor produces frames into a PipeWire node, and the program reads them as a PipeWire client. On GNOME and KDE every screen sharing app reads its frames this way. lamco-dsi-tools (DSI: Desktop session interfaces) records the PipeWire graph, and in a build with the pipewire feature reads the screen cast stream itself: Its format negotiation, its states, and every buffer's times and description, never its pixels.
What it is
PipeWire is the session's media server. The portal's Start answers with a node for each shared source, and OpenPipeWireRemote returns a file descriptor for a PipeWire connection on which those nodes are visible. The program creates a stream on that connection, connects it to the node, and negotiates.
Negotiation is in SPA parameters. The consumer offers the video formats it takes, such as BGRx or RGBA at a size, and for DMA-BUF the DRM format modifiers it can import. The producer picks one and fixes it. The buffers then come either as DMA-BUFs, buffers a driver shares by file descriptor whose layout the modifier describes, or as shared memory the consumer can read directly. Each buffer can carry metadata blocks: A header with the producer's presentation time (pts), the damaged regions, and, when the cursor mode is metadata, a cursor block with its position and sometimes its image. The stream moves through states (connecting, paused, streaming, error), and a stream that never reaches streaming didn't agree on a format or wasn't linked.
Compositors usually send a buffer when the screen changes, so a still screen may give one buffer and then nothing, and a frozen share isn't always a fault. A capture tells the cases apart: It holds each state change and each buffer, or says that none came.
The toolkit's client offers BGRx, BGRA, RGBx and RGBA, each first as DMA-BUF and then as memory, so which one the compositor picks is an observation. It connects without mapping buffers, copies each buffer's description and gives it straight back. A static portable build has no PipeWire client, since libpipewire is a shared library: It opens the portal session and records the stream as not read, with the reason.
Which desktops offered it
The matrix has one row for the portal and its stream together, "ScreenCast portal and PipeWire":
| Desktop | State |
|---|---|
| GNOME Shell 48.7 (Debian 13) | present |
| GNOME Shell 51.0 (Fedora 45) | present |
| KDE Plasma, KWin 6.5.6 (NixOS) | present |
| KDE Plasma, KWin 6.8.2 (KDE neon) | present |
| Sway 1.9 | not examined |
| Hyprland 0.56.2 | present |
| COSMIC, cosmic-comp 1.0.0 | present |
| labwc 0.20.3 (Budgie session, CachyOS) | present |
| Cinnamon Wayland session (Linux Mint) | absent |
These captures were taken with dsisee observe on 2026-11-27 and 2026-11-28, one version of each desktop on one virtual machine, with no permission dialog answered, so no stream was opened in them and present means offered and not exercised. Sway reads not examined because its portal wasn't running.
The README's run record: On GNOME Shell 48.7 (PipeWire 1.4.2) a full build read the ScreenCast stream. On KDE Plasma 6.8.2 (PipeWire 1.6.0) it read the stream, 14 buffers. A screen cast through the portal on KWin 6.7.4 had 472 of 472 buffers as DMA-BUFs with the modifier 0x0, and their markers weren't read. Input to pixels was run on Mutter 48.7 and KWin 6.8.2 through the portal's stream.
The project's record of runs, reconciled on 2026-12-04, adds:
- Markers read from DMA-BUFs through the helper, on KWin 6.7.4 on a GPU function on 2026-11-28: 592 of 592 buffers were mapped read-only and every marker was decoded. KWin listed two buffer layouts, linear and implicit, and chose linear whether it was offered both or linear alone.
- Long runs on the portal route, ten minutes each beside an animation of 60 frames a second, on 2026-11-28. GNOME Shell 48.7: 35,922 buffers, no stalls, 68 presented frames missed. KWin 6.8.2: 18,075 buffers and 19 presented frames missed. Five minutes into that run KDE's idle timer locked the session and switched the display off, 183 buffers showed no marker, and the stall and rate findings were raised.
- Input to pixels with the focus wait, on KWin 6.8.2 on 2026-11-28: 22 of 22 keys.
- The cursor as metadata (
--cursor-mode metadata) on the portal route, on KWin 6.8.2 on 2026-11-29: All 20 buffers carried the cursor. Eight pointer moves through the kernel route showed as a change of position in exactly eight buffers. The cursor's image, 32 by 32, came once and was recorded as a hash. - Markers read from the DMA-BUFs of a graphics driver, and input to pixels on them, on KWin 6.7.4 on a GPU function on 2026-11-29: The client library hadn't mapped the linear DMA-BUFs (modifier
0x0), and the helper mapped 72 of 72 read-only; a marker was decoded in 64 and none was found in 8. Of the input steps, 22 of 22 were seen by the window and shown by a captured buffer.
The record, through 2026-11-29, has no run of --memory-buffers, of --modifiers with all or with a list other than linear, of --no-dmabuf-map, or of a marker read from the DMA-BUFs of a graphics driver other than that one.
A real stream, from two desktops
On 2026-12-04 the released 0.4.0 full build read the screen cast stream on GNOME Shell 50.1 (PipeWire 1.6.2) and on KWin 6.8.2 (PipeWire 1.6.11), both virtual machines with no GPU. Both negotiated raw BGRx at 1280 by 800 with a variable frame rate (0/1) and a maximum of 60/1. On GNOME the buffers were in memory. On KDE they were DMA-BUFs with the modifier 0x0, from a virtual display, and the tool noted that "the format first came with the modifier still a choice, and a second Format arrived when it was fixed". Over 10 seconds, GNOME delivered one or two buffers and KDE nine to eighteen, because a compositor sends a buffer when the screen changes and these screens were mostly still. The ScreenCast portal page has the session step by step.
How to check it with lamco-dsi-tools
dsisee pipewire diagnose # every object pw-dump prints, and the daemon's version
dsisee pipewire probe --duration 15 # pw-profiler's driver cycles, as a distribution
dsisee capture observe --route portal --frames 30 --out cast.json # open the cast (dialog) and record the stream
dsitell timing cast.json # buffer intervals by arrival and by pts, apart
dsitell health cast.json # the ScreenCast route's state, with findings
capture observe in a full build records the formats it offered, the formats the node enumerates, the one chosen, each change of state, and each buffer with its arrival time, its pts, its data blocks and its metadata. dsitell timing gives the interval between buffers once on the instrument's clock and once on the producer's, and never subtracts one clock from the other. --modifiers linear asks for DMA-BUFs in the linear layout, and --memory-buffers for shared memory, which are two other paths through the compositor. --cursor-mode metadata asks for the cursor beside the frames, and the capture counts the buffers that carried a cursor block.
Driving it with dsido
dsido screen animate --duration 20 --out animate.json & # marked frames on the screen
dsisee capture probe --route portal --modifiers linear --read-markers --duration 15 --out linear.json
dsitell glass animate.json linear.json # frames presented and not delivered
With --read-markers each buffer is searched for the animation's marker, and only the counter, its place and a confidence are kept. A DMA-BUF is read only where the client library mapped it or the format is fixed on the linear modifier; any other is recorded as not read, with the reason.
Findings
PW-001:pw-dumpcouldn't read the PipeWire graph.PW-002: The PipeWire profiler counted xruns.PW-003:pw-dumpprinted malformed JSON, and part of it was skipped.CAP-004: A screen cast through the portal delivered no buffer.CAP-006: The screen cast's PipeWire stream wasn't read.CAP-009: Buffers of a capture couldn't be read for markers.CAP-012: The instrument's own mapping of a DMA-BUF was refused.CAP-013: The cursor was asked for as metadata and no buffer carried any.
Related
- xdg-desktop-portal ScreenCast, which opens the stream.
- PipeWire audio graph, the same daemon's sinks and sources.
- ext-image-copy-capture-v1, a capture route that doesn't go through PipeWire.
- Building from source, for the
pipewirefeature, and what to attach to a Wayland screen sharing bug report. - Lamco RDP Server, a Wayland-native RDP server for Linux.
- PipeWire's documentation.