hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
273 stars 47 forks source link

OBS window sharing not working #58

Closed Tony-Klink closed 1 year ago

Tony-Klink commented 1 year ago

First of all thank you for Hyprland!

I have an issue sharing windows in OBS. When I try to share window in OBS I get only black screen. The program logs error:

'loop->recurse > 0' failed at ../pipewire/src/pipewire/thread-loop.c:417 pw_thread_loop_wait()
info: [pipewire] Stream 0x564e0a695e10 state: "unconnected" (error: none)
info: PipeWire initialized
info: [pipewire] Screencast session created
info: [pipewire] Asking for desktop
info: [pipewire] desktop selected, setting up screencast
info: [pipewire] Server version: 0.3.70
info: [pipewire] Library version: 0.3.70
info: [pipewire] Header version: 0.3.70
info: [pipewire] Created stream 0x564e0a695e10
info: [pipewire] Stream 0x564e0a695e10 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x564e0a695e10
info: [pipewire] Stream 0x564e0a695e10 state: "paused" (error: none)
info: [pipewire] Stream 0x564e0a695e10 state: "error" (error: no more input formats)
error: [pipewire] Error id:2 seq:8 res:-32 (Unknown error -32): no more input formats

I killed killall xdg-desktop-portal xdg-desktop-portal-hyprland and started /usr/lib/xdg-desktop-portal-hyprland -l DEBUG I checked /usr/lib/xdg-desktop-portal-hyprland -l DEBUG:

2023/05/14 14:08:08 [DEBUG] - hyprland: toplevel handle created 55aab89a0000
2023/05/14 14:08:08 [DEBUG] - hyprland: toplevel app_id com.obsproject.Studio
2023/05/14 14:08:09 [INFO] - dbus: create session method invoked
2023/05/14 14:08:09 [INFO] - dbus: request_handle: /org/freedesktop/portal/desktop/request/1_90/obs13
2023/05/14 14:08:09 [INFO] - dbus: session_handle: /org/freedesktop/portal/desktop/session/1_90/obs5
2023/05/14 14:08:09 [INFO] - dbus: app_id: 
2023/05/14 14:08:09 [INFO] - dbus: select sources method invoked
2023/05/14 14:08:09 [INFO] - dbus: request_handle: /org/freedesktop/portal/desktop/request/1_90/obs14
2023/05/14 14:08:09 [INFO] - dbus: session_handle: /org/freedesktop/portal/desktop/session/1_90/obs5
2023/05/14 14:08:09 [INFO] - dbus: app_id: 
2023/05/14 14:08:09 [INFO] - dbus: option types:1
2023/05/14 14:08:09 [INFO] - dbus: option multiple: 0
2023/05/14 14:08:09 [INFO] - dbus: option cursor_mode:2
2023/05/14 14:08:09 [INFO] - dbus: persist 2
2023/05/14 14:08:09 [DEBUG] - dbus: select sources: found matching session /org/freedesktop/portal/desktop/session/1_90/obs5
2023/05/14 14:08:09 [INFO] - wlroots: capturable output: DZX model: Z1: id: 50 name: HDMI-A-1
2023/05/14 14:08:09 [DEBUG] - Screencast: Picker: Running command "WAYLAND_DISPLAY=wayland-1 QT_QPA_PLATFORM="wayland" XCURSOR_SIZE=24 HYPRLAND_INSTANCE_SIGNATURE=f27873a6f06dc2f87600edb890f3c38298bfb55f_1684083312 XDPH_WINDOW_SHARING_LIST="3097100288[HC>]com.obsproject.Studio[HT>]Properties for  Screen Capture (PipeWire) [HE>]3095601824[HC>]LibreWolf[HT>]New Issue · hyprwm/xdg-desktop-portal-hyprland — LibreWolf[HE>]3095601392[HC>]foot[HT>]obs[HE>]3095601040[HC>]com.obsproject.Studio[HT>]OBS 29.1.1-1 - Profile: Untitled - Scenes: Untitled[HE>]3095600688[HC>]foot[HT>]/usr/lib/xdg-desktop-portal[HE>]3095600336[HC>]foot[HT>]/usr/lib/xdg-desktop-portal-hyprland[HE>]" hyprland-share-picker"
2023/05/14 14:08:15 [DEBUG] - Screencast: Attempting to find window for window:-1199365472

2023/05/14 14:08:15 [INFO] - xdpw: screencast instance 0x55aab89a2180 has 1 references
2023/05/14 14:08:15 [INFO] - xdpw: 2 active screencast instances
2023/05/14 14:08:15 [INFO] - hyprland: window handle -1199365472
2023/05/14 14:08:15 [INFO] - dbus: session closed
2023/05/14 14:08:15 [DEBUG] - dbus: destroying session 0x55aab8998500
2023/05/14 14:08:15 [DEBUG] - xdpw: screencast instance 0x55aab899b0f0 now has 0 references
2023/05/14 14:08:15 [DEBUG] - xdpw: destroying cast instance
2023/05/14 14:08:15 [DEBUG] - pipewire: destroying stream
2023/05/14 14:08:15 [INFO] - pipewire: stream state changed to "unconnected"
2023/05/14 14:08:15 [INFO] - pipewire: node id is -1
2023/05/14 14:08:15 [DEBUG] - hyprland: toplevel handle created 55aab8999d50
2023/05/14 14:08:15 [DEBUG] - hyprland: toplevel app_id hyprland-share-picker
2023/05/14 14:08:15 [DEBUG] - hyprland: toplevel closed hyprland-share-picker
2023/05/14 14:08:15 [INFO] - dbus: start method invoked
2023/05/14 14:08:15 [INFO] - dbus: request_handle: /org/freedesktop/portal/desktop/request/1_90/obs15
2023/05/14 14:08:15 [INFO] - dbus: session_handle: /org/freedesktop/portal/desktop/session/1_90/obs5
2023/05/14 14:08:15 [INFO] - dbus: app_id: 
2023/05/14 14:08:15 [INFO] - dbus: parent_window: 
2023/05/14 14:08:15 [DEBUG] - dbus: start: found matching session /org/freedesktop/portal/desktop/session/1_90/obs5
2023/05/14 14:08:15 [INFO] - wlroots: no modifiers available for format 0
2023/05/14 14:08:15 [INFO] - pipewire: stream state changed to "connecting"
2023/05/14 14:08:15 [INFO] - pipewire: node id is -1
2023/05/14 14:08:15 [INFO] - pipewire: stream state changed to "paused"
2023/05/14 14:08:15 [INFO] - pipewire: node id is 66
2023/05/14 14:08:15 [INFO] - xdph: registered restoreToken with token E2CA1774-21B3-4663-B49E-6E1BF34ADDC1
2023/05/14 14:08:15 [DEBUG] - dbus: start: returning node 66
2023/05/14 14:08:15 [INFO] - pipewire: stream state changed to "error"
2023/05/14 14:08:15 [INFO] - pipewire: node id is 66
2023/05/14 14:08:16 [DEBUG] - hyprland: toplevel closed com.obsproject.Studio

systemctl --user status xdg-desktop-portal-hyprland logs:

● xdg-desktop-portal-hyprland.service - Portal service (Hyprland implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-hyprland.service; static)
     Active: active (running) since Sun 2023-05-14 14:11:24 CST; 1min 3s ago
   Main PID: 19905 (xdg-desktop-por)
      Tasks: 6 (limit: 76108)
     Memory: 12.7M
        CPU: 374ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal-hyprland.service
             └─19905 /usr/lib/xdg-desktop-portal-hyprland

May 14 14:11:24 archlinuxtower systemd[838]: Starting Portal service (Hyprland implementation)...
May 14 14:11:24 archlinuxtower systemd[838]: Started Portal service (Hyprland implementation).

systemctl --user status wireplumber logs:

● wireplumber.service - Multimedia Service Session Manager
     Loaded: loaded (/usr/lib/systemd/user/wireplumber.service; enabled; preset: enabled)
     Active: active (running) since Sun 2023-05-14 10:55:12 CST; 3h 15min ago
   Main PID: 1296 (wireplumber)
      Tasks: 6 (limit: 76108)
     Memory: 38.7M
        CPU: 281ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/wireplumber.service
             └─1296 /usr/bin/wireplumber

May 14 13:50:06 archlinuxtower wireplumber[1296]: <WpPortalPermissionStorePlugin:0x5645dfb8c7d0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
May 14 13:50:12 archlinuxtower wireplumber[1296]: <WpPortalPermissionStorePlugin:0x5645dfb8c7d0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
May 14 13:50:20 archlinuxtower wireplumber[1296]: <WpPortalPermissionStorePlugin:0x5645dfb8c7d0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
May 14 13:50:24 archlinuxtower wireplumber[1296]: <WpPortalPermissionStorePlugin:0x5645dfb8c7d0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
May 14 13:50:35 archlinuxtower wireplumber[1296]: <WpPortalPermissionStorePlugin:0x5645dfb8c7d0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
May 14 13:50:47 archlinuxtower wireplumber[1296]: <WpPortalPermissionStorePlugin:0x5645dfb8c7d0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
May 14 13:51:48 archlinuxtower wireplumber[1296]: <WpPortalPermissionStorePlugin:0x5645dfb8c7d0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
May 14 13:52:12 archlinuxtower wireplumber[1296]: <WpPortalPermissionStorePlugin:0x5645dfb8c7d0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
May 14 14:02:26 archlinuxtower wireplumber[1296]: <WpPortalPermissionStorePlugin:0x5645dfb8c7d0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
May 14 14:08:15 archlinuxtower wireplumber[1296]: <WpPortalPermissionStorePlugin:0x5645dfb8c7d0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
vaxerski commented 1 year ago

nvidia? 10 bit? does monitor share work? I need more info.

Tony-Klink commented 1 year ago

Thank you for reply.

Whole screen share is working.

GPU: AMD 7900xtx CPU: Ryzen 7950X3D

pipewire 1:0.3.70-2 wireplumber 0.4.14-1 xdg-desktop-portal 1.16.0-3 xdg-desktop-portal-hyprland 0.3.1-1

I didn't set up 10 bit channels for display.

gyaru commented 1 year ago

same setup (7900 xtx/7950x3d), same issue (screen/monitor sharing works but window is just black)

hyprland-git r2914.79b8576d-1
xdg-desktop-portal 1.16.0-3
xdg-desktop-portal-hyprland-git 1:r283.4f0c575-1
wireplumber 0.4.14-1
pipewire 1:0.3.70-2

