diff --git a/src/modules/module-client-node/remote-node.c b/src/modules/module-client-node/remote-node.c index 82ff95fa1..af9551928 100644 --- a/src/modules/module-client-node/remote-node.c +++ b/src/modules/module-client-node/remote-node.c @@ -1178,6 +1178,12 @@ static const struct pw_proxy_events proxy_client_node_events = { .bound_props = client_node_bound_props, }; +static inline uint64_t get_time_ns(struct spa_system *system) +{ + struct timespec ts; + spa_system_clock_gettime(system, CLOCK_MONOTONIC, &ts); + return SPA_TIMESPEC_TO_NSEC(&ts); +} static int node_ready(void *d, int status) { struct node_data *data = d; @@ -1195,6 +1201,7 @@ static int node_ready(void *d, int status) } a->state[0].status = status; + a->signal_time = get_time_ns(data_system); if (SPA_UNLIKELY(spa_system_eventfd_write(data_system, data->rtwritefd, 1) < 0)) pw_log_warn("node %p: write failed %m", node); diff --git a/src/pipewire/impl-node.c b/src/pipewire/impl-node.c index 6fc1a7dc1..c7144310d 100644 --- a/src/pipewire/impl-node.c +++ b/src/pipewire/impl-node.c @@ -1719,6 +1719,7 @@ static int node_ready(void *data, int status) } node_signal_func(node); } else { + uint64_t signal_time = a->signal_time; /* old nodes set the TRIGGERED status on node_ready, patch this * up here to avoid errors in pw-top */ a->status = PW_NODE_ACTIVATION_FINISHED; @@ -1739,6 +1740,7 @@ static int node_ready(void *data, int status) pw_context_driver_emit_complete(node->context, node); a->prev_signal_time = a->signal_time; + a->signal_time = signal_time; } /* This update is done too late, the driver should do this @@ -1791,7 +1793,8 @@ again: } a->status = PW_NODE_ACTIVATION_TRIGGERED; - a->signal_time = nsec; + if (!node->remote) + a->signal_time = nsec; impl->prev_signal_time = a->prev_signal_time; a->prev_signal_time = a->signal_time;