From 8f2ee0a29c65bb11ae9944f7465e9305d7ff1938 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 16 Oct 2023 09:34:59 +0200 Subject: [PATCH] Revert "jack: use a private writable mapping on input" This reverts commit 6fefd49a8a212e827b0413b05ed5f73f1bd72876. We can't use PRIVATE because mmap docs say that we then might not see changes in the data anymore from other processes. Fixes #3575 --- pipewire-jack/src/pipewire-jack.c | 12 +++++------- src/modules/module-client-node/remote-node.c | 2 -- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index 6a1da51eb..8edae6d80 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -2575,14 +2575,12 @@ static int client_node_port_use_buffers(void *data, return -ENOSPC; } - if (direction == SPA_DIRECTION_INPUT) { - if (p->object->port.type_id == TYPE_ID_VIDEO) { - fl = PW_MEMMAP_FLAG_READ; - } else { - /* some apps write to the input buffer so we want everything readwrite */ - fl = PW_MEMMAP_FLAG_READWRITE | PW_MEMMAP_FLAG_PRIVATE; - } + if (p->object->port.type_id == TYPE_ID_VIDEO && direction == SPA_DIRECTION_INPUT) { + fl = PW_MEMMAP_FLAG_READ; } else { + /* some apps write to the input buffer so we want everything readwrite. We + * can't use PRIVATE because then we might not see changes in the buffer + * by other apps. */ fl = PW_MEMMAP_FLAG_READWRITE; } diff --git a/src/modules/module-client-node/remote-node.c b/src/modules/module-client-node/remote-node.c index 7a1b482fc..17c1c5780 100644 --- a/src/modules/module-client-node/remote-node.c +++ b/src/modules/module-client-node/remote-node.c @@ -606,8 +606,6 @@ client_node_port_use_buffers(void *_data, if (n_buffers > MAX_BUFFERS) return -ENOSPC; - /* this is for the metadata, which needs to be writable for input buffers - * as well, for the busy metadata, for example */ prot = PW_MEMMAP_FLAG_READWRITE; /* clear previous buffers */