emersion / xdg-desktop-portal-wlr

xdg-desktop-portal backend for wlroots

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[QUESTION] Firefox 106 screensharing is not working

ngortheone opened this issue · comments

This is not a bug of xdg-desktop-portal-wlr, or at least it doesn't immediately seem like one.

On FreeBSD 14 an upgrade to firefox 106 broke screensharing. The test script https://gitlab.gnome.org/snippets/19 still works. Firefox 102 still works too.

Something has changed in Firefox 106 (they had some WebRTC related improvements) and now it doesn't allow me to select the screen to share.

I do not see any expected logs in xdg-desktop-portal / xdg-desktop-portal-wlr

I used to see logs this xdg-desktop-portal-wlr debug output

2022/10/22 08:44:35 [INFO] - xdpw: screencast instance 0x82d0bc8c0 has 1 references
2022/10/22 08:44:35 [INFO] - xdpw: 1 active screencast instances
2022/10/22 08:44:35 [INFO] - wlroots: output: DP-1
2022/10/22 08:44:35 [INFO] - dbus: start method invoked
2022/10/22 08:44:35 [INFO] - dbus: request_handle: /org/freedesktop/portal/desktop/request/1_2299/webrtc722843940
2022/10/22 08:44:35 [INFO] - dbus: session_handle: /org/freedesktop/portal/desktop/session/1_2299/webrtc_session935133376
2022/10/22 08:44:35 [INFO] - dbus: app_id:
2022/10/22 08:44:35 [INFO] - dbus: parent_window:
2022/10/22 08:44:35 [DEBUG] - dbus: start: found matching session /org/freedesktop/portal/desktop/session/1_2299/webrtc_session935133376
2022/10/22 08:44:35 [INFO] - wlroots: num_modififiers 1
2022/10/22 08:44:35 [INFO] - pipewire: stream state changed to "connecting"
2022/10/22 08:44:35 [INFO] - pipewire: node id is -1
2022/10/22 08:44:35 [INFO] - pipewire: stream state changed to "paused"
2022/10/22 08:44:35 [INFO] - pipewire: node id is 37
2022/10/22 08:44:35 [DEBUG] - dbus: start: returning node 37
2022/10/22 08:44:35 [DEBUG] - pipewire: Format negotiated:
2022/10/22 08:44:35 [DEBUG] - pipewire: buffer_type: 0 (4)
2022/10/22 08:44:35 [DEBUG] - pipewire: format: 7
2022/10/22 08:44:35 [DEBUG] - pipewire: modifier: 0
2022/10/22 08:44:35 [DEBUG] - pipewire: size: (3840, 2160)
2022/10/22 08:44:35 [DEBUG] - pipewire: max_framerate: (59 / 1)
2022/10/22 08:44:35 [DEBUG] - pipewire: add buffer event handle
2022/10/22 08:44:35 [DEBUG] - pipewire: add buffer event handle
2022/10/22 08:44:35 [INFO] - pipewire: stream state changed to "streaming"
2022/10/22 08:44:35 [INFO] - pipewire: node id is 37
2022/10/22 08:44:40 [DEBUG] - fps_limit: average FPS in the last 5.02 seconds: 29.30
2022/10/22 08:44:45 [DEBUG] - fps_limit: average FPS in the last 5.00 seconds: 28.20
2022/10/22 08:44:46 [INFO] - pipewire: stream state changed to "paused"
2022/10/22 08:44:46 [INFO] - pipewire: node id is 37
2022/10/22 08:44:46 [INFO] - dbus: session closed
2022/10/22 08:44:46 [DEBUG] - dbus: destroying session 0x82d182660
2022/10/22 08:44:46 [DEBUG] - xdpw: screencast instance 0x82d0bc8c0 now has 0 references
2022/10/22 08:44:46 [DEBUG] - xdpw: destroying cast instance

or these logs in xdg-desktop-portal

XDP: org.freedesktop.portal.Desktop acquired
XDP: screen cast session owned by ':1.2219' created
XDP: screen cast session owned by ':1.2219' started
XDP: screen cast session owned by ':1.2219' closed
XDP: screen cast session owned by ':1.2245' created
XDP: screen cast session owned by ':1.2245' started
XDP: screen cast session owned by ':1.2245' closed
XDP: screen cast session owned by ':1.2299' created
XDP: screen cast session owned by ':1.2299' started
XDP: screen cast session owned by ':1.2299' closed
XDP: screen cast session owned by ':1.2299' created
XDP: screen cast session owned by ':1.2299' started
XDP: screen cast session owned by ':1.2299' closed

But I don't see these anymore with Firefox 106. As if it is not even trying to call relevant dbus methods...

The question
Did firefox break screensharing or desktop portal(s) implementation lagging behind and firefox expects some newer interface?

2022-10-22-090559
2022-10-22-090612

These are the dialogs when I attempt to run screenshare on Firefox 106

With Firefox 102 the same dialog looks the different (and pressing Allow button starts screensharing)
2022-10-22-090907

have you been able to figure out a solution with firefox 106 and above?

I think the reason for me was that version 106 of Firefox was built without webrtc support in FreeBSD (some port build issue that I don't remember at the moment)

In any case, I was able to confirm that it is not a fault of xdg-desktop-portal-wlr

oh, I fixed mine, turns out I was missing rtkit which is necessary for xdg-desktop-portal to run realtime