Skip to content

linux-pipewire: Use serials to select nodes when available - #14064

Open
MonterraByte wants to merge 1 commit into
obsproject:masterfrom
MonterraByte:pw-serial
Open

MonterraByte wants to merge 1 commit into
obsproject:masterfrom
MonterraByte:pw-serial

Conversation

@MonterraByte

@MonterraByte MonterraByte commented Oct 22, 2026 •

Copy link
Copy Markdown

Description

This changes the PipeWire implementation so that it uses a serial provided by the ScreenCast portal instead of the node ID when selecting the node to capture.

The minimum version of PipeWire was raised to 0.3.44, which is where PW_KEY_TARGET_OBJECT was added. (Though even that is rather old, being from 2022.)

(The Camera portal still uses node IDs, I haven't changed that. Not sure if it's even needed.)

Motivation and Context

Node IDs can be reused after the node is destroyed. This can cause OBS to capture other windows or screens than the one selected for capture after it is closed/disconnected.
On the other hand, serials are not reused, they increase monotonically. For this reason, PipeWire has deprecated the use of IDs to specify target nodes. The ScreenCast portal provides this serial as of version 6.

How Has This Been Tested?

Screen capture was tested on Arch Linux with KDE Plasma, and Fedora 45 with GNOME.
Camera capture was also tested on Fedora 45 with GNOME.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

Node IDs can be reused after the node is destroyed. Serials are not
reused, they increase monotonically.

For this reason, PipeWire has deprecated the use of IDs to specify
target nodes.

The ScreenCast portal provides this serial as of version 6.
This commit just forwards it to PipeWire.
@Sodivad

Sodivad commented Oct 22, 2026

Copy link
Copy Markdown

changes look sensible to me

@tytan652

Copy link
Copy Markdown
Collaborator

Not a bug fix, feel free to update the "Types of changes" properly.

@tytan652 tytan652 added kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. platform/linux Categorizes issue or PR as affecting Linux specifically labels Oct 22, 2026
@MonterraByte

Copy link
Copy Markdown
Author

It does fix a bug (capturing the wrong window), and I don't see what other type would be more appropriate.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. platform/linux Categorizes issue or PR as affecting Linux specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants