maintainer-feedback requested: [Bug 268726] www/chromium: enable PipeWire support (screen capture under Wayland)
Date: Tue, 03 Jan 2023 05:09:41 UTC
Bugzilla Automation <bugzilla@FreeBSD.org> has asked freebsd-chromium (Nobody) <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=268726 --- Description --- PipeWire-based screen capture is complex replacement[1] for wlr-screencopy-unstable-v1 (wlroots, MirServer >= 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=false (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 fine both under native Wayland and Xwayland. Runtime testing recipe: # pkg install chromium sway pam_xdg xdg-desktop-portal-wlr xdg-desktop-portal # echo 'session optional pam_xdg.so notroot runtime' >>/etc/pam.d/system # sysrc seatd_enable=YES # service seatd start $ exit # log out to pick up XDG_RUNTIME_DIR <new login> $ dbus-daemon --session --fork --address=unix:runtime=yes $ export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus # workaround $ sway <GUI session> $ export XDG_CURRENT_DESKTOP=sway $ 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-and-l ack-agreement-when-use-them [2] https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/124