hypr monitor config (because i read in another issue that forcing 8bit might make it work but it did not)

monitor = DP-1, 3440x1440@160, 1440x0, 1, bitdepth, 8

i've tried 60hz etc too, no difference

pipewire negotiation errors

May 19 17:28:55 mogu wireplumber[20477]: <WpPortalPermissionStorePlugin:0x5639dda69fc0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
May 19 17:28:55 mogu pipewire[20476]: pw.context: params Spa:Enum:ParamId:EnumFormat: 0:0 Invalid argument (input format (no more input formats))
May 19 17:28:55 mogu pipewire[20476]: pw.context: Object: size 376, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 2        (Spa:Enum:MediaType:video)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 1        (Spa:Enum:MediaSubtype:raw)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 12       (Spa:Enum:VideoFormat:BGRA)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:modifier (131074), flags 00000018
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Enum, flags 00000000 112 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757872388
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757872388
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757856004
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757659396
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757438212
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757871364
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757854980
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757658372
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757437188
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188075858436
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 0
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 72057594037927935
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle 1x1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle 1x1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle -1x-1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:framerate (131076), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:maxFramerate (131077), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context: Object: size 248, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 2        (Spa:Enum:MediaType:video)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 1        (Spa:Enum:MediaSubtype:raw)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 12       (Spa:Enum:VideoFormat:BGRA)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle 1x1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle 1x1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle -1x-1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:framerate (131076), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:maxFramerate (131077), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context: Object: size 376, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 2        (Spa:Enum:MediaType:video)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 1        (Spa:Enum:MediaSubtype:raw)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 11       (Spa:Enum:VideoFormat:RGBA)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:modifier (131074), flags 00000018
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Enum, flags 00000000 112 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757872388
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757872388
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757856004
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757659396
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757438212
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757871364
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757854980
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757658372
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757437188
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188075858436
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 0
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 72057594037927935
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle 1x1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle 1x1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle -1x-1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:framerate (131076), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:maxFramerate (131077), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context: Object: size 248, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 2        (Spa:Enum:MediaType:video)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 1        (Spa:Enum:MediaSubtype:raw)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 11       (Spa:Enum:VideoFormat:RGBA)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle 1x1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle 1x1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle -1x-1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:framerate (131076), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:maxFramerate (131077), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context: Object: size 376, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 2        (Spa:Enum:MediaType:video)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 1        (Spa:Enum:MediaSubtype:raw)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 8        (Spa:Enum:VideoFormat:BGRx)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:modifier (131074), flags 00000018
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Enum, flags 00000000 112 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757872388
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757872388
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757856004
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757659396
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757438212
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757871364
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757854980
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757658372
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188757437188
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 144115188075858436
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 0
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Long 72057594037927935
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle 1x1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle 1x1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle -1x-1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:framerate (131076), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:maxFramerate (131077), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context: Object: size 248, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 2        (Spa:Enum:MediaType:video)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 1        (Spa:Enum:MediaSubtype:raw)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle 1x1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle 1x1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Rectangle -1x-1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:framerate (131076), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:maxFramerate (131077), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context: params Spa:Enum:ParamId:EnumFormat: 1:0 Invalid argument (output format (no more input formats))
May 19 17:28:55 mogu pipewire[20476]: pw.context: Object: size 184, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 2        (Spa:Enum:MediaType:video)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 1        (Spa:Enum:MediaSubtype:raw)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Id 7        (Spa:Enum:VideoFormat:RGBx)
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Rectangle 1920x1080
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:framerate (131076), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Fraction 0/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:   Prop: key Spa:Pod:Object:Param:Format:Video:maxFramerate (131077), flags 00000000
May 19 17:28:55 mogu pipewire[20476]: pw.context:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 1/1
May 19 17:28:55 mogu pipewire[20476]: pw.context:       Fraction 60/1
May 19 17:28:55 mogu pipewire[20476]: pw.link: (95.0 -> 62.0) negotiating -> error (no more input formats)
Tony-Klink commented 1 year ago

I see hyprland: window handle -1199365472. Can window handle be a negative number?

Bryan2333 commented 1 year ago

I meet the same problem. OBS window sharing works for the first time I setup the OBS. However after I close OBS and launch again, I get black screen. I' am using AMD iGPU. There is also a coredump file created.

vaxerski commented 1 year ago

I see hyprland: window handle -1199365472. Can window handle be a negative number?

it's just an incorrect type in the log, don't worry

vaxerski commented 1 year ago

There is also a coredump file created.

attach the stacktrace

Bryan2333 commented 1 year ago

There is also a coredump file created.

attach the stacktrace

Here is the stacktrace of the coredump file.

