ASE may be in non-configurable state also if it has no associated stream, eg. as a result of failed stream teardown or other misbehavior. Check also ASE state when selecting a "free" one. Fixes wrongly picking ASE that is not IDLE/CONFIG/QOS and cannot be configured. --- src/shared/bap.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index c27e675ff..ed5c322b4 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -6224,6 +6224,15 @@ static bool find_ep_ucast(const void *data, const void *user_data) } } + switch (ep->state) { + case BT_ASCS_ASE_STATE_IDLE: + case BT_ASCS_ASE_STATE_CONFIG: + case BT_ASCS_ASE_STATE_QOS: + break; + default: + return false; + } + if (ep->dir != match->rpac->type) return false; -- 2.50.1