bluez5: deal with missing TX timestamps

There are known controller firmware bugs that cause packet completion
reports, mainly for ISO packets, to be missing.

To avoid getting stuck e.g. in ISO queue flushing, we should consider a
packet completed if sufficient time has passed even if controller (and
kernel) don't report it completed. Take 1 s as conservative timeout, the
expected values are some ms.

These firmware bugs also cause kernel to stop sending packets if too
many are left uncompleted, but we cannot detect that.
This commit is contained in:
Pauli Virtanen 2026-01-11 14:25:23 +02:00
parent 0869be11f8
commit d0309b4e1e
3 changed files with 111 additions and 36 deletions

View file

@ -1315,7 +1315,10 @@ static void media_on_flush_error(struct spa_source *source)
if (spa_bt_iso_io_recv_errqueue(this->transport->iso_io) == 0)
return;
} else {
if (spa_bt_latency_recv_errqueue(&this->tx_latency, this->flush_source.fd, this->log) == 0)
struct timespec ts;
spa_system_clock_gettime(this->data_system, CLOCK_REALTIME, &ts);
if (spa_bt_latency_recv_errqueue(&this->tx_latency, this->flush_source.fd, SPA_TIMESPEC_TO_NSEC(&ts), this->log) == 0)
return;
}