From ed2ea554925c6f8e5fcb4ffd5780032b6802eaa0 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 18 May 2023 11:20:30 +0200 Subject: [PATCH] Add patch to fix JACK buffersize updates --- ...ize-and-samplerate-when-skipping-not.patch | 50 +++++++++++++++++++ pipewire.spec | 6 ++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 0001-jack-update-bufsize-and-samplerate-when-skipping-not.patch diff --git a/0001-jack-update-bufsize-and-samplerate-when-skipping-not.patch b/0001-jack-update-bufsize-and-samplerate-when-skipping-not.patch new file mode 100644 index 0000000..0ad6a86 --- /dev/null +++ b/0001-jack-update-bufsize-and-samplerate-when-skipping-not.patch @@ -0,0 +1,50 @@ +From 1b823f1bc3363c496758a9230c9f5d4ce4491815 Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Thu, 18 May 2023 09:59:26 +0200 +Subject: [PATCH] jack: update bufsize and samplerate when skipping notify + +When we skip the notify because we are not active or we don't have a +callback, still update the buffer_size and sample_rate fields or else +we will keep on trying forever. + +Fixes #3226 +--- + pipewire-jack/src/pipewire-jack.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c +index ee82425a9..ed21ccf76 100644 +--- a/pipewire-jack/src/pipewire-jack.c ++++ b/pipewire-jack/src/pipewire-jack.c +@@ -1027,8 +1027,6 @@ static int queue_notify(struct client *c, int type, struct object *o, int arg1, + struct notify *notify; + bool emit = false;; + +- if ((type & NOTIFY_ACTIVE_FLAG) && !c->active) +- return 0; + switch (type) { + case NOTIFY_TYPE_REGISTRATION: + emit = c->registration_callback != NULL && o != NULL; +@@ -1060,8 +1058,18 @@ static int queue_notify(struct client *c, int type, struct object *o, int arg1, + default: + break; + } ++ if ((type & NOTIFY_ACTIVE_FLAG) && !c->active) ++ emit = false; + if (!emit) { +- pw_log_debug("%p: skip notify %d", c, type); ++ switch (type) { ++ case NOTIFY_TYPE_BUFFER_FRAMES: ++ c->buffer_frames = arg1; ++ break; ++ case NOTIFY_TYPE_SAMPLE_RATE: ++ c->sample_rate = arg1; ++ break; ++ } ++ pw_log_debug("%p: skip notify %08x active:%d", c, type, c->active); + if (o != NULL && arg1 == 0 && o->removing) { + o->removing = false; + free_object(c, o); +-- +2.40.1 + diff --git a/pipewire.spec b/pipewire.spec index d2ede25..ac0aea5 100644 --- a/pipewire.spec +++ b/pipewire.spec @@ -9,7 +9,7 @@ %global ms_version 0.4.2 # For rpmdev-bumpspec and releng automation -%global baserelease 1 +%global baserelease 2 #global snapdate 20210107 #global gitcommit b17db2cebc1a5ab2c01851d29c05f79cd2f262bb @@ -63,6 +63,7 @@ Source0: https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/%{ver %endif ## upstream patches +Patch0001: 0001-jack-update-bufsize-and-samplerate-when-skipping-not.patch ## upstreamable patches @@ -611,6 +612,9 @@ systemctl --no-reload preset --global pipewire.socket >/dev/null 2>&1 || : %{_libdir}/pipewire-%{apiversion}/libpipewire-module-x11-bell.so %changelog +* Thu May 18 2023 Wim Taymans - 0.3.71-2 +- Add patch to fix JACK buffersize updates + * Wed May 17 2023 Wim Taymans - 0.3.71-1 - Update version to 0.3.71