diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 2994881..b776511 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
}
break;
case BT_BAP_STREAM_STATE_STREAMING:
+ /* Order of STREAMING and iso_connect_cb() is nondeterministic.
+ *
+ * If iso_connect_cb() did not complete yet, mark IO as
+ * connected regardless, otherwise transport fails acquiring it.
+ * If the connect doesn't actually succeed, it is handled via
+ * normal disconnect flow.
+ */
+ if (setup) {
+ int fd;
+
+ if (!setup->io || !setup->cis_active)
+ break;
+ if (!bt_bap_stream_io_is_connecting(stream, &fd))
+ break;
+ if (fd != g_io_channel_unix_get_fd(setup->io))
+ break;
+
+ DBG("setup %p stream %p io not yet ready",
+ setup, stream);
+ bt_bap_stream_set_io(stream, fd);
+ }
break;
}
}