diff mbox series

[v2,3/3] bap:Update transport acquire/release flow for bcast src

Message ID 20231002153352.3163-4-iulia.tanasescu@nxp.com
State New
Headers show
Series Update transport acquire/release flow BAP bcast source | expand

Commit Message

Iulia Tanasescu Oct. 2, 2023, 3:33 p.m. UTC
From: Silviu Florian Barbulescu <silviu.barbulescu@nxp.com>

Update transport acquire/release flow for BAP bcast source

---
 profiles/audio/bap.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 48a1a4f86..9a46b16ab 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -1328,6 +1328,10 @@  static void iso_connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
 	fd = g_io_channel_unix_get_fd(chan);
 
 	if (bt_bap_stream_set_io(stream, fd)) {
+		if (bt_bap_stream_get_type(stream) ==
+						BT_BAP_STREAM_TYPE_BCAST) {
+			bt_bap_stream_start(stream, NULL, NULL);
+		}
 		g_io_channel_set_close_on_unref(chan, FALSE);
 		return;
 	}
@@ -1887,18 +1891,16 @@  static void bap_state(struct bt_bap_stream *stream, uint8_t old_state,
 		}
 		break;
 	case BT_BAP_STREAM_STATE_QOS:
-		bap_create_io(data, ep, stream, true);
+		if (bt_bap_stream_get_type(stream) ==
+					BT_BAP_STREAM_TYPE_UCAST) {
+			bap_create_io(data, ep, stream, true);
+		}
 		break;
 	case BT_BAP_STREAM_STATE_ENABLING:
 		if (ep)
 			bap_create_io(data, ep, stream, false);
 		break;
 	case BT_BAP_STREAM_STATE_STREAMING:
-		if (bt_bap_stream_get_type(stream) ==
-				BT_BAP_STREAM_TYPE_BCAST) {
-			if (ep)
-				bap_create_io(data, ep, stream, false);
-		}
 		break;
 	}
 }
@@ -2116,6 +2118,8 @@  static void bap_connecting(struct bt_bap_stream *stream, bool state, int fd,
 
 			ep->qos.bcast.big = qos.bcast.big;
 			ep->qos.bcast.bis = qos.bcast.bis;
+			bt_bap_stream_config(ep->stream, &ep->qos,
+					ep->caps, NULL, NULL);
 		}
 
 		DBG("stream %p fd %d: BIG 0x%02x BIS 0x%02x", stream, fd,