5

I'm quite new to Ubuntu. A month or two ago, I installed Discord from Snap and everything worked properly but after some weeks my Discord couldn't share a screen properly. When I first used Discord it didn't ask me for anything to share screen it just showed me the apps that I could stream and my screen in the "Screens" section. Now there's like a window popping up (sometimes even popping up twice) from the Ubuntu itself that asks for me to choose what I will share then Discord recognizes that whole stream as an app and no other options.

1

2

When I choose this option my stream doesn't start and it just loads infinitely. I ran Discord from the terminal to see the logs and saw this when trying to share the screen:

mainScreen.UpdaterEvents: UPDATER_HISTORY_QUERY_AND_TRUNCATE
mainScreen.UpdaterEvents: UPDATER_HISTORY_QUERY_AND_TRUNCATE
Warning: terminator_CreateInstance: Failed to CreateInstance in ICD 2.  Skipping ICD.

[8202:0605/220724.883923:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times! 'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:426 pw_thread_loop_wait() 'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:426 pw_thread_loop_wait() 'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:426 pw_thread_loop_wait() 'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:426 pw_thread_loop_wait() [8145:0605/221335.407648:ERROR:screencast_portal.cc(367)] Failed to start the screen cast session. [8145:0605/221335.407664:ERROR:base_capturer_pipewire.cc(81)] ScreenCastPortal failed: 2 Error occurred in handler for 'DISCORD_DESKTOP_CAPTURER_GET_SOURCES': Failed to get sources. (The last two lines of error showed up more than once)

Any help would be appreciated. (My discord at the moment is the 0.0.55.deb)

Ajay
  • 2,241
Simeon
  • 61

3 Answers3

2

This fixed it for me and others.

Steps (detailed explanation of the steps are above):

  • echo $XDG_SESSION_TYPE (if it say wayland and not X11 follow with the below)
  • open the config sudo nano /etc/gdm3/custom.conf
  • Change #WaylandEnable=false to WaylandEnable=false
  • CTRL+O and enter to write out changes & CTRL+X and enter to close the session
  • Reboot

Your screen sharing should work now.

David DE
  • 2,316
2

discord is built using electron, and although electron now has support for screen sharing under wayland, the discord client does not as it still uses an older version of electron.

So your solutions are:

  1. Use the discord web version with a support browser (e.g chrome), a short hand way is the following command
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WebRTCPipeWireCapturer --app=https://discord.com/app
  1. Use discord canary which can be downloaded here (this is an alpha version of discord and will be unstable

  2. Use a third-party discord client like WebCord or Vesktop (using a third party discord client is against the discord TOS and could get you banned)

Matin
  • 21
  • 3
0

I had the same issue with my Ubuntu, I solved it by switching to xorg display mode.

Method:

  1. Sign out of your computer.

  2. Go to log in where it prompts for your password.

  3. Bottom right hand corner there should be a setting icon.

  4. Click it and switch to xorg display mode.

Sign back in and you should be able to stream again. Hope this helps!