From 30af0cb3e483da7c0c463f3fd06df58920d114fb Mon Sep 17 00:00:00 2001 From: dkwo Date: Sat, 29 Jan 2022 19:36:10 +0100 Subject: [PATCH] pipewire: update to 0.3.44, remove unneeded patch, add musl patch --- .../patches/fix-compilation-with-musl.patch | 42 ++++++ .../pipewire/patches/fix-neon-detection.patch | 56 -------- .../patches/upstream-maxlength-1.patch | 25 ++++ .../patches/upstream-maxlength-2.patch | 123 ++++++++++++++++++ .../patches/upstream-maxlength-3.patch | 42 ++++++ srcpkgs/pipewire/template | 6 +- 6 files changed, 235 insertions(+), 59 deletions(-) create mode 100644 srcpkgs/pipewire/patches/fix-compilation-with-musl.patch delete mode 100644 srcpkgs/pipewire/patches/fix-neon-detection.patch create mode 100644 srcpkgs/pipewire/patches/upstream-maxlength-1.patch create mode 100644 srcpkgs/pipewire/patches/upstream-maxlength-2.patch create mode 100644 srcpkgs/pipewire/patches/upstream-maxlength-3.patch diff --git a/srcpkgs/pipewire/patches/fix-compilation-with-musl.patch b/srcpkgs/pipewire/patches/fix-compilation-with-musl.patch new file mode 100644 index 000000000000..1d01d09d1c32 --- /dev/null +++ b/srcpkgs/pipewire/patches/fix-compilation-with-musl.patch @@ -0,0 +1,42 @@ +From 3256c6e5e7e2cef1f765dc05a001114359cc3134 Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Thu, 27 Jan 2022 14:59:11 +0100 +Subject: [PATCH] tools: fix compilation with musl + +--- + src/tools/pw-cli.c | 4 ++++ + src/tools/pw-dump.c | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/src/tools/pw-cli.c b/src/tools/pw-cli.c +index 7c1a5ae68..8cb67f0b8 100644 +--- a/src/tools/pw-cli.c ++++ b/src/tools/pw-cli.c +@@ -36,6 +36,10 @@ + #include + #include + ++#if !defined(FNM_EXTMATCH) ++#define FNM_EXTMATCH 0 ++#endif ++ + #define spa_debug(...) fprintf(stdout,__VA_ARGS__);fputc('\n', stdout) + + #include +diff --git a/src/tools/pw-dump.c b/src/tools/pw-dump.c +index d9d9e144c..9597a6ce1 100644 +--- a/src/tools/pw-dump.c ++++ b/src/tools/pw-dump.c +@@ -32,6 +32,10 @@ + #include + #include + ++#if !defined(FNM_EXTMATCH) ++#define FNM_EXTMATCH 0 ++#endif ++ + #include + #include + #include +-- +GitLab diff --git a/srcpkgs/pipewire/patches/fix-neon-detection.patch b/srcpkgs/pipewire/patches/fix-neon-detection.patch deleted file mode 100644 index cf65d1b4cdfd..000000000000 --- a/srcpkgs/pipewire/patches/fix-neon-detection.patch +++ /dev/null @@ -1,56 +0,0 @@ -Workaround for NEON detection for armv6l/armv7l -https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/235 - -diff --git meson.build meson.build -index 29b4b892..0d048a1f 100644 ---- a/meson.build -+++ b/meson.build -@@ -116,37 +116,17 @@ - have_avx2 = cc.has_argument(avx2_args) - - have_neon = false --if host_machine.cpu_family() == 'aarch64' -- if cc.compiles(''' -- #include -- int main () { -- float *s; -- asm volatile( -- " ld1 { v0.4s }, [%[s]], #16\n" -- " fcvtzs v0.4s, v0.4s, #31\n" -- : [s] "+r" (s) : :); -- } -- ''', -- name : 'aarch64 Neon Support') -- neon_args = [] -- have_neon = true -- -- endif --elif cc.has_argument('-mfpu=neon') -- if cc.compiles(''' -- #include -- int main () { -- float *s; -- asm volatile( -- " vld1.32 { q0 }, [%[s]]!\n" -- " vcvt.s32.f32 q0, q0, #31\n" -- : [s] "+r" (s) : :); -- } -- ''', -- args: '-mfpu=neon', -- name : 'arm Neon Support') -- neon_args = ['-mfpu=neon'] -- have_neon = true -+neon_args = [] -+if host_machine.cpu_family() == 'arm' or host_machine.cpu_family() == 'aarch64' -+ if cc.compiles( -+''' -+#include -+int32x4_t testfunc(int16_t *a, int16_t *b) { -+return vmull_s16(vld1_s16(a), vld1_s16(b)); -+} -+''', -+ name : 'NEON support') -+ have_neon = true - endif - endif - diff --git a/srcpkgs/pipewire/patches/upstream-maxlength-1.patch b/srcpkgs/pipewire/patches/upstream-maxlength-1.patch new file mode 100644 index 000000000000..b624bea88aa6 --- /dev/null +++ b/srcpkgs/pipewire/patches/upstream-maxlength-1.patch @@ -0,0 +1,25 @@ +From 5ead4507cca922081bc8dc066ff281a71e893d5d Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Fri, 28 Jan 2022 16:13:09 +0100 +Subject: [PATCH] pulse-server: ensure tlength <= maxlength + +See #2069 +--- + src/modules/module-protocol-pulse/stream.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/modules/module-protocol-pulse/stream.c b/src/modules/module-protocol-pulse/stream.c +index 4c362f92f..dc4fdbf2c 100644 +--- a/src/modules/module-protocol-pulse/stream.c ++++ b/src/modules/module-protocol-pulse/stream.c +@@ -332,6 +332,8 @@ int stream_update_minreq(struct stream *stream, uint32_t minreq) + return 0; + + stream->attr.tlength = new_tlength; ++ if (stream->attr.tlength > stream->attr.maxlength) ++ stream->attr.tlength = stream->attr.maxlength; + + if (client->version >= 15) { + struct message *msg; +-- +GitLab diff --git a/srcpkgs/pipewire/patches/upstream-maxlength-2.patch b/srcpkgs/pipewire/patches/upstream-maxlength-2.patch new file mode 100644 index 000000000000..8d3d373a4c6e --- /dev/null +++ b/srcpkgs/pipewire/patches/upstream-maxlength-2.patch @@ -0,0 +1,123 @@ +From 1ac1f914e3aea81e16511934ce8dd87cf6b62f33 Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Fri, 28 Jan 2022 16:21:03 +0100 +Subject: [PATCH] pulse-server: allows allocate MAXLENGTH for the ringbuffer + +See #2069 +--- + src/modules/module-protocol-pulse/defs.h | 2 +- + .../module-protocol-pulse/pulse-server.c | 24 +++++++++---------- + src/modules/module-protocol-pulse/server.c | 6 ++--- + 3 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/src/modules/module-protocol-pulse/defs.h b/src/modules/module-protocol-pulse/defs.h +index 8a9b38644..1e2bed318 100644 +--- a/src/modules/module-protocol-pulse/defs.h ++++ b/src/modules/module-protocol-pulse/defs.h +@@ -52,7 +52,7 @@ + #define MIN_BUFFERS 1u + #define MAX_BUFFERS 4u + +-#define MAXLENGTH (4*1024*1024) /* 4MB */ ++#define MAXLENGTH (4u*1024*1024) /* 4MB */ + + #define SCACHE_ENTRY_SIZE_MAX (1024*1024*16) + +diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c +index 7e6448390..e926de4e6 100644 +--- a/src/modules/module-protocol-pulse/pulse-server.c ++++ b/src/modules/module-protocol-pulse/pulse-server.c +@@ -463,7 +463,7 @@ static int reply_create_playback_stream(struct stream *stream, struct pw_manager + lat.denom = stream->ss.rate; + lat.num = fix_playback_buffer_attr(stream, &stream->attr); + +- stream->buffer = calloc(1, stream->attr.maxlength); ++ stream->buffer = calloc(1, MAXLENGTH); + if (stream->buffer == NULL) + return -errno; + +@@ -601,7 +601,7 @@ static int reply_create_record_stream(struct stream *stream, struct pw_manager_o + lat.denom = stream->ss.rate; + lat.num = fix_record_buffer_attr(stream, &stream->attr); + +- stream->buffer = calloc(1, stream->attr.maxlength); ++ stream->buffer = calloc(1, MAXLENGTH); + if (stream->buffer == NULL) + return -errno; + +@@ -1186,8 +1186,8 @@ do_process_done(struct spa_loop *loop, + return -errno; + + spa_ringbuffer_read_data(&stream->ring, +- stream->buffer, stream->attr.maxlength, +- index % stream->attr.maxlength, ++ stream->buffer, MAXLENGTH, ++ index % MAXLENGTH, + msg->data, towrite); + + client_queue_message(client, msg); +@@ -1255,8 +1255,8 @@ static void stream_process(void *data) + if ((stream->attr.prebuf == 0 || do_flush) && !stream->corked) { + if (avail > 0) { + spa_ringbuffer_read_data(&stream->ring, +- stream->buffer, stream->attr.maxlength, +- index % stream->attr.maxlength, ++ stream->buffer, MAXLENGTH, ++ index % MAXLENGTH, + p, avail); + } + pd.playing_for = size; +@@ -1282,8 +1282,8 @@ static void stream_process(void *data) + size = SPA_MIN(size, minreq); + + spa_ringbuffer_read_data(&stream->ring, +- stream->buffer, stream->attr.maxlength, +- index % stream->attr.maxlength, ++ stream->buffer, MAXLENGTH, ++ index % MAXLENGTH, + p, size); + + index += size; +@@ -1315,10 +1315,10 @@ static void stream_process(void *data) + } + + spa_ringbuffer_write_data(&stream->ring, +- stream->buffer, stream->attr.maxlength, +- index % stream->attr.maxlength, ++ stream->buffer, MAXLENGTH, ++ index % MAXLENGTH, + SPA_PTROFF(p, buf->datas[0].chunk->offset, void), +- SPA_MIN(size, stream->attr.maxlength)); ++ SPA_MIN(size, MAXLENGTH)); + + index += size; + pd.write_inc = size; +@@ -2080,7 +2080,7 @@ static int do_create_upload_stream(struct client *client, uint32_t command, uint + + stream->props = props; + +- stream->buffer = calloc(1, stream->attr.maxlength); ++ stream->buffer = calloc(1, MAXLENGTH); + if (stream->buffer == NULL) + goto error_errno; + +diff --git a/src/modules/module-protocol-pulse/server.c b/src/modules/module-protocol-pulse/server.c +index f952cc4fa..d3bcfd4e3 100644 +--- a/src/modules/module-protocol-pulse/server.c ++++ b/src/modules/module-protocol-pulse/server.c +@@ -178,10 +178,10 @@ static int handle_memblock(struct client *client, struct message *msg) + /* always write data to ringbuffer, we expect the other side + * to recover */ + spa_ringbuffer_write_data(&stream->ring, +- stream->buffer, stream->attr.maxlength, +- index % stream->attr.maxlength, ++ stream->buffer, MAXLENGTH, ++ index % MAXLENGTH, + msg->data, +- SPA_MIN(msg->length, stream->attr.maxlength)); ++ SPA_MIN(msg->length, MAXLENGTH)); + index += msg->length; + stream->write_index += msg->length; + spa_ringbuffer_write_update(&stream->ring, index); +-- +GitLab diff --git a/srcpkgs/pipewire/patches/upstream-maxlength-3.patch b/srcpkgs/pipewire/patches/upstream-maxlength-3.patch new file mode 100644 index 000000000000..30ec45b35314 --- /dev/null +++ b/srcpkgs/pipewire/patches/upstream-maxlength-3.patch @@ -0,0 +1,42 @@ +From ce03fc7c158c66c59f9fa4201f0962e0edc3478e Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Fri, 28 Jan 2022 16:23:42 +0100 +Subject: [PATCH] pulse-server: increase maxlength to match tlength + +When we need to increase tlength because of a quantum change, increase +maxlength as well, but clamp it to MAXLENGTH. + +See #2069 +--- + src/modules/module-protocol-pulse/stream.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/modules/module-protocol-pulse/stream.c b/src/modules/module-protocol-pulse/stream.c +index dc4fdbf2c..2a2e1a6c4 100644 +--- a/src/modules/module-protocol-pulse/stream.c ++++ b/src/modules/module-protocol-pulse/stream.c +@@ -38,6 +38,7 @@ + + #include "client.h" + #include "commands.h" ++#include "defs.h" + #include "internal.h" + #include "log.h" + #include "message.h" +@@ -331,9 +332,12 @@ int stream_update_minreq(struct stream *stream, uint32_t minreq) + if (new_tlength <= old_tlength) + return 0; + ++ if (new_tlength > MAXLENGTH) ++ new_tlength = MAXLENGTH; ++ + stream->attr.tlength = new_tlength; + if (stream->attr.tlength > stream->attr.maxlength) +- stream->attr.tlength = stream->attr.maxlength; ++ stream->attr.maxlength = stream->attr.tlength; + + if (client->version >= 15) { + struct message *msg; +-- +GitLab + diff --git a/srcpkgs/pipewire/template b/srcpkgs/pipewire/template index cb2aac730c29..d20f3978b6b8 100644 --- a/srcpkgs/pipewire/template +++ b/srcpkgs/pipewire/template @@ -1,6 +1,6 @@ # Template file for 'pipewire' pkgname=pipewire -version=0.3.43 +version=0.3.44 revision=1 _pms_version=0.4.1 build_style=meson @@ -21,7 +21,7 @@ makedepends="$(vopt_if sdl2 SDL2-devel) gst-plugins-base1-devel jack-devel sbc-devel v4l-utils-devel libva-devel libbluetooth-devel ncurses-devel libfreeaptx-devel libusb-devel fdk-aac-devel libsndfile-devel Vulkan-Headers vulkan-loader pulseaudio-devel avahi-libs-devel webrtc-audio-processing-devel - readline-devel openssl-devel lilv-devel " + readline-devel openssl-devel lilv-devel libcanberra-devel dbus-devel" depends="libspa-alsa>=${version}_${revision} libspa-audioconvert>=${version}_${revision} libspa-audiomixer>=${version}_${revision} libspa-control>=${version}_${revision} libspa-v4l2>=${version}_${revision}" @@ -32,7 +32,7 @@ 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 https://gitlab.freedesktop.org/pipewire/media-session/-/archive/${_pms_version}/media-session-${_pms_version}.tar.gz" -checksum="87f692a2cb5b14ee900e102502b5e078a0cd3f7836f03a2e7cb30690ead37b50 +checksum="680e986d74e1639724fc9192fed987ba143e9964bb36dc4d2c6d323f6d627f29 119c9216070b54018217552c7924f9888da270c3c4647c5e2b85ffa6b1574975" make_dirs="/var/lib/pipewire 0755 _pipewire _pipewire" system_accounts="_pipewire"