Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core dump when trying to share the screen #190

Closed
Gleydar opened this issue Feb 15, 2022 · 37 comments · Fixed by #191
Closed

Core dump when trying to share the screen #190

Gleydar opened this issue Feb 15, 2022 · 37 comments · Fixed by #191

Comments

@Gleydar
Copy link

Gleydar commented Feb 15, 2022

I'm getting a reproducible core dump when trying to share my screen via WebRTC with the following error message:

2022/02/15 11:27:02 [ERROR] - xdg-desktop-portal-wlr: failed to convert wl_shm format 0x34324742 to spa_video_format
[1]    19548 abort (core dumped)  /usr/lib/xdg-desktop-portal-wlr -r

Currently, I'm using manjaro with the -git version of the following packages:

sway-git - r6879.f707f583-1
wlroots-git - 0.16.0.r5365.252b2348-1
xdg-desktop-portal-wlr-git - v0.5.0.r24.gc34d098-1

All other packages are the most up to date normal versions.

@columbarius
Copy link
Collaborator

Just as a quick Note: the corresponding drm_format should be DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */

Out of curiosity what gpu are you using?

Can you please test #191

@Gleydar
Copy link
Author

Gleydar commented Feb 15, 2022

I will test it asap, and give you feedback whether or not it solved the issue for me :)

I know I'll get a stern no-no, but I have a Nvidia GPU (believe me, trying to get wayland to work on it punishment in and of itself... 😢)

@Gleydar
Copy link
Author

Gleydar commented Feb 15, 2022

This fixes the crash, but not my screen sharing issues :D I will have to keep looking for the reason for those. Thanks for your really really quick help though!

@gl4eqen
Copy link

gl4eqen commented Mar 5, 2022

Nvidia GPU

In the same boat. Trying to look through the issues with sway + proprietary Nvidia drivers (510.54 currently). After applying the patch, crash goes away but pipewire seems very unhappy with the value it gets.

Mar 05 20:44:31 arch-i7-9700k pipewire[684]: pw.context: params Spa:Enum:ParamId:EnumFormat: 0:0 Invalid argument (input format (no more input formats))
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default: Object: size 288, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 2        (Spa:Enum:MediaType:video)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 1        (Spa:Enum:MediaSubtype:raw)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 12       (Spa:Enum:VideoFormat:BGRA)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:modifier (131074), flags 00000018
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Enum, flags 00000000 136 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099856
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099856
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099857
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099858
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099859
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099860
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099861
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496656
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496657
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496658
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496659
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496660
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496661
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 0
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 72057594037927935
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle -1x-1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default: Object: size 136, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 2        (Spa:Enum:MediaType:video)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 1        (Spa:Enum:MediaSubtype:raw)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 12       (Spa:Enum:VideoFormat:BGRA)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle -1x-1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default: Object: size 288, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 2        (Spa:Enum:MediaType:video)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 1        (Spa:Enum:MediaSubtype:raw)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 11       (Spa:Enum:VideoFormat:RGBA)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:modifier (131074), flags 00000018
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Enum, flags 00000000 136 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099856
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099856
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099857
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099858
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099859
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099860
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099861
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496656
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496657
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496658
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496659
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496660
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496661
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 0
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 72057594037927935
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle -1x-1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default: Object: size 136, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 2        (Spa:Enum:MediaType:video)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 1        (Spa:Enum:MediaSubtype:raw)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 11       (Spa:Enum:VideoFormat:RGBA)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle -1x-1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default: Object: size 288, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 2        (Spa:Enum:MediaType:video)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 1        (Spa:Enum:MediaSubtype:raw)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 8        (Spa:Enum:VideoFormat:BGRx)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:modifier (131074), flags 00000018
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Enum, flags 00000000 136 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099856
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099856
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099857
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099858
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099859
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099860
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099861
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496656
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496657
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496658
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496659
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496660
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496661
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 0
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 72057594037927935
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle -1x-1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default: Object: size 136, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 2        (Spa:Enum:MediaType:video)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 1        (Spa:Enum:MediaSubtype:raw)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 8        (Spa:Enum:VideoFormat:BGRx)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle -1x-1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default: Object: size 288, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 2        (Spa:Enum:MediaType:video)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 1        (Spa:Enum:MediaSubtype:raw)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 7        (Spa:Enum:VideoFormat:RGBx)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:modifier (131074), flags 00000018
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Enum, flags 00000000 136 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099856
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099856
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099857
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099858
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099859
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099860
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782120099861
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496656
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496657
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496658
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496659
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496660
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 216172782128496661
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 0
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Long 72057594037927935
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle -1x-1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default: Object: size 136, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 2        (Spa:Enum:MediaType:video)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 1        (Spa:Enum:MediaSubtype:raw)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 7        (Spa:Enum:VideoFormat:RGBx)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle 1x1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Rectangle -1x-1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: pw.context: params Spa:Enum:ParamId:EnumFormat: 1:0 Invalid argument (output format (no more input formats))
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default: Object: size 184, type Spa:Pod:Object:Param:Format (262147), id Spa:Enum:ParamId:EnumFormat (3)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaType (1), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 2        (Spa:Enum:MediaType:video)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:mediaSubtype (2), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 1        (Spa:Enum:MediaSubtype:raw)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:format (131073), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Id 15       (Spa:Enum:VideoFormat:RGB)
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:size (131075), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Rectangle 2560x1440
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:framerate (131076), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Fraction 0/1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:   Prop: key Spa:Pod:Object:Param:Format:Video:maxFramerate (131077), flags 00000000
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:     Choice: type Spa:Enum:Choice:Range, flags 00000000 40 8
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Fraction 144/1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Fraction 1/1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: default:       Fraction 144/1
Mar 05 20:44:31 arch-i7-9700k pipewire[684]: pw.link: (68.0 -> 45.0) negotiating -> error (no more input formats)

For testing I'm just using Screen Capture API test. I'm rocking very similar setup on my laptop with AMD GPU and it works fine there. Probably a lot of rough edges in case of Nvidia driver.

@columbarius
Copy link
Collaborator

columbarius commented Mar 5, 2022

I know I'll get a stern no-no, but I have a Nvidia GPU

I'd just asked, because different gpus and setups make specific errors more likely.

I don't mind adding support for a format since this isn't only applicable to one vendor.
If I read the log correctly your problem is that the client connecting to xdpw doesn't support BGR buffers. PipeWire doesn't offer any format conversion and as such the negotiation process fails.

  • The browsers (webrtc) only support a limited amount of formats and it looks like BGR is not supported.
  • You could try obs since it has support for more formats, but no guarantees. (No obs doesn't support BGR)
  • You could create a gstreamer pipeline and add it in between via the pw-cli or another tool, but that is really hacky.

If you can report that this MR works with a client we will consider merging it.

@glaeqen btw. are you using #152 ?

@gl4eqen
Copy link

gl4eqen commented Mar 6, 2022

@columbarius

@glaeqen btw. are you using #152 ?

I tried it now, the only difference in logs against what I posted is more less this (left side is with #152 patch):

1d0
< arch-i7-9700k wireplumber <WpPortalPermissionStorePlugin:0x562e71aba0e0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
174c173
< arch-i7-9700k pipewire default:     Id 9        (Spa:Enum:VideoFormat:xRGB)
---
> arch-i7-9700k pipewire default:     Id 15       (Spa:Enum:VideoFormat:RGB)
184c183
< arch-i7-9700k pipewire pw.link: (64.0 -> 65.0) negotiating -> error (no more input formats)
---
> arch-i7-9700k pipewire pw.link: (68.0 -> 45.0) negotiating -> error (no more input formats)

@gl4eqen
Copy link

gl4eqen commented Mar 21, 2022

Is there any way I can help with moving this issue forward? :)

@columbarius
Copy link
Collaborator

If I remember correctly there is not much from our side to do: We can merge #191 but your problem is that this format is not supported by the other end. PipeWire currently doesn't do video format conversion and so the negotiation fails and no link is established. So you might want to open a bug request for libwebrtc.

@gl4eqen
Copy link

gl4eqen commented Apr 12, 2022

@columbarius libwebrtc is used both by Firefox and Chrome? Sorry, I don't fully follow the separation of concerns in the xdg-portal/pipewire ecosystem.

@columbarius
Copy link
Collaborator

columbarius commented Apr 12, 2022

Both use libwebtrc but it's not shared between Firefox and Chromium. They both ship their own version with small integration changes and different versions.

@grulja
Copy link

grulja commented Apr 17, 2022

Both use libwebtrc but it's not shared between Firefox and Chromium. They both ship their own version with small integration changes and different versions.

It is shared, just Firefox doesn't keep up so they carry a year old copy of WebRTC, but once Firefox does a rebase they will be again on par with screen sharing support.

I also have Nvidia driver (v510) and screen sharing works for me in both KDE and GNOME (these are the ones I test my code with). I'm also not sure adding support for BGR will help here as WebRTC uses only BGRA, BGRx, RGBA, RGBx.

@gl4eqen
Copy link

gl4eqen commented Apr 17, 2022

I also have Nvidia driver (v510) and screen sharing works for me in both KDE and GNOME (these are the ones I test my code with)

So only with wlroots based wayland compositors there are issues, am I getting you right?

@columbarius
Copy link
Collaborator

@grulja

Both use libwebtrc but it's not shared between Firefox and Chromium. They both ship their own version with small integration changes and different versions.

It is shared, just Firefox doesn't keep up so they carry a year old copy of WebRTC, but once Firefox does a rebase they will be again on par with screen sharing support.

Right: I meant not shared in not using the same shared library.

I also have Nvidia driver (v510) and screen sharing works for me in both KDE and GNOME (these are the ones I test my code with). I'm also not sure adding support for BGR will help here as WebRTC uses only BGRA, BGRx, RGBA, RGBx.

Great to hear. May I ask you for your distro and if you could test OBS from flathub-beta?

@columbarius
Copy link
Collaborator

@Gleydar Then your best bet is to look if wlroots/sway has the option to force a format. xdpw only supports the format used by wlroots for the surface which is recorded.

@Gleydar
Copy link
Author

Gleydar commented Apr 17, 2022

Hm, I don't think there is a way to do that, but I might need to dig into that.

@grulja
Copy link

grulja commented Apr 19, 2022

I also have Nvidia driver (v510) and screen sharing works for me in both KDE and GNOME (these are the ones I test my code with). I'm also not sure adding support for BGR will help here as WebRTC uses only BGRA, BGRx, RGBA, RGBx.

Great to hear. May I ask you for your distro and if you could test OBS from flathub-beta?

Fedora 36.

OBS from flathub-beta works for me. I already used OBS before, just not from flathub-beta.

I also have Nvidia driver (v510) and screen sharing works for me in both KDE and GNOME (these are the ones I test my code with)

So only with wlroots based wayland compositors there are issues, am I getting you right?

I haven't tried. I can try to install Sway on Fedora and see if it works for me.

@columbarius
Copy link
Collaborator

Fedora 36.

OBS from flathub-beta works for me. I already used OBS before, just not from flathub-beta.

Interesting when it just works for you ootb.

I haven't tried. I can try to install Sway on Fedora and see if it works for me.

If you could try sway with xdpw build from master that would be great. It looks like Nvidia doesn't support implicit modifiers and we now support explicit modifiers. Even if it works I'm interested to see the DEBUG log from the screencast.

@gl4eqen
Copy link

gl4eqen commented Apr 28, 2022

@columbarius

If you could try sway with xdpw build from master that would be great. It looks like Nvidia doesn't support implicit modifiers and we now support explicit modifiers. Even if it works I'm interested to see the DEBUG log from the screencast.

I just built the xdpw from master and it still fails, on unsupported wl_shm format - log gist

@columbarius
Copy link
Collaborator

Oh right, please remove the aborts() from screencast_common.c

@gl4eqen
Copy link

gl4eqen commented Apr 28, 2022

I tried to do this

diff --git a/src/screencast/screencast_common.c b/src/screencast/screencast_common.c
index 038cf7a..426ca69 100644
--- a/src/screencast/screencast_common.c
+++ b/src/screencast/screencast_common.c
@@ -302,9 +302,9 @@ uint32_t xdpw_format_drm_fourcc_from_wl_shm(enum wl_shm_format format) {
    case WL_SHM_FORMAT_BGRA1010102:
        return (uint32_t)format;
    default:
-       logprint(ERROR, "xdg-desktop-portal-wlr: unsupported wl_shm "
+       logprint(WARN, "xdg-desktop-portal-wlr: unsupported wl_shm "
            "format 0x%08x", format);
-       abort();
+       return (uint32_t)format;
    }
 }

but then xdpw cannot convert the format to spa_video_format.

2022/04/28 21:41:14 [TRACE] - wlroots: callbacks registered
2022/04/28 21:41:14 [TRACE] - wlroots: buffer event handler
2022/04/28 21:41:14 [WARN] - xdg-desktop-portal-wlr: unsupported wl_shm format 0x34324742
2022/04/28 21:41:14 [TRACE] - wlroots: linux_dmabuf event handler
2022/04/28 21:41:14 [TRACE] - wlroots: buffer_done event handler
2022/04/28 21:41:14 [TRACE] - wlroots: finish screencopy
2022/04/28 21:41:14 [TRACE] - wlroots: frame destroyed
2022/04/28 21:41:14 [INFO] - wlroots: num_modififiers 13
2022/04/28 21:41:14 [ERROR] - xdg-desktop-portal-wlr: failed to convert drm format 0x34324742 to spa_video_format
<SIGABRT>

I'm not sure how it should be converted considering this comment? So is it, in fact, possible to somehow use this video format in libwebrtc, considering comments that claims it works in KDE and GNOME? Sorry for being a little lost here.

@columbarius
Copy link
Collaborator

Ok to summarize:
webrtc only supports BGRA, BGRx, RGBA, RGBx.
While KDE and GNOME copy and transform the buffer before exporting, xdpw just exports the buffer in the format used by the compositor. Since your compositor decides to use a bufferformat not supported by webrtc there is nothing we can do here.
Your best bets are:

  • Find some way to tell your compositor to avoid certain formats.
  • Wait until someone writes a PipeWire plugin to convert video streams between different formats.

Sry for sending you on the patch route. I hoped the format used with dmabuf transport could be different and one of the supported ones.

@columbarius
Copy link
Collaborator

columbarius commented May 5, 2022

Sry miss click

@andrewathalye
Copy link

Would it be feasible to add software conversion of the buffer from BGR to BGRx? I don't know exactly where in the code the buffer gets passed to PipeWire, but if you've got any tips on that I might be able to write a rudimentary routine. I'm on the (now open-source-ish) NVIDIA driver 515.43 on Sway.

@columbarius
Copy link
Collaborator

Would it be feasible to add software conversion of the buffer from BGR to BGRx?

Not really. We would have to spin up our own renderer and add intermediate copies and stuff. The better way is to pursue a videoconvert plugin for PipeWire which would do the convertion. This would be useful for all clients.

@athre0z
Copy link

athre0z commented May 30, 2022

Regardless of the conversion issue: is aborting the correct thing to do here? I'm not very familiar with Wayland internals, but it'd seem to me that it'd be best to somehow send that error to be displayed by whomever requested the screen sharing to be initiated instead of dumping core.

@athre0z
Copy link

athre0z commented Jun 2, 2022

FWIW, applying this patch to wlroots works around the problem by forcing a more common format to be picked:

diff --git a/types/output/render.c b/types/output/render.c
index 985b93a9..7df1894f 100644
--- a/types/output/render.c
+++ b/types/output/render.c
@@ -284,20 +284,5 @@ struct wlr_drm_format *output_pick_format(struct wlr_output *output,
 }
 
 uint32_t wlr_output_preferred_read_format(struct wlr_output *output) {
-	struct wlr_renderer *renderer = output->renderer;
-	assert(renderer != NULL);
-
-	if (!renderer->impl->preferred_read_format || !renderer->impl->read_pixels) {
-		return DRM_FORMAT_INVALID;
-	}
-
-	if (!output_attach_back_buffer(output, NULL)) {
-		return false;
-	}
-
-	uint32_t fmt = renderer->impl->preferred_read_format(renderer);
-
-	output_clear_back_buffer(output);
-
-	return fmt;
+    return DRM_FORMAT_XRGB8888;
 }

With this patch in place, OBS and friends work just fine.

@yellowhat
Copy link

Hi,
I am using the above patch against wlroots and still getting crash when I try to screen share using chromium (strangely it works with Firefox).
May I ask which option did you use to start sway?

Thanks

@athre0z
Copy link

athre0z commented Nov 11, 2022

LD_PRELOAD="$HOME/devel/wlroots/build/libwlroots.so.10" _JAVA_AWT_WM_NONREPARENTING=1 WLR_NO_HARDWARE_CURSORS=1 sway --unsupported-gpu

I preloaded the wlroots library so I didn't have to rebuild sway as well / install the patched version system-wide. I never tried Chromium screen sharing, so can't comment on that. I only tested OBS.

@tukusejssirs
Copy link

[@columbarius]

@Gleydar Then your best bet is to look if wlroots/sway has the option to force a format. xdpw only supports the format used by wlroots for the surface which is recorded.

Sorry to ask a bit OT question, but is there a to force a format on Sway? 😉 If you don’t know that, could be please help me formulate the question for the Sway devs, as I have no idea how to describe that. 😉

Thanks! 🙏

@LuNeder
Copy link

LuNeder commented Oct 19, 2023

Hey! Are there any new fixes for this? Or is the only way to fix this still having to patch it and compile it myself (which also means I'll also have to compile everything else that depends on wlroots so my wm and stuff)?

Are there no plans for that patch to be merged into wlroots? Does it even still work after a year?

@athre0z
Copy link

athre0z commented Oct 19, 2023

The patch is quite the hack and unlikely to ever be merged: it simply hardcodes one particular DRM format and some graphics cards might not actually support this. As to whether it still works: no idea, sorry. Personally I gave up on Wayland for this year and went back to X11.

@LuNeder
Copy link

LuNeder commented Oct 19, 2023

I’ll probably try to apply the patch then, since Wayfire doesn’t have a feature to force the pixel format yet

I gave up on Wayland for this year and went back to X11.

I can definitely understand that, making wayland usable is indeed way too much work. I too did not switch to wayland, I’m trying to do so rn and yikes so much stuff just doesn’t work.

it simply hardcodes one particular DRM format and some graphics cards might not actually support this

Ohhh okay, I thought something like “if nvidia” with the patch inside could fix that so that’s why I asked

@columbarius
Copy link
Collaborator

Hey! Are there any new fixes for this?

This won't be fixed in wlroots or xdpw. The compositor desides on the used format based on the supported hardware. The goal is to do a format convertion in PipeWire such that browsers can use the format xdpw offers. There is a protoype, but sadly I won't have till the end of the year to finish it. In the meantime please use the "hack" if it works for you.

@columbarius
Copy link
Collaborator

xdpw won't crash anymore when using 24bit colour formats, but since they are not commonly supported you might still need the "hack".

@ibrokemypie
Copy link

FWIW, applying this patch to wlroots works around the problem by forcing a more common format to be picked:

diff --git a/types/output/render.c b/types/output/render.c
index 985b93a9..7df1894f 100644
--- a/types/output/render.c
+++ b/types/output/render.c
@@ -284,20 +284,5 @@ struct wlr_drm_format *output_pick_format(struct wlr_output *output,
 }
 
 uint32_t wlr_output_preferred_read_format(struct wlr_output *output) {
-	struct wlr_renderer *renderer = output->renderer;
-	assert(renderer != NULL);
-
-	if (!renderer->impl->preferred_read_format || !renderer->impl->read_pixels) {
-		return DRM_FORMAT_INVALID;
-	}
-
-	if (!output_attach_back_buffer(output, NULL)) {
-		return false;
-	}
-
-	uint32_t fmt = renderer->impl->preferred_read_format(renderer);
-
-	output_clear_back_buffer(output);
-
-	return fmt;
+    return DRM_FORMAT_XRGB8888;
 }

With this patch in place, OBS and friends work just fine.

Does anyone have an updated version of this patch for wlroots 0.16.2? I am still getting [ERROR] - xdg-desktop-portal-wlr: unsupported wl_shm format 0x34324742 and a coredump currently, and this patch fails to apply

patching file types/output/render.c
Hunk #1 FAILED at 284.
1 out of 1 hunk FAILED -- saving rejects to file types/output/render.c.rej

@LuNeder
Copy link

LuNeder commented Dec 2, 2023

Hey, @ibrokemypie! I’ve edited the patch to work on current(?) wlroots back in October. You can find it here if you’d like. It works for me and fixes the problem.

To make my own life easier I actually published it on my repository for openSUSE Tumbleweed (because it’s a pain in the ass to conciliate compiled packages with package manager packages), so if that’s what you use you could probably add my repo and install it too.

Note that it’s possible that my patch won’t work if you’re trying to use the current wlroots branch - but it does work on the latest release (or at least with the latest release available on openSUSE repos) and that’s probably what you’d want to use.

That said, you should probably know that wlroots unfortunately works like shit on NVidia (flashing windows, etcetera. Quite unusable, at least on my machine). You should try it out yourself to see if it works fine for you, of course, but personally I am getting more interested in the evolution of Louvre and Smithay since they both officially support NVidia. In fact, I’m starting to get interested in either migrating Wayfire to louvre from wlroots (since wayfire is awesome and currently what I’m trying to migrate to since it’s the only compositor out there that mimics essential features of my current Compiz workflow) as a side project or start making my own smithay compositor (not sure at all which would be less of a pain in the ass tbh) - this is really just a random idea I had for a side project that would make it feasible for myself to migrate to wayland tho, so don’t really expect anything.

@LuNeder
Copy link

LuNeder commented Dec 2, 2023

The goal is to do a format convertion in PipeWire such that browsers can use the format xdpw offers. There is a protoype, but sadly I won't have till the end of the year to finish it. In the meantime please use the "hack" if it works for you.

It’s nice to know it’s a planned feature! Thanks for your reply and of course take your time 💖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants