Skip to content
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

tests: bsim: Bluetooth: Enable some high reliability CAP tests #80788

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 32 additions & 10 deletions subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
static int create_prepare_cb(struct lll_prepare_param *p);
static int prepare_cb(struct lll_prepare_param *p);
static int prepare_cb_common(struct lll_prepare_param *p);
static int is_abort_cb(void *next, void *curr, lll_prepare_cb_t *resume_cb);
static void abort_cb(struct lll_prepare_param *prepare_param, void *param);
static void isr_rx_estab(void *param);
static void isr_rx(void *param);
Expand All @@ -56,9 +57,10 @@
static void isr_rx_iso_data_valid(const struct lll_sync_iso *const lll,
uint16_t handle, struct node_rx_pdu *node_rx);
static void isr_rx_iso_data_invalid(const struct lll_sync_iso *const lll,
uint8_t bn, uint16_t handle,
uint16_t latency, uint8_t bn,
uint16_t handle,
struct node_rx_pdu *node_rx);
static void isr_rx_ctrl_recv(struct lll_sync_iso *lll, struct pdu_bis *pdu);

Check notice on line 63 in subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c:63 -static void isr_rx_iso_data_invalid(const struct lll_sync_iso *const lll, - uint16_t latency, uint8_t bn, - uint16_t handle, - struct node_rx_pdu *node_rx); +static void isr_rx_iso_data_invalid(const struct lll_sync_iso *const lll, uint16_t latency, + uint8_t bn, uint16_t handle, struct node_rx_pdu *node_rx);

/* FIXME: Optimize by moving to a common place, as similar variable is used for
* connections too.
Expand Down Expand Up @@ -146,9 +148,9 @@
int err;

/* Invoke common pipeline handling of prepare */
err = lll_prepare(lll_is_abort_cb, abort_cb, create_prepare_cb, 0U,
err = lll_prepare(is_abort_cb, abort_cb, create_prepare_cb, 0U,
param);
LL_ASSERT(!err || err == -EINPROGRESS);

Check notice on line 153 in subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c:153 - err = lll_prepare(is_abort_cb, abort_cb, create_prepare_cb, 0U, - param); + err = lll_prepare(is_abort_cb, abort_cb, create_prepare_cb, 0U, param);
}

static void prepare_bh(void *param)
Expand All @@ -156,7 +158,7 @@
int err;

/* Invoke common pipeline handling of prepare */
err = lll_prepare(lll_is_abort_cb, abort_cb, prepare_cb, 0U, param);
err = lll_prepare(is_abort_cb, abort_cb, prepare_cb, 0U, param);
LL_ASSERT(!err || err == -EINPROGRESS);
}

Expand Down Expand Up @@ -404,6 +406,20 @@
return 0;
}

static int is_abort_cb(void *next, void *curr, lll_prepare_cb_t *resume_cb)
{
if (next != curr) {
struct lll_sync_iso *lll;

lll = curr;
if (lll->bn_curr <= lll->bn) {
return 0;
}
}

return -ECANCELED;
}

static void abort_cb(struct lll_prepare_param *prepare_param, void *param)
{
struct event_done_extra *e;
Expand Down Expand Up @@ -1160,7 +1176,6 @@
uint16_t latency_event;
uint16_t payload_index;
uint8_t bis_idx;
uint8_t bn;

/* Enqueue PDUs to ULL */
node_rx = NULL;
Expand Down Expand Up @@ -1191,8 +1206,7 @@
}

payload_tail = lll->payload_tail;
bn = lll->bn;
while (bn--) {
for (uint8_t bn = 0U; bn < lll->bn; bn++) {
if (lll->payload[stream_curr][payload_tail]) {
node_rx = lll->payload[stream_curr][payload_tail];
lll->payload[stream_curr][payload_tail] = NULL;
Expand All @@ -1217,7 +1231,8 @@
pdu->len = 0U;

handle = LL_BIS_SYNC_HANDLE_FROM_IDX(stream_handle);
isr_rx_iso_data_invalid(lll, bn, handle, node_rx);
isr_rx_iso_data_invalid(lll, latency_event, bn,
handle, node_rx);

iso_rx_put(node_rx->hdr.link, node_rx);
}
Expand Down Expand Up @@ -1363,7 +1378,9 @@

iso_meta = &node_rx->rx_iso_meta;
iso_meta->payload_number = lll->payload_count + (lll->bn_curr - 1U) +
(lll->ptc_curr * lll->pto) - lll->bn;
(lll->ptc_curr * lll->pto);
/* Decrement BN as payload_count was pre-incremented */

Check notice on line 1382 in subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c:1382 - iso_meta->payload_number = lll->payload_count + (lll->bn_curr - 1U) + - (lll->ptc_curr * lll->pto); + iso_meta->payload_number = + lll->payload_count + (lll->bn_curr - 1U) + (lll->ptc_curr * lll->pto);
iso_meta->payload_number -= lll->bn;

stream = ull_sync_iso_lll_stream_get(lll->stream_handle[0]);
iso_meta->timestamp = HAL_TICKER_TICKS_TO_US(radio_tmr_start_get()) +
Expand All @@ -1381,9 +1398,10 @@
}

static void isr_rx_iso_data_invalid(const struct lll_sync_iso *const lll,
uint8_t bn, uint16_t handle,
uint16_t latency, uint8_t bn,
uint16_t handle,
struct node_rx_pdu *node_rx)
{

Check notice on line 1404 in subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c:1404 -static void isr_rx_iso_data_invalid(const struct lll_sync_iso *const lll, - uint16_t latency, uint8_t bn, - uint16_t handle, - struct node_rx_pdu *node_rx) +static void isr_rx_iso_data_invalid(const struct lll_sync_iso *const lll, uint16_t latency, + uint8_t bn, uint16_t handle, struct node_rx_pdu *node_rx)
struct lll_sync_iso_stream *stream;
struct node_rx_iso_meta *iso_meta;

Expand All @@ -1391,15 +1409,19 @@
node_rx->hdr.handle = handle;

iso_meta = &node_rx->rx_iso_meta;
iso_meta->payload_number = lll->payload_count - bn - 1U;
iso_meta->payload_number = lll->payload_count + bn;
/* Decrement BN as payload_count was pre-incremented */
iso_meta->payload_number -= (latency + 1U) * lll->bn;

stream = ull_sync_iso_lll_stream_get(lll->stream_handle[0]);
iso_meta->timestamp = HAL_TICKER_TICKS_TO_US(radio_tmr_start_get()) +
radio_tmr_aa_restore() - addr_us_get(lll->phy) -
((stream->bis_index - 1U) *
lll->sub_interval * ((lll->irc * lll->bn) +
lll->ptc));
iso_meta->timestamp -= (latency * lll->iso_interval *
PERIODIC_INT_UNIT_US);
iso_meta->timestamp %=

Check notice on line 1424 in subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c:1424 - iso_meta->timestamp -= (latency * lll->iso_interval * - PERIODIC_INT_UNIT_US); + iso_meta->timestamp -= (latency * lll->iso_interval * PERIODIC_INT_UNIT_US);
HAL_TICKER_TICKS_TO_US_64BIT(BIT64(HAL_TICKER_CNTR_MSBIT + 1U));
iso_meta->status = 1U;
}
Expand Down
28 changes: 17 additions & 11 deletions subsys/bluetooth/controller/ll_sw/ull_sync_iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,6 @@
struct pdu_big_info *bi;
uint32_t ready_delay_us;
uint32_t ticks_expire;
uint32_t ctrl_spacing;
uint32_t pdu_spacing;
uint32_t interval_us;
uint32_t ticks_diff;
struct pdu_adv *pdu;
Expand Down Expand Up @@ -581,11 +579,6 @@
interval_us -= lll->window_widening_periodic_us;

/* Calculate ISO Receiver BIG event timings */
pdu_spacing = PDU_BIS_US(lll->max_pdu, lll->enc, lll->phy,
PHY_FLAGS_S8) +
EVENT_MSS_US;
ctrl_spacing = PDU_BIS_US(sizeof(struct pdu_big_ctrl), lll->enc,
lll->phy, PHY_FLAGS_S8);

/* Number of maximum BISes to sync from the first BIS to sync */
/* NOTE: When ULL scheduling is implemented for subevents, then update
Expand All @@ -605,26 +598,39 @@
*/

if (IS_ENABLED(CONFIG_BT_CTLR_SYNC_ISO_RESERVE_MAX)) {
/* Maximum time reservation for both sequential and interleaved
uint32_t ctrl_spacing_us;

/* Maximum time reservation for sequential and interleaved
* packing.
*/
slot_us = (pdu_spacing * lll->nse * num_bis) + ctrl_spacing;
if (lll->bis_spacing >= (lll->sub_interval * lll->nse)) {
slot_us = lll->sub_interval * lll->nse * num_bis;
} else {
slot_us = lll->bis_spacing * lll->nse * num_bis;
}

ctrl_spacing_us = PDU_BIS_US(sizeof(struct pdu_big_ctrl),
lll->enc, lll->phy, PHY_FLAGS_S8);
slot_us += ctrl_spacing_us;

Check notice on line 614 in subsys/bluetooth/controller/ll_sw/ull_sync_iso.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/bluetooth/controller/ll_sw/ull_sync_iso.c:614 - ctrl_spacing_us = PDU_BIS_US(sizeof(struct pdu_big_ctrl), - lll->enc, lll->phy, PHY_FLAGS_S8); + ctrl_spacing_us = + PDU_BIS_US(sizeof(struct pdu_big_ctrl), lll->enc, lll->phy, PHY_FLAGS_S8);

} else if (lll->bis_spacing >= (lll->sub_interval * lll->nse)) {
/* Time reservation omitting PTC subevents in sequential
* packing.
*/
slot_us = pdu_spacing * ((lll->nse * num_bis) - lll->ptc);
slot_us = lll->sub_interval * ((lll->nse * num_bis) - lll->ptc);

} else {
/* Time reservation omitting PTC subevents in interleaved
* packing.
*/
slot_us = pdu_spacing * ((lll->nse - lll->ptc) * num_bis);
slot_us = lll->bis_spacing * ((lll->nse - lll->ptc) * num_bis);
}

/* Add radio ready delay */
slot_us += ready_delay_us;
slot_us += lll->window_widening_periodic_us << 1U;
slot_us += EVENT_JITTER_US << 1U;
slot_us += EVENT_TICKER_RES_MARGIN_US << 2U;

/* Add implementation defined radio event overheads */
if (IS_ENABLED(CONFIG_BT_CTLR_EVENT_OVERHEAD_RESERVE_MAX)) {
Expand Down
68 changes: 57 additions & 11 deletions tests/bsim/bluetooth/audio/overlay-bt_ll_sw_split.conf
Original file line number Diff line number Diff line change
@@ -1,45 +1,91 @@
# Controller Settings
CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=255
# Controller
CONFIG_BT_LL_SW_SPLIT=y

# Rx ACL and Adv Reports
CONFIG_BT_CTLR_RX_BUFFERS=9
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

# Coded PHY support
CONFIG_BT_CTLR_PHY_CODED=y

# Advertising Sets and Extended Scanning
CONFIG_BT_CTLR_ADV_EXT=y
CONFIG_BT_CTLR_ADV_SET=3
CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=191
CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=1650

# Controller advanced options
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_ADV_AUX_SET=3
CONFIG_BT_CTLR_ADV_AUX_PDU_BACK2BACK=y
CONFIG_BT_CTLR_ADV_SYNC_SET=3
CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK=y
CONFIG_BT_CTLR_ADV_DATA_BUF_MAX=6

# Increase the below to receive interleaved advertising chains
CONFIG_BT_CTLR_SCAN_AUX_SET=1
# CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS=y
# CONFIG_BT_CTLR_SCAN_AUX_CHAIN_COUNT=1

CONFIG_BT_CTLR_ADV_RESERVE_MAX=n
CONFIG_BT_CTLR_ADV_ISO_RESERVE_MAX=y
CONFIG_BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN=y
CONFIG_BT_CTLR_SYNC_PERIODIC_SKIP_ON_SCAN_AUX=n
CONFIG_BT_CTLR_SYNC_ISO_RESERVE_MAX=n
CONFIG_BT_CTLR_CENTRAL_RESERVE_MAX=n
CONFIG_BT_CTLR_PERIPHERAL_RESERVE_MAX=n
CONFIG_BT_CTLR_PERIPHERAL_ISO_RESERVE_MAX=n
CONFIG_BT_CTLR_EVENT_OVERHEAD_RESERVE_MAX=y
CONFIG_BT_CTLR_SLOT_RESERVATION_UPDATE=n
CONFIG_BT_CTLR_SCAN_UNRESERVED=y
CONFIG_BT_TICKER_NEXT_SLOT_GET_MATCH=y
CONFIG_BT_TICKER_EXT=y
CONFIG_BT_TICKER_EXT_SLOT_WINDOW_YIELD=y

# Control Procedure
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6

# ISO Broadcaster Controller
CONFIG_BT_CTLR_ADV_EXT=y
CONFIG_BT_CTLR_ADV_PERIODIC=y
CONFIG_BT_CTLR_SYNC_TRANSFER_SENDER=y
CONFIG_BT_CTLR_ADV_ISO=y
CONFIG_BT_CTLR_ADV_ISO_PDU_LEN_MAX=247
CONFIG_BT_CTLR_ADV_ISO_STREAM_MAX=2
CONFIG_BT_CTLR_ADV_ISO_SET=1
CONFIG_BT_CTLR_ADV_ISO_STREAM_COUNT=2
CONFIG_BT_CTLR_ADV_ISO_STREAM_MAX=2
CONFIG_BT_CTLR_ADV_ISO_PDU_LEN_MAX=247

# ISO Receive Controller
CONFIG_BT_CTLR_ADV_EXT=y
CONFIG_BT_CTLR_SYNC_PERIODIC=y
CONFIG_BT_CTLR_SYNC_TRANSFER_RECEIVER=y
CONFIG_BT_CTLR_SYNC_ISO=y
CONFIG_BT_CTLR_SYNC_ISO_PDU_LEN_MAX=251
CONFIG_BT_CTLR_SCAN_SYNC_ISO_SET=1
CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT=2
CONFIG_BT_CTLR_SYNC_ISO_STREAM_MAX=2
CONFIG_BT_CTLR_SYNC_ISO_PDU_LEN_MAX=251

# ISO Connection Oriented
CONFIG_BT_CTLR_CENTRAL_ISO=y
CONFIG_BT_CTLR_PERIPHERAL_ISO=y
CONFIG_BT_CTLR_CONN_ISO_GROUPS=1
CONFIG_BT_CTLR_CONN_ISO_STREAMS=2
CONFIG_BT_CTLR_CONN_ISO_STREAMS_PER_GROUP=2
CONFIG_BT_CTLR_CONN_ISO_SDU_LEN_MAX=247
CONFIG_BT_CTLR_CONN_ISO_PDU_LEN_MAX=251
CONFIG_BT_CTLR_CONN_ISO_LOW_LATENCY_POLICY=y

# ISO Transmissions
CONFIG_BT_ISO_TX_MTU=310
CONFIG_BT_ISO_TX_BUF_COUNT=4
CONFIG_BT_CTLR_ISO_TX_BUFFERS=8
CONFIG_BT_CTLR_ISO_TX_BUFFER_SIZE=255
CONFIG_BT_CTLR_ISOAL_SOURCES=2
CONFIG_BT_CTLR_ISO_TX_BUFFERS=18
CONFIG_BT_CTLR_ISO_TX_BUFFER_SIZE=255

# ISO Receptions
CONFIG_BT_ISO_RX_MTU=310
CONFIG_BT_CTLR_ISO_RX_BUFFERS=8
CONFIG_BT_CTLR_ISOAL_SINKS=2
CONFIG_BT_CTLR_ISO_RX_BUFFERS=8

# Tx Power Dynamic Control
CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y

# Ignore HCI ISO data Tx sequence numbers
# CONFIG_BT_CTLR_ISOAL_PSN_IGNORE=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# In theory, CONFIG_BT_ISO_TX_BUF_COUNT=1, should be sufficient but this count
# is used in the context of IPC which falls into a "Newton's Cradle" effect
# where probably (CONFIG_BT_CTLR_ISO_TX_BUFFERS - CONFIG_BT_ISO_TX_BUF_COUNT)
# buffers get throttled. Hence, always have the value equal or greater.
Comment on lines +1 to +4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest to create the GH issue and reference it here rather than having this comment all the places :) Then it's easier to find and cleanup later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still on my todo list to create a IPC test!...

Just not to loose track created this: #81866

CONFIG_BT_ISO_TX_BUF_COUNT=18

CONFIG_BT_CTLR_ISO_TX_BUFFERS=18
2 changes: 1 addition & 1 deletion tests/bsim/bluetooth/audio/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ CONFIG_BT_BAP_BROADCAST_SNK_STREAM_COUNT=2
CONFIG_BT_ISO_PERIPHERAL=y
CONFIG_BT_ISO_MAX_CHAN=4
CONFIG_BT_ISO_TX_MTU=310
CONFIG_BT_ISO_TX_BUF_COUNT=4
CONFIG_BT_ISO_TX_BUF_COUNT=36
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes :D I assume this is 2 x BROADCAST_ENQUEUE_COUNT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, 2x due to 2 BISes support (though test only uses 1 BIS) and the build error check in the test needs this 2x.

CONFIG_BT_ISO_RX_MTU=310
CONFIG_BT_ISO_RX_BUF_COUNT=4

Expand Down
13 changes: 12 additions & 1 deletion tests/bsim/bluetooth/audio/src/cap_acceptor_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@
#include "bap_common.h"

#if defined(CONFIG_BT_CAP_ACCEPTOR)
/* Zephyr Controller works best while Extended Advertising interval to be a multiple
* of the ISO Interval minus 10 ms (max. advertising random delay). This is
* required to place the AUX_ADV_IND PDUs in a non-overlapping interval with the
* Broadcast ISO radio events.
*/
#define BT_LE_EXT_ADV_CONN_CUSTOM \
BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_CONN, \
BT_GAP_MS_TO_ADV_INTERVAL(140), \
BT_GAP_MS_TO_ADV_INTERVAL(140), \
NULL)

