electron: Microsoft Teams crashes when sharing screen under Wayland

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • N/A (I’m sorry, I can’t get to know which version of Electron is used by Microsoft Teams)
  • Operating System:
    • Fedora 31

Expected Behavior

Be able to share my screen in the Teams application.

Actual Behavior

Sharing the screen when on Wayland is actually crashing the Teams application.

To Reproduce

  • Start a session under GNOME (Wayland)
  • Install flatpak package of Teams: flatpak install com.microsoft.Teams
  • Run Teams
  • Start a video call
  • Share your screen
  • Teams crashes and closes

Additional Information

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 62
  • Comments: 55 (4 by maintainers)

Most upvoted comments

Any chance of adding the ‘rtc_use_pipewire=true’ build flag to support Wayland screen sharing?

Still can’t share desktop

Manjaro 21.2, gnome 41.3, teams 1.4.00.26453-1, wayland

It’s both.

Electron needs a fix and MS needs to build a version of Teams which includes that fix.

As I understand it, the people working on a wayland compatible electron (called electron-ozone) have already added this fix, but electron-ozone itself is not that stable.

Electron doesn’t need to wait for ozone to add this fix though. This flag works fine from xwayland, as evidenced by Chromium. Even still, it has to be added, tested, make it into a release, adopted by MS in a build of Teams, and the logic about when to display the screenshare button needs to be updated.

For now, use browser-based Teams in Chromium that supports PipeWire, and set a different user agent so the screenshare button shows up.

There doesn’t appear to be anything we can do here to fix this issue. Since Microsoft Teams is proprietary we are dependent on them to fix this. Please upvote this feature request as likely this issue won’t be fixed until Teams updates/fixes their version of Electron.

Wrt teams, I posted a uservoice on their site for this issue. Please vote 😃

https://microsoftteams.uservoice.com/forums/555103-public/suggestions/41524504-screen-sharing-on-wayland

I use Fedora 34, Gnome 40 on Wayland. I cant screen shared, App dont crushes, but i cant see the option a button screen. I see the comment, hopefully it is resolved quickly.

Update: the mentioned Electron issue is now closed. The issue here is very likely Teams specific and cannot be fixed by making a change to Electron.

Outdated comment: I’ve opened an upstream feature request to build Electron with PipeWire by default. Solving the upstream issue would theoretically solve this Teams issue, but does not necessarily mean PipeWire will work for Teams by default, currently you would still need --enable-features=WebRTCPipeWireCapturer (see the upstream issue for more info).

I had the same problem (Fedora 32) , once I updated (today) teams to vesion 1.3.00.30857-1.x86_64 problem disappeared.

THanks @danshick . Sounds pretty awkward, will maybe just not use the tool 😦

Incidently for those wondering what Microsoft is doing with this (i.e. what version of electron they used), you can extract the version number from the installed files (in my case installed by the deb package)

grep -E "^electron" -A2 /usr/share/teams/resources/ThirdPartyNotice.txt

which currently indicates they’re still using electron 10,

$ grep -E "^electron" -A2 /usr/share/teams/resources/ThirdPartyNotice.txt 
electron
10.4.7 <https://github.com/electron/electron/archive/v10.4.7.zip>
Copyright (c) 2013-2020 GitHub Inc.

Is it just me or is this link broken? If so, is there a new feature request we can follow?

They decommissioned their UserVoice instance… It’s one way to fix all the user requests at once… I think the closest thing right now is the answers section in the MS docs: https://docs.microsoft.com/en-us/answers/search.html?type=question OR idea OR kbentry OR answer OR topic OR user&redirect=search%2Fsearch&sort=relevance&q=wayland [office-teams-linux-itpro]

Don’t think so, I get the same thing without any Nvidia hardware in sight.

@MightyCreak Yes, this particular issue relates to the official Teams app only, but neither version will correctly support screen sharing as Electron doesn’t build with RTC_USE_PIPEWIRE=true by default. This is true of every electron app using upstream electron at the moment.

Edit: I referenced the non-official version because of the claim that it does support screen casting, as that improperly reflects the nature of the issue.

I doubt very much that any Electron app is capable of full screen screen sharing on Wayland yet unless you are using electron-ozone or building electron yourself. Electron sharing will work with XWayland windows as well as other Chrome tabs or Electron apps, and this was always the case.

Edit: yeah, looks like they’re treating it as an upstream bug/wontfix https://github.com/IsmaelMartinez/teams-for-linux/issues/177

There doesn’t appear to be anything we can do here to fix this issue. Since Microsoft Teams is proprietary we are dependent on them to fix this. Please upvote this feature request as likely this issue won’t be fixed until Teams updates/fixes their version of Electron.

Is it just me or is this link broken? If so, is there a new feature request we can follow?

I tested Teams 1.4.00.7556 using the AUR package (based on the official .deb package) and the flatpak one. No progress: in recent versions the sharing of windows/screen is not even proposed. I’m using Arch Linux with Gnome Shell 40 with Wayland. Can someone else confirm that this version of Teams works on Wayland in sharing the whole screen?

I was all excited for a minute! I’m also running Teams 1.4.00.7556, from their RPM repo, but still cannot share my screen. I’m running Fedora 34 Workstation with gnome-shell-40.0-1.

The rtc_use_pipewire=true build flag is enabled by default in recent releases of Chromium, so you don’t find it in Electron’s code. I don’t know which Electron version is used by Teams, and whether they explicitly disabled the build flag.

Anyway to enable PipeWire in Teams you need to ask Teams team to:

  1. Make sure rtc_use_pipewire build flag is turned on.
  2. Explicitly enable the WebRTCPipeWireCapturer feature in their codebase.

But still I don’t know if this would solve the crash, if you want to have maintainers of Electron to be able to look into this issue, you have to work out a minimal example to reproduce the crash in Electron, without involving Teams. Otherwise you have to count on Teams developers to solve it for you.

The build flag is enabled in Electron but the feature itself is disabled by default, can you try if passing --enable-features=WebRTCPipeWireCapturer in command line solves the problem?

I use a chromium derivative, but I see two reasons to use the electron app:

  1. I get more then one video stream. This makes the webapp unusable to do a call with multiple users involved, especially due to the delay when switching between video streams. Well, except when you need to share your screen, then you need to switch quickly …
  2. I always get notifications. In my browser I don’t seem to get notifications for the current chat, so it frequently happens that someone is speaking to me without me knowing. That might be an issue with my browser (qutebrowser), I didn’t really debug it yet.

I would prefer to use my browser, but as the Linux electron app is still lagging behind, being limited to only 4 video streams, I’m not holding my breath for when decent support would land in the webapp …