Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [Solved] Unable to screen share with SwayWM using Wayland and Pipewire (Read 603 times) previous topic - next topic
0 Members and 5 Guests are viewing this topic.

[Solved] Unable to screen share with SwayWM using Wayland and Pipewire

I just recently upgraded to using Pipewire so that I could get OBS working & now I can record my audio and screen video as I would expect, but I am not able to share my screen, specifically via using Jitsi-desktop or from any web browser (*list at the end) & still can't get screen sharing to work, so I think it may be a system configuration issue.

I have followed the instructions from the Alpine Wiki Pipewire page of creating a bash script in my Sway config, which works.

I have also followed along with the Arch Wiki Pipewire page, specifically 3.2 WebRTC screen sharing about getting this working & I have still not gotten screen sharing to work. I have `xdg-desktop-portal` and `xdg-desktop-portal-wlr` installed.

I've look thru older threads about this - do I need to somehow set my `XDG_CURRENT_DESKTOP=sway` variable? This old Artix forum post discusses this variable, but I couldn't get it set for some reason - https://forum.artixlinux.org/index.php/topic,3205.msg20898.html#msg20898

I ran `jitsi-meet-desktop` in the terminal to see the output of when I try to screen share and I get the following:
Code: [Select]
[30565:0815/224426.707624:ERROR:screen_capture_portal_interface.cc(28)] Failed to get a proxy for the portal: Unknown or unsupported transport “disabled” for address “disabled:”
[30565:0815/224426.707643:ERROR:base_capturer_pipewire.cc(81)] ScreenCastPortal failed: 3
Error occurred in handler for 'jitsi-screen-sharing-get-sources': Failed to get sources.
[30565:0815/224428.683294:ERROR:screen_capture_portal_interface.cc(28)] Failed to get a proxy for the portal: Unknown or unsupported transport “disabled” for address “disabled:”
[30565:0815/224428.683310:ERROR:base_capturer_pipewire.cc(81)] ScreenCastPortal failed: 3
Error occurred in handler for 'jitsi-screen-sharing-get-sources': Failed to get sources.

Trying to work through this xdg-desktop-portal-wlr troubleshooting guide & will update if anything helps, but it's all systemd based :(
https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist

I'm not sure what to try next. Any & all suggestions and help is appreciated.



* web browsers tried:
- Brave web browser (Version 1.68.141 Chromium: 127.0.6533.120 (Official Build) (64-bit))
- Mullvad browser (13.5.2 (based on Mozilla Firefox 115.14.0esr))
- ungoogled Chromium (v 127.0.6533.99)
- vanilla Firefox (v 129.0.1)
- Librewolf (v 129.0.1, a Firefox fork)
- Falkon (v 24.05.2)

Re: Unable to screen share with SwayWM using Wayland and Pipewire

Reply #1
I followed what was done in this Artix Forum post, https://forum.artixlinux.org/index.php/topic,3205.msg20898.html#msg20898, and changed "Exec=sway" to "Exec=env XDG_CURRENT_DESKTOP=sway dbus-run-session sway" and rebooted.

Now when I run `jitsi-meet-desktop` in the terminal to see the output, I get different output when trying to screenshare:
Code: [Select]
[3278:0815/231706.815086:ERROR:screen_capture_portal_interface.cc(48)] Failed to request session: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.ScreenCast” on object at path /org/freedesktop/portal/desktop
[3278:0815/231706.815110:ERROR:base_capturer_pipewire.cc(81)] ScreenCastPortal failed: 3
Error occurred in handler for 'jitsi-screen-sharing-get-sources': Failed to get sources.
[3278:0815/231708.783477:ERROR:screen_capture_portal_interface.cc(48)] Failed to request session: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.ScreenCast” on object at path /org/freedesktop/portal/desktop
[3278:0815/231708.783500:ERROR:base_capturer_pipewire.cc(81)] ScreenCastPortal failed: 3
Error occurred in handler for 'jitsi-screen-sharing-get-sources': Failed to get sources.

Looks like I'm getting closer. Any ideas or suggestions?

Re: Unable to screen share with SwayWM using Wayland and Pipewire

Reply #2
There is a part for non systemd distro:
https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist#non-systemd-distributions

When I was trying wayland I did something in .config/xdg-desktop-portal I think.
To record the screen.

Is it even possible to share the screen?
As you may know wayland can be a problem, some time ago I know that I was not possible no idea now.

Do you have dbus running? For example there is a user dinit service.

Re: Unable to screen share with SwayWM using Wayland and Pipewire

Reply #3
There is a part for non systemd distro:
https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist#non-systemd-distributions

When I was trying wayland I did something in .config/xdg-desktop-portal I think.
To record the screen.

Is it even possible to share the screen?
As you may know wayland can be a problem, some time ago I know that I was not possible no idea now.

Do you have dbus running? For example there is a user dinit service.

Thanks for your help @kiblaster, as I was able to get it working but in a very hacky way... I'll explain so other Artix users can benefit and perhaps another user will have an idea on how to implement this in a better way.

I only followed that non-systemd distro section in the link you shared by adding a "~/.config/xdg-desktop-portal-wlr" with what was suggested in that link:
Code: [Select]
[screencast]
output_name=eDP-1
max_fps=60
chooser_cmd=slurp -f %o -or
chooser_type=simple

Then I found this weblink, https://soyuka.me/make-screen-sharing-wayland-sway-work/, and I followed some suggestions at the end as follows:

1. I opened one terminal and ran "/usr/lib/xdg-desktop-portal-wlr -l DEBUG"
2. I opened a 2nd terminal and ran "/usr/lib/xdg-desktop-portal --verbose -r"
3. Then I can run "jitsi-meet-desktop" and I'm able to screen share successfully. It is a little buggy but I've tested that it's working.

I'm also able now to screen share in some of the web browsers I listed out in the OP - notably firefox-nightly and brave. I also still have trouble screen sharing in most of these browsers, but we now have a solution for Wayland.

Looking forward to seeing if other Artix users have any ideas or suggestions on how to make this a better process before we mark this as the [Solution].

 

Re: Unable to screen share with SwayWM using Wayland and Pipewire

Reply #4
Took another pass at this to see how to implement it better. Followed the other suggestion from the link shared by @kiblaster

I next added this as the first line of my ~/.config/sway/config and upon system reboot - the screen sharing works in jitsi-deskop app without running shell commands.
Code: [Select]
exec dbus-update-activation-environment DISPLAY I3SOCK SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway

Marking this as [Solved]