From 42415eadd9dbdfd7f043518c92155fa29ef8243d Mon Sep 17 00:00:00 2001 From: Martin Geier Date: Wed, 8 Apr 2026 16:59:29 +0200 Subject: [PATCH] bluez5: iso-io: don't use streams without tx_latency enabled for fill level calculation When there is a stream without tx_latency enabled, the fill_count ends with MIN_FILL value. This causes one buffer of silence to be written to every stream before the actual data in each iteration. Consequently, more data is written than consumed in each iteration. After several iterations, spa_bt_send fails, triggering a group_latency_check failure in few next iterations and leading to dropped data. Skip streams without tx_latency enabled in fill level calculations to prevent these audio glitches. --- spa/plugins/bluez5/iso-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/bluez5/iso-io.c b/spa/plugins/bluez5/iso-io.c index 2cc65a2bf..ce1fd7d0c 100644 --- a/spa/plugins/bluez5/iso-io.c +++ b/spa/plugins/bluez5/iso-io.c @@ -411,7 +411,7 @@ static void group_on_timeout(struct spa_source *source) /* Ensure controller fill level */ fill_count = UINT_MAX; spa_list_for_each(stream, &group->streams, link) { - if (!stream->sink || !group->started) + if (!stream->sink || !group->started || !stream->tx_latency.enabled) continue; if (stream->tx_latency.queue < MIN_FILL) fill_count = SPA_MIN(fill_count, MIN_FILL - stream->tx_latency.queue);