From 5ade045654eef5166263a4dd16a8040b0fdb66c9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 19 Mar 2026 13:14:50 +0100 Subject: [PATCH] pipewire-jack: only call timebase on 0 status If the status passed to cycle_signal != 0 we should not call the timebase callback. We already do this but we can use this fact to also not call the timebase_callback when there was no buffer_frames configured yet. Do this by setting the fallback return value of process_callback to != 0. When there is no buffer_frames yet, this will be used and we can then avoid the buffer_frames check in cycle_signal. --- pipewire-jack/src/pipewire-jack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index cf1b8c754..55f2d0d56 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -2172,7 +2172,7 @@ static inline void cycle_signal(struct client *c, int status) struct pw_node_activation *driver = c->rt.driver_activation; struct pw_node_activation *activation = c->activation; - if (SPA_LIKELY(status == 0 && c->buffer_frames != (uint32_t)-1)) { + if (SPA_LIKELY(status == 0)) { if (c->timebase_callback && driver && driver->segment_owner[0] == c->node_id) { if (activation->pending_new_pos || c->jack_state == JackTransportRolling || @@ -2210,7 +2210,7 @@ on_rtsocket_condition(void *data, int fd, uint32_t mask) } } else if (SPA_LIKELY(mask & SPA_IO_IN)) { uint32_t buffer_frames; - int status = 0; + int status = -EBUSY; buffer_frames = cycle_run(c);