From 38a32b768a270d53f368d746476e45bad3ee4939 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Wed, 18 Dec 2024 14:01:03 +0100 Subject: [PATCH] tests: Bluetooth: BAP: Add broadcast tests with multiple subgroups Add 4 new tests for BAP broadcast: 1) One subgroup with one stream per subgroup 2) One subgroup with two streams per subgroup 3) Two subgroups with one stream per subgroup 4) Two subgroup with two streams per subgroup To support these, the number of broadcast streams and data paths was updated to be up to 4. Signed-off-by: Emil Gydesen --- .../audio/overlay-bt_ll_sw_split.conf | 12 ++++---- ...lay-nrf5340_cpunet_iso-bt_ll_sw_split.conf | 9 ++++++ tests/bsim/bluetooth/audio/prj.conf | 10 +++---- .../audio/test_scripts/_bap_broadcast.sh | 17 +++++++++++ ...dcast_audio_multiple_group_multiple_bis.sh | 28 +++++++++++++++++++ ...oadcast_audio_multiple_group_single_bis.sh | 28 +++++++++++++++++++ ...oadcast_audio_single_group_multiple_bis.sh | 28 +++++++++++++++++++ ...broadcast_audio_single_group_single_bis.sh | 28 +++++++++++++++++++ 8 files changed, 149 insertions(+), 11 deletions(-) create mode 100755 tests/bsim/bluetooth/audio/test_scripts/_bap_broadcast.sh create mode 100755 tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_multiple_group_multiple_bis.sh create mode 100755 tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_multiple_group_single_bis.sh create mode 100755 tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_single_group_multiple_bis.sh create mode 100755 tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_single_group_single_bis.sh diff --git a/tests/bsim/bluetooth/audio/overlay-bt_ll_sw_split.conf b/tests/bsim/bluetooth/audio/overlay-bt_ll_sw_split.conf index cf40449c4cc..a8dcadfbca6 100644 --- a/tests/bsim/bluetooth/audio/overlay-bt_ll_sw_split.conf +++ b/tests/bsim/bluetooth/audio/overlay-bt_ll_sw_split.conf @@ -51,8 +51,8 @@ CONFIG_BT_CTLR_ADV_PERIODIC=y CONFIG_BT_CTLR_SYNC_TRANSFER_SENDER=y CONFIG_BT_CTLR_ADV_ISO=y 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_STREAM_COUNT=4 +CONFIG_BT_CTLR_ADV_ISO_STREAM_MAX=4 CONFIG_BT_CTLR_ADV_ISO_PDU_LEN_MAX=247 # ISO Receive Controller @@ -61,8 +61,8 @@ CONFIG_BT_CTLR_SYNC_PERIODIC=y CONFIG_BT_CTLR_SYNC_TRANSFER_RECEIVER=y CONFIG_BT_CTLR_SYNC_ISO=y 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_STREAM_COUNT=4 +CONFIG_BT_CTLR_SYNC_ISO_STREAM_MAX=4 CONFIG_BT_CTLR_SYNC_ISO_PDU_LEN_MAX=251 # ISO Connection Oriented @@ -76,12 +76,12 @@ CONFIG_BT_CTLR_CONN_ISO_PDU_LEN_MAX=251 CONFIG_BT_CTLR_CONN_ISO_LOW_LATENCY_POLICY=y # ISO Transmissions -CONFIG_BT_CTLR_ISOAL_SOURCES=2 +CONFIG_BT_CTLR_ISOAL_SOURCES=4 CONFIG_BT_CTLR_ISO_TX_BUFFERS=18 CONFIG_BT_CTLR_ISO_TX_BUFFER_SIZE=255 # ISO Receptions -CONFIG_BT_CTLR_ISOAL_SINKS=2 +CONFIG_BT_CTLR_ISOAL_SINKS=4 CONFIG_BT_CTLR_ISO_RX_BUFFERS=8 # Tx Power Dynamic Control diff --git a/tests/bsim/bluetooth/audio/overlay-nrf5340_cpunet_iso-bt_ll_sw_split.conf b/tests/bsim/bluetooth/audio/overlay-nrf5340_cpunet_iso-bt_ll_sw_split.conf index 4e61f830892..d90eca55e7c 100644 --- a/tests/bsim/bluetooth/audio/overlay-nrf5340_cpunet_iso-bt_ll_sw_split.conf +++ b/tests/bsim/bluetooth/audio/overlay-nrf5340_cpunet_iso-bt_ll_sw_split.conf @@ -5,3 +5,12 @@ CONFIG_BT_ISO_TX_BUF_COUNT=18 CONFIG_BT_CTLR_ISO_TX_BUFFERS=18 + +CONFIG_BT_CTLR_ADV_ISO_STREAM_COUNT=4 +CONFIG_BT_CTLR_ADV_ISO_STREAM_MAX=4 + +CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT=4 +CONFIG_BT_CTLR_SYNC_ISO_STREAM_MAX=4 + +CONFIG_BT_CTLR_ISOAL_SOURCES=4 +CONFIG_BT_CTLR_ISOAL_SINKS=4 diff --git a/tests/bsim/bluetooth/audio/prj.conf b/tests/bsim/bluetooth/audio/prj.conf index 8c88146875a..dcc7fd5f40f 100644 --- a/tests/bsim/bluetooth/audio/prj.conf +++ b/tests/bsim/bluetooth/audio/prj.conf @@ -44,10 +44,10 @@ CONFIG_BT_BAP_BROADCAST_SOURCE=y CONFIG_BT_BAP_BROADCAST_SINK=y CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE=196 CONFIG_BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE=196 -CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT=2 -CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT=1 -CONFIG_BT_BAP_BROADCAST_SNK_SUBGROUP_COUNT=1 -CONFIG_BT_BAP_BROADCAST_SNK_STREAM_COUNT=2 +CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT=4 +CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT=2 +CONFIG_BT_BAP_BROADCAST_SNK_SUBGROUP_COUNT=2 +CONFIG_BT_BAP_BROADCAST_SNK_STREAM_COUNT=4 CONFIG_BT_ISO_PERIPHERAL=y CONFIG_BT_ISO_MAX_CHAN=4 CONFIG_BT_ISO_TX_MTU=310 @@ -131,7 +131,7 @@ CONFIG_BT_OTS_CLIENT=y # Broadcast Audio Scan Service and client CONFIG_BT_BAP_SCAN_DELEGATOR=y -CONFIG_BT_BAP_BASS_MAX_SUBGROUPS=1 +CONFIG_BT_BAP_BASS_MAX_SUBGROUPS=2 CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE=255 CONFIG_BT_BAP_BROADCAST_ASSISTANT=y diff --git a/tests/bsim/bluetooth/audio/test_scripts/_bap_broadcast.sh b/tests/bsim/bluetooth/audio/test_scripts/_bap_broadcast.sh new file mode 100755 index 00000000000..b31ddd057fe --- /dev/null +++ b/tests/bsim/bluetooth/audio/test_scripts/_bap_broadcast.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 + +dir_path=$(dirname "$0") + +set -e # Exit on error + +# Run all bap_broadcast_audio* tests +for file in "$dir_path"/bap_broadcast_audio*.sh; do + if [ -f "$file" ]; then + echo "Running $file" + $file + fi +done diff --git a/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_multiple_group_multiple_bis.sh b/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_multiple_group_multiple_bis.sh new file mode 100755 index 00000000000..391f5c146c8 --- /dev/null +++ b/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_multiple_group_multiple_bis.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 + +VERBOSITY_LEVEL=2 +EXECUTE_TIMEOUT=120 + +source ${ZEPHYR_BASE}/tests/bsim/sh_common.source + +cd ${BSIM_OUT_PATH}/bin + +SIMULATION_ID="bap_broadcast_audio_multiple_group_multiple_bis" + +Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf \ + -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=broadcast_source \ + -RealEncryption=1 -rs=23 -D=2 -argstest subgroup_cnt 2 streams_per_subgroup_cnt 2 + +Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf \ + -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=1 -testid=broadcast_sink \ + -RealEncryption=1 -rs=27 -D=2 + +# Simulation time should be larger than the WAIT_TIME in common.h +Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ + -D=2 -sim_length=60e6 $@ + +wait_for_background_jobs diff --git a/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_multiple_group_single_bis.sh b/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_multiple_group_single_bis.sh new file mode 100755 index 00000000000..544887be7a2 --- /dev/null +++ b/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_multiple_group_single_bis.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 + +VERBOSITY_LEVEL=2 +EXECUTE_TIMEOUT=120 + +source ${ZEPHYR_BASE}/tests/bsim/sh_common.source + +cd ${BSIM_OUT_PATH}/bin + +SIMULATION_ID="bap_broadcast_audio_multiple_group_single_bis" + +Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf \ + -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=broadcast_source \ + -RealEncryption=1 -rs=23 -D=2 -argstest subgroup_cnt 2 streams_per_subgroup_cnt 1 + +Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf \ + -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=1 -testid=broadcast_sink \ + -RealEncryption=1 -rs=27 -D=2 + +# Simulation time should be larger than the WAIT_TIME in common.h +Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ + -D=2 -sim_length=60e6 $@ + +wait_for_background_jobs diff --git a/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_single_group_multiple_bis.sh b/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_single_group_multiple_bis.sh new file mode 100755 index 00000000000..9d50f018122 --- /dev/null +++ b/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_single_group_multiple_bis.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 + +VERBOSITY_LEVEL=2 +EXECUTE_TIMEOUT=120 + +source ${ZEPHYR_BASE}/tests/bsim/sh_common.source + +cd ${BSIM_OUT_PATH}/bin + +SIMULATION_ID="bap_broadcast_audio_single_group_multiple_bis" + +Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf \ + -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=broadcast_source \ + -RealEncryption=1 -rs=23 -D=2 -argstest subgroup_cnt 1 streams_per_subgroup_cnt 2 + +Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf \ + -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=1 -testid=broadcast_sink \ + -RealEncryption=1 -rs=27 -D=2 + +# Simulation time should be larger than the WAIT_TIME in common.h +Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ + -D=2 -sim_length=60e6 $@ + +wait_for_background_jobs diff --git a/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_single_group_single_bis.sh b/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_single_group_single_bis.sh new file mode 100755 index 00000000000..87b11003ab1 --- /dev/null +++ b/tests/bsim/bluetooth/audio/test_scripts/bap_broadcast_audio_single_group_single_bis.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 + +VERBOSITY_LEVEL=2 +EXECUTE_TIMEOUT=120 + +source ${ZEPHYR_BASE}/tests/bsim/sh_common.source + +cd ${BSIM_OUT_PATH}/bin + +SIMULATION_ID="bap_broadcast_audio_single_group_single_bis" + +Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf \ + -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=broadcast_source \ + -RealEncryption=1 -rs=23 -D=2 -argstest subgroup_cnt 1 streams_per_subgroup_cnt 1 + +Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf \ + -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=1 -testid=broadcast_sink \ + -RealEncryption=1 -rs=27 -D=2 + +# Simulation time should be larger than the WAIT_TIME in common.h +Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ + -D=2 -sim_length=60e6 $@ + +wait_for_background_jobs