Skip to content

[Bug]: Linux capture produces no recording on niri/Wayland although the portal session succeeds #324

Description

@talison-cardoso

Search existing issues

  • I have searched the existing issues

Describe the bug

Screen recording does not start on Linux in current OpenScreen releases.

The same machine and environment were able to record the screen correctly with OpenScreen v1.6 and earlier. After upgrading to a newer version, clicking the record button does not result in an actual recording starting.

The application starts normally and the openscreen-pipewire-helper process is created, but the recording never reaches a usable capture/encoding state.

I investigated the problem extensively and found evidence that the PipeWire ScreenCast path is being initialized and that the helper is actively communicating with PipeWire, but the recording itself still does not start.

Expected behavior

Clicking the record button should start screen recording and produce an MP4 recording.

This worked correctly with OpenScreen v1.6 and earlier on the same system.

To Reproduce

  1. Start OpenScreen on Linux.
  2. Select screen recording.
  3. Start recording.
  4. Observe that the recording does not actually start.
  5. The openscreen-pipewire-helper process is present, but no usable recording is produced.

Screenshots

No response

OS

Linux

OS Version

CachyOS

Other OS

No response

Browser

None

Browser Version

No response

Other Browser

No response

Device Type

Laptop

Other Device

No response

Additional context

The following observations may help identify where the regression occurs.

PipeWire

PipeWire itself is running:

/usr/bin/pipewire
/usr/bin/pipewire-pulse

OpenScreen also exposes a PipeWire screen node:

node.name = "openscreen-pipewire-helper"
media.role = "Screen"

The helper process is spawned when recording is initiated:

/tmp/.mount_.../resources/electron/native/bin/linux-x64/openscreen-pipewire-helper

Its process tree shows it as a child of OpenScreen.

The helper is actually connected to PipeWire

/proc//maps shows active PipeWire shared memory:

[memfd:pipewire-memfd]

and the system PipeWire library:

/usr/lib/libpipewire-0.3.so.0.1608.0

There are also multiple PipeWire modules mapped into the helper process.

Cursor samples are being produced

The helper continuously writes cursor metadata events such as:

{
"assetId": "...",
"event": "cursor-sample",
"height": 1080,
"schemaVersion": 1,
"timestampMs": 1786326629322,
"visible": true,
"width": 2560,
"x": 1897,
"y": 0
}

This was also confirmed directly with strace:

[pid 19619] write(1, "{"assetId":"...","event":"cursor-sample",...}", 208) = 208

So the helper is not simply failing to start or immediately exiting.

FFmpeg / encoder components

The helper loads the bundled FFmpeg libraries:

libavcodec.so.62
libavformat.so.62
libavutil.so.60
libswscale.so.9

The executable also contains strings indicating support for several Linux H.264 encoder paths:

h264_vaapi
h264_vulkan
libopenh264
OPENSCREEN_LINUX_ENCODER

It also contains:

is not one of auto, vaapi, vulkan, software

and:

no H.264 encoder could be opened

as well as FFmpeg calls such as:

avcodec_find_encoder_by_name
avcodec_alloc_context3
avcodec_open2
avcodec_send_frame
avcodec_receive_packet

This makes the encoder stage a possible point of failure.

Electron process

The Electron utility processes were observed with:

--enable-features=...,WebRTCPipeWireCapturer

but also:

--disable-features=...,Vulkan

I am not assuming this is the cause, since the actual recording helper is a separate native process, but it may be relevant when comparing the working and broken versions.

Helper invocation

The helper was observed being started with a request similar to:

{
"outputPath": "/home/.../.config/openscreen/recordings/recording-....mp4",
"cursorMode": "metadata",
"video": {
"fps": 60
},
"audio": {
"system": {
"enabled": false
},
"microphone": {
"enabled": false,
"gain": 1.4
}
},
"deferStart": true
}
Important regression information

OpenScreen v1.6 and earlier worked correctly for screen recording.

The current version does not.

This appears to be a regression introduced after v1.6, although I cannot currently identify the exact commit or component responsible.

Tests already attempted

A substantial amount of troubleshooting was performed before opening this issue, including:

checking that PipeWire is running;
checking PipeWire nodes;
checking the OpenScreen process tree;
checking that openscreen-pipewire-helper is actually spawned;
inspecting /proc//maps;
inspecting file descriptors;
inspecting the helper's dynamic libraries;
tracing the helper with strace;
checking PipeWire shared-memory mappings;
checking /dev/dri;
inspecting strings in the native helper;
checking for VA-API/Vulkan/H.264 encoder support;
attempting to force the Linux encoder backend with OPENSCREEN_LINUX_ENCODER=software;
attempting to force the VA-API backend;
attempting to force the Vulkan backend.

None of these approaches resulted in a working recording.

The important result is that the helper remains alive and communicates with PipeWire, including emitting cursor samples, while the actual recording still fails to start.

Environment
OS: Linux
Desktop/session: Niri
Display protocol: Wayland
Distribution: CachyOS
Kernel: 6.18.42-1-cachyos-lts
GPU: Intel Corporation Raptor Lake-P [Iris Xe Graphics]
OpenScreen version: 1.9.1
Working version: v1.6 and earlier
Device: Desktop
Additional context

The main reason I am reporting this as a possible regression rather than an environment/configuration problem is that screen recording worked on this same machine with OpenScreen v1.6 and earlier.

The current helper also appears to successfully establish the PipeWire side of the capture pipeline. The failure therefore seems to occur later in the recording pipeline, potentially around frame delivery, encoder initialization, or the transition from deferred capture to actual recording.

The native helper contains explicit Linux encoder-selection code and support for:

auto
vaapi
vulkan
software

so a comparison between the v1.6 helper and the current helper may be useful.

I can provide additional strace, /proc mappings, process-tree output, or binary inspection results if needed.


Disclaimer

This report was prepared with the assistance of ChatGPT after an extensive troubleshooting session involving multiple attempts to diagnose the issue, including PipeWire inspection, process-tree analysis, /proc inspection, strace, dynamic-library inspection, encoder investigation, and tests with different Linux encoder backends.

The observations and command outputs above are based on the actual tests performed on the affected system; the report was organized and written by ChatGPT to make the investigation easier for the OpenScreen maintainers to review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions