emersion / xdg-desktop-portal-wlr

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

I cannot get screen sharing to work with Sway, it's completely blank/black #239

Closed HenrikDK2 closed 1 year ago

HenrikDK2 commented 1 year ago

For the longest time I haven't been able to get this backend to work with Sway, I've tried various solutions by following the Troubleshooting Checklist, but no dice. I would appreciate it if I could get some help.

systemctl --user status pipewire pipewire.socket xdg-desktop-portal xdg-desktop-portal-wlr

● pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/usr/lib/systemd/user/pipewire.service; disabled; preset: enabled)
     Active: active (running) since Tue 2022-09-20 02:36:45 CEST; 19s ago
TriggeredBy: ● pipewire.socket
   Main PID: 1437 (pipewire)
      Tasks: 2 (limit: 38409)
     Memory: 7.0M
        CPU: 29ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service
             └─1437 /usr/bin/pipewire

sep 20 02:37:03 arch pipewire[1437]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:siz>
sep 20 02:37:03 arch pipewire[1437]: default:     Rectangle 5120x1440
sep 20 02:37:03 arch pipewire[1437]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:fra>
sep 20 02:37:03 arch pipewire[1437]: default:     Fraction 0/1
sep 20 02:37:03 arch pipewire[1437]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:max>
sep 20 02:37:03 arch pipewire[1437]: default:     Choice: type Spa:Enum:Choice:Range, flags 000>
sep 20 02:37:03 arch pipewire[1437]: default:       Fraction 119/1
sep 20 02:37:03 arch pipewire[1437]: default:       Fraction 1/1
sep 20 02:37:03 arch pipewire[1437]: default:       Fraction 119/1
sep 20 02:37:03 arch pipewire[1437]: pw.link: (77.0 -> 80.0) negotiating -> error (no more inpu>

● pipewire.socket - PipeWire Multimedia System Socket
     Loaded: loaded (/usr/lib/systemd/user/pipewire.socket; enabled; preset: enabled)
     Active: active (running) since Tue 2022-09-20 02:36:43 CEST; 22s ago
      Until: Tue 2022-09-20 02:36:43 CEST; 22s ago
   Triggers: ● pipewire.service
     Listen: /run/user/1000/pipewire-0 (Stream)
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/pipewire.socket

sep 20 02:36:43 arch systemd[597]: Listening on PipeWire Multimedia System Socket.

● xdg-desktop-portal.service - Portal service
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal.service; static)
     Active: active (running) since Tue 2022-09-20 02:36:45 CEST; 19s ago
   Main PID: 1395 (xdg-desktop-por)
      Tasks: 5 (limit: 38409)
     Memory: 4.5M
        CPU: 22ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal.ser>
             └─1395 /usr/lib/xdg-desktop-portal

sep 20 02:36:45 arch systemd[597]: Starting Portal service...
sep 20 02:36:45 arch xdg-desktop-por[1395]: No skeleton to export
sep 20 02:36:45 arch systemd[597]: Started Portal service.

● xdg-desktop-portal-wlr.service - Portal service (wlroots implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-wlr.service; static)

/usr/lib/xdg-desktop-portal -vr & /usr/lib/xdg-desktop-portal-wlr -l DEBUG 2>&1 | tee xdpw.log

XDP: load portals from /usr/share/xdg-desktop-portal/portals
2022/09/20 02:08:00 [DEBUG] - config: outputname:  (null)
2022/09/20 02:08:00 [DEBUG] - config: max_fps:  0.000000
2022/09/20 02:08:00 [DEBUG] - config: exec_before:  (null)
2022/09/20 02:08:00 [DEBUG] - config: exec_after:  (null)
2022/09/20 02:08:00 [DEBUG] - config: chooser_cmd: (null)
2022/09/20 02:08:00 [DEBUG] - config: chooser_type: default
2022/09/20 02:08:00 [DEBUG] - config: force_mod_linear: 0
2022/09/20 02:08:00 [DEBUG] - dbus: connected
2022/09/20 02:08:00 [DEBUG] - wlroots: wl_display connected
2022/09/20 02:08:00 [DEBUG] - pipewire: pw_loop created
2022/09/20 02:08:00 [DEBUG] - pipewire: establishing connection to core
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register wl_shm  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: |-- registered to interface wl_shm (Version 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register wl_drm  (Version: 2)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwp_linux_dmabuf_v1  (Version: 4)
2022/09/20 02:08:00 [DEBUG] - wlroots: |-- registered to interface zwp_linux_dmabuf_v1 (Version 4)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register wl_compositor  (Version: 4)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register wl_subcompositor  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register wl_data_device_manager  (Version: 3)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwlr_gamma_control_manager_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zxdg_output_manager_v1  (Version: 3)
2022/09/20 02:08:00 [DEBUG] - wlroots: |-- registered to interface zxdg_output_manager_v1 (Version 3)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register org_kde_kwin_idle  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwp_idle_inhibit_manager_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwlr_layer_shell_v1  (Version: 4)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register xdg_wm_base  (Version: 2)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwp_tablet_manager_v2  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register org_kde_kwin_server_decoration_manager  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zxdg_decoration_manager_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwp_relative_pointer_manager_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwp_pointer_constraints_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register wp_presentation  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwlr_output_manager_v1  (Version: 2)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwlr_output_power_manager_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwp_input_method_manager_v2  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwp_text_input_manager_v3  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwlr_foreign_toplevel_manager_v1  (Version: 3)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register wp_drm_lease_device_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwlr_export_dmabuf_manager_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwlr_screencopy_manager_v1  (Version: 3)
2022/09/20 02:08:00 [DEBUG] - wlroots: |-- registered to interface zwlr_screencopy_manager_v1 (Version 3)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwlr_data_control_manager_v1  (Version: 2)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwp_primary_selection_device_manager_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register wp_viewporter  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zxdg_exporter_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zxdg_importer_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zxdg_exporter_v2  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zxdg_importer_v2  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register xdg_activation_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwp_virtual_keyboard_manager_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwlr_virtual_pointer_manager_v1  (Version: 2)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwlr_input_inhibit_manager_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwp_keyboard_shortcuts_inhibit_manager_v1  (Version: 1)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register wl_seat  (Version: 7)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register zwp_pointer_gestures_v1  (Version: 3)
2022/09/20 02:08:00 [DEBUG] - wlroots: interface to register wl_output  (Version: 4)
2022/09/20 02:08:00 [DEBUG] - wlroots: |-- registered to interface wl_output (Version 1)
2022/09/20 02:08:00 [DEBUG] - wayland: registry listeners run
2022/09/20 02:08:00 [DEBUG] - wlroots: linux_dmabuf_feedback_handle_main_device called
2022/09/20 02:08:00 [INFO] - xdpw: Using render node /dev/dri/renderD128
XDP: loading /usr/share/xdg-desktop-portal/portals/wlr.portal
XDP: portal implementation for wlroots, sway, Wayfire, river, phosh
XDP: portal implementation supports org.freedesktop.impl.portal.Screenshot
XDP: portal implementation supports org.freedesktop.impl.portal.ScreenCast
XDP: loading /usr/share/xdg-desktop-portal/portals/gnome-keyring.portal
XDP: portal implementation for gnome
XDP: portal implementation supports org.freedesktop.impl.portal.Secret
XDP: providing portal org.freedesktop.portal.MemoryMonitor
XDP: providing portal org.freedesktop.portal.PowerProfileMonitor
XDP: providing portal org.freedesktop.portal.NetworkMonitor
XDP: providing portal org.freedesktop.portal.ProxyResolver
XDP: providing portal org.freedesktop.portal.Trash
XDP: providing portal org.freedesktop.portal.GameMode
XDP: providing portal org.freedesktop.portal.Realtime

(/usr/lib/xdg-desktop-portal:2668): xdg-desktop-portal-WARNING **: 02:08:00.615: No skeleton to export
XDP: Using wlr.portal for org.freedesktop.impl.portal.Screenshot in sway
XDP: Falling back to gnome-keyring.portal for org.freedesktop.impl.portal.Secret
XDP: providing portal org.freedesktop.portal.Secret
XDP: Using wlr.portal for org.freedesktop.impl.portal.ScreenCast in sway
XDP: providing portal org.freedesktop.portal.ScreenCast
XDP: org.freedesktop.portal.Desktop acquired
2022/09/20 02:08:00 [DEBUG] - wlroots: linux_dmabuf_feedback_format_table called
2022/09/20 02:08:00 [DEBUG] - wlroots: linux_dmabuf_feedback_tranche_target_devices called
2022/09/20 02:08:00 [DEBUG] - wlroots: linux_dmabuf_feedback_tranche_flags called
2022/09/20 02:08:00 [DEBUG] - wlroots: linux_dmabuf_feedback_tranche_formats called
2022/09/20 02:08:00 [DEBUG] - wlroots: linux_dmabuf_feedback_tranche_done called
2022/09/20 02:08:00 [DEBUG] - wlroots: linux_dmabuf_feedback_handle_done called
2022/09/20 02:08:00 [DEBUG] - wayland: xdg output listeners run
2022/09/20 02:08:00 [ERROR] - dbus: failed to acquire service name: File exists
'impl->enter_count > 0' failed at ../pipewire/spa/plugins/support/loop.c:346 loop_leave()
henrik@arch ~ (master)> XDP: screen cast session owned by ':1.28' created
XDP: screen cast session owned by ':1.28' started
XDP: screen cast session owned by ':1.28' closed

pw-dump | jq -r '[.[] | select(.info.props."node.name" | IN("firefox","gnome-shell","kwin_wayland","obs","xdg-desktop-portal-wlr","xdp-screencast.py")) | .id] as $pw_node_ids | [ .[] | select(.info.props."node.id" | IN($pw_node_ids[])) | .id ] as $pw_port_ids | .[] | select(.id | IN(($pw_node_ids + $pw_port_ids)[]))'

{
  "id": 88,
  "type": "PipeWire:Interface:Port",
  "version": 3,
  "permissions": [
    "r",
    "w",
    "x",
    "m"
  ],
  "info": {
    "direction": "input",
    "change-mask": [
      "props",
      "params"
    ],
    "props": {
      "port.id": 0,
      "port.direction": "in",
      "port.name": "in_0",
      "port.alias": "firefox:in_0",
      "node.id": 86,
      "object.id": 88,
      "object.serial": 104
    },
    "params": {
      "EnumFormat": [
        {
          "mediaType": "video",
          "mediaSubtype": "raw",
          "format": {
            "default": "BGRx",
            "alt1": "RGBx",
            "alt2": "RGBA",
            "alt3": "BGRx",
            "alt4": "BGRA"
          },
          "size": {
            "default": {
              "width": 1,
              "height": 1
            },
            "min": {
              "width": 1,
              "height": 1
            },
            "max": {
              "width": 4294967295,
              "height": 4294967295
            }
          }
        }
      ],
      "Meta": [
        {
          "type": "Busy",
          "size": 8
        }
      ],
      "IO": [
        {
          "id": "Buffers",
          "size": 8
        }
      ],
      "Format": [],
      "Buffers": [],
      "Latency": []
    }
  }
}
HenrikDK2 commented 1 year ago

Setting render_bit_depth to 10bit was the problem. I removed the line from my Sway config, and it resolved the issue.