-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluetooth: BAP: Add a set of suggested intervals to use with BAP #81093
base: main
Are you sure you want to change the base?
Conversation
ad61f81
to
b94bd7b
Compare
include/zephyr/bluetooth/audio/bap.h
Outdated
* Suggest use is to use this as both the minimum and maximum interval for best results. | ||
* The intervals are suited for both unicast and broadcast. | ||
* @{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chose to use a set of intervals in MS, rather than sets of extended advertising parameters, periodic advertising parameters and sets of connection parameters.
If someone thinks the 3 types of sets (similar to how we have BT_LE_CONN_PARAM_DEFAULT
, BT_LE_ADV_CONN
, BT_LE_PER_ADV_DEFAULT, etc.), please let me know so we can discuss it, but it will be 3 times as many macros.
include/zephyr/bluetooth/audio/bap.h
Outdated
*/ | ||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these are not used by any sample or test. Should we remove one of the "FAST" ones, or keep the unused ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these are suggestions to the application developer of good intervals to use we can keep the FAST ones, even when they are not used in a sample IMO
b94bd7b
to
f4f3960
Compare
f4f3960
to
60198f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only minor nitpicking
@@ -69,19 +69,34 @@ static void broadcast_stream_sent_cb(struct bt_bap_stream *stream) | |||
|
|||
static int setup_extended_adv(struct bt_le_ext_adv **adv) | |||
{ | |||
/* Zephyr Controller works best while Extended Advertising interval to be a multiple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* Zephyr Controller works best while Extended Advertising interval to be a multiple | |
/* Zephyr Controller works best while Extended Advertising interval is a multiple |
@@ -146,10 +146,27 @@ static struct bt_bap_stream_ops broadcast_stream_ops = { | |||
|
|||
static int setup_extended_adv(struct bt_le_ext_adv **adv) | |||
{ | |||
/* Zephyr Controller works best while Extended Advertising interval to be a multiple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* Zephyr Controller works best while Extended Advertising interval to be a multiple | |
/* Zephyr Controller works best while Extended Advertising interval is a multiple |
@@ -133,10 +133,27 @@ static const struct bt_data ad[] = { | |||
|
|||
static int setup_extended_adv(struct bt_le_ext_adv **adv) | |||
{ | |||
/* Zephyr Controller works best while Extended Advertising interval to be a multiple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* Zephyr Controller works best while Extended Advertising interval to be a multiple | |
/* Zephyr Controller works best while Extended Advertising interval is a multiple |
@@ -149,6 +155,42 @@ BT_CONN_CB_DEFINE(conn_callbacks) = { | |||
.security_changed = security_changed_cb, | |||
}; | |||
|
|||
void setup_broadcast_adv(struct bt_le_ext_adv **adv) | |||
{ | |||
/* Zephyr Controller works best while Extended Advertising interval to be a multiple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* Zephyr Controller works best while Extended Advertising interval to be a multiple | |
/* Zephyr Controller works best while Extended Advertising interval is a multiple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked through bap.h.
My concerns are mostly related to that the selected intervals should match what the BAP specification defines as suggested intervals.
@@ -50,6 +50,63 @@ extern "C" { | |||
/** An invalid Broadcast ID */ | |||
#define BT_BAP_INVALID_BROADCAST_ID 0xFFFFFFFFU | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for selecting different sets of intervals for 7.5 ms and 10 ms SDU intervals? To keep things simple, I would suggest using a common factor of these. That is, use intervals 30, 60, or 90 ms.
Edit. The BAP specification in itself suggests to use connection intervals of 7.5 - 30 ms, or 50 - 70 ms, see https://www.bluetooth.com/specifications/specs/bap-1-0-2/. I would suggest to stick to that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The BAP specification suggests to use an advertising interval of 20-30 ms or 150 ms. See https://www.bluetooth.com/specifications/specs/bap-1-0-2/. Is there a reason for not sticking to that?
include/zephyr/bluetooth/audio/bap.h
Outdated
* | ||
* This works well with ISO intervals of 10, 20 and 30 milliseconds for broadcast and unicast | ||
*/ | ||
#define BT_BAP_COEX_INT_MS_10_FAST_1 60U |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Coex" is often used when talking about coexistence with wifi and other protocols. Therefore, to avoid confusion I would suggest to leave that out.
@@ -784,6 +784,7 @@ static void bap_broadcast_assistant_write_cp_cb(struct bt_conn *conn, uint8_t er | |||
net_buf_simple_reset(&att_buf); | |||
|
|||
atomic_clear_bit(inst->flags, BAP_BA_FLAG_BUSY); | |||
LOG_ERR(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you indent to remove this one? :)
You make a very good point. I had forgotten about the values defined in BAP, and it's counterintuitive that we defined different values here. I will revisit the changes in this PR, and see if I can make a good solution with the BAP defined values. |
2537d93
to
73076a5
Compare
I've refactored this PR to defined some more complete parameters, based on the values defined the BAP spec. For broadcast there are no values defined by BAP, and in those cases I've just defined some myself. I opted to use Let me know if you disagree |
7ad7bf2
to
c0f2bd3
Compare
This due to missing implementation to handle the overlapping ACL (or other) events at the CIS establishment instant.
May I know the ACL connection and ISO intervals in this failing test? |
Fix for the symptom (as fix to handle the symptom needs more work, TODO is still valid): #81823 |
43eb7b1
to
51ed62f
Compare
Add a selection of interval values that are suitable for BAP, which will allow better coexistence between ISO and ACL, for both broadcast and unicast. Some of these are defined by the BAP spec, and some are defined by Zephyr, since they do have a suggested value from BAP. Samples and tests have been updated to use these new values. The shell has also been updated to use the LE Audio (BAP) values if audio is enabled, and the audio.conf file has disabled automatic updating of the connection parameters as the peripheral, as we rarely (if ever) want to do that. Due to the connection interval change, CI hit an issue with test_bass_broadcast_code in test_main_client_sync, where the reading of the long receive state did not finish before we attempted to do another procedure, so the function was updated to have a retry. Signed-off-by: Emil Gydesen <[email protected]>
51ed62f
to
66677da
Compare
Add a selection of interval values that are suitable for BAP,
which will allow better coexistence between ISO and ACL,
for both broadcast and unicast.
Samples and tests have been updated to use these new values.
The shell has also been updated to use the LE Audio (BAP) values
if audio is enabled, and the audio.conf file has disabled automatic
updating of the connection parameters as the peripheral, as we rarely
(if ever) want to do that.