Stack trace of thread 1493:
                #0  0x00007f86b1624b5f wl_list_remove (libwayland-client.so.0 + 0x7b5f)
                #1  0x000055fec1e2a42a n/a (xdg-desktop-portal-hyprland + 0xf42a)
                #2  0x00007f86b156ce2d n/a (libsystemd.so.0 + 0x32e2d)
                #3  0x00007f86b15832be n/a (libsystemd.so.0 + 0x492be)
                #4  0x000055fec1e21c71 n/a (xdg-desktop-portal-hyprland + 0x6c71)
                #5  0x00007f86b125d850 n/a (libc.so.6 + 0x23850)
                #6  0x00007f86b125d90a __libc_start_main (libc.so.6 + 0x2390a)
                #7  0x000055fec1e22265 n/a (xdg-desktop-portal-hyprland + 0x7265)

                Stack trace of thread 1498:
                #0  0x00007f86b12bdf0e n/a (libc.so.6 + 0x83f0e)
                #1  0x00007f86b12c07a0 pthread_cond_wait (libc.so.6 + 0x867a0)
                #2  0x00007f86ae4c854c n/a (radeonsi_dri.so + 0xc854c)
                #3  0x00007f86ae51540c n/a (radeonsi_dri.so + 0x11540c)
                #4  0x00007f86b12c144b n/a (libc.so.6 + 0x8744b)
                #5  0x00007f86b1344e40 n/a (libc.so.6 + 0x10ae40)

                Stack trace of thread 1495:
                #0  0x00007f86b1345266 epoll_wait (libc.so.6 + 0x10b266)
                #1  0x00007f86b1646c39 n/a (libspa-support.so + 0x15c39)
                #2  0x00007f86b16394fd n/a (libspa-support.so + 0x84fd)
                #3  0x00007f86b149f6b2 n/a (libpipewire-0.3.so.0 + 0x446b2)
                #4  0x00007f86b12c144b n/a (libc.so.6 + 0x8744b)
                #5  0x00007f86b1344e40 n/a (libc.so.6 + 0x10ae40)

                Stack trace of thread 1496:
                #0  0x00007f86b12bdf0e n/a (libc.so.6 + 0x83f0e)
                #1  0x00007f86b12c07a0 pthread_cond_wait (libc.so.6 + 0x867a0)
                #2  0x00007f86ae4c854c n/a (radeonsi_dri.so + 0xc854c)
                #3  0x00007f86ae51540c n/a (radeonsi_dri.so + 0x11540c)
                #4  0x00007f86b12c144b n/a (libc.so.6 + 0x8744b)
                #5  0x00007f86b1344e40 n/a (libc.so.6 + 0x10ae40)

                Stack trace of thread 1497:
                #0  0x00007f86b12bdf0e n/a (libc.so.6 + 0x83f0e)
                #1  0x00007f86b12c07a0 pthread_cond_wait (libc.so.6 + 0x867a0)
                #2  0x00007f86ae4c854c n/a (radeonsi_dri.so + 0xc854c)
                #3  0x00007f86ae51540c n/a (radeonsi_dri.so + 0x11540c)
                #4  0x00007f86b12c144b n/a (libc.so.6 + 0x8744b)
                #5  0x00007f86b1344e40 n/a (libc.so.6 + 0x10ae40)

                Stack trace of thread 1499:
                #0  0x00007f86b12bdf0e n/a (libc.so.6 + 0x83f0e)
                #1  0x00007f86b12c07a0 pthread_cond_wait (libc.so.6 + 0x867a0)
                #2  0x00007f86ae4c854c n/a (radeonsi_dri.so + 0xc854c)
                #3  0x00007f86ae51540c n/a (radeonsi_dri.so + 0x11540c)
                #4  0x00007f86b12c144b n/a (libc.so.6 + 0x8744b)
                #5  0x00007f86b1344e40 n/a (libc.so.6 + 0x10ae40)
                ELF object binary architecture: AMD x86-64
ThomChroma commented 1 year ago

The problem is gone because you don't use XDPH with Gnome, so why close this issue? You're not alone, think about the others please ❤️

Same here, screen sharing works but window and region are just black screens.

hyprland 0.25.0
xdg-desktop-portal 1.16.0
xdg-desktop-portal-hyprland 0.3.1
pipewire 0.3.71
wireplumber 0.4.14
obs-studio 29.1.2

AMD Radeon RX 580. Monitor set to 8 bit and 10 bit, same result.

When launching XDPH with /usr/lib/xdg-desktop-portal-hyprland -l DEBUG and picking a window in OBS, XDPH crashes (region doesn't but it's black). Stack trace:

Stack trace of thread 14416:
#0  0x00005616f1656f80 n/a (xdg-desktop-portal-hyprland + 0x12f80)
#1  0x00005616f1657708 n/a (xdg-desktop-portal-hyprland + 0x13708)
#2  0x00007f6bc1dda8d2 n/a (libffi.so.8 + 0x78d2)
#3  0x00007f6bc1dd724f n/a (libffi.so.8 + 0x424f)
#4  0x00007f6bc1dd9e96 ffi_call (libffi.so.8 + 0x6e96)
#5  0x00007f6bc21dca23 n/a (libwayland-client.so.0 + 0x7a23)
#6  0x00007f6bc21dd203 n/a (libwayland-client.so.0 + 0x8203)
#7  0x00007f6bc21dd494 wl_display_dispatch_queue_pending (libwayland-client.so.0 + 0x8494)
#8  0x00005616f164b388 n/a (xdg-desktop-portal-hyprland + 0x7388)
#9  0x00007f6bc1e05bb0 __libc_start_call_main (libc.so.6 + 0x27bb0)
#10 0x00007f6bc1e05c79 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x27c79)
#11 0x00005616f164bad5 n/a (xdg-desktop-portal-hyprland + 0x7ad5)

