LADI
/
spa
1
Fork 0

node: small cleanups and debug improvements

This commit is contained in:
Wim Taymans 2023-05-02 14:11:37 +02:00
parent dd36352a5c
commit 6bbe64a64b
2 changed files with 12 additions and 6 deletions

View File

@ -478,7 +478,8 @@ client_node_set_io(void *_data,
data->position = size >= sizeof(*data->position) ? ptr : NULL;
break;
}
data->node->driving = data->clock && data->position && data->position->clock.id == data->clock->id;
data->node->driving = data->clock && data->position &&
data->position->clock.id == data->clock->id;
res = spa_node_set_io(data->node->node, id, ptr, size);
@ -1181,6 +1182,7 @@ static int node_ready(void *d, int status)
struct spa_system *data_system = data->data_system;
struct timespec ts;
struct pw_impl_port *p;
uint64_t now;
pw_log_trace_fp("node %p: ready driver:%d exported:%d status:%d", node,
node->driver, node->exported, status);
@ -1192,8 +1194,10 @@ static int node_ready(void *d, int status)
a->state[0].status = status;
spa_system_clock_gettime(data_system, CLOCK_MONOTONIC, &ts);
a->signal_time = SPA_TIMESPEC_TO_NSEC(&ts);
a->awake_time = a->signal_time;
now = SPA_TIMESPEC_TO_NSEC(&ts);
a->signal_time = now;
a->awake_time = now;
if (SPA_UNLIKELY(spa_system_eventfd_write(data_system, data->rtwritefd, 1) < 0))
pw_log_warn("node %p: write failed %m", node);

View File

@ -1093,7 +1093,7 @@ static inline int resume_node(struct pw_impl_node *this, int status, uint64_t ns
{
struct pw_node_target *t;
pw_log_trace_fp("%p: trigger peers %"PRIu64, this, nsec);
pw_log_trace_fp("%p: %s trigger peers %"PRIu64, this, this->name, nsec);
spa_list_for_each(t, &this->rt.target_list, link) {
struct pw_node_activation *a = t->activation;
@ -1133,7 +1133,8 @@ static inline int process_node(void *data)
uint64_t nsec;
nsec = get_time_ns(data_system);
pw_log_trace_fp("%p: %s process %"PRIu64, this, this->name, nsec);
pw_log_trace_fp("%p: %s process remote:%u exported:%u %"PRIu64,
this, this->name, this->remote, this->exported, nsec);
a->status = PW_NODE_ACTIVATION_AWAKE;
a->awake_time = nsec;
@ -1195,7 +1196,8 @@ static void node_on_fd_events(struct spa_source *source)
pw_log_info("(%s-%u) client missed %"PRIu64" wakeups",
this->name, this->info.id, cmd - 1);
pw_log_trace_fp("%p: got process", this);
pw_log_trace_fp("%p: remote:%u exported:%u %s got process", this, this->remote,
this->exported, this->name);
process_node(this);
}
}