From 1d34d994e2f6fdc2988cffd7cc8a98d7b6e6d899 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 3 Aug 2018 17:39:55 +0200 Subject: [PATCH] link: limit number of buffers when allocating When we let the nodes allocat buffer, limit the number of buffers to 16 for now. We run out of fds when sending the message. We would need to send the fds in multiple sendmsg calls. --- src/pipewire/link.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pipewire/link.c b/src/pipewire/link.c index 13971cfe0..026dc3fb8 100644 --- a/src/pipewire/link.c +++ b/src/pipewire/link.c @@ -33,7 +33,7 @@ #include "link.h" #include "work-queue.h" -#define MAX_BUFFERS 32 +#define MAX_BUFFERS 64 /** \cond */ struct impl { @@ -685,8 +685,12 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s /* when one of the ports can allocate buffer memory, set the minsize to * 0 to make sure we don't allocate memory in the shared memory */ if ((in_flags & SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS) || - (out_flags & SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS)) + (out_flags & SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS)) { minsize = 0; + /* limit buffers to 16 because there is a limit on the number of + * fds in a message for now */ + max_buffers = 16; + } data_sizes[0] = minsize; data_strides[0] = stride;