Implement ClearConfiguration() and Reconfigure() for BAP unicast MediaEndpoints. v3: - Add bt_bap_stream_lock(), instead of bt_bap_stream_discard() - Separate commit for "detach on RELEASING" - Move "bap: do not try QoS before links are updated" first, as it makes sense standalone - Add "bap: don't show error when releasing stream" - Add "bap: delay QoS & IO creation if CIG is busy or setups configuring" This reworks the unicast stream creation/QoS/CIG activation logic, to avoid doing operations that are impossible due to CIG state machine rules, or lead to ID conflicts. Unicast tested manually on: - Sony Linkbuds S: switching between AC 6(ii), 8(ii), 11(ii) - Earfun Air Pro 3: switching between AC 6(i), 11(i) with corresponding Pipewire branch https://gitlab.freedesktop.org/pvir/pipewire/-/commits/bap-codec-switch-select Some more testing is probably warranted. Broadcast has not been tested. Pauli Virtanen (10): bap: do not try QoS before links are updated & io created shared/bap: detach ucast io on RELEASING and unlink streams shared/bap: add client ASE reuse and upper level stream locking bap: lock streams when used bap: add ready callback for setup configuration bap: support removing streams with ClearConfiguration() bap: add callback at the end of ucast client select/config bap: implement Reconfigure() bap: don't show error when releasing stream bap: delay QoS & IO creation if CIG is busy or setups configuring profiles/audio/bap.c | 1085 ++++++++++++++++++++++++++++-------- profiles/audio/transport.c | 20 +- profiles/audio/transport.h | 1 + src/shared/bap.c | 168 ++++-- src/shared/bap.h | 3 + 5 files changed, 1005 insertions(+), 272 deletions(-) -- 2.49.0