Github messages for voidlinux
 help / color / mirror / Atom feed
From: Logarithmus <Logarithmus@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] chromium: enable WebRTC screen sharing via PipeWire
Date: Mon, 16 Nov 2020 05:44:26 +0100	[thread overview]
Message-ID: <20201116044426.5jaza-T7FluxLeLy4361L6KgaheD6b-d2bdg6H_iWT8@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26144@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1308 bytes --]

There is an updated pull request by Logarithmus against master on the void-packages repository

https://github.com/Logarithmus/void-packages libpipewire02
https://github.com/void-linux/void-packages/pull/26144

chromium: enable WebRTC screen sharing via PipeWire
- [x] libpipewire0.2
- [x] patch chromium's template
- [ ] test building for all archs:
    - [ ] x86_64 - 🚧
    - [ ] i686 - 🚧
    - [x] aarch64 - ignoring because `nocross=yes`
    - [x] armv7l - ignoring because `nocross=yes`
    - [x] x86_64-musl - works with some issues (tested on my laptop: https://youtu.be/0JOtntP9_oU):
    * have to kill `xdg-desktop-portal*` processes sometimes, probably caused by some sort of race condition;
    * some services work, others don't:
        ✔️ https://www.webrtc-experiment.com/Pluginfree-Screen-Sharing
        ⚠️ https://zoom.us web version - you need to start/stop screen sharing multiple times before it will eventually work
        ❌ https://discord.com web version - screen sharing starts, but it shows nothing
        ❓ https://web.skype.com - not tested yet
        ❓ https://meet.google.com - not tested yet
    - [x] aarch64-musl - ignoring because `nocross=yes`

A patch file from https://github.com/void-linux/void-packages/pull/26144.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libpipewire02-26144.patch --]
[-- Type: text/x-diff, Size: 11039 bytes --]

From c77541f3f5f8ac3f58c9c5c0d880041977350b95 Mon Sep 17 00:00:00 2001
From: Artur Sinila <opensource@logarithmus.dev>
Date: Mon, 16 Nov 2020 07:00:34 +0300
Subject: [PATCH 1/4] linux: disable CONFIG_RT_GROUP_SCHED for pulseaudio and
 pipewire

---
 srcpkgs/linux5.9/files/x86_64-dotconfig | 2 +-
 srcpkgs/linux5.9/template               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/linux5.9/files/x86_64-dotconfig b/srcpkgs/linux5.9/files/x86_64-dotconfig
index d853eda50b1..e6bf60737ca 100644
--- a/srcpkgs/linux5.9/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.9/files/x86_64-dotconfig
@@ -166,7 +166,7 @@ CONFIG_CGROUP_WRITEBACK=y
 CONFIG_CGROUP_SCHED=y
 CONFIG_FAIR_GROUP_SCHED=y
 CONFIG_CFS_BANDWIDTH=y
-CONFIG_RT_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
 CONFIG_CGROUP_PIDS=y
 # CONFIG_CGROUP_RDMA is not set
 CONFIG_CGROUP_FREEZER=y
diff --git a/srcpkgs/linux5.9/template b/srcpkgs/linux5.9/template
index 378f60e6326..efc8e024af2 100644
--- a/srcpkgs/linux5.9/template
+++ b/srcpkgs/linux5.9/template
@@ -1,7 +1,7 @@
 # Template file for 'linux5.9'
 pkgname=linux5.9
 version=5.9.8
-revision=1
+revision=2
 wrksrc="linux-${version}"
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Érico Nogueira <ericonr@disroot.org>"

From a756d3cd040dddbaf9d297e6945fe0c061089c54 Mon Sep 17 00:00:00 2001
From: Artur Sinila <opensource@logarithmus.dev>
Date: Wed, 4 Nov 2020 02:42:23 +0300
Subject: [PATCH 2/4] New package: libpipewire0.2

---
 srcpkgs/libpipewire0.2-devel    |  1 +
 srcpkgs/libpipewire0.2/template | 41 +++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 120000 srcpkgs/libpipewire0.2-devel
 create mode 100644 srcpkgs/libpipewire0.2/template

diff --git a/srcpkgs/libpipewire0.2-devel b/srcpkgs/libpipewire0.2-devel
new file mode 120000
index 00000000000..456616f84ec
--- /dev/null
+++ b/srcpkgs/libpipewire0.2-devel
@@ -0,0 +1 @@
+libpipewire0.2
\ No newline at end of file
diff --git a/srcpkgs/libpipewire0.2/template b/srcpkgs/libpipewire0.2/template
new file mode 100644
index 00000000000..9891b55f156
--- /dev/null
+++ b/srcpkgs/libpipewire0.2/template
@@ -0,0 +1,41 @@
+# Template file for 'libpipewire0.2'
+pkgname=libpipewire0.2
+version=0.2.7
+revision=1
+wrksrc=pipewire-${version}
+build_style=meson
+configure_args="-Dgstreamer=disabled -Ddocs=false -Dsystemd=false"
+hostmakedepends="pkg-config"
+makedepends="dbus-devel alsa-lib-devel libudev-devel"
+short_desc="Server and user space API to deal with multimedia pipelines (v0.2)"
+maintainer="Artur Sinila <opensource@logarithmus.dev>"
+license="MIT"
+homepage="https://pipewire.org/"
+changelog="https://gitlab.freedesktop.org/pipewire/pipewire/-/raw/master/NEWS"
+distfiles="https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/${version}/pipewire-${version}.tar.gz"
+checksum=bfaa0f6ae6c0791e2e0b59234d399753bf24f1b33dbf587682363a8463dd8df1
+#conf_files="/etc/pipewire/pipewire.conf"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+	LDFLAGS+=" -latomic"
+fi
+
+post_install() {
+	rm -r ${DESTDIR}/{etc,usr/bin}
+	mv ${DESTDIR}/usr/include/pipewire ${DESTDIR}/usr/include/pipewire-0.2
+	mv ${DESTDIR}/usr/include/spa ${DESTDIR}/usr/include/spa-0.1
+	vlicense LICENSE
+}
+
+libpipewire0.2-devel_package() {
+	depends="${pkgname}-${version}_${revision}"
+	short_desc+=" - pipewire and libspa development files"
+	pkg_install() {
+		vmove usr/include/pipewire-0.2
+		vmove usr/include/spa-0.1
+		vmove usr/lib/pkgconfig/libpipewire-0.2.pc
+		vmove usr/lib/pkgconfig/libspa-0.1.pc
+		vmove usr/lib/libpipewire-0.2.so
+	}
+}

From 2ee6064ccb66f8f5873b0ecc2775b7b8a187b3cc Mon Sep 17 00:00:00 2001
From: Artur Sinila <opensource@logarithmus.dev>
Date: Mon, 16 Nov 2020 00:59:09 +0300
Subject: [PATCH 3/4] pipewire: update to 0.3.15, patches for v0.2 compat &
 musl

---
 ...x-pipewire-0.2-clients-like-chromium.patch | 44 +++++++++++++++++++
 .../replace-strndupa-with-alloca.patch        | 31 +++++++++++++
 srcpkgs/pipewire/template                     |  5 ++-
 3 files changed, 78 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/pipewire/patches/fix-pipewire-0.2-clients-like-chromium.patch
 create mode 100644 srcpkgs/pipewire/patches/replace-strndupa-with-alloca.patch

diff --git a/srcpkgs/pipewire/patches/fix-pipewire-0.2-clients-like-chromium.patch b/srcpkgs/pipewire/patches/fix-pipewire-0.2-clients-like-chromium.patch
new file mode 100644
index 00000000000..cccf3902f95
--- /dev/null
+++ b/srcpkgs/pipewire/patches/fix-pipewire-0.2-clients-like-chromium.patch
@@ -0,0 +1,44 @@
+From b8c7b36d3b8be16593f554964cf2f852c21b5c2c Mon Sep 17 00:00:00 2001
+From: Wim Taymans <wtaymans@redhat.com>
+Date: Wed, 4 Nov 2020 16:12:25 +0100
+Subject: [PATCH] protocol-native: do version check on HELLO
+
+Always do the version check on HELLO because the connection could
+have been moved from a v3 portal to a v0 client (like chrome)
+
+Fixes #270
+---
+ src/modules/module-protocol-native/connection.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/src/modules/module-protocol-native/connection.c b/src/modules/module-protocol-native/connection.c
+index 84fad68f..1807833a 100644
+--- src/modules/module-protocol-native/connection.c
++++ src/modules/module-protocol-native/connection.c
+@@ -72,7 +72,6 @@ struct impl {
+ 
+ 	uint32_t version;
+ 	size_t hdr_size;
+-	unsigned int checked:1;
+ };
+ 
+ /** \endcond */
+@@ -319,7 +318,7 @@ static int prepare_packet(struct pw_protocol_native_connection *conn, struct buf
+ 	buf->msg.opcode = p[1] >> 24;
+ 	len = p[1] & 0xffffff;
+ 
+-	if (!impl->checked) {
++	if (buf->msg.id == 0 && buf->msg.opcode == 1) {
+ 		if (p[3] >= 4) {
+ 			pw_log_warn("old version detected");
+ 			impl->version = 0;
+@@ -331,7 +330,6 @@ static int prepare_packet(struct pw_protocol_native_connection *conn, struct buf
+ 		spa_hook_list_call(&conn->listener_list,
+ 				struct pw_protocol_native_connection_events,
+ 				start, 0, impl->version);
+-		impl->checked = 1;
+ 	}
+ 	if (impl->version >= 3) {
+ 		buf->msg.seq = p[2];
+-- 
+GitLab
diff --git a/srcpkgs/pipewire/patches/replace-strndupa-with-alloca.patch b/srcpkgs/pipewire/patches/replace-strndupa-with-alloca.patch
new file mode 100644
index 00000000000..d502fab01cb
--- /dev/null
+++ b/srcpkgs/pipewire/patches/replace-strndupa-with-alloca.patch
@@ -0,0 +1,31 @@
+--- pipewire-pulseaudio/src/stream.c
++++ pipewire-pulseaudio/src/stream.c
+@@ -965,8 +965,12 @@ static int create_stream(pa_stream_direction_t direction,
+            devid &= PA_IDX_MASK_MONITOR;
+
+ 		if (devid == PW_ID_ANY) {
+-			if (pa_endswith(dev, ".monitor"))
+-				dev = strndupa(dev, strlen(dev) - 8);
++			if (pa_endswith(dev, ".monitor")) {
++				char *old = dev;
++				size_t n = strlen(old) - 8;
++				dev = alloca(n);
++				strncpy(dev, old, n);
++			}
+ 		}
+ 	}
+ 
+--- src/modules/module-protocol-pulse/pulse-server.c
++++ src/modules/module-protocol-pulse/pulse-server.c
+@@ -3343,7 +3343,10 @@ static int do_get_info(struct client *client, uint32_t command, uint32_t tag, st
+ 
+ 	if (command == COMMAND_GET_SOURCE_INFO &&
+ 	    sel.value != NULL && pw_endswith(sel.value, ".monitor")) {
+-		sel.value = strndupa(sel.value, strlen(sel.value)-8);
++		char *old = sel.value;
++		size_t n = strlen(old) - 8;
++		sel.value = alloca(n);
++		strncpy(sel.value, old, n);
+ 	}
+ 
+ 	o = select_object(manager, &sel);
diff --git a/srcpkgs/pipewire/template b/srcpkgs/pipewire/template
index 930e4b6a0af..35547be50d9 100644
--- a/srcpkgs/pipewire/template
+++ b/srcpkgs/pipewire/template
@@ -1,6 +1,6 @@
 # Template file for 'pipewire'
 pkgname=pipewire
-version=0.3.12
+version=0.3.15
 revision=1
 build_style=meson
 configure_args="-Dman=true -Dgstreamer=true -Ddocs=true -Dsystemd=false
@@ -9,13 +9,14 @@ configure_args="-Dman=true -Dgstreamer=true -Ddocs=true -Dsystemd=false
 hostmakedepends="doxygen graphviz pkg-config xmltoman"
 makedepends="SDL2-devel ffmpeg-devel gst-plugins-base1-devel jack-devel
  sbc-devel v4l-utils-devel libva-devel libbluetooth-devel"
+depends="rtkit"
 short_desc="Server and user space API to deal with multimedia pipelines"
 maintainer="Kridsada Thanabulpong <sirn@ogsite.net>"
 license="MIT"
 homepage="https://pipewire.org/"
 changelog="https://gitlab.freedesktop.org/pipewire/pipewire/-/raw/master/NEWS"
 distfiles="https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/${version}/pipewire-${version}.tar.gz"
-checksum=98c71228aad2f8443e73a524106f32ca9a74e13c2bf55b65b1e06b72325892cd
+checksum=659bf2baeb5bb783b141b1b9d14da72865d3e84073b3e85503ac119a6813aa2a
 conf_files="/etc/pipewire/pipewire.conf"
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then

From 20ece8a6dc090046ee3726d831329ae523b0ba7d Mon Sep 17 00:00:00 2001
From: Artur Sinila <opensource@logarithmus.dev>
Date: Thu, 5 Nov 2020 07:24:27 +0300
Subject: [PATCH 4/4] chromium: enable WebRTC screen sharing via PipeWire [ci
 skip]

---
 srcpkgs/chromium/template | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index e9db11e215c..b80316b772d 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -16,12 +16,13 @@ lib32disabled=yes
 nodebug=yes
 nopie=yes  # contains tools that are not PIE, enables PIE itself
 
-build_options="clang js_optimize vaapi pulseaudio sndio"
+build_options="clang js_optimize vaapi pulseaudio sndio pipewire"
 desc_option_clang="Use clang to build"
 desc_option_js_optimize="Optimize the JS used for Chromium's UI"
 desc_option_vaapi="Enable support for VA-API"
 desc_option_pulseaudio="Enable support for PulseAudio"
 desc_option_sndio="Enable support for sndio"
+desc_option_pipewire="Enable support for screen sharing for WebRTC via PipeWire"
 
 hostmakedepends="$(vopt_if clang clang) python pkgconf perl gperf bison ninja nodejs hwids
  libatomic-devel libevent-devel libglib-devel $(vopt_if js_optimize openjdk)"
@@ -35,14 +36,15 @@ makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
  minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel
  re2-devel fontconfig-devel freetype-devel opus-devel
  ffmpeg-devel libva-devel python-setuptools xcb-proto
- $(vopt_if sndio sndio-devel)"
+ $(vopt_if sndio sndio-devel)
+ $(vopt_if pipewire libpipewire0.2-devel)"
 depends="libexif hwids desktop-file-utils hicolor-icon-theme xdg-utils"
 
 case "$XBPS_TARGET_MACHINE" in
 	ppc64*-musl) makedepends+=" libucontext-devel" ;;
 esac
 
-build_options_default="clang js_optimize vaapi pulseaudio"
+build_options_default="clang js_optimize vaapi pulseaudio pipewire"
 
 post_patch() {
 	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
@@ -196,6 +198,10 @@ do_configure() {
 		"use_pulseaudio=$(vopt_if pulseaudio true false)"
 	)
 
+	conf+=(
+		"rtc_use_pipewire=$(vopt_if pipewire true false)"
+	)
+
 	# Use explicit library dependencies instead of dlopen.
 	# GN only has "link_pulseaudio", the other options used before are not available atm
 	# linux_link_cups=true

  parent reply	other threads:[~2020-11-16  4:44 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05  3:49 [PR PATCH] chromium: enable Logarithmus
2020-11-05  4:25 ` [PR PATCH] [Updated] chromium: enable WebRTC screen sharing via PipeWire Logarithmus
2020-11-05  4:25 ` Logarithmus
2020-11-05  4:38 ` Logarithmus
2020-11-11  1:43 ` Logarithmus
2020-11-11  2:13 ` Logarithmus
2020-11-11  3:02 ` Logarithmus
2020-11-13 20:33 ` Logarithmus
2020-11-15  7:50 ` Logarithmus
2020-11-15 22:06 ` Logarithmus
2020-11-16  1:08 ` Logarithmus
2020-11-16  4:00 ` Logarithmus
2020-11-16  4:44 ` Logarithmus [this message]
2020-11-16 14:12 ` Logarithmus
2020-11-16 14:15 ` Logarithmus
2020-11-17 14:53 ` Logarithmus
2020-11-18  4:16 ` Logarithmus
2020-11-18  4:20 ` Logarithmus
2020-11-19  5:41 ` [PR PATCH] [Updated] " Logarithmus
2020-11-19 20:40 ` [PR PATCH] [Updated] [ci skip] chromium: update to 87.0.4280.66 & " Logarithmus
2020-11-19 21:54 ` Logarithmus
2020-11-20  1:02 ` [PR PATCH] [Updated] chromium: " Logarithmus
2020-11-20 21:26 ` Logarithmus
2020-11-21  0:59 ` [PR PATCH] [Updated] " Logarithmus
2020-11-21  1:00 ` Logarithmus
2020-11-21  1:03 ` ericonr
2020-11-21  1:15 ` [PR PATCH] [Updated] " Logarithmus
2020-11-21  1:35 ` Logarithmus
2020-11-21  1:46 ` Logarithmus
2020-11-21  1:53 ` Logarithmus
2020-11-21  1:54 ` Logarithmus
2020-11-21  1:54 ` Logarithmus
2020-11-21  1:57 ` Logarithmus
2020-11-21  1:57 ` Logarithmus
2020-11-21  1:57 ` Logarithmus
2020-11-21  1:59 ` Logarithmus
2020-11-21  2:00 ` ericonr
2020-11-21  2:08 ` Logarithmus
2020-11-21  2:08 ` Logarithmus
2020-11-21  2:08 ` Logarithmus
2020-11-21  2:10 ` Logarithmus
2020-11-21  2:28 ` [PR PATCH] [Updated] " Logarithmus
2020-11-21  2:29 ` Logarithmus
2020-11-21 11:17 ` ifreund
2020-11-21 11:44 ` Logarithmus
2020-11-21 11:44 ` Logarithmus
2020-11-21 12:33 ` ifreund
2020-11-21 12:34 ` ifreund
2020-11-21 13:21 ` Logarithmus
2020-11-21 13:22 ` Logarithmus
2020-11-21 13:23 ` Logarithmus
2020-11-21 19:04 ` ifreund
2020-11-22 14:52 ` ifreund
2020-12-03  7:10 ` [PR PATCH] [Updated] " Logarithmus
2020-12-13 21:42 ` Logarithmus
2020-12-13 21:42 ` [PR PATCH] [Closed]: " Logarithmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201116044426.5jaza-T7FluxLeLy4361L6KgaheD6b-d2bdg6H_iWT8@z \
    --to=logarithmus@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).