audioadapter: always pass Start when passthrough

When we are operating in passthrough, let the Start command pass through
to the follower in all cases. Only do the negotiate/buffers when not in
passthrough.

This fixes a case where the buffers are cleared on the alsa node and it
Pauses but then never resumes in a Start because the node is already
started. The real problem is probably somewhere else (in PipeWire) but
for now this will improve things in passthrough.
This commit is contained in:
Wim Taymans 2023-10-02 15:41:56 +02:00
parent 96c12c2988
commit 428f766d11

View file

@ -373,9 +373,6 @@ static int negotiate_buffers(struct impl *this)
struct spa_data *datas; struct spa_data *datas;
uint64_t follower_flags, conv_flags; uint64_t follower_flags, conv_flags;
if (this->target == this->follower)
return 0;
spa_log_debug(this->log, "%p: n_buffers:%d", this, this->n_buffers); spa_log_debug(this->log, "%p: n_buffers:%d", this, this->n_buffers);
if (this->n_buffers > 0) if (this->n_buffers > 0)
@ -516,10 +513,9 @@ static int configure_format(struct impl *this, uint32_t flags, const struct spa_
this->have_format = format != NULL; this->have_format = format != NULL;
if (format == NULL) { if (format == NULL) {
this->n_buffers = 0; this->n_buffers = 0;
} else { } else if (this->target != this->follower) {
res = negotiate_buffers(this); res = negotiate_buffers(this);
} }
return res; return res;
} }
@ -846,9 +842,6 @@ static int negotiate_format(struct impl *this)
struct spa_pod_builder b = { 0 }; struct spa_pod_builder b = { 0 };
int res; int res;
if (this->target == this->follower)
return 0;
spa_log_debug(this->log, "%p: have_format:%d", this, this->have_format); spa_log_debug(this->log, "%p: have_format:%d", this, this->have_format);
if (this->have_format) if (this->have_format)
@ -920,12 +913,12 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
switch (SPA_NODE_COMMAND_ID(command)) { switch (SPA_NODE_COMMAND_ID(command)) {
case SPA_NODE_COMMAND_Start: case SPA_NODE_COMMAND_Start:
spa_log_debug(this->log, "%p: starting %d", this, this->started); spa_log_debug(this->log, "%p: starting %d", this, this->started);
if (this->started) if (this->target != this->follower) {
return 0; if (this->started)
if ((res = negotiate_format(this)) < 0) return 0;
return res; if ((res = negotiate_format(this)) < 0)
if ((res = negotiate_buffers(this)) < 0) return res;
return res; }
this->ready = true; this->ready = true;
this->warned = false; this->warned = false;
break; break;