From f9b0bf3f95733d93eee30272461c4f36036f6133 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sat, 14 Jun 2025 16:21:06 +0300 Subject: [PATCH] bluez5: limit CVSD block size Don't try to write data in too large blocks. This controls the maximum amount of data to send at once. sco-io will buffer and fragment packets to the right size. Previously in sco-sink, SO_SNDBUF was not set, so there could be a longer queue in the socket. --- spa/plugins/bluez5/hfp-codec-cvsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/bluez5/hfp-codec-cvsd.c b/spa/plugins/bluez5/hfp-codec-cvsd.c index d5f30fa2a..66b801ecc 100644 --- a/spa/plugins/bluez5/hfp-codec-cvsd.c +++ b/spa/plugins/bluez5/hfp-codec-cvsd.c @@ -88,7 +88,7 @@ static void *codec_init(const struct media_codec *codec, uint32_t flags, if (!this) return NULL; - this->block_size = 2 * (mtu/2); + this->block_size = SPA_MIN(2 * (mtu/2), 144u); /* cap to 9 ms */ return this; }