Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ] shared/bap: Don't link ucast streams before CIS IDs are assigned
@ 2026-06-09 21:11 Simon Mikuda
  2026-06-09 22:03 ` Pauli Virtanen
  2026-06-09 23:00 ` [BlueZ] " bluez.test.bot
  0 siblings, 2 replies; 3+ messages in thread
From: Simon Mikuda @ 2026-06-09 21:11 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda

bap_ucast_io_link pairs streams whose CIG/CIS IDs match, but the IDs
are unset in Codec Configured state, so a Sink and Source bound for
different CISes get linked. The stray link later propagates a
disconnect to the wrong ASE and breaks Receiver Start Ready.

Skip linking until QoS Configured assigns the IDs.

Fixes PTS test BAP/USR/STR/BV-362-C
---
 src/shared/bap.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index deb85b264..98537de60 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -2679,6 +2679,12 @@ static int bap_ucast_io_link(struct bt_bap_stream *stream,
 			stream->ep->dir == link->ep->dir)
 		return -EINVAL;
 
+	/* Don't link until QoS Configured assigns the CIS IDs; while unset
+	 * the check above would pair unrelated streams.
+	 */
+	if (!stream->qos.ucast.cis_id || !link->qos.ucast.cis_id)
+		return -EINVAL;
+
 	if (stream->client && !(stream->locked && link->locked))
 		return -EINVAL;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-09 23:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 21:11 [PATCH BlueZ] shared/bap: Don't link ucast streams before CIS IDs are assigned Simon Mikuda
2026-06-09 22:03 ` Pauli Virtanen
2026-06-09 23:00 ` [BlueZ] " bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox