Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ] bap: Reset broadcast source stream when ISO io is lost
@ 2026-11-22 11:50 Simon Mikuda
  2026-11-22 18:40 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-11-22 11:50 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda

When a broadcast source transport is released while its ISO connect is
in flight, the late callback still moves the stream to STREAMING and
the io closes right after. Nothing resets the stream, so every later
Acquire() fails with "Request Acquire Reply Input/output error" and the
broadcast shows as active with no BIG on air, until bluetoothd
restarts.

Move such a stream back to CONFIG.

Steps to reproduce:
1. Start and stop a broadcast source (a PipeWire BAP broadcast sink
   node) a few times in quick succession.
2. The broadcast shows as active, but nothing is on air, and stopping
   and starting it again doesn't help until bluetoothd restarts.

Assisted-by: Claude:claude-opus-5-5
---
 profiles/audio/bap.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 457ba5de8..0731e1f23 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -2919,6 +2919,13 @@ static void setup_io_disconnected(int cond, void *user_data)
 
 	setup_io_close(setup, NULL);
 
+	if (bt_bap_pac_get_type(setup->ep->lpac) == BT_BAP_BCAST_SOURCE &&
+		bt_bap_stream_get_state(setup->stream) ==
+					BT_BAP_STREAM_STATE_STREAMING) {
+		DBG("stream %p: io lost while streaming", setup->stream);
+		bt_bap_stream_disable(setup->stream, false, NULL, NULL);
+	}
+
 	bap_update_cigs(setup->ep->data);
 }
 

base-commit: 1adfe662efeff12997df9ddd0960dbd0de9c8ea7
-- 
2.43.0


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

end of thread, other threads:[~2026-11-22 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 11:50 [PATCH BlueZ] bap: Reset broadcast source stream when ISO io is lost Simon Mikuda
2026-11-22 18:40 ` [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