Check notice on line 52 in tests/bsim/bluetooth/audio/src/cap_acceptor_test.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

tests/bsim/bluetooth/audio/src/cap_acceptor_test.c:52 -#define BT_LE_EXT_ADV_CONN_CUSTOM \ - BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_CONN, \ - BT_GAP_MS_TO_ADV_INTERVAL(140), \ - BT_GAP_MS_TO_ADV_INTERVAL(140), \ - NULL) +#define BT_LE_EXT_ADV_CONN_CUSTOM \ + BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_CONN, \ + BT_GAP_MS_TO_ADV_INTERVAL(140), BT_GAP_MS_TO_ADV_INTERVAL(140), NULL)
extern enum bst_result_t bst_result;

#define SINK_CONTEXT \
Expand Down Expand Up @@ -608,7 +619,7 @@
struct bt_le_ext_adv *ext_adv;

/* Create a connectable non-scannable advertising set */
err = bt_le_ext_adv_create(BT_LE_ADV_CONN_FAST_1, NULL, &ext_adv);
err = bt_le_ext_adv_create(BT_LE_EXT_ADV_CONN_CUSTOM, NULL, &ext_adv);
if (err != 0) {
FAIL("Failed to create advertising set (err %d)\n", err);

Expand Down
2 changes: 1 addition & 1 deletion tests/bsim/bluetooth/audio/src/cap_commander_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ static bool scan_check_and_sync_broadcast(struct bt_data *data, void *user_data)

printk("Found broadcaster with ID 0x%06X and addr %s and sid 0x%02X\n", broadcast_id,
le_addr, info->sid);
printk("Adv type %02X interval %u", info->adv_type, info->interval);
printk("Adv type %02X interval %u\n", info->adv_type, info->interval);

SET_FLAG(flag_broadcaster_found);

Expand Down
10 changes: 5 additions & 5 deletions tests/bsim/bluetooth/audio/src/cap_initiator_broadcast_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
* Broadcast ISO radio events.
*/
#define BT_LE_EXT_ADV_CUSTOM \
BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV, BT_GAP_MS_TO_ADV_INTERVAL(80), \
BT_GAP_MS_TO_ADV_INTERVAL(80), NULL)
BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV, BT_GAP_MS_TO_ADV_INTERVAL(140), \
BT_GAP_MS_TO_ADV_INTERVAL(140), NULL)

