bluez5: media-sink: write packets exactly on time

Delay output by one packet, so that we never need to wait for
node_process to supply more data when a packet is due out, and can write
audio packets at exactly equal intervals (up to timer/io accuracy).

In principle, this should not be necessary. However, enable it for now,
in case this improves the various stutter/etc. bug reports.
This commit is contained in:
Pauli Virtanen 2023-02-23 22:01:53 +02:00 committed by P V
parent f05e68e4d4
commit 99d5436f15

View file

@ -754,13 +754,16 @@ again:
/ port->current_format.info.raw.rate);
/*
* We could delay the output by one packet to avoid waiting
* We can delay the output by one packet to avoid waiting
* for the next buffer and so make send intervals exactly regular.
* However, this is not needed for A2DP or BAP. The controller
* will do the scheduling for us, and there's also the socket buffer
* in between.
*
* Although in principle this should not be needed, we
* do it regardless in case it helps.
*/
#if 0
#if 1
this->next_flush_time += SPA_MIN(packet_time,
duration_ns * (port->n_buffers - 1));
#endif