GNU bug report logs -
#52492
[PATCH 0/7] Improve screen sharing support under Wayland
Previous Next
Reported by: Josselin Poiret <dev <at> jpoiret.xyz>
Date: Tue, 14 Dec 2021 21:46:01 UTC
Severity: normal
Tags: patch
Done: Mathieu Othacehe <othacehe <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52492 in the body.
You can then email your comments to 52492 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#52492
; Package
guix-patches
.
(Tue, 14 Dec 2021 21:46:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Josselin Poiret <dev <at> jpoiret.xyz>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Tue, 14 Dec 2021 21:46:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello,
This patchset updates and improves various packages related to screen
sharing/screeshotting on Wayland, and especially wlroots-based
compositors.
I can get screensharing working in icecat on sway by manually starting
pipewire then wireplumber (and then xdg-desktop-portal-wlr followed by
xdg-desktop-portal if they're not installed in your profile, otherwise
your user DBus session will launch them automatically), and starting
icecat with
`LD_LIBRARY_PATH="$(./pre-inst-env guix build
pipewire)/lib:$LD_LIBRARY_PATH" icecat`
since the pipewire library is dlopened by libwebrtc rather than
statically or dynamically linked. We could possibly add this to the
icecat package, as it has a wrapper doing a similar thing for other
libraries.
Another way to test screensharing without icecat would be to use this
python script [1], using `guix shell python python-pygobject
gst-plugins-bad pipewire python-dbus -- python3 xdp-screen-cast.py`.
I also took the liberty to patch xdg-desktop-portal-wlr's
screenshotting process, as it simply execl'd to slurp and grim. Along
with an update to flameshot, I can use the latter properly on sway as
well.
Best,
Josselin
[1] https://gitlab.gnome.org/-/snippets/19
Josselin Poiret (7):
gnu: pipewire-0.3: Use new input style
gnu: pipewire-0.3: Update to 0.3.41
gnu: Add wireplumber
gnu: xdg-desktop-portal-wlr: Update to 0.5.0
gnu: xdg-desktop-portal-wlr: Use new input style
gnu: xdg-desktop-portal-wlr: Add binary dependencies
gnu: flameshot: Update to 0.10.2
gnu/local.mk | 1 +
gnu/packages/freedesktop.scm | 38 ++++++++++----
gnu/packages/image.scm | 4 +-
gnu/packages/linux.scm | 52 +++++++++++++++----
...g-desktop-portal-wlr-harcoded-length.patch | 28 ++++++++++
5 files changed, 100 insertions(+), 23 deletions(-)
create mode 100644 gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#52492
; Package
guix-patches
.
(Tue, 14 Dec 2021 21:49:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 52492 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/linux.scm (pipewire-0.3): Refactor it.
---
gnu/packages/linux.scm | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index c752df7996..191ab757e4 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -8134,15 +8134,14 @@ (define-public pipewire-0.3
(modify-phases %standard-phases
;; Skip shrink-runpath, otherwise validate-runpath fails.
(delete 'shrink-runpath))))
- (inputs
- (append (package-inputs pipewire)
- `(("avahi" ,avahi)
- ("bluez" ,bluez)
- ("jack" ,jack-2)
- ("ldacbt" ,ldacbt)
- ("pulseaudio" ,pulseaudio)
- ("vulkan-loader" ,vulkan-loader)
- ("vulkan-headers" ,vulkan-headers))))))
+ (inputs (modify-inputs (package-inputs pipewire)
+ (prepend avahi
+ bluez
+ jack-2
+ ldacbt
+ pulseaudio
+ vulkan-loader
+ vulkan-headers)))))
(define-public ell
(package
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#52492
; Package
guix-patches
.
(Tue, 14 Dec 2021 21:49:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 52492 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/linux.scm (pipewire-0.3): Update it.
---
gnu/packages/linux.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 191ab757e4..77632c51c9 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -8114,7 +8114,7 @@ (define-public pipewire-0.3
(package
(inherit pipewire)
(name "pipewire")
- (version "0.3.40")
+ (version "0.3.41")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -8123,7 +8123,7 @@ (define-public pipewire-0.3
(file-name (git-file-name name version))
(sha256
(base32
- "1c6gni23l5w3ghwqnfs712kjj6l1825f0ib8a6r2xc1ymr0sx3kr"))))
+ "05ksl2nbn00gvdmnmffa8q8r3z29ip75554d36xchsrhqq4sxdcm"))))
(arguments
'(#:configure-flags
(list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#52492
; Package
guix-patches
.
(Tue, 14 Dec 2021 21:49:03 GMT)
Full text and
rfc822 format available.
Message #14 received at 52492 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/linux.scm (wireplumber): Add it.
---
gnu/packages/linux.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 77632c51c9..ec41a5450b 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -88,6 +88,7 @@ (define-module (gnu packages linux)
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
#:use-module (gnu packages boost)
+ #:use-module (gnu packages build-tools)
#:use-module (gnu packages calendar)
#:use-module (gnu packages check)
#:use-module (gnu packages cpio)
@@ -8143,6 +8144,36 @@ (define-public pipewire-0.3
vulkan-loader
vulkan-headers)))))
+(define-public wireplumber
+ (package
+ (name "wireplumber")
+ (version "0.4.5")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url
+ "https://gitlab.freedesktop.org/pipewire/wireplumber.git")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1k56i5cardwr03vkldg68714hyksyp1vb0b315yw1bilaj2ka30i"))))
+ (build-system meson-build-system)
+ (arguments
+ `(#:configure-flags '("-Dsystemd=disabled"
+ "-Dsystem-lua=true")))
+ (native-inputs
+ `(("glib-bin" ,glib "bin")
+ ("pkg-config" ,pkg-config)))
+ (inputs (list dbus elogind glib lua pipewire-0.3))
+ (home-page "https://gitlab.freedesktop.org/pipewire/wireplumber")
+ (synopsis "Session / policy manager implementation for PipeWire")
+ (description "WirePlumber is a modular session / policy manager for
+PipeWire and a GObject-based high-level library that wraps PipeWire's API,
+providing convenience for writing the daemon's modules as well as external
+tools for managing PipeWire.")
+ (license license:expat)))
+
(define-public ell
(package
(name "ell")
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#52492
; Package
guix-patches
.
(Tue, 14 Dec 2021 21:49:03 GMT)
Full text and
rfc822 format available.
Message #17 received at 52492 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/freedesktop.scm (xdg-desktop-portal-wlr): Update it.
---
gnu/packages/freedesktop.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index a14fba862c..a1608cbb70 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2378,7 +2378,7 @@ (define-public xdg-desktop-portal-gtk
(define-public xdg-desktop-portal-wlr
(package
(name "xdg-desktop-portal-wlr")
- (version "0.4.0")
+ (version "0.5.0")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -2387,7 +2387,7 @@ (define-public xdg-desktop-portal-wlr
(file-name (git-file-name name version))
(sha256
(base32
- "13fbzh8bjnhk4xs8j9bpc01q3hy27zpbf0gkk1fnh3hm5pnyfyiv"))))
+ "1ipg35gv8ja39ijwbyi96qlyq2y1fjdggl40s38rv68bsya8zry1"))))
(build-system meson-build-system)
(arguments
`(#:configure-flags
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#52492
; Package
guix-patches
.
(Tue, 14 Dec 2021 21:49:03 GMT)
Full text and
rfc822 format available.
Message #20 received at 52492 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/freedesktop.scm (xdg-desktop-portal-wlr): Refactor it.
---
gnu/packages/freedesktop.scm | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index a1608cbb70..e1827ffdad 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2395,13 +2395,12 @@ (define-public xdg-desktop-portal-wlr
"-Dsd-bus-provider=libelogind")))
(native-inputs
(list cmake pkg-config))
- (inputs
- `(("elogind" ,elogind)
- ("iniparser" ,iniparser)
- ("pipewire" ,pipewire-0.3)
- ("inih" ,libinih)
- ("wayland" ,wayland)
- ("wayland-protocols" ,wayland-protocols)))
+ (inputs (list elogind
+ iniparser
+ libinih
+ pipewire-0.3
+ wayland
+ wayland-protocols))
(home-page "https://github.com/emersion/xdg-desktop-portal-wlr")
(synopsis "@code{xdg-desktop-portal} backend for wlroots")
(description
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#52492
; Package
guix-patches
.
(Tue, 14 Dec 2021 21:49:04 GMT)
Full text and
rfc822 format available.
Message #23 received at 52492 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch:
Add it.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/freedesktop.scm (xdg-desktop-portal-wlr): Add
dependencies on bash-minimal, grim and slurp, and hardcode the paths
in source.
---
gnu/local.mk | 1 +
gnu/packages/freedesktop.scm | 23 +++++++++++++--
...g-desktop-portal-wlr-harcoded-length.patch | 28 +++++++++++++++++++
3 files changed, 50 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index a138e574d0..9bbcd42733 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1914,6 +1914,7 @@ dist_patch_DATA = \
%D%/packages/patches/wpa-supplicant-CVE-2021-27803.patch \
%D%/packages/patches/wpa-supplicant-CVE-2021-30004.patch \
%D%/packages/patches/x265-arm-flags.patch \
+ %D%/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch\
%D%/packages/patches/xf86-video-ark-remove-mibstore.patch \
%D%/packages/patches/xf86-video-mach64-bool-to-boolean.patch \
%D%/packages/patches/xf86-video-mach64-glibc-2.20.patch \
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index e1827ffdad..1ed09dbf2c 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2387,18 +2387,37 @@ (define-public xdg-desktop-portal-wlr
(file-name (git-file-name name version))
(sha256
(base32
- "1ipg35gv8ja39ijwbyi96qlyq2y1fjdggl40s38rv68bsya8zry1"))))
+ "1ipg35gv8ja39ijwbyi96qlyq2y1fjdggl40s38rv68bsya8zry1"))
+ (patches (search-patches "xdg-desktop-portal-wlr-harcoded-length.patch"))))
(build-system meson-build-system)
(arguments
`(#:configure-flags
'("-Dsystemd=disabled"
- "-Dsd-bus-provider=libelogind")))
+ "-Dsd-bus-provider=libelogind")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'hardcode-binaries
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((sh (search-input-file inputs "/bin/sh"))
+ (grim (search-input-file inputs "/bin/grim"))
+ (slurp (search-input-file inputs "/bin/slurp")))
+ (substitute* "src/screenshot/screenshot.c"
+ (("grim") grim)
+ (("slurp") slurp)
+ (("execl\\(\"/bin/sh\", \"/bin/sh\"")
+ (string-append "execl(\"" sh "\", \"" sh "\"")))
+ (substitute* "src/screencast/screencast.c"
+ (("execvp\\(\"sh")
+ (string-append "execvp(\"" sh)))))))))
(native-inputs
(list cmake pkg-config))
(inputs (list elogind
+ bash-minimal
+ grim
iniparser
libinih
pipewire-0.3
+ slurp
wayland
wayland-protocols))
(home-page "https://github.com/emersion/xdg-desktop-portal-wlr")
diff --git a/gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch b/gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch
new file mode 100644
index 0000000000..b499a039e8
--- /dev/null
+++ b/gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch
@@ -0,0 +1,28 @@
+From 3121eeb5e68bedd6e2398f35b9bd60b69709a47e Mon Sep 17 00:00:00 2001
+From: Josselin Poiret <dev <at> jpoiret.xyz>
+Date: Tue, 14 Dec 2021 18:49:54 +0100
+Subject: [PATCH] Replace hardcoded command length
+
+---
+ src/screenshot/screenshot.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/screenshot/screenshot.c b/src/screenshot/screenshot.c
+index 9df0ea7..5f27681 100644
+--- a/src/screenshot/screenshot.c
++++ b/src/screenshot/screenshot.c
+@@ -42,8 +42,9 @@ static bool exec_screenshooter_interactive(const char *path) {
+ perror("fork");
+ return false;
+ } else if (pid == 0) {
+- char cmd[strlen(path) + 25];
+- snprintf(cmd, sizeof(cmd), "grim -g \"$(slurp)\" -- %s", path);
++ const char cmd_fmt[] = "grim -g \"$(slurp)\" -- %s";
++ char cmd[strlen(path) + sizeof(cmd_fmt)];
++ snprintf(cmd, sizeof(cmd), cmd_fmt, path);
+ execl("/bin/sh", "/bin/sh", "-c", cmd, NULL);
+ perror("execl");
+ exit(127);
+--
+2.34.0
+
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#52492
; Package
guix-patches
.
(Tue, 14 Dec 2021 21:49:04 GMT)
Full text and
rfc822 format available.
Message #26 received at 52492 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/image.scm (flameshot): Update it.
---
gnu/packages/image.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index b6378a3890..8bed2da65c 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -1823,7 +1823,7 @@ (define-public libiptcdata
(define-public flameshot
(package
(name "flameshot")
- (version "0.8.5")
+ (version "0.10.2")
(source
(origin
(method git-fetch)
@@ -1833,7 +1833,7 @@ (define-public flameshot
(file-name (git-file-name name version))
(sha256
(base32
- "1z77igs60lz106vsf6wsayxjafxm3llf2lm4dpvsqyyrxybfq191"))))
+ "07n98pp5i6i51g7a4vqwbd6xarihzl7r714r2knvw2zn5mlj55dd"))))
(build-system qt-build-system)
(native-inputs
(list qttools))
--
2.34.0
Reply sent
to
Mathieu Othacehe <othacehe <at> gnu.org>
:
You have taken responsibility.
(Sun, 19 Dec 2021 12:23:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Josselin Poiret <dev <at> jpoiret.xyz>
:
bug acknowledged by developer.
(Sun, 19 Dec 2021 12:23:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 52492-done <at> debbugs.gnu.org (full text, mbox):
Hey Josselin,
Thanks for working on that. I fixed a few minor details and pushed the
series.
> I can get screensharing working in icecat on sway by manually starting
> pipewire then wireplumber (and then xdg-desktop-portal-wlr followed by
> xdg-desktop-portal if they're not installed in your profile, otherwise
> your user DBus session will launch them automatically), and starting
> icecat with
As discussed on #guix, we may need to find a way to start those services
automatically.
> since the pipewire library is dlopened by libwebrtc rather than
> statically or dynamically linked. We could possibly add this to the
> icecat package, as it has a wrapper doing a similar thing for other
> libraries.
Seems fair.
I also tried to run obs, this way:
--8<---------------cut here---------------start------------->8---
QT_QPA_PLATFORM=wayland obs
--8<---------------cut here---------------end--------------->8---
was prompted for a screen/window to capture using pipewire, but then I
have the following error, does that ring a bell?
--8<---------------cut here---------------start------------->8---
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info: - source: 'Window Capture (PipeWire)' (pipewire-window-capture-source)
info: ------------------------------------------------
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
info: [pipewire] available cursor modes:
info: [pipewire] - Metadata
info: [pipewire] - Always visible
info: [pipewire] - Hidden
Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /gnu/store/1fp8wl9y2i72ld59d1spw85xvw9l88ws-obs-27.0.1/share/obs/obs-studio/images/overflow.png
info: [pipewire] screencast session created
info: [pipewire] asking for window…
info: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Mic/Aux)
warning: [pipewire] Failed to start screencast, denied or cancelled by user
info: PipeWire initialized (sender name: 1_1734)
info: User added source 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source) to scene 'Scene'
info: [pipewire] available cursor modes:
info: [pipewire] - Metadata
info: [pipewire] - Always visible
info: [pipewire] - Hidden
info: [pipewire] screencast session created
info: [pipewire] asking for desktop…
warning: [pipewire] Failed to start screencast, denied or cancelled by user
^Cinfo: ==== Shutting down ==================================================
--8<---------------cut here---------------end--------------->8---
Thanks,
Mathieu
Information forwarded
to
guix-patches <at> gnu.org
:
bug#52492
; Package
guix-patches
.
(Sun, 19 Dec 2021 12:24:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 52492 <at> debbugs.gnu.org (full text, mbox):
You are missing the final dot on the commit title of each commit.
Mathieu
Information forwarded
to
guix-patches <at> gnu.org
:
bug#52492
; Package
guix-patches
.
(Sun, 19 Dec 2021 12:25:02 GMT)
Full text and
rfc822 format available.
Message #37 received at 52492 <at> debbugs.gnu.org (full text, mbox):
> + (native-inputs
> + `(("glib-bin" ,glib "bin")
> + ("pkg-config" ,pkg-config)))
I replaced it to use the new style.
Mathieu
Information forwarded
to
guix-patches <at> gnu.org
:
bug#52492
; Package
guix-patches
.
(Sun, 19 Dec 2021 12:25:02 GMT)
Full text and
rfc822 format available.
Message #40 received at 52492 <at> debbugs.gnu.org (full text, mbox):
> + (lambda* (#:key inputs outputs #:allow-other-keys)
outputs is not required here.
Mathieu
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 17 Jan 2022 12:24:12 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 245 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.