Categories
Linux

How to fix Screen Sharing in KDE Neon Wayland Session

NOTE: This is no longer needed! ? KDE Neon have now rolled out the latest version of xdg-desktop-portal in the normal repo, which fixes the problem. Note the version is v1.14.1 and the repo is archive.neon.kde.org

/e/a/sources.list.d[15:49]> apt policy xdg-desktop-portal
xdg-desktop-portal:
  Installed: 1.14.1-1+20.04+focal+release+build1
  Candidate: 1.14.1-1+20.04+focal+release+build1
  Version table:
 *** 1.14.1-1+20.04+focal+release+build1 500
        500 http://archive.neon.kde.org/user focal/main amd64 Packages
        100 /var/lib/dpkg/status
     1.6.0-1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

Old Guide:

I’ve been testing the new Wayland session in KDE Neon, and it’s working pretty great, but one thing that has been broken is screen sharing when using Wayland. The easiest way I’ve found to test this is to go to Mozilla’s screen sharing test page, here: https://mozilla.github.io/webrtc-landing/gum_test.html

When going to that page on a fresh Neon install, logged into wayland, you can press the “Screen capture” button to test screen sharing:

You will get a prompt asking for permissions inside Firefox:

But then the screen share will silently fail. The icon at the top of the screen shows that Firefox thinks it’s sharing, but nothing appears in the browser:

I posted on the KDE Neon forums, and a couple of users there helped me out with finding the solution – the discussion is here: https://forum.kde.org/viewtopic.php?f=309&t=174329

Solution

First, check you are using the same base OS and version as what I have tested on. You can run the command cat /etc/os-release to see your OS details. This is what my OS details are – in particular note the VERSION_ID is “20.04”, because currently KDE neon is based on Ubuntu 20.04. Once KDE Neon re-bases to Ubuntu 22.04 these steps shouldn’t be needed:

jtuckey@testingneon:~$ cat /etc/os-release 
NAME="KDE neon"
VERSION="5.24"
ID=neon
ID_LIKE="ubuntu debian"
PRETTY_NAME="KDE neon User - 5.24"
VARIANT="User Edition"
VARIANT_ID=user
VERSION_ID="20.04"
HOME_URL="https://neon.kde.org/"
SUPPORT_URL="https://neon.kde.org/"
BUG_REPORT_URL="https://bugs.kde.org/"
LOGO=start-here-kde-neon
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

The version of plasma I tested on was 5.24.3, but it should work on future versions as well.

jtuckey@testingneon:~$ plasmashell --version
plasmashell 5.24.3

The specific package that causes the screen share to fail is an out-of-date version of xdg-desktop-portal, which is v1.6.0:

jtuckey@testingneon:~$ apt policy xdg-desktop-portal
xdg-desktop-portal:
  Installed: 1.6.0-1
  Candidate: 1.6.0-1
  Version table:
 *** 1.6.0-1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status

Fortunately, someone has provided a PPA with an updated version of the package, available here: https://launchpad.net/~hggg-0/+archive/ubuntu/neon-backports – you can install it like this (trimmed a little):

# run sudo add-apt-repository ppa:hggg-0/neon-backports

jtuckey@testingneon:~$ sudo add-apt-repository ppa:hggg-0/neon-backports
[sudo] password for jtuckey: 
 Some backports for Neon
 More info: https://launchpad.net/~hggg-0/+archive/ubuntu/neon-backports
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Get:1 file:/var/lib/preinstalled-pool focal InRelease
...
Get:9 http://ppa.launchpad.net/hggg-0/neon-backports/ubuntu focal/main amd64 Packages [3,812 B]
Fetched 184 kB in 3s (68.9 kB/s)                                    
Reading package lists... Done
# Then run sudo apt update && sudo apt dist-upgrade

jtuckey@testingneon:~$ sudo apt update && sudo apt dist-upgrade
...
Fetched 162 kB in 2s (69.0 kB/s)   
Reading package lists... Done
Building dependency tree       
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  libfwupdplugin1 librest-0.7-0 libsoup-gnome2.4-1 linux-headers-5.4.0-99 linux-headers-5.4.0-99-generic
  linux-image-5.4.0-99-generic linux-modules-5.4.0-99-generic linux-modules-extra-5.4.0-99-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
  gir1.2-gtk-3.0 gtk-update-icon-cache libgtk-3-0 libgtk-3-bin libgtk-3-common xdg-desktop-portal
6 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 7,370 kB of archives.
After this operation, 26.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/hggg-0/neon-backports/ubuntu focal/main amd64 libgtk-3-common all 3.24.30-0~202110121834~ubuntu20.04.1 [3,785 kB]
...
Setting up gtk-update-icon-cache (3.24.30-0~202110121834~ubuntu20.04.1) ...
Setting up libgtk-3-bin (3.24.30-0~202110121834~ubuntu20.04.1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.7) ...
Processing triggers for man-db (2.9.1-1) ...
Not building database; man-db/auto-update is not 'true'.

This should upgrade xdg-desktop-portal to v1.8.1. Reboot the computer, then screen sharing on Wayland should work:

I’ve had success with both Firefox and OBS Studio after these steps.

Leave a Reply

Your email address will not be published. Required fields are marked *