zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.67k stars 6.52k forks source link

Bluetooth: ISO: Change implicit ISO data path setup to explicit ISO data path setup #68359

Open Thalley opened 8 months ago

Thalley commented 8 months ago

Is your enhancement proposal related to a problem? Please describe. In the ISO API, the data paths are automatically setup and removed by the ISO layer at connection/disconnection.

This design offers a simpler version of ISO, but it is also less flexible, and does not allow the upper layers to control how or when the ISO data paths are setup. This design have caused several issues in BAP where multiple unicast streams may share the same CIS, but enters the streaming state at different times (unlike a CIS where both directions are connected at the same time). ISO should not autonomously setup the ISO data path, and should be done by the upper layers

Describe the solution you'd like Remove the call to bt_iso_setup_data_path in bt_iso_connected and the call to bt_iso_remove_data_path in bt_iso_chan_disconnected.

Move the bt_iso_setup_data_path and bt_iso_remove_data_path to public API functions that allows the upper layer to control the ISO data path. The parameters may be modified.

Finally remove the struct bt_iso_chan_path *path; from struct bt_iso_chan_io_qos.

Describe alternatives you've considered N/A

Additional context Samples, tests and BAP need to be modified for this as well, and thus is a larger change. Consider implementing the data path functionality in BAP, rather than exposing similar functions at the BAP level, as the BAP implementation should be able to control the data paths (basically setup the data path when entering streaming (or even enabling) state, and remove when exiting the streamng state.

Thalley commented 3 weeks ago

Blocked by https://github.com/zephyrproject-rtos/zephyr/issues/77387