#define BT_LE_PER_ADV_CUSTOM \
BT_LE_PER_ADV_PARAM(BT_GAP_MS_TO_PER_ADV_INTERVAL(90), BT_GAP_MS_TO_PER_ADV_INTERVAL(90), \
BT_LE_PER_ADV_OPT_NONE)
BT_LE_PER_ADV_PARAM(BT_GAP_MS_TO_PER_ADV_INTERVAL(150), \
BT_GAP_MS_TO_PER_ADV_INTERVAL(150), BT_LE_PER_ADV_OPT_NONE)

#define BROADCAST_STREMT_CNT CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT
#define BROADCAST_ENQUEUE_COUNT 2U
#define BROADCAST_ENQUEUE_COUNT 18U
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This refers to the number of SDUs to enqueue - 18 seems excessive (180ms of audio data). Is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

50 ms ISO interval with PTO=1 (BN=5 + 1) needs to have 12 SDUs buffered at an ISO interval and additional 6 SDUs to ensure subsequent ISO intervals have SDUs ready in the Controller. This is equivalent to how 3 Tx ACL buffers are required to ensure a peripheral ACL sends data every connection interval.

#define TOTAL_BUF_NEEDED (BROADCAST_ENQUEUE_COUNT * BROADCAST_STREMT_CNT)
#define CAP_AC_MAX_STREAM 2
#define LOCATION (BT_AUDIO_LOCATION_FRONT_LEFT | BT_AUDIO_LOCATION_FRONT_RIGHT)
Expand Down
5 changes: 5 additions & 0 deletions tests/bsim/bluetooth/audio/sysbuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC)
CACHE INTERNAL ""
)

set(${NET_APP}_EXTRA_CONF_FILE
${APP_DIR}/overlay-nrf5340_cpunet_iso-bt_ll_sw_split.conf
CACHE INTERNAL ""
)

native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP})
endif()

Expand Down
Loading
Loading