bluez5: media-source: allow using bigger A2DP receive buffers

The maximum receive buffer target of 6 packets may be too small when
there's huge jitter in reception.  Increase it so that we may use all
buffer available if needed (2*quantum_limit = 370 ms @ 44100).

For SCO, explicitly set maximum buffer to 40 ms, so that latency cannot
grow too large there.  For A2DP duplex, set it to 80 ms for same reason.
These are close to the old 6*packet limit.
This commit is contained in:
Pauli Virtanen 2023-02-20 19:26:39 +02:00
parent d28990af34
commit 15e4b3d500
3 changed files with 26 additions and 5 deletions

View file

@ -679,6 +679,10 @@ static int do_start(struct impl *this)
this->quantum_limit, this->quantum_limit)) < 0)
return res;
/* 40 ms max buffer */
spa_bt_decode_buffer_set_max_latency(&port->buffer,
port->current_format.info.raw.rate * 40 / 1000);
/* Init mSBC if needed */
if (this->transport->codec == HFP_AUDIO_CODEC_MSBC) {
sbc_init_msbc(&this->msbc, 0);