emersion / xdg-desktop-portal-wlr

xdg-desktop-portal backend for wlroots
MIT License
580 stars 54 forks source link

GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.ScreenCast” on object at path /org/freedesktop/portal/desktop #193

Open nelaaro opened 2 years ago

nelaaro commented 2 years ago

Hi, I am getting the following error.

base_capturer_pipewire.cc(820)] Failed to create a screen cast session: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.ScreenCast” on object at path /org/freedesktop/portal/desktop

I have run through the https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist and will show the output below.

I am lost as to what else I can do to troubleshoot or investigate these issues. Please let me know what I can do to provide further information

A simple test using google chrome. using the webrtc test.

https://www.webrtc-experiment.com/Pluginfree-Screen-Sharing/#9554611117497905
https://mozilla.github.io/webrtc-landing/gum_test.html

When I run google chrome.

google-chrome-stable --enable-features=WebRTCPipeWireCapturer --enable-features=UseOzonePlatform --ozone-platform=wayland
[8591:8627:0311/095204.664914:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.portal.FileChooser”
[8591:8627:0311/095204.667207:ERROR:select_file_dialog_impl_portal.cc(243)] Failed to read portal version property
[8635:8635:0311/095204.734159:ERROR:gpu_init.cc(440)] Passthrough is not supported, GL is egl, ANGLE is
[8635:8635:0311/095204.741935:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[8591:8591:0311/095205.039175:ERROR:cursor_loader.cc(116)] Failed to load a platform cursor of type kNull
[8591:8591:0311/095334.048404:ERROR:base_capturer_pipewire.cc(820)] Failed to create a screen cast session: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.ScreenCast” on object at path /org/freedesktop/portal/desktop
[8591:8591:0311/095346.006443:ERROR:base_capturer_pipewire.cc(820)] Failed to create a screen cast session: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.ScreenCast” on object at path /org/freedesktop/portal/desktop

Here is a complete rundown of the troubleshooting guide.

My login manager Greetd also starts and xdg-desktop-portal so there are two running one for the logging manager and then one for my sway desktop session.

The screenCast is included in the installation of xdg

ls /usr/share/dbus-1/interfaces/org.freedesktop.portal.ScreenCast.xml
/usr/share/dbus-1/interfaces/org.freedesktop.portal.ScreenCast.xml

Sway is started with the dbus-run-session.

❯ ps -ef | grep sway
aaron       1019    1002  0 09:21 tty7     00:00:00 /bin/sh /etc/greetd/sessions/sway.sh
aaron       1025    1019  0 09:21 tty7     00:00:00 /usr/bin/dbus-run-session sway
aaron       1027    1025  1 09:21 tty7     00:00:44 sway

❯ pamac search -i pipewire
manjaro-pipewire                                                                                                                                                              20220217-2  extra
    Manjaro meta package for complete PipeWire support.
gst-plugin-pipewire                                                                                                                                                           1:0.3.47-2  extra
    Multimedia graph framework - pipewire plugin
pipewire-zeroconf                                                                                                                                                             1:0.3.47-2  extra
    Low-latency audio/video router and processor - Zeroconf support
pipewire-v4l2                                                                                                                                                                 1:0.3.47-2  extra
    Low-latency audio/video router and processor - V4L2 interceptor
pipewire-pulse                                                                                                                                                                1:0.3.47-2  extra
    Low-latency audio/video router and processor - PulseAudio replacement
pipewire-media-session                                                                                                                                                        1:0.4.1-1   extra
    Example session manager for PipeWire
pipewire-dummy                                                                                                                                                                1-3         AUR
    dummy pipewire package for pulseeffects
pipewire-docs                                                                                                                                                                 1:0.3.47-2  extra
    Low-latency audio/video router and processor - documentation
pipewire-alsa                                                                                                                                                                 1:0.3.47-2  extra
    Low-latency audio/video router and processor - ALSA configuration
pipewire                                                                                                                                                                      1:0.3.47-2  extra
    Low-latency audio/video router and processor

❯ pamac search -i xdg-desktop
xdg-desktop-portal-wlr                                                                                                                                                      0.5.0-1   community
    xdg-desktop-portal backend for wlroots
xdg-desktop-portal                                                                                                                                                          1.12.1-1  extra
    Desktop integration portals for sandboxed apps

Here is the rest of the troubleshooting guide output.

systemctl --user status pipewire-media-session
● pipewire-media-session.service - PipeWire Media Session Manager
    Loaded: loaded (/usr/lib/systemd/user/pipewire-media-session.service; enabled; vendor preset: enabled)
    Active: active (running) since Fri 2022-03-11 09:21:55 SAST; 15min ago
Main PID: 1124 (pipewire-media-)
    Tasks: 2 (limit: 13810)
    Memory: 21.1M
        CPU: 139ms
    CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire-media-session.service
            └─1124 /usr/bin/pipewire-media-session

Mar 11 09:21:55 aaron-wpc systemd[1008]: Started PipeWire Media Session Manager.

❯ systemctl --user status pipewire-media-session
● pipewire-media-session.service - PipeWire Media Session Manager
    Loaded: loaded (/usr/lib/systemd/user/pipewire-media-session.service; enabled; vendor preset: enabled)
    Active: active (running) since Fri 2022-03-11 09:21:55 SAST; 15min ago
Main PID: 1124 (pipewire-media-)
    Tasks: 2 (limit: 13810)
    Memory: 21.1M
        CPU: 139ms
    CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire-media-session.service
            └─1124 /usr/bin/pipewire-media-session

Mar 11 09:21:55 aaron-wpc systemd[1008]: Started PipeWire Media Session Manager.

❯ systemctl --user status xdg-desktop-portal
● xdg-desktop-portal.service - Portal service
    Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal.service; static)
    Active: active (running) since Fri 2022-03-11 09:22:20 SAST; 15min ago
Main PID: 1073 (xdg-desktop-por)
    Tasks: 4 (limit: 13810)
    Memory: 2.4M
        CPU: 31ms
    CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal.service
            └─1073 /usr/lib/xdg-desktop-portal

Mar 11 09:21:55 aaron-wpc systemd[1008]: Starting Portal service...
Mar 11 09:21:55 aaron-wpc xdg-desktop-por[1073]: No skeleton to export
Mar 11 09:22:20 aaron-wpc xdg-desktop-por[1073]: Failed to create secret proxy: Error calling StartServiceByName for org.freedesktop.secrets: Timeout was reached
Mar 11 09:22:20 aaron-wpc xdg-desktop-por[1073]: No skeleton to export
Mar 11 09:22:20 aaron-wpc systemd[1008]: Started Portal service.

❯ env | grep '^WAYLAND_DISPLAY='
WAYLAND_DISPLAY=wayland-1

❯ env | grep '^XDG'
XDG_VTNR=7
XDG_SESSION_ID=3
XDG_CURRENT_DESKTOP=sway
XDG_SESSION_DESKTOP=sway
XDG_RUNTIME_DIR=/run/user/1000
XDG_SESSION_CLASS=user
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_CONFIG_HOME=/home/aaron/.config
XDG_SESSION_TYPE=wayland
XDG_SEAT=seat0

❯ pidof xdg-desktop-portal
1136 1073

❯ ps -ef | grep xdg
aaron       1073    1008  0 09:21 ?        00:00:00 /usr/lib/xdg-desktop-portal
aaron       1076    1008  0 09:21 ?        00:00:00 /usr/lib/xdg-desktop-portal-wlr
aaron       1092    1008  0 09:21 ?        00:00:00 /usr/lib/xdg-document-portal
aaron       1095    1008  0 09:21 ?        00:00:00 /usr/lib/xdg-permission-store
aaron       1136       1  0 09:21 tty7     00:00:00 /usr/lib/xdg-desktop-portal
aaron       1145       1  0 09:21 tty7     00:00:00 /usr/lib/xdg-permission-store
aaron       4178    3240  0 09:39 pts/3    00:00:00 grep --color=auto xdg

❯ systemctl --user restart xdg-desktop-portal

❯ ps -ef | grep xdg
aaron       1076    1008  0 09:21 ?        00:00:00 /usr/lib/xdg-desktop-portal-wlr
aaron       1092    1008  0 09:21 ?        00:00:00 /usr/lib/xdg-document-portal
aaron       1095    1008  0 09:21 ?        00:00:00 /usr/lib/xdg-permission-store
aaron       1136       1  0 09:21 tty7     00:00:00 /usr/lib/xdg-desktop-portal
aaron       1145       1  0 09:21 tty7     00:00:00 /usr/lib/xdg-permission-store
aaron       4274    1008  0 09:40 ?        00:00:00 /usr/lib/xdg-desktop-portal
aaron       4584    3240  0 09:45 pts/3    00:00:00 grep --color=auto xdg

❯ systemctl --user status xdg-desktop-portal
● xdg-desktop-portal.service - Portal service
    Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal.service; static)
    Active: active (running) since Fri 2022-03-11 09:40:56 SAST; 4min 58s ago
Main PID: 4274 (xdg-desktop-por)
    Tasks: 4 (limit: 13810)
    Memory: 2.1M
        CPU: 27ms
    CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal.service
            └─4274 /usr/lib/xdg-desktop-portal

Mar 11 09:40:31 aaron-wpc systemd[1008]: Starting Portal service...
Mar 11 09:40:31 aaron-wpc xdg-desktop-por[4274]: No skeleton to export
Mar 11 09:40:56 aaron-wpc xdg-desktop-por[4274]: Failed to create secret proxy: Error calling StartServiceByName for org.freedesktop.secrets: Timeout was reached
Mar 11 09:40:56 aaron-wpc xdg-desktop-por[4274]: No skeleton to export
Mar 11 09:40:56 aaron-wpc systemd[1008]: Started Portal service.

pidof xdg-desktop-portal
4274 1136

❯ cat /proc/4274/environ | tr '\0' '\n' | grep '^WAYLAND_DISPLAY='
WAYLAND_DISPLAY=wayland-1

❯ systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
systemctl --user start pipewire-media-session
Warning: Stopping pipewire.service, but it can still be activated by:
pipewire.socket

❯ cat systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
systemctl --user start pipewire-media-session^C

❯ cat /usr/share/xdg-desktop-portal/portals/wlr.portal
[portal]
DBusName=org.freedesktop.impl.portal.desktop.wlr
Interfaces=org.freedesktop.impl.portal.Screenshot;org.freedesktop.impl.portal.ScreenCast;
UseIn=wlroots;sway;Wayfire;river

❯ cat /proc/4274/environ | tr '\0' '\n' | grep '^XDG_='
cat: /proc/4274/environ: No such file or directory

❯ pidof xdg-desktop-portal
1136

❯ systemctl --user start xdg-desktop-portal-wlr.service

❯ pidof xdg-desktop-portal
1136

❯ systemctl --user start xdg-desktop-portal

❯ pidof xdg-desktop-portal
8103 1136

❯ cat /proc/8103/environ | tr '\0' '\n'
HOME=/home/aaron
LANG=en_ZA.UTF-8
LC_ADDRESS=en_ZA.UTF-8
LC_IDENTIFICATION=en_ZA.UTF-8
LC_MEASUREMENT=en_ZA.UTF-8
LC_MONETARY=en_ZA.UTF-8
LC_NAME=en_ZA.UTF-8
LC_NUMERIC=en_ZA.UTF-8
LC_PAPER=en_ZA.UTF-8
LC_TELEPHONE=en_ZA.UTF-8
LC_TIME=en_ZA.UTF-8
LOGNAME=aaron
MAIL=/var/spool/mail/aaron
PATH=/usr/local/bin:/usr/bin:/var/lib/snapd/snap/bin
SHELL=/bin/bash
SYSTEMD_EXEC_PID=8103
USER=aaron
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DISPLAY=:0
SWAYSOCK=/run/user/1000/sway-ipc.1000.1027.sock
WAYLAND_DISPLAY=wayland-1
XDG_CURRENT_DESKTOP=sway
MANAGERPID=1008
INVOCATION_ID=bca2078dc18a4ea885226a61872842ef
JOURNAL_STREAM=8:59206

❯ cat /proc/8103/environ | tr '\0' '\n' | grep '^XDG'
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
XDG_CURRENT_DESKTOP=sway
depate commented 2 years ago

Does this issue still exist for you?

I've experienced it a couple of days ago.

UltraBlackLinux commented 2 years ago

I'm currently experiencing this on firefox and brave. Very annoying.

I'm running wayfire on archlinux.

UltraBlackLinux commented 2 years ago

For anyone wondering: xdg-desktop-portal-wlr 0.6.0 doesn't work for me, while 0.5.0 works

fauust commented 2 years ago

Hi! I have just hit this too. I can't compile xdg-desktop-portal-wlr 0.6.0 on Debian 11 (too old mesa version if I understand correctly). So, I am using the 0.5.0 version. My screencast was broken not sure since when (I don't use it often).

My problem was described in the 6. of https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist:

< "/proc/$(pidof xdg-desktop-portal)/environ" tr '\0' '\n' | grep '^XDG_CURRENT_DESKTOP='

Was empty (but xdg-desktop-portal is running).

Here is how I solved it:

diff --git a/sway/config.d/50-systemd-user.conf b/sway/config.d/50-systemd-user.conf
index af204fb..575c3ee 100644
--- a/sway/config.d/50-systemd-user.conf
+++ b/sway/config.d/50-systemd-user.conf
@@ -6,4 +6,4 @@
 exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK

 exec hash dbus-update-activation-environment 2>/dev/null && \
-        dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
+  dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway

My ~/.config/sway/config file contains include /etc/sway/config.d/*.

purxiz commented 5 months ago

I received the same error when trying to screencast. I went through the entire troubleshooting guide with no issue.

GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.ScreenCast” on object at path /org/freedesktop/portal/desktop

I was able to solve the issue simply by sym linking the wlr.portal file to wherever gtk.portal was being found:

ln -s /usr/local/share/xdg-desktop-portal/portals/wlr.portal /usr/share/xdg-desktop-portal/portals/wlr.portal

So hopefully that's helpful information. It just seems like in this scenario, /usr/local/share isn't in the list of places xdg-desktop-portal checks for portals for whatever reason. I realized this when everything seemed to be working, but xdg-destop-portal --replace --verbose showed itself loading gtk.portal, but not wlr.portal.

This is relevant to xdg-desktop-portal 1.18.2 and xdg-desktop-portal-wlr 0.7.1