mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-01-01 22:10:08 +01:00
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:
parent
02c332bb78
commit
bfbf38d5f7
3 changed files with 11 additions and 6 deletions
|
|
@ -245,10 +245,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));
|
||||
|
|
|
|||
|
|
@ -2162,9 +2162,11 @@ retry_status:
|
|||
} else {
|
||||
all_ready &= ta->pending_sync == false;
|
||||
}
|
||||
ta->prev_signal_time = ta->signal_time;
|
||||
ta->prev_awake_time = ta->awake_time;
|
||||
ta->prev_finish_time = ta->finish_time;
|
||||
}
|
||||
|
||||
a->prev_signal_time = a->signal_time;
|
||||
node->driver_start = nsec;
|
||||
|
||||
a->sync_timeout = SPA_MIN(min_timeout, DEFAULT_SYNC_TIMEOUT);
|
||||
|
|
|
|||
|
|
@ -608,7 +608,10 @@ struct pw_node_activation {
|
|||
uint32_t segment_owner[16]; /* id of owners for each segment info struct.
|
||||
* nodes that want to update segment info need to
|
||||
* CAS their node id in this array. */
|
||||
uint32_t padding[11]; /* must be 0 */
|
||||
uint64_t prev_awake_time;
|
||||
uint64_t prev_finish_time;
|
||||
uint32_t padding[7]; /* must be 0 */
|
||||
|
||||
uint32_t client_version; /* verions of client, see above */
|
||||
uint32_t server_version; /* verions of server, see above */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue