From ce8af10cfe5db556331cdcf5cd2791d2d1e74477 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 7 Jan 2022 16:36:29 +0100 Subject: [PATCH] impl-node: set signal and awake time When a non-driver emits the ready event, set the awake and signal time so that pw-top reports times correctly. See #1987 --- src/pipewire/impl-node.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pipewire/impl-node.c b/src/pipewire/impl-node.c index e4f3671a3..0951031c9 100644 --- a/src/pipewire/impl-node.c +++ b/src/pipewire/impl-node.c @@ -1654,6 +1654,16 @@ again: if (SPA_UNLIKELY(node->driver && !node->driving)) return 0; + if (!node->driver) { + struct timespec ts; + struct pw_node_activation *a = node->rt.activation; + struct spa_system *data_system = node->context->data_system; + + spa_system_clock_gettime(data_system, CLOCK_MONOTONIC, &ts); + a->status = PW_NODE_ACTIVATION_AWAKE; + a->signal_time = a->awake_time = SPA_TIMESPEC_TO_NSEC(&ts); + } + if (status & SPA_STATUS_HAVE_DATA) { spa_list_for_each(p, &node->rt.output_mix, rt.node_link) spa_node_process(p->mix);