Stack trace of thread 14417:
#0  0x00007f6bc1ef2fd6 epoll_wait (libc.so.6 + 0x114fd6)
#1  0x00007f6bc1a3a8b4 n/a (libspa-support.so + 0x158b4)
#2  0x00007f6bc1a2d4bd n/a (libspa-support.so + 0x84bd)
#3  0x00007f6bc2063a24 n/a (libpipewire-0.3.so.0 + 0x46a24)
#4  0x00007f6bc1e6bab4 start_thread (libc.so.6 + 0x8dab4)
#5  0x00007f6bc1ef2b60 __clone3 (libc.so.6 + 0x114b60)

Stack trace of thread 14418:
#0  0x00007f6bc1e6805e __futex_abstimed_wait_common (libc.so.6 + 0x8a05e)
#1  0x00007f6bc1e6ada0 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8cda0)
#2  0x00007f6bbf0c7bfb n/a (radeonsi_dri.so + 0xc7bfb)
#3  0x00007f6bbf10eb37 n/a (radeonsi_dri.so + 0x10eb37)
#4  0x00007f6bc1e6bab4 start_thread (libc.so.6 + 0x8dab4)
#5  0x00007f6bc1ef2b60 __clone3 (libc.so.6 + 0x114b60)

Stack trace of thread 14419:
#0  0x00007f6bc1e6805e __futex_abstimed_wait_common (libc.so.6 + 0x8a05e)
#1  0x00007f6bc1e6ada0 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8cda0)
#2  0x00007f6bbf0c7bfb n/a (radeonsi_dri.so + 0xc7bfb)
#3  0x00007f6bbf10eb37 n/a (radeonsi_dri.so + 0x10eb37)
#4  0x00007f6bc1e6bab4 start_thread (libc.so.6 + 0x8dab4)
#5  0x00007f6bc1ef2b60 __clone3 (libc.so.6 + 0x114b60)

Stack trace of thread 14421:
#0  0x00007f6bc1e6805e __futex_abstimed_wait_common (libc.so.6 + 0x8a05e)
#1  0x00007f6bc1e6ada0 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8cda0)
#2  0x00007f6bbf0c7bfb n/a (radeonsi_dri.so + 0xc7bfb)
#3  0x00007f6bbf10eb37 n/a (radeonsi_dri.so + 0x10eb37)
#4  0x00007f6bc1e6bab4 start_thread (libc.so.6 + 0x8dab4)
#5  0x00007f6bc1ef2b60 __clone3 (libc.so.6 + 0x114b60)

Stack trace of thread 14420:
#0  0x00007f6bc1e6805e __futex_abstimed_wait_common (libc.so.6 + 0x8a05e)
#1  0x00007f6bc1e6ada0 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8cda0)
#2  0x00007f6bbf0c7bfb n/a (radeonsi_dri.so + 0xc7bfb)
#3  0x00007f6bbf10eb37 n/a (radeonsi_dri.so + 0x10eb37)
#4  0x00007f6bc1e6bab4 start_thread (libc.so.6 + 0x8dab4)
#5  0x00007f6bc1ef2b60 __clone3 (libc.so.6 + 0x114b60)
ELF object binary architecture: AMD x86-64

I also noticed in the OBS Studio log that for screen and region, the pipewire negotiated format was Format: 8 (Spa:Enum:VideoFormat:BGRx) but for window it's Format: 7 (Spa:Enum:VideoFormat:RGBx). I don't know if it helps…

uncomfyhalomacro commented 1 year ago

I didn't notice this issue until now.

aryklein commented 1 year ago

I have the same issue. Downgrading obs-studio from 29.1.1-2 to 29.0.2-6, solved the problem.

ThomChroma commented 1 year ago

Hmm so maybe it's this change? "Fixed transparent windows capturing incorrectly on Wayland using PipeWire" https://github.com/obsproject/obs-studio/commit/584de6b2646320ea46b600b56b01965a87136810

Edit: OBS actually does get the window, I can see its shape with the rounded corners, but the border itself and the inside are black.

uncomfyhalomacro commented 1 year ago

I have the same issue. Downgrading obs-studio from 29.1.1-2 to 29.0.2-6, solved the problem.

should we open a separate issue then to OBS studio?

gyaru commented 1 year ago

downgrading OBS does not fix anything for me fyi, still negotiation errors.

G3ordan1 commented 1 year ago

I have the same issue. Downgrading obs-studio from 29.1.1-2 to 29.0.2-6, solved the problem.

Thanks, this worked for me.

xbb commented 1 year ago

I have the same issue. Downgrading obs-studio from 29.1.1-2 to 29.0.2-6, solved the problem.

Thanks, this worked for me.

Same here

Hyprland 0.26 (NVIDIA with patch) xdg-desktop-portal-hyprland 0.4.0 xdg-desktop-portal 1.16.0 pipewire 0.3.71

Error output after window selection:

info: [pipewire] Screencast session created
debug: [pipewire] Response to select source received
info: [pipewire] Asking for desktop
info: [pipewire] desktop selected, setting up screencast
info: [pipewire] Server version: 0.3.71
info: [pipewire] Library version: 0.3.65
info: [pipewire] Header version: 0.3.65
debug: [pipewire] registered event 0x564dfdf4e460
info: [pipewire] Created stream 0x564dfdf65c20
info: [pipewire] Stream 0x564dfdf65c20 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x564dfdf65c20
info: [pipewire] Stream 0x564dfdf65c20 state: "paused" (error: none)
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 8 (Spa:Enum:VideoFormat:BGRx)
info: [pipewire]     Size: 1297x1384
info: [pipewire]     Framerate: 0/1
info: [pipewire] Stream 0x564dfdf65c20 state: "streaming" (error: none)
info: [pipewire] Stream 0x564dfdf65c20 state: "paused" (error: none)
info: [pipewire] Stream 0x564dfdf65c20 state: "error" (error: no more input formats)
error: [pipewire] Error id:2 seq:16 res:-32 (Unknown error -32): no more input formats

I traced down the issue affecting the window selection to this change: https://github.com/obsproject/obs-studio/commit/8abc3528cf6d371184a0499cb4669afb019251ae

Removing this code makes the window selection working again, I have no idea why though

#if PW_CHECK_VERSION(0, 3, 62)
    if (check_pw_version(&obs_pw->server_version, 0, 3, 62)) {
        /* Video transformation */
        params[n_params++] = spa_pod_builder_add_object(
            &pod_builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
            SPA_PARAM_META_type,
            SPA_POD_Id(SPA_META_VideoTransform),
            SPA_PARAM_META_size,
            SPA_POD_Int(sizeof(struct spa_meta_videotransform)));
    }
#endif

Lines 766-776 https://github.com/obsproject/obs-studio/blob/8abc3528cf6d371184a0499cb4669afb019251ae/plugins/linux-pipewire/pipewire.c#L766-L776

Lines 849-859 (OBS 29.1.2) https://github.com/obsproject/obs-studio/blob/e15a92e16fc3827027a956f6d6a1223b41aced61/plugins/linux-pipewire/pipewire.c#L849-L859

0x08088405 commented 1 year ago

Can confirm that downgrading to OBS 29.0 fixes the issue.

pipewire 0.3.70 wireplumber 0.4.14 hyprland 0.26.0 xdph 0.4.0 xdp 1.16.0

mesa 23.0.3 on Intel HD 4000

Gustash commented 1 year ago

I've got the same issue on my end. Monitor capture works fine, but window capture always crashes XDPH, even in Webcord.

This is the debug output of XDPH:

2023/06/18 18:27:53 [INFO] - config: no config file found, using the default config
2023/06/18 18:27:53 [DEBUG] - config: outputname:  (null)
2023/06/18 18:27:53 [DEBUG] - config: max_fps:  0.000000
2023/06/18 18:27:53 [DEBUG] - config: exec_before:  (null)
2023/06/18 18:27:53 [DEBUG] - config: exec_after:  (null)
2023/06/18 18:27:53 [DEBUG] - config: chooser_cmd: (null)
2023/06/18 18:27:53 [DEBUG] - config: chooser_type: default
2023/06/18 18:27:53 [DEBUG] - config: force_mod_linear: 0
2023/06/18 18:27:53 [DEBUG] - dbus: connected
2023/06/18 18:27:53 [DEBUG] - wlroots: wl_display connected
2023/06/18 18:27:54 [DEBUG] - pipewire: pw_loop created
2023/06/18 18:27:54 [DEBUG] - hyprland: |-- registered to interface hyprland_global_shortcuts_manager_v1 (Version 1)
2023/06/18 18:27:54 [DEBUG] - dbus: gs: ret bind 0
2023/06/18 18:27:54 [DEBUG] - pipewire: establishing connection to core
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wl_shm  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: |-- registered to interface wl_shm (Version 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wl_drm  (Version: 2)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwp_linux_dmabuf_v1  (Version: 4)
2023/06/18 18:27:54 [DEBUG] - wlroots: |-- registered to interface zwp_linux_dmabuf_v1 (Version 4)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wl_compositor  (Version: 6)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wl_subcompositor  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wl_data_device_manager  (Version: 3)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwlr_export_dmabuf_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwlr_data_control_manager_v1  (Version: 2)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwp_primary_selection_device_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wp_viewporter  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwlr_gamma_control_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwlr_output_power_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register xdg_wm_base  (Version: 5)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wl_seat  (Version: 8)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wp_presentation  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register org_kde_kwin_idle  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwlr_layer_shell_v1  (Version: 4)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register org_kde_kwin_server_decoration_manager  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zxdg_decoration_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zxdg_output_manager_v1  (Version: 3)
2023/06/18 18:27:54 [DEBUG] - wlroots: |-- registered to interface zxdg_output_manager_v1 (Version 3)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwlr_output_manager_v1  (Version: 4)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwlr_input_inhibit_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwp_keyboard_shortcuts_inhibit_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zext_workspace_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwp_pointer_constraints_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwp_relative_pointer_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwp_virtual_keyboard_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwlr_virtual_pointer_manager_v1  (Version: 2)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwlr_foreign_toplevel_manager_v1  (Version: 3)
2023/06/18 18:27:54 [DEBUG] - hyprland: |-- registered to interface zwlr_foreign_toplevel_manager_v1 (Version 3)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wp_drm_lease_device_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwp_tablet_manager_v2  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwp_idle_inhibit_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zxdg_exporter_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zxdg_importer_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zxdg_exporter_v2  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zxdg_importer_v2  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwp_pointer_gestures_v1  (Version: 3)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwp_text_input_manager_v3  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwp_input_method_manager_v2  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register xdg_activation_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register ext_session_lock_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wp_single_pixel_buffer_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register xwayland_shell_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register hyprland_toplevel_export_manager_v1  (Version: 2)
2023/06/18 18:27:54 [DEBUG] - hyprland: |-- registered to interface hyprland_toplevel_export_manager_v1 (Version 2)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wp_fractional_scale_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwp_text_input_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register hyprland_global_shortcuts_manager_v1  (Version: 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register zwlr_screencopy_manager_v1  (Version: 3)
2023/06/18 18:27:54 [DEBUG] - wlroots: |-- registered to interface zwlr_screencopy_manager_v1 (Version 3)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wl_output  (Version: 4)
2023/06/18 18:27:54 [DEBUG] - wlroots: |-- registered to interface wl_output (Version 1)
2023/06/18 18:27:54 [DEBUG] - wlroots: interface to register wl_output  (Version: 4)
2023/06/18 18:27:54 [DEBUG] - wlroots: |-- registered to interface wl_output (Version 1)
2023/06/18 18:27:54 [DEBUG] - wayland: registry listeners run
2023/06/18 18:27:54 [DEBUG] - wlroots: linux_dmabuf_feedback_handle_main_device called
2023/06/18 18:27:54 [INFO] - xdpw: Using render node /dev/dri/renderD128
2023/06/18 18:27:54 [DEBUG] - wlroots: linux_dmabuf_feedback_format_table called
2023/06/18 18:27:54 [DEBUG] - wlroots: linux_dmabuf_feedback_tranche_target_devices called
2023/06/18 18:27:54 [DEBUG] - wlroots: linux_dmabuf_feedback_tranche_flags called
2023/06/18 18:27:54 [DEBUG] - wlroots: linux_dmabuf_feedback_tranche_formats called
2023/06/18 18:27:54 [DEBUG] - wlroots: linux_dmabuf_feedback_tranche_done called
2023/06/18 18:27:54 [DEBUG] - wlroots: linux_dmabuf_feedback_handle_done called
2023/06/18 18:27:54 [DEBUG] - hyprland: toplevel handle created 561a4908a7b0
2023/06/18 18:27:54 [DEBUG] - hyprland: toplevel app_id kitty
2023/06/18 18:27:54 [INFO] - Output 561a49087bd0 name: DP-1
2023/06/18 18:27:54 [INFO] - Output 561a49088d10 name: DP-2
2023/06/18 18:27:54 [DEBUG] - wayland: xdg output listeners run
2023/06/18 18:27:54 [DEBUG] - hyprland: toplevel handle created 561a491f54b0
2023/06/18 18:27:54 [DEBUG] - hyprland: toplevel app_id kitty
2023/06/18 18:28:01 [INFO] - dbus: create session method invoked
2023/06/18 18:28:01 [INFO] - dbus: request_handle: /org/freedesktop/portal/desktop/request/1_105/obs1
2023/06/18 18:28:01 [INFO] - dbus: session_handle: /org/freedesktop/portal/desktop/session/1_105/obs1
2023/06/18 18:28:01 [INFO] - dbus: app_id: com.obsproject.Studio
2023/06/18 18:28:01 [INFO] - dbus: select sources method invoked
2023/06/18 18:28:01 [INFO] - dbus: request_handle: /org/freedesktop/portal/desktop/request/1_105/obs2
2023/06/18 18:28:01 [INFO] - dbus: session_handle: /org/freedesktop/portal/desktop/session/1_105/obs1
2023/06/18 18:28:01 [INFO] - dbus: app_id: com.obsproject.Studio
2023/06/18 18:28:01 [INFO] - dbus: option types:1
2023/06/18 18:28:01 [INFO] - dbus: option multiple: 0
2023/06/18 18:28:01 [INFO] - dbus: option cursor_mode:2
2023/06/18 18:28:01 [INFO] - dbus: persist 2
2023/06/18 18:28:01 [DEBUG] - dbus: select sources: found matching session /org/freedesktop/portal/desktop/session/1_105/obs1
2023/06/18 18:28:01 [INFO] - wlroots: capturable output: AOC model: 24G2W1G4: id: 49 name: DP-1
2023/06/18 18:28:01 [INFO] - wlroots: capturable output: LG Electronics model: LG FHD: id: 50 name: DP-2
2023/06/18 18:28:01 [DEBUG] - Screencast: Picker: Running command "WAYLAND_DISPLAY=wayland-1 QT_QPA_PLATFORM="wayland" XCURSOR_SIZE=24 HYPRLAND_INSTANCE_SIGNATURE=2295bbdd80b48f580977fc80e9643841fbc9a496_1687109250 XDPH_WINDOW_SHARING_LIST="1226790064[HC>]kitty[HT>]~[HE>]1225303984[HC>]kitty[HT>]/usr/lib/xdg-desktop ~[HE>]" hyprland-share-picker"
2023/06/18 18:28:04 [DEBUG] - Screencast: Attempting to find window for window:1225303984

2023/06/18 18:28:04 [INFO] - xdpw: screencast instance 0x561a491f82a0 has 1 references
2023/06/18 18:28:04 [INFO] - xdpw: 1 active screencast instances
2023/06/18 18:28:04 [INFO] - hyprland: window handle 1225303984
2023/06/18 18:28:04 [DEBUG] - hyprland: toplevel handle created 561a491f6f20
2023/06/18 18:28:04 [DEBUG] - hyprland: toplevel app_id com.obsproject.Studio
2023/06/18 18:28:04 [DEBUG] - hyprland: toplevel handle created 561a491f6f90
2023/06/18 18:28:04 [DEBUG] - hyprland: toplevel app_id hyprland-share-picker
2023/06/18 18:28:04 [DEBUG] - hyprland: toplevel closed hyprland-share-picker
2023/06/18 18:28:04 [INFO] - dbus: start method invoked
2023/06/18 18:28:04 [INFO] - dbus: request_handle: /org/freedesktop/portal/desktop/request/1_105/obs3
2023/06/18 18:28:04 [INFO] - dbus: session_handle: /org/freedesktop/portal/desktop/session/1_105/obs1
2023/06/18 18:28:04 [INFO] - dbus: app_id: com.obsproject.Studio
2023/06/18 18:28:04 [INFO] - dbus: parent_window: 
2023/06/18 18:28:04 [DEBUG] - dbus: start: found matching session /org/freedesktop/portal/desktop/session/1_105/obs1
2023/06/18 18:28:04 [INFO] - wlroots: no modifiers available for format 0
2023/06/18 18:28:04 [INFO] - pipewire: stream state changed to "connecting"
2023/06/18 18:28:04 [INFO] - pipewire: node id is -1
2023/06/18 18:28:04 [INFO] - pipewire: stream state changed to "paused"
2023/06/18 18:28:04 [INFO] - pipewire: node id is 61
2023/06/18 18:28:04 [INFO] - xdph: registered restoreToken with token 3698140A-6328-4A0E-B15C-C27D5D873852
2023/06/18 18:28:04 [DEBUG] - dbus: start: returning node 61
2023/06/18 18:28:04 [DEBUG] - pipewire: Format negotiated:
2023/06/18 18:28:04 [DEBUG] - pipewire: buffer_type: 0 (4)
2023/06/18 18:28:04 [DEBUG] - pipewire: format: 7
2023/06/18 18:28:04 [DEBUG] - pipewire: modifier: 0
2023/06/18 18:28:04 [DEBUG] - pipewire: size: (1040, 1020)
2023/06/18 18:28:04 [DEBUG] - pipewire: max_framerate: (60 / 1)
2023/06/18 18:28:04 [DEBUG] - pipewire: add buffer event handle
2023/06/18 18:28:04 [DEBUG] - pipewire: add buffer event handle
2023/06/18 18:28:04 [INFO] - pipewire: stream state changed to "streaming"
2023/06/18 18:28:04 [INFO] - pipewire: node id is 61
fish: Job 1, '/usr/lib/xdg-desktop-portal-hyp…' terminated by signal SIGSEGV (Address boundary error)

This happens no matter what window I try to share, even if it's in the same workspace as OBS (in case that could potentially make a difference).

Versions:

xbb commented 1 year ago

I think I got it

https://github.com/hyprwm/xdg-desktop-portal-hyprland/blob/4d9ff0c17716936e0b5ca577a39e263633901ed1/src/screencast/pipewire_screencast.c#L458-L462

output is null when selecting a window, so the portal crashes at that point.

Can be fixed either by checking cast->target.output is not null (but it will not apply transforms, for example if your screen is rotated the captured window rotation is not adjusted), or setting the output in here, like for screen and region selections:

https://github.com/hyprwm/xdg-desktop-portal-hyprland/blob/4d9ff0c17716936e0b5ca577a39e263633901ed1/src/screencast/wlr_screencast.c#L744-L760

Though, I don't know how to get the correct output from the window result, I think it needs to be sent from hyprland-share-picker like for region selection and I'm not sure if it breaks screencast session restore.

Gustash commented 1 year ago

So, I did some further digging.

As @xbb mentions, the program crashes due to cast->target.output being NULL when window sharing. I was able to get around this by commenting out that portion of the code (obviously an actual fix would be required, but this enables me to get further).

After doing that, it is no longer the program that crashes, but OBS itself. I saw that OBS was reporting the pipewire stream format as Spa:Enum:VideoFormat:RGBx, while output streaming was reported as Spa:Enum:VideoFormat:BGRx.

Changing these lines:

https://github.com/hyprwm/xdg-desktop-portal-hyprland/blob/4d9ff0c17716936e0b5ca577a39e263633901ed1/src/screencast/screencast_common.c#L331-L332

To return return SPA_VIDEO_FORMAT_BGRx no longer crashes OBS, but obviously the colors are now wrong as blue and red are flipped.

I'm 99% sure the code here is correct, and the issue might be with OBS not handling this format properly, but I'm far from knowledgeable enough here to make that call.

EDIT:

https://github.com/obsproject/obs-studio/issues/8925 might be related to this. It seems the latest xdg-desktop-portal-wlr version has fixed this issue. I can see that this repo is around 15 commits behind, so maybe a pull from upstream is in order...

vaxerski commented 1 year ago

closing due to the v1.0 rewrite