Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Jan 2023 05:09:41 +0000
From:      bugzilla-noreply@freebsd.org
To:        chromium@FreeBSD.org
Subject:   maintainer-feedback requested: [Bug 268726] www/chromium: enable PipeWire support (screen capture under Wayland)
Message-ID:  <bug-268726-28929-DjdlMgrmtv@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-268726-28929@https.bugs.freebsd.org/bugzilla/>
References:  <bug-268726-28929@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
Bugzilla Automation <bugzilla@FreeBSD.org> has asked freebsd-chromium (Nobo=
dy)
<chromium@FreeBSD.org> for maintainer-feedback:
Bug 268726: www/chromium: enable PipeWire support (screen capture under
Wayland)
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D268726



--- Description ---
PipeWire-based screen capture is complex replacement[1] for
wlr-screencopy-unstable-v1 (wlroots, MirServer >=3D 2.8, to be standardized=
[2]),
primarily designed for sandboxing apps via Flatpak or similar. It can work
under both X11 and Wayland but most consumers limit it to Wayland. See also
other xdg-desktop-portal examples:
- org.freedesktop.portal.ScreenCast: firefox-esr, obs-studio, kooha
- org.freedesktop.portal.Screenshot: flameshot, ksnip, gimp-app

This expands ports 8fc70d7e9054 to include Screen Capture in WebRTC. With
rtc_link_pipewire=3Dfalse (upstream default) libpipewire is used via dlopen=
(3),
so it can always be enabled like Wayland support.

"poudriere bulk -t" passed on 13.1 amd64. Runtime tested inside 13.1 jail on
14.0 host under Sway with X11/Wayland/DBus sockets passed through. Works fi=
ne
both under native Wayland and Xwayland.

Runtime testing recipe:

# pkg install chromium sway pam_xdg xdg-desktop-portal-wlr xdg-desktop-port=
al
# echo 'session optional pam_xdg.so notroot runtime' >>/etc/pam.d/system
# sysrc seatd_enable=3DYES
# service seatd start
$ exit # log out to pick up XDG_RUNTIME_DIR
<new login>
$ dbus-daemon --session --fork --address=3Dunix:runtime=3Dyes
$ export DBUS_SESSION_BUS_ADDRESS=3Dunix:path=3D$XDG_RUNTIME_DIR/bus # work=
around
$ sway
<GUI session>
$ export XDG_CURRENT_DESKTOP=3Dsway
$ dbus-update-activation-environment --all
$ daemon -f pipewire
$ daemon -f /usr/local/libexec/xdg-desktop-portal # workaround
$ daemon -f /usr/local/libexec/xdg-desktop-portal-wlr # workaround
$ chrome
- open chrome://flags
- enter "wayland" in Search field
- set "WebRTC PipeWire support" to "Enabled"
- set "Preferred Ozone platform" to "Auto"
- click Relaunch

- open https://mozilla.github.io/webrtc-landing/gum_test.html
- click on "Screen Capture"
- click on "Entire Screen" tab in "Choose what to share" prompt
- click anywhere to select the desired output/monitor
- notice preview is filled with screen content
- click "Share" to confirm
- click anywhere to select the desired output/monitor
- watch screen content mirrored on the web page
- click on "Stop Sharing" to end the capture or just close the browser

References:
[1]
https://blogs.kde.org/2020/10/11/linux-desktop-shell-ipc-wayland-vs-d-bus-a=
nd-l
ack-agreement-when-use-them
[2]
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/1=
24



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-268726-28929-DjdlMgrmtv>