Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fallback to X11 capturer if pipewire fails on Wayland #37511

Merged
merged 3 commits into from
Mar 7, 2023

Conversation

VerteDinde
Copy link
Member

@VerteDinde VerteDinde commented Mar 6, 2023

Description of Change

Closes #37463

Desktop Capturer behaves inconsistently on Wayland. We use PipeWire within WebRTC on Wayland to gather desktop window & screen capture sources. However, PipeWire does not always successfully start, and beginning with this CL, we no longer fall back to the X11 capturer, even if it is enabled: https://webrtc-review.googlesource.com/c/src/+/279163

Currently if neither PipeWire or X11 can be used, we return a nullptr in place of the capturer sources, crashing the application.

This PR does two things:

  1. Reinstates the previous fallback behavior in WebRTC, so that if PipeWire fails on Wayland, we can still attempt to gather capture sources, rather than simply failing. I'll submit this as a patch for upstream consideration as well.
  2. Ensures that a lower level capturer of some kind exists before trying to create one within Electron's DesktopCapturer::StartHandling method. (Thanks @ckerr!)

Checklist

Release Notes

Notes: Fixed a crash on capturing sources when using desktopCapturer API on Wayland.

@VerteDinde VerteDinde requested a review from ckerr March 6, 2023 18:52
@VerteDinde VerteDinde requested a review from a team as a code owner March 6, 2023 18:52
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Mar 6, 2023
@VerteDinde VerteDinde changed the title Fallback x11 capturer wayland fix: fallback to X11 capturer if pipewire fails on Wayland Mar 6, 2023
@VerteDinde VerteDinde added semver/patch backwards-compatible bug fixes target/23-x-y PR should also be added to the "23-x-y" branch. target/24-x-y PR should also be added to the "24-x-y" branch. labels Mar 6, 2023
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Mar 7, 2023
@VerteDinde VerteDinde merged commit 77bd80d into main Mar 7, 2023
@VerteDinde VerteDinde deleted the fallback-x11-capturer-wayland branch March 7, 2023 21:59
@release-clerk
Copy link

release-clerk bot commented Mar 7, 2023

Release Notes Persisted

Fixed a crash on capturing sources when using desktopCapturer API on Wayland.

@trop
Copy link
Contributor

trop bot commented Mar 7, 2023

I have automatically backported this PR to "23-x-y", please check out #37526

@trop trop bot added in-flight/23-x-y and removed target/23-x-y PR should also be added to the "23-x-y" branch. labels Mar 7, 2023
@trop
Copy link
Contributor

trop bot commented Mar 7, 2023

I have automatically backported this PR to "24-x-y", please check out #37527

@trop trop bot added in-flight/24-x-y merged/23-x-y PR was merged to the "23-x-y" branch. merged/24-x-y PR was merged to the "24-x-y" branch and removed target/24-x-y PR should also be added to the "24-x-y" branch. in-flight/23-x-y labels Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/23-x-y PR was merged to the "23-x-y" branch. merged/24-x-y PR was merged to the "24-x-y" branch semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: DesktopCapturer doesn't work in Ubuntu 22.04.2 LTS
5 participants