impl-node: save all previous timestamps on start

When the driver starts, save all previous node timestamps, not just the
previous signal time.

For async nodes, uses the previous timestamps in the profiler messages
so that we get stats with 1 cycle of delay instead of bogus values
because the node is still processing.

Fixes pw-top for async nodes.
This commit is contained in:
Wim Taymans 2024-11-15 18:06:12 +01:00
parent 1084cc24b6
commit a997627906
3 changed files with 11 additions and 6 deletions

View file

@ -285,10 +285,10 @@ static void context_do_profile(void *data)
spa_pod_builder_add_struct(&b,
SPA_POD_Int(t->id),
SPA_POD_String(t->name),
SPA_POD_Long(a->signal_time),
SPA_POD_Long(na->signal_time),
SPA_POD_Long(na->awake_time),
SPA_POD_Long(na->finish_time),
SPA_POD_Long(a->prev_signal_time),
SPA_POD_Long(n->async ? na->prev_signal_time : na->signal_time),
SPA_POD_Long(n->async ? na->prev_awake_time : na->awake_time),
SPA_POD_Long(n->async ? na->prev_finish_time : na->finish_time),
SPA_POD_Int(na->status),
SPA_POD_Fraction(&latency),
SPA_POD_Int(na->xrun_count));