* [PATCH BlueZ 0/2] test-bap: Add Broadcast Source STR MBIS tests @ 2024-06-06 10:25 Iulia Tanasescu 2024-06-06 10:25 ` [PATCH BlueZ 1/2] test-bap: Add support to config multiple bsrc streams Iulia Tanasescu 2024-06-06 10:25 ` [PATCH BlueZ 2/2] " Iulia Tanasescu 0 siblings, 2 replies; 9+ messages in thread From: Iulia Tanasescu @ 2024-06-06 10:25 UTC (permalink / raw) To: linux-bluetooth Cc: claudia.rosu, mihai-octavian.urzica, vlad.pruteanu, andrei.istodorescu, luiz.dentz, Iulia Tanasescu This patch adds BAP unit tests for Broadcast Source streaming with multiple BISes (4.14.3 Broadcast Audio Stream with Multiple BISes - Source - page 184). Iulia Tanasescu (2): test-bap: Add support to config multiple bsrc streams test-bap: Add Broadcast Source STR MBIS tests unit/test-bap.c | 406 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 391 insertions(+), 15 deletions(-) base-commit: 7c619d864afd01df6a98baeffe7030a3d144b22a -- 2.39.2 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH BlueZ 1/2] test-bap: Add support to config multiple bsrc streams 2024-06-06 10:25 [PATCH BlueZ 0/2] test-bap: Add Broadcast Source STR MBIS tests Iulia Tanasescu @ 2024-06-06 10:25 ` Iulia Tanasescu 2024-06-06 12:31 ` test-bap: Add Broadcast Source STR MBIS tests bluez.test.bot 2024-06-06 10:25 ` [PATCH BlueZ 2/2] " Iulia Tanasescu 1 sibling, 1 reply; 9+ messages in thread From: Iulia Tanasescu @ 2024-06-06 10:25 UTC (permalink / raw) To: linux-bluetooth Cc: claudia.rosu, mihai-octavian.urzica, vlad.pruteanu, andrei.istodorescu, luiz.dentz, Iulia Tanasescu This adds support to configure multiple bsrc streams. --- unit/test-bap.c | 52 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index 638717afc..c37f7676f 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -538,15 +538,17 @@ static void bsrc_pac_added(struct bt_bap_pac *pac, void *user_data) bt_bap_pac_set_ops(pac, &bcast_pac_ops, NULL); - stream = bt_bap_stream_new(data->bap, pac, NULL, - &data->cfg->qos, - &data->cfg->cc); - g_assert(stream); + for (uint8_t i = 0; i < data->cfg->streams; i++) { + stream = bt_bap_stream_new(data->bap, pac, NULL, + &data->cfg->qos, + &data->cfg->cc); + g_assert(stream); - queue_push_tail(data->streams, stream); + queue_push_tail(data->streams, stream); - bt_bap_stream_config(stream, &data->cfg->qos, - &data->cfg->cc, NULL, data); + bt_bap_stream_config(stream, &data->cfg->qos, + &data->cfg->cc, NULL, data); + } } static void bsrc_state_cfg(struct bt_bap_stream *stream, uint8_t old_state, @@ -5603,6 +5605,7 @@ static struct test_config cfg_bsrc_8_1_1 = { .base = UTIL_IOV_INIT(BASE_LC3_8_1), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_8_1_2 = { @@ -5611,6 +5614,7 @@ static struct test_config cfg_bsrc_8_1_2 = { .base = UTIL_IOV_INIT(BASE_LC3_8_1), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_8_2 \ @@ -5627,6 +5631,7 @@ static struct test_config cfg_bsrc_8_2_1 = { .base = UTIL_IOV_INIT(BASE_LC3_8_2), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_8_2_2 = { @@ -5635,6 +5640,7 @@ static struct test_config cfg_bsrc_8_2_2 = { .base = UTIL_IOV_INIT(BASE_LC3_8_2), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_16_1 \ @@ -5651,6 +5657,7 @@ static struct test_config cfg_bsrc_16_1_1 = { .base = UTIL_IOV_INIT(BASE_LC3_16_1), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_16_1_2 = { @@ -5659,6 +5666,7 @@ static struct test_config cfg_bsrc_16_1_2 = { .base = UTIL_IOV_INIT(BASE_LC3_16_1), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_16_2 \ @@ -5675,6 +5683,7 @@ static struct test_config cfg_bsrc_16_2_1 = { .base = UTIL_IOV_INIT(BASE_LC3_16_2), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_16_2_2 = { @@ -5683,6 +5692,7 @@ static struct test_config cfg_bsrc_16_2_2 = { .base = UTIL_IOV_INIT(BASE_LC3_16_2), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_24_1 \ @@ -5699,6 +5709,7 @@ static struct test_config cfg_bsrc_24_1_1 = { .base = UTIL_IOV_INIT(BASE_LC3_24_1), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_24_1_2 = { @@ -5707,6 +5718,7 @@ static struct test_config cfg_bsrc_24_1_2 = { .base = UTIL_IOV_INIT(BASE_LC3_24_1), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_24_2 \ @@ -5723,6 +5735,7 @@ static struct test_config cfg_bsrc_24_2_1 = { .base = UTIL_IOV_INIT(BASE_LC3_24_2), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_24_2_2 = { @@ -5731,6 +5744,7 @@ static struct test_config cfg_bsrc_24_2_2 = { .base = UTIL_IOV_INIT(BASE_LC3_24_2), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_32_1 \ @@ -5747,6 +5761,7 @@ static struct test_config cfg_bsrc_32_1_1 = { .base = UTIL_IOV_INIT(BASE_LC3_32_1), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_32_1_2 = { @@ -5755,6 +5770,7 @@ static struct test_config cfg_bsrc_32_1_2 = { .base = UTIL_IOV_INIT(BASE_LC3_32_1), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_32_2 \ @@ -5771,6 +5787,7 @@ static struct test_config cfg_bsrc_32_2_1 = { .base = UTIL_IOV_INIT(BASE_LC3_32_2), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_32_2_2 = { @@ -5779,6 +5796,7 @@ static struct test_config cfg_bsrc_32_2_2 = { .base = UTIL_IOV_INIT(BASE_LC3_32_2), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_44_1 \ @@ -5795,6 +5813,7 @@ static struct test_config cfg_bsrc_44_1_1 = { .base = UTIL_IOV_INIT(BASE_LC3_44_1), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_44_1_2 = { @@ -5803,6 +5822,7 @@ static struct test_config cfg_bsrc_44_1_2 = { .base = UTIL_IOV_INIT(BASE_LC3_44_1), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_44_2 \ @@ -5819,6 +5839,7 @@ static struct test_config cfg_bsrc_44_2_1 = { .base = UTIL_IOV_INIT(BASE_LC3_44_2), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_44_2_2 = { @@ -5827,6 +5848,7 @@ static struct test_config cfg_bsrc_44_2_2 = { .base = UTIL_IOV_INIT(BASE_LC3_44_2), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_48_1 \ @@ -5843,6 +5865,7 @@ static struct test_config cfg_bsrc_48_1_1 = { .base = UTIL_IOV_INIT(BASE_LC3_48_1), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_48_1_2 = { @@ -5851,6 +5874,7 @@ static struct test_config cfg_bsrc_48_1_2 = { .base = UTIL_IOV_INIT(BASE_LC3_48_1), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_48_2 \ @@ -5867,6 +5891,7 @@ static struct test_config cfg_bsrc_48_2_1 = { .base = UTIL_IOV_INIT(BASE_LC3_48_2), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_48_2_2 = { @@ -5875,6 +5900,7 @@ static struct test_config cfg_bsrc_48_2_2 = { .base = UTIL_IOV_INIT(BASE_LC3_48_2), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_48_3 \ @@ -5891,6 +5917,7 @@ static struct test_config cfg_bsrc_48_3_1 = { .base = UTIL_IOV_INIT(BASE_LC3_48_3), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_48_3_2 = { @@ -5899,6 +5926,7 @@ static struct test_config cfg_bsrc_48_3_2 = { .base = UTIL_IOV_INIT(BASE_LC3_48_3), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_48_4 \ @@ -5915,6 +5943,7 @@ static struct test_config cfg_bsrc_48_4_1 = { .base = UTIL_IOV_INIT(BASE_LC3_48_4), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_48_4_2 = { @@ -5923,6 +5952,7 @@ static struct test_config cfg_bsrc_48_4_2 = { .base = UTIL_IOV_INIT(BASE_LC3_48_4), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_48_5 \ @@ -5939,6 +5969,7 @@ static struct test_config cfg_bsrc_48_5_1 = { .base = UTIL_IOV_INIT(BASE_LC3_48_5), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_48_5_2 = { @@ -5947,6 +5978,7 @@ static struct test_config cfg_bsrc_48_5_2 = { .base = UTIL_IOV_INIT(BASE_LC3_48_5), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define LC3_CFG_48_6 \ @@ -5963,6 +5995,7 @@ static struct test_config cfg_bsrc_48_6_1 = { .base = UTIL_IOV_INIT(BASE_LC3_48_6), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; static struct test_config cfg_bsrc_48_6_2 = { @@ -5971,6 +6004,7 @@ static struct test_config cfg_bsrc_48_6_2 = { .base = UTIL_IOV_INIT(BASE_LC3_48_6), .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; #define VS_CC \ @@ -6007,6 +6041,7 @@ static struct test_config cfg_bsrc_vs = { .vs = true, .src = true, .state_func = bsrc_state_cfg, + .streams = 1, }; /* Test Purpose: @@ -6152,6 +6187,7 @@ static struct test_config cfg_bsrc_8_1_1_estab = { .qos = LC3_QOS_8_1_1_B, .src = true, .state_func = bsrc_state_estab, + .streams = 1, }; /* Test Purpose: @@ -6196,6 +6232,7 @@ static struct test_config cfg_bsrc_8_1_1_disable = { .qos = LC3_QOS_8_1_1_B, .src = true, .state_func = bsrc_state_disable, + .streams = 1, }; /* Test Purpose: @@ -6241,6 +6278,7 @@ static struct test_config cfg_bsrc_8_1_1_release = { .qos = LC3_QOS_8_1_1_B, .src = true, .state_func = bsrc_state_release, + .streams = 1, }; /* Test Purpose: -- 2.39.2 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* RE: test-bap: Add Broadcast Source STR MBIS tests 2024-06-06 10:25 ` [PATCH BlueZ 1/2] test-bap: Add support to config multiple bsrc streams Iulia Tanasescu @ 2024-06-06 12:31 ` bluez.test.bot 0 siblings, 0 replies; 9+ messages in thread From: bluez.test.bot @ 2024-06-06 12:31 UTC (permalink / raw) To: linux-bluetooth, iulia.tanasescu [-- Attachment #1: Type: text/plain, Size: 949 bytes --] This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series: PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=859457 ---Test result--- Test Summary: CheckPatch PASS 0.82 seconds GitLint PASS 0.44 seconds BuildEll PASS 25.43 seconds BluezMake PASS 1670.30 seconds MakeCheck PASS 13.21 seconds MakeDistcheck PASS 180.34 seconds CheckValgrind PASS 254.86 seconds CheckSmatch PASS 359.76 seconds bluezmakeextell PASS 123.43 seconds IncrementalBuild PASS 3115.42 seconds ScanBuild PASS 1014.02 seconds --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH BlueZ 2/2] test-bap: Add Broadcast Source STR MBIS tests 2024-06-06 10:25 [PATCH BlueZ 0/2] test-bap: Add Broadcast Source STR MBIS tests Iulia Tanasescu 2024-06-06 10:25 ` [PATCH BlueZ 1/2] test-bap: Add support to config multiple bsrc streams Iulia Tanasescu @ 2024-06-06 10:25 ` Iulia Tanasescu 2024-06-06 20:28 ` Luiz Augusto von Dentz 1 sibling, 1 reply; 9+ messages in thread From: Iulia Tanasescu @ 2024-06-06 10:25 UTC (permalink / raw) To: linux-bluetooth Cc: claudia.rosu, mihai-octavian.urzica, vlad.pruteanu, andrei.istodorescu, luiz.dentz, Iulia Tanasescu 4.14.3 Broadcast Audio Stream with Multiple BISes - Source Test Purpose: Verify that a Broadcast Source IUT can stream multiple BISes to a Broadcast Sink. Test Case Configuration: BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1] BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2] BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 16_1] BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 16_2] BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 24_1] BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 24_2] BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 32_1] BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 32_2] BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 44.1_1] BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 44.1_2] BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 48_1] BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 48_2] BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 48_3] BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 48_4] BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 48_5] BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 48_6] BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS] Pass verdict: If the Codec ID is LC3, the IUT sends encoded LC3 audio data in BIS Data PDUs on each synchronized BIS. If the Codec ID is a vendor-specific Codec ID, the IUT sends BIS Data PDUs on each synchronized BIS. The parameters included in the Codec_Specific_Configuration data are as defined in TSPX_VS_Codec_Specific_Configuration. If the Codec ID is LC3, each parameter included in Codec_Specific_Configuration data is formatted in an LTV structure with the length, type, and value specified in Table 4.83. Test Summary ------------ BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1] Passed BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2] Passed BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 16_1] Passed BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 16_2] Passed BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 24_1] Passed BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 24_2] Passed BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 32_1] Passed BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 32_2] Passed BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 44.1_1] Passed BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 44.1_2] Passed BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 48_1] Passed BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 48_2] Passed BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 48_3] Passed BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 48_4] Passed BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 48_5] Passed BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 48_6] Passed BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS] Passed --- unit/test-bap.c | 354 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 346 insertions(+), 8 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index c37f7676f..30c223d16 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -6972,27 +6972,86 @@ static void test_bsnk_str(void) NULL, test_bcast, &cfg_bsnk_str_vs_mbis, IOV_NULL); } +static void stream_count_config(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + uint8_t *streams = user_data; + + if (bt_bap_stream_get_state(stream) == BT_BAP_STREAM_STATE_CONFIG) + (*streams)++; +} + +static void stream_count_enabling(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + uint8_t *streams = user_data; + + if (bt_bap_stream_get_state(stream) == BT_BAP_STREAM_STATE_ENABLING) + (*streams)++; +} + +static void stream_enable(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); +} + +static void stream_start(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + + bt_bap_stream_start(stream, NULL, NULL); +} + static void bsrc_state_str(struct bt_bap_stream *stream, uint8_t old_state, uint8_t new_state, void *user_data) { struct test_data *data = user_data; + uint8_t streams = 0; switch (new_state) { case BT_BAP_STREAM_STATE_CONFIG: - bt_bap_stream_enable(stream, true, NULL, NULL, NULL); + queue_foreach(data->streams, stream_count_config, &streams); + + if (streams == data->cfg->streams) + /* After all streams have transitioned to CONFIG + * state, enable each one. + */ + queue_foreach(data->streams, stream_enable, NULL); break; case BT_BAP_STREAM_STATE_ENABLING: - data->base = bt_bap_stream_get_base(stream); + queue_foreach(data->streams, stream_count_enabling, &streams); - g_assert(data->base); - g_assert(data->base->iov_len == data->cfg->base.iov_len); - g_assert(memcmp(data->base->iov_base, data->cfg->base.iov_base, - data->base->iov_len) == 0); + if (streams == 1) { + /* After the first stream has transitioned to ENABLING + * state, bt_bap_stream_get_base will generate the + * BASE from all previously configured streams. + */ + data->base = bt_bap_stream_get_base(stream); + + g_assert(data->base); + g_assert(data->base->iov_len == + data->cfg->base.iov_len); + g_assert(memcmp(data->base->iov_base, + data->cfg->base.iov_base, + data->base->iov_len) == 0); + } - bt_bap_stream_start(stream, NULL, NULL); + if (streams == data->cfg->streams) + /* After all streams have transitioned to ENABLING + * state, start each one. + */ + queue_foreach(data->streams, stream_start, NULL); break; case BT_BAP_STREAM_STATE_STREAMING: - tester_test_passed(); + queue_foreach(data->streams, stream_count_streaming, &streams); + + if (streams == data->cfg->streams) + /* Test is completed after all streams have transitioned + * to STREAMING state. + */ + tester_test_passed(); break; } } @@ -7225,9 +7284,288 @@ static void test_bsrc_str_1b(void) NULL, test_bcast, &cfg_bsrc_str_vs, IOV_NULL); } +#define BASE_LC3_8_1_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_8_1, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_8_1_mbis = { + .cc = LC3_CONFIG_8_1, + .qos = LC3_QOS_8_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_8_1_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_8_2_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_8_2, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_8_2_mbis = { + .cc = LC3_CONFIG_8_2, + .qos = LC3_QOS_8_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_8_2_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_16_1_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_16_1, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_16_1_mbis = { + .cc = LC3_CONFIG_16_1, + .qos = LC3_QOS_16_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_16_1_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_16_2_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_16_2, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_16_2_mbis = { + .cc = LC3_CONFIG_16_2, + .qos = LC3_QOS_16_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_16_2_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_24_1_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_24_1, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_24_1_mbis = { + .cc = LC3_CONFIG_24_1, + .qos = LC3_QOS_24_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_24_1_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_24_2_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_24_2, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_24_2_mbis = { + .cc = LC3_CONFIG_24_2, + .qos = LC3_QOS_24_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_24_2_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_32_1_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_32_1, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_32_1_mbis = { + .cc = LC3_CONFIG_32_1, + .qos = LC3_QOS_32_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_32_1_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_32_2_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_32_2, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_32_2_mbis = { + .cc = LC3_CONFIG_32_2, + .qos = LC3_QOS_32_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_32_2_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_44_1_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_44_1, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_44_1_mbis = { + .cc = LC3_CONFIG_44_1, + .qos = LC3_QOS_44_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_44_1_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_44_2_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_44_2, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_44_2_mbis = { + .cc = LC3_CONFIG_44_2, + .qos = LC3_QOS_44_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_44_2_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_48_1_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_48_1, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_48_1_mbis = { + .cc = LC3_CONFIG_48_1, + .qos = LC3_QOS_48_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_1_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_48_2_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_48_2, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_48_2_mbis = { + .cc = LC3_CONFIG_48_2, + .qos = LC3_QOS_48_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_2_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_48_3_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_48_3, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_48_3_mbis = { + .cc = LC3_CONFIG_48_3, + .qos = LC3_QOS_48_3_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_3_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_48_4_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_48_4, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_48_4_mbis = { + .cc = LC3_CONFIG_48_4, + .qos = LC3_QOS_48_4_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_4_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_48_5_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_48_5, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_48_5_mbis = { + .cc = LC3_CONFIG_48_5, + .qos = LC3_QOS_48_5_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_5_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_LC3_48_6_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_48_6, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_48_6_mbis = { + .cc = LC3_CONFIG_48_6, + .qos = LC3_QOS_48_6_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_6_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +#define BASE_VS_MBIS \ + BASE(40000, 1, 2, 0xFF, 0x00, 0x00, 0x00, 0x00, \ + VS_CFG, 0x00, 0x01, 0x00, 0x02, 0x00) + +static struct test_config cfg_bsrc_str_vs_mbis = { + .cc = UTIL_IOV_INIT(VS_CC), + .qos = QOS_BCAST, + .base = UTIL_IOV_INIT(BASE_VS_MBIS), + .src = true, + .state_func = bsrc_state_str, + .vs = true, + .streams = 2, +}; + +/* Test Purpose: + * Verify that a Broadcast Source IUT can stream multiple BISes to + * a Broadcast Sink. The verification is performed for each set of + * parameters in turn, as specified in Table 4.82. + * + * Pass verdict: + * If the Codec ID is LC3, the IUT sends encoded LC3 audio data in + * BIS Data PDUs on each synchronized BIS. + * + * If the Codec ID is a vendor-specific Codec ID, the IUT sends BIS + * Data PDUs on each synchronized BIS. The parameters included in the + * Codec_Specific_Configuration data are as defined in + * TSPX_VS_Codec_Specific_Configuration. + * + * If the Codec ID is LC3, each parameter included in + * Codec_Specific_Configuration data is formatted in an LTV structure + * with the length, type, and value specified in Table 4.83. + */ +static void test_bsrc_str_2b(void) +{ + define_test("BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1]", + NULL, test_bcast, &cfg_bsrc_str_8_1_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2]", + NULL, test_bcast, &cfg_bsrc_str_8_2_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 16_1]", + NULL, test_bcast, &cfg_bsrc_str_16_1_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 16_2]", + NULL, test_bcast, &cfg_bsrc_str_16_2_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 24_1]", + NULL, test_bcast, &cfg_bsrc_str_24_1_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 24_2]", + NULL, test_bcast, &cfg_bsrc_str_24_2_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 32_1]", + NULL, test_bcast, &cfg_bsrc_str_32_1_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 32_2]", + NULL, test_bcast, &cfg_bsrc_str_32_2_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 44.1_1]", + NULL, test_bcast, &cfg_bsrc_str_44_1_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 44.1_2]", + NULL, test_bcast, &cfg_bsrc_str_44_2_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 48_1]", + NULL, test_bcast, &cfg_bsrc_str_48_1_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 48_2]", + NULL, test_bcast, &cfg_bsrc_str_48_2_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 48_3]", + NULL, test_bcast, &cfg_bsrc_str_48_3_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 48_4]", + NULL, test_bcast, &cfg_bsrc_str_48_4_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 48_5]", + NULL, test_bcast, &cfg_bsrc_str_48_5_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 48_6]", + NULL, test_bcast, &cfg_bsrc_str_48_6_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS]", + NULL, test_bcast, &cfg_bsrc_str_vs_mbis, IOV_NULL); +} + static void test_bsrc_str(void) { test_bsrc_str_1b(); + test_bsrc_str_2b(); } int main(int argc, char *argv[]) -- 2.39.2 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH BlueZ 2/2] test-bap: Add Broadcast Source STR MBIS tests 2024-06-06 10:25 ` [PATCH BlueZ 2/2] " Iulia Tanasescu @ 2024-06-06 20:28 ` Luiz Augusto von Dentz 2024-06-10 7:23 ` Iulia Tanasescu 2024-06-20 14:22 ` Iulia Tanasescu 0 siblings, 2 replies; 9+ messages in thread From: Luiz Augusto von Dentz @ 2024-06-06 20:28 UTC (permalink / raw) To: Iulia Tanasescu Cc: linux-bluetooth, claudia.rosu, mihai-octavian.urzica, vlad.pruteanu, andrei.istodorescu Hi Iulia, On Thu, Jun 6, 2024 at 6:26 AM Iulia Tanasescu <iulia.tanasescu@nxp.com> wrote: > > 4.14.3 Broadcast Audio Stream with Multiple BISes - Source > > Test Purpose: > Verify that a Broadcast Source IUT can stream multiple > BISes to a Broadcast Sink. > > Test Case Configuration: > BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1] > BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2] > BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 16_1] > BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 16_2] > BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 24_1] > BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 24_2] > BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 32_1] > BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 32_2] > BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 44.1_1] > BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 44.1_2] > BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 48_1] > BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 48_2] > BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 48_3] > BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 48_4] > BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 48_5] > BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 48_6] > BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS] > > Pass verdict: > If the Codec ID is LC3, the IUT sends encoded LC3 audio > data in BIS Data PDUs on each synchronized BIS. > > If the Codec ID is a vendor-specific Codec ID, the IUT > sends BIS Data PDUs on each synchronized BIS. The parameters > included in the Codec_Specific_Configuration data are as > defined in TSPX_VS_Codec_Specific_Configuration. > > If the Codec ID is LC3, each parameter included in > Codec_Specific_Configuration data is formatted in an LTV > structure with the length, type, and value specified in > Table 4.83. > > Test Summary > ------------ > BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1] Passed > BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2] Passed > BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 16_1] Passed > BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 16_2] Passed > BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 24_1] Passed > BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 24_2] Passed > BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 32_1] Passed > BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 32_2] Passed > BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 44.1_1] Passed > BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 44.1_2] Passed > BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 48_1] Passed > BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 48_2] Passed > BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 48_3] Passed > BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 48_4] Passed > BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 48_5] Passed > BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 48_6] Passed > BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS] Passed > --- > unit/test-bap.c | 354 ++++++++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 346 insertions(+), 8 deletions(-) > > diff --git a/unit/test-bap.c b/unit/test-bap.c > index c37f7676f..30c223d16 100644 > --- a/unit/test-bap.c > +++ b/unit/test-bap.c > @@ -6972,27 +6972,86 @@ static void test_bsnk_str(void) > NULL, test_bcast, &cfg_bsnk_str_vs_mbis, IOV_NULL); > } > > +static void stream_count_config(void *data, void *user_data) > +{ > + struct bt_bap_stream *stream = data; > + uint8_t *streams = user_data; > + > + if (bt_bap_stream_get_state(stream) == BT_BAP_STREAM_STATE_CONFIG) > + (*streams)++; > +} > + > +static void stream_count_enabling(void *data, void *user_data) > +{ > + struct bt_bap_stream *stream = data; > + uint8_t *streams = user_data; > + > + if (bt_bap_stream_get_state(stream) == BT_BAP_STREAM_STATE_ENABLING) > + (*streams)++; > +} > + > +static void stream_enable(void *data, void *user_data) > +{ > + struct bt_bap_stream *stream = data; > + > + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); > +} > + > +static void stream_start(void *data, void *user_data) > +{ > + struct bt_bap_stream *stream = data; > + > + bt_bap_stream_start(stream, NULL, NULL); > +} > + > static void bsrc_state_str(struct bt_bap_stream *stream, uint8_t old_state, > uint8_t new_state, void *user_data) > { > struct test_data *data = user_data; > + uint8_t streams = 0; > > switch (new_state) { > case BT_BAP_STREAM_STATE_CONFIG: > - bt_bap_stream_enable(stream, true, NULL, NULL, NULL); > + queue_foreach(data->streams, stream_count_config, &streams); > + > + if (streams == data->cfg->streams) > + /* After all streams have transitioned to CONFIG > + * state, enable each one. > + */ > + queue_foreach(data->streams, stream_enable, NULL); > break; > case BT_BAP_STREAM_STATE_ENABLING: > - data->base = bt_bap_stream_get_base(stream); > + queue_foreach(data->streams, stream_count_enabling, &streams); > > - g_assert(data->base); > - g_assert(data->base->iov_len == data->cfg->base.iov_len); > - g_assert(memcmp(data->base->iov_base, data->cfg->base.iov_base, > - data->base->iov_len) == 0); > + if (streams == 1) { > + /* After the first stream has transitioned to ENABLING > + * state, bt_bap_stream_get_base will generate the > + * BASE from all previously configured streams. > + */ > + data->base = bt_bap_stream_get_base(stream); > + > + g_assert(data->base); > + g_assert(data->base->iov_len == > + data->cfg->base.iov_len); > + g_assert(memcmp(data->base->iov_base, > + data->cfg->base.iov_base, > + data->base->iov_len) == 0); > + } > > - bt_bap_stream_start(stream, NULL, NULL); > + if (streams == data->cfg->streams) > + /* After all streams have transitioned to ENABLING > + * state, start each one. > + */ > + queue_foreach(data->streams, stream_start, NULL); > break; > case BT_BAP_STREAM_STATE_STREAMING: > - tester_test_passed(); > + queue_foreach(data->streams, stream_count_streaming, &streams); > + > + if (streams == data->cfg->streams) > + /* Test is completed after all streams have transitioned > + * to STREAMING state. > + */ > + tester_test_passed(); > break; > } > } > @@ -7225,9 +7284,288 @@ static void test_bsrc_str_1b(void) > NULL, test_bcast, &cfg_bsrc_str_vs, IOV_NULL); > } > > +#define BASE_LC3_8_1_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_8_1, 0x00, 0x01, 0x00, 0x02, 0x00) I wonder if we couldn't define these as part of lc3.h, in fact the LC3_CFG looks awful similar to LC3_CONFIG from lc3.h, so perhaps we could do just s/LC3_CFG/LC3_CONFIG and add something like LC3_BASE for example then rename the existing LC3_BASE to LC3_TYPE(_id), anyway I can probably do that myself later after merging this just wanted to check first if you thought about that already. > +static struct test_config cfg_bsrc_str_8_1_mbis = { > + .cc = LC3_CONFIG_8_1, > + .qos = LC3_QOS_8_1_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_8_1_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_8_2_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_8_2, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_8_2_mbis = { > + .cc = LC3_CONFIG_8_2, > + .qos = LC3_QOS_8_2_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_8_2_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_16_1_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_16_1, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_16_1_mbis = { > + .cc = LC3_CONFIG_16_1, > + .qos = LC3_QOS_16_1_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_16_1_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_16_2_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_16_2, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_16_2_mbis = { > + .cc = LC3_CONFIG_16_2, > + .qos = LC3_QOS_16_2_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_16_2_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_24_1_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_24_1, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_24_1_mbis = { > + .cc = LC3_CONFIG_24_1, > + .qos = LC3_QOS_24_1_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_24_1_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_24_2_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_24_2, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_24_2_mbis = { > + .cc = LC3_CONFIG_24_2, > + .qos = LC3_QOS_24_2_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_24_2_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_32_1_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_32_1, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_32_1_mbis = { > + .cc = LC3_CONFIG_32_1, > + .qos = LC3_QOS_32_1_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_32_1_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_32_2_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_32_2, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_32_2_mbis = { > + .cc = LC3_CONFIG_32_2, > + .qos = LC3_QOS_32_2_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_32_2_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_44_1_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_44_1, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_44_1_mbis = { > + .cc = LC3_CONFIG_44_1, > + .qos = LC3_QOS_44_1_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_44_1_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_44_2_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_44_2, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_44_2_mbis = { > + .cc = LC3_CONFIG_44_2, > + .qos = LC3_QOS_44_2_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_44_2_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_48_1_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_48_1, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_48_1_mbis = { > + .cc = LC3_CONFIG_48_1, > + .qos = LC3_QOS_48_1_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_48_1_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_48_2_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_48_2, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_48_2_mbis = { > + .cc = LC3_CONFIG_48_2, > + .qos = LC3_QOS_48_2_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_48_2_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_48_3_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_48_3, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_48_3_mbis = { > + .cc = LC3_CONFIG_48_3, > + .qos = LC3_QOS_48_3_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_48_3_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_48_4_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_48_4, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_48_4_mbis = { > + .cc = LC3_CONFIG_48_4, > + .qos = LC3_QOS_48_4_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_48_4_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_48_5_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_48_5, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_48_5_mbis = { > + .cc = LC3_CONFIG_48_5, > + .qos = LC3_QOS_48_5_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_48_5_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_LC3_48_6_MBIS \ > + BASE_LC3(40000, 1, 2, LC3_CFG_48_6, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_48_6_mbis = { > + .cc = LC3_CONFIG_48_6, > + .qos = LC3_QOS_48_6_1_B, > + .base = UTIL_IOV_INIT(BASE_LC3_48_6_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .streams = 2, > +}; > + > +#define BASE_VS_MBIS \ > + BASE(40000, 1, 2, 0xFF, 0x00, 0x00, 0x00, 0x00, \ > + VS_CFG, 0x00, 0x01, 0x00, 0x02, 0x00) > + > +static struct test_config cfg_bsrc_str_vs_mbis = { > + .cc = UTIL_IOV_INIT(VS_CC), > + .qos = QOS_BCAST, > + .base = UTIL_IOV_INIT(BASE_VS_MBIS), > + .src = true, > + .state_func = bsrc_state_str, > + .vs = true, > + .streams = 2, > +}; > + > +/* Test Purpose: > + * Verify that a Broadcast Source IUT can stream multiple BISes to > + * a Broadcast Sink. The verification is performed for each set of > + * parameters in turn, as specified in Table 4.82. > + * > + * Pass verdict: > + * If the Codec ID is LC3, the IUT sends encoded LC3 audio data in > + * BIS Data PDUs on each synchronized BIS. > + * > + * If the Codec ID is a vendor-specific Codec ID, the IUT sends BIS > + * Data PDUs on each synchronized BIS. The parameters included in the > + * Codec_Specific_Configuration data are as defined in > + * TSPX_VS_Codec_Specific_Configuration. > + * > + * If the Codec ID is LC3, each parameter included in > + * Codec_Specific_Configuration data is formatted in an LTV structure > + * with the length, type, and value specified in Table 4.83. > + */ > +static void test_bsrc_str_2b(void) > +{ > + define_test("BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1]", > + NULL, test_bcast, &cfg_bsrc_str_8_1_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2]", > + NULL, test_bcast, &cfg_bsrc_str_8_2_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 16_1]", > + NULL, test_bcast, &cfg_bsrc_str_16_1_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 16_2]", > + NULL, test_bcast, &cfg_bsrc_str_16_2_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 24_1]", > + NULL, test_bcast, &cfg_bsrc_str_24_1_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 24_2]", > + NULL, test_bcast, &cfg_bsrc_str_24_2_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 32_1]", > + NULL, test_bcast, &cfg_bsrc_str_32_1_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 32_2]", > + NULL, test_bcast, &cfg_bsrc_str_32_2_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 44.1_1]", > + NULL, test_bcast, &cfg_bsrc_str_44_1_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 44.1_2]", > + NULL, test_bcast, &cfg_bsrc_str_44_2_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 48_1]", > + NULL, test_bcast, &cfg_bsrc_str_48_1_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 48_2]", > + NULL, test_bcast, &cfg_bsrc_str_48_2_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 48_3]", > + NULL, test_bcast, &cfg_bsrc_str_48_3_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 48_4]", > + NULL, test_bcast, &cfg_bsrc_str_48_4_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 48_5]", > + NULL, test_bcast, &cfg_bsrc_str_48_5_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 48_6]", > + NULL, test_bcast, &cfg_bsrc_str_48_6_mbis, IOV_NULL); > + > + define_test("BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS]", > + NULL, test_bcast, &cfg_bsrc_str_vs_mbis, IOV_NULL); > +} > + > static void test_bsrc_str(void) > { > test_bsrc_str_1b(); > + test_bsrc_str_2b(); > } > > int main(int argc, char *argv[]) > -- > 2.39.2 > -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH BlueZ 2/2] test-bap: Add Broadcast Source STR MBIS tests 2024-06-06 20:28 ` Luiz Augusto von Dentz @ 2024-06-10 7:23 ` Iulia Tanasescu 2024-06-20 14:22 ` Iulia Tanasescu 1 sibling, 0 replies; 9+ messages in thread From: Iulia Tanasescu @ 2024-06-10 7:23 UTC (permalink / raw) To: luiz.dentz Cc: andrei.istodorescu, claudia.rosu, iulia.tanasescu, linux-bluetooth, mihai-octavian.urzica, vlad.pruteanu Hi Luiz, > -----Original Message----- > From: Luiz Augusto von Dentz <luiz.dentz@gmail.com> > Sent: Thursday, June 6, 2024 11:29 PM > To: Iulia Tanasescu <iulia.tanasescu@nxp.com> > Cc: linux-bluetooth@vger.kernel.org; Claudia Cristina Draghicescu > <claudia.rosu@nxp.com>; Mihai-Octavian Urzica <mihai- > octavian.urzica@nxp.com>; Vlad Pruteanu <vlad.pruteanu@nxp.com>; > Andrei Istodorescu <andrei.istodorescu@nxp.com> > Subject: Re: [PATCH BlueZ 2/2] test-bap: Add Broadcast Source STR > MBIS tests > > Hi Iulia, > > On Thu, Jun 6, 2024 at 6:26 AM Iulia Tanasescu <iulia.tanasescu@nxp.com> > wrote: > > > > 4.14.3 Broadcast Audio Stream with Multiple BISes - Source > > > > Test Purpose: > > Verify that a Broadcast Source IUT can stream multiple > > BISes to a Broadcast Sink. > > > > Test Case Configuration: > > BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1] > > BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2] > > BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 16_1] > > BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 16_2] > > BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 24_1] > > BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 24_2] > > BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 32_1] > > BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 32_2] > > BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 44.1_1] > > BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 44.1_2] > > BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 48_1] > > BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 48_2] > > BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 48_3] > > BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 48_4] > > BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 48_5] > > BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 48_6] > > BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS] > > > > Pass verdict: > > If the Codec ID is LC3, the IUT sends encoded LC3 audio > > data in BIS Data PDUs on each synchronized BIS. > > > > If the Codec ID is a vendor-specific Codec ID, the IUT > > sends BIS Data PDUs on each synchronized BIS. The parameters > > included in the Codec_Specific_Configuration data are as > > defined in TSPX_VS_Codec_Specific_Configuration. > > > > If the Codec ID is LC3, each parameter included in > > Codec_Specific_Configuration data is formatted in an LTV > > structure with the length, type, and value specified in > > Table 4.83. > > > > Test Summary > > ------------ > > BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1] Passed > > BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2] Passed > > BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 16_1] Passed > > BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 16_2] Passed > > BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 24_1] Passed > > BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 24_2] Passed > > BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 32_1] Passed > > BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 32_2] Passed > > BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 44.1_1] Passed > > BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 44.1_2] Passed > > BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 48_1] Passed > > BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 48_2] Passed > > BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 48_3] Passed > > BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 48_4] Passed > > BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 48_5] Passed > > BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 48_6] Passed > > BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS] Passed > > --- > > unit/test-bap.c | 354 > > ++++++++++++++++++++++++++++++++++++++++++++++-- > > 1 file changed, 346 insertions(+), 8 deletions(-) > > > > diff --git a/unit/test-bap.c b/unit/test-bap.c index > > c37f7676f..30c223d16 100644 > > --- a/unit/test-bap.c > > +++ b/unit/test-bap.c > > @@ -6972,27 +6972,86 @@ static void test_bsnk_str(void) > > NULL, test_bcast, &cfg_bsnk_str_vs_mbis, IOV_NULL); } > > > > +static void stream_count_config(void *data, void *user_data) { > > + struct bt_bap_stream *stream = data; > > + uint8_t *streams = user_data; > > + > > + if (bt_bap_stream_get_state(stream) == > BT_BAP_STREAM_STATE_CONFIG) > > + (*streams)++; > > +} > > + > > +static void stream_count_enabling(void *data, void *user_data) { > > + struct bt_bap_stream *stream = data; > > + uint8_t *streams = user_data; > > + > > + if (bt_bap_stream_get_state(stream) == > BT_BAP_STREAM_STATE_ENABLING) > > + (*streams)++; > > +} > > + > > +static void stream_enable(void *data, void *user_data) { > > + struct bt_bap_stream *stream = data; > > + > > + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); } > > + > > +static void stream_start(void *data, void *user_data) { > > + struct bt_bap_stream *stream = data; > > + > > + bt_bap_stream_start(stream, NULL, NULL); } > > + > > static void bsrc_state_str(struct bt_bap_stream *stream, uint8_t old_state, > > uint8_t new_state, void *user_data) { > > struct test_data *data = user_data; > > + uint8_t streams = 0; > > > > switch (new_state) { > > case BT_BAP_STREAM_STATE_CONFIG: > > - bt_bap_stream_enable(stream, true, NULL, NULL, NULL); > > + queue_foreach(data->streams, stream_count_config, &streams); > > + > > + if (streams == data->cfg->streams) > > + /* After all streams have transitioned to CONFIG > > + * state, enable each one. > > + */ > > + queue_foreach(data->streams, stream_enable, NULL); > > break; > > case BT_BAP_STREAM_STATE_ENABLING: > > - data->base = bt_bap_stream_get_base(stream); > > + queue_foreach(data->streams, stream_count_enabling, > &streams); > > > > - g_assert(data->base); > > - g_assert(data->base->iov_len == data->cfg->base.iov_len); > > - g_assert(memcmp(data->base->iov_base, data->cfg- > >base.iov_base, > > - data->base->iov_len) == 0); > > + if (streams == 1) { > > + /* After the first stream has transitioned to ENABLING > > + * state, bt_bap_stream_get_base will generate the > > + * BASE from all previously configured streams. > > + */ > > + data->base = bt_bap_stream_get_base(stream); > > + > > + g_assert(data->base); > > + g_assert(data->base->iov_len == > > + data->cfg->base.iov_len); > > + g_assert(memcmp(data->base->iov_base, > > + data->cfg->base.iov_base, > > + data->base->iov_len) == 0); > > + } > > > > - bt_bap_stream_start(stream, NULL, NULL); > > + if (streams == data->cfg->streams) > > + /* After all streams have transitioned to ENABLING > > + * state, start each one. > > + */ > > + queue_foreach(data->streams, stream_start, NULL); > > break; > > case BT_BAP_STREAM_STATE_STREAMING: > > - tester_test_passed(); > > + queue_foreach(data->streams, stream_count_streaming, > &streams); > > + > > + if (streams == data->cfg->streams) > > + /* Test is completed after all streams have transitioned > > + * to STREAMING state. > > + */ > > + tester_test_passed(); > > break; > > } > > } > > @@ -7225,9 +7284,288 @@ static void test_bsrc_str_1b(void) > > NULL, test_bcast, &cfg_bsrc_str_vs, IOV_NULL); > > } > > > > +#define BASE_LC3_8_1_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_8_1, 0x00, 0x01, 0x00, 0x02, 0x00) > > I wonder if we couldn't define these as part of lc3.h, in fact the > LC3_CFG looks awful similar to LC3_CONFIG from lc3.h, so perhaps we > could do just s/LC3_CFG/LC3_CONFIG and add something like LC3_BASE for > example then rename the existing LC3_BASE to LC3_TYPE(_id), anyway I > can probably do that myself later after merging this just wanted to > check first if you thought about that already. I added LC3_CFG because LC3_CONFIG from lc3.h defines a iovec struct, while I needed some byte array to include in BASE_LC3. But I do think it would be useful to add the BASE defines to lc3.h, and they could be used for iso-tester as well. > > > +static struct test_config cfg_bsrc_str_8_1_mbis = { > > + .cc = LC3_CONFIG_8_1, > > + .qos = LC3_QOS_8_1_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_8_1_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_8_2_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_8_2, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_8_2_mbis = { > > + .cc = LC3_CONFIG_8_2, > > + .qos = LC3_QOS_8_2_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_8_2_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_16_1_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_16_1, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_16_1_mbis = { > > + .cc = LC3_CONFIG_16_1, > > + .qos = LC3_QOS_16_1_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_16_1_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_16_2_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_16_2, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_16_2_mbis = { > > + .cc = LC3_CONFIG_16_2, > > + .qos = LC3_QOS_16_2_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_16_2_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_24_1_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_24_1, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_24_1_mbis = { > > + .cc = LC3_CONFIG_24_1, > > + .qos = LC3_QOS_24_1_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_24_1_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_24_2_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_24_2, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_24_2_mbis = { > > + .cc = LC3_CONFIG_24_2, > > + .qos = LC3_QOS_24_2_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_24_2_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_32_1_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_32_1, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_32_1_mbis = { > > + .cc = LC3_CONFIG_32_1, > > + .qos = LC3_QOS_32_1_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_32_1_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_32_2_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_32_2, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_32_2_mbis = { > > + .cc = LC3_CONFIG_32_2, > > + .qos = LC3_QOS_32_2_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_32_2_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_44_1_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_44_1, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_44_1_mbis = { > > + .cc = LC3_CONFIG_44_1, > > + .qos = LC3_QOS_44_1_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_44_1_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_44_2_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_44_2, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_44_2_mbis = { > > + .cc = LC3_CONFIG_44_2, > > + .qos = LC3_QOS_44_2_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_44_2_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_48_1_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_1, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_48_1_mbis = { > > + .cc = LC3_CONFIG_48_1, > > + .qos = LC3_QOS_48_1_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_48_1_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_48_2_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_2, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_48_2_mbis = { > > + .cc = LC3_CONFIG_48_2, > > + .qos = LC3_QOS_48_2_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_48_2_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_48_3_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_3, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_48_3_mbis = { > > + .cc = LC3_CONFIG_48_3, > > + .qos = LC3_QOS_48_3_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_48_3_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_48_4_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_4, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_48_4_mbis = { > > + .cc = LC3_CONFIG_48_4, > > + .qos = LC3_QOS_48_4_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_48_4_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_48_5_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_5, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_48_5_mbis = { > > + .cc = LC3_CONFIG_48_5, > > + .qos = LC3_QOS_48_5_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_48_5_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_LC3_48_6_MBIS \ > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_6, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_48_6_mbis = { > > + .cc = LC3_CONFIG_48_6, > > + .qos = LC3_QOS_48_6_1_B, > > + .base = UTIL_IOV_INIT(BASE_LC3_48_6_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .streams = 2, > > +}; > > + > > +#define BASE_VS_MBIS \ > > + BASE(40000, 1, 2, 0xFF, 0x00, 0x00, 0x00, 0x00, \ > > + VS_CFG, 0x00, 0x01, 0x00, 0x02, 0x00) > > + > > +static struct test_config cfg_bsrc_str_vs_mbis = { > > + .cc = UTIL_IOV_INIT(VS_CC), > > + .qos = QOS_BCAST, > > + .base = UTIL_IOV_INIT(BASE_VS_MBIS), > > + .src = true, > > + .state_func = bsrc_state_str, > > + .vs = true, > > + .streams = 2, > > +}; > > + > > +/* Test Purpose: > > + * Verify that a Broadcast Source IUT can stream multiple BISes to > > + * a Broadcast Sink. The verification is performed for each set of > > + * parameters in turn, as specified in Table 4.82. > > + * > > + * Pass verdict: > > + * If the Codec ID is LC3, the IUT sends encoded LC3 audio data in > > + * BIS Data PDUs on each synchronized BIS. > > + * > > + * If the Codec ID is a vendor-specific Codec ID, the IUT sends BIS > > + * Data PDUs on each synchronized BIS. The parameters included in the > > + * Codec_Specific_Configuration data are as defined in > > + * TSPX_VS_Codec_Specific_Configuration. > > + * > > + * If the Codec ID is LC3, each parameter included in > > + * Codec_Specific_Configuration data is formatted in an LTV structure > > + * with the length, type, and value specified in Table 4.83. > > + */ > > +static void test_bsrc_str_2b(void) > > +{ > > + define_test("BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1]", > > + NULL, test_bcast, &cfg_bsrc_str_8_1_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2]", > > + NULL, test_bcast, &cfg_bsrc_str_8_2_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 > 16_1]", > > + NULL, test_bcast, &cfg_bsrc_str_16_1_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 > 16_2]", > > + NULL, test_bcast, &cfg_bsrc_str_16_2_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 > 24_1]", > > + NULL, test_bcast, &cfg_bsrc_str_24_1_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 > 24_2]", > > + NULL, test_bcast, &cfg_bsrc_str_24_2_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 > 32_1]", > > + NULL, test_bcast, &cfg_bsrc_str_32_1_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 > 32_2]", > > + NULL, test_bcast, &cfg_bsrc_str_32_2_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 > 44.1_1]", > > + NULL, test_bcast, &cfg_bsrc_str_44_1_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 > 44.1_2]", > > + NULL, test_bcast, &cfg_bsrc_str_44_2_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 > 48_1]", > > + NULL, test_bcast, &cfg_bsrc_str_48_1_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 > 48_2]", > > + NULL, test_bcast, &cfg_bsrc_str_48_2_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 > 48_3]", > > + NULL, test_bcast, &cfg_bsrc_str_48_3_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 > 48_4]", > > + NULL, test_bcast, &cfg_bsrc_str_48_4_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 > 48_5]", > > + NULL, test_bcast, &cfg_bsrc_str_48_5_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 > 48_6]", > > + NULL, test_bcast, &cfg_bsrc_str_48_6_mbis, IOV_NULL); > > + > > + define_test("BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS]", > > + NULL, test_bcast, &cfg_bsrc_str_vs_mbis, IOV_NULL); > > +} > > + > > static void test_bsrc_str(void) > > { > > test_bsrc_str_1b(); > > + test_bsrc_str_2b(); > > } > > > > int main(int argc, char *argv[]) > > -- > > 2.39.2 > > > > > -- > Luiz Augusto von Dentz Regards, Iulia ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH BlueZ 2/2] test-bap: Add Broadcast Source STR MBIS tests 2024-06-06 20:28 ` Luiz Augusto von Dentz 2024-06-10 7:23 ` Iulia Tanasescu @ 2024-06-20 14:22 ` Iulia Tanasescu 2024-06-20 14:27 ` Luiz Augusto von Dentz 1 sibling, 1 reply; 9+ messages in thread From: Iulia Tanasescu @ 2024-06-20 14:22 UTC (permalink / raw) To: luiz.dentz Cc: andrei.istodorescu, claudia.rosu, iulia.tanasescu, linux-bluetooth, mihai-octavian.urzica, vlad.pruteanu Hi Luiz, > -----Original Message----- > From: Iulia Tanasescu > Sent: Monday, June 10, 2024 10:24 AM > To: luiz.dentz@gmail.com > Cc: Andrei Istodorescu <andrei.istodorescu@nxp.com>; Claudia Cristina > Draghicescu <claudia.rosu@nxp.com>; Iulia Tanasescu > <iulia.tanasescu@nxp.com>; linux-bluetooth@vger.kernel.org; Mihai- > Octavian Urzica <mihai-octavian.urzica@nxp.com>; Vlad Pruteanu > <vlad.pruteanu@nxp.com> > Subject: Re: [PATCH BlueZ 2/2] test-bap: Add Broadcast Source STR MBIS > tests > > Hi Luiz, > > > -----Original Message----- > > From: Luiz Augusto von Dentz <luiz.dentz@gmail.com> > > Sent: Thursday, June 6, 2024 11:29 PM > > To: Iulia Tanasescu <iulia.tanasescu@nxp.com> > > Cc: linux-bluetooth@vger.kernel.org; Claudia Cristina Draghicescu > > <claudia.rosu@nxp.com>; Mihai-Octavian Urzica <mihai- > > octavian.urzica@nxp.com>; Vlad Pruteanu <vlad.pruteanu@nxp.com>; > > Andrei Istodorescu <andrei.istodorescu@nxp.com> > > Subject: Re: [PATCH BlueZ 2/2] test-bap: Add Broadcast Source STR MBIS > > tests > > > > Hi Iulia, > > > > On Thu, Jun 6, 2024 at 6:26 AM Iulia Tanasescu > > <iulia.tanasescu@nxp.com> > > wrote: > > > > > > 4.14.3 Broadcast Audio Stream with Multiple BISes - Source > > > > > > Test Purpose: > > > Verify that a Broadcast Source IUT can stream multiple > > > BISes to a Broadcast Sink. > > > > > > Test Case Configuration: > > > BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1] > > > BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2] > > > BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 16_1] > > > BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 16_2] > > > BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 24_1] > > > BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 24_2] > > > BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 32_1] > > > BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 32_2] > > > BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 44.1_1] > > > BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 44.1_2] > > > BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 48_1] > > > BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 48_2] > > > BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 48_3] > > > BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 48_4] > > > BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 48_5] > > > BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 48_6] > > > BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS] > > > > > > Pass verdict: > > > If the Codec ID is LC3, the IUT sends encoded LC3 audio > > > data in BIS Data PDUs on each synchronized BIS. > > > > > > If the Codec ID is a vendor-specific Codec ID, the IUT > > > sends BIS Data PDUs on each synchronized BIS. The parameters > > > included in the Codec_Specific_Configuration data are as > > > defined in TSPX_VS_Codec_Specific_Configuration. > > > > > > If the Codec ID is LC3, each parameter included in > > > Codec_Specific_Configuration data is formatted in an LTV > > > structure with the length, type, and value specified in > > > Table 4.83. > > > > > > Test Summary > > > ------------ > > > BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1] Passed > > > BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2] Passed > > > BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 16_1] Passed > > > BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 16_2] Passed > > > BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 24_1] Passed > > > BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 24_2] Passed > > > BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 32_1] Passed > > > BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 32_2] Passed > > > BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 44.1_1] Passed > > > BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 44.1_2] Passed > > > BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 48_1] Passed > > > BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 48_2] Passed > > > BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 48_3] Passed > > > BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 48_4] Passed > > > BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 48_5] Passed > > > BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 48_6] Passed > > > BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS] Passed > > > --- > > > unit/test-bap.c | 354 > > > ++++++++++++++++++++++++++++++++++++++++++++++-- > > > 1 file changed, 346 insertions(+), 8 deletions(-) > > > > > > diff --git a/unit/test-bap.c b/unit/test-bap.c index > > > c37f7676f..30c223d16 100644 > > > --- a/unit/test-bap.c > > > +++ b/unit/test-bap.c > > > @@ -6972,27 +6972,86 @@ static void test_bsnk_str(void) > > > NULL, test_bcast, &cfg_bsnk_str_vs_mbis, IOV_NULL); > > > } > > > > > > +static void stream_count_config(void *data, void *user_data) { > > > + struct bt_bap_stream *stream = data; > > > + uint8_t *streams = user_data; > > > + > > > + if (bt_bap_stream_get_state(stream) == > > BT_BAP_STREAM_STATE_CONFIG) > > > + (*streams)++; > > > +} > > > + > > > +static void stream_count_enabling(void *data, void *user_data) { > > > + struct bt_bap_stream *stream = data; > > > + uint8_t *streams = user_data; > > > + > > > + if (bt_bap_stream_get_state(stream) == > > BT_BAP_STREAM_STATE_ENABLING) > > > + (*streams)++; > > > +} > > > + > > > +static void stream_enable(void *data, void *user_data) { > > > + struct bt_bap_stream *stream = data; > > > + > > > + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); } > > > + > > > +static void stream_start(void *data, void *user_data) { > > > + struct bt_bap_stream *stream = data; > > > + > > > + bt_bap_stream_start(stream, NULL, NULL); } > > > + > > > static void bsrc_state_str(struct bt_bap_stream *stream, uint8_t > old_state, > > > uint8_t new_state, void *user_data) { > > > struct test_data *data = user_data; > > > + uint8_t streams = 0; > > > > > > switch (new_state) { > > > case BT_BAP_STREAM_STATE_CONFIG: > > > - bt_bap_stream_enable(stream, true, NULL, NULL, NULL); > > > + queue_foreach(data->streams, stream_count_config, > > > + &streams); > > > + > > > + if (streams == data->cfg->streams) > > > + /* After all streams have transitioned to CONFIG > > > + * state, enable each one. > > > + */ > > > + queue_foreach(data->streams, stream_enable, > > > + NULL); > > > break; > > > case BT_BAP_STREAM_STATE_ENABLING: > > > - data->base = bt_bap_stream_get_base(stream); > > > + queue_foreach(data->streams, stream_count_enabling, > > &streams); > > > > > > - g_assert(data->base); > > > - g_assert(data->base->iov_len == data->cfg->base.iov_len); > > > - g_assert(memcmp(data->base->iov_base, data->cfg- > > >base.iov_base, > > > - data->base->iov_len) == 0); > > > + if (streams == 1) { > > > + /* After the first stream has transitioned to ENABLING > > > + * state, bt_bap_stream_get_base will generate the > > > + * BASE from all previously configured streams. > > > + */ > > > + data->base = bt_bap_stream_get_base(stream); > > > + > > > + g_assert(data->base); > > > + g_assert(data->base->iov_len == > > > + data->cfg->base.iov_len); > > > + g_assert(memcmp(data->base->iov_base, > > > + data->cfg->base.iov_base, > > > + data->base->iov_len) == 0); > > > + } > > > > > > - bt_bap_stream_start(stream, NULL, NULL); > > > + if (streams == data->cfg->streams) > > > + /* After all streams have transitioned to ENABLING > > > + * state, start each one. > > > + */ > > > + queue_foreach(data->streams, stream_start, > > > + NULL); > > > break; > > > case BT_BAP_STREAM_STATE_STREAMING: > > > - tester_test_passed(); > > > + queue_foreach(data->streams, stream_count_streaming, > > &streams); > > > + > > > + if (streams == data->cfg->streams) > > > + /* Test is completed after all streams have transitioned > > > + * to STREAMING state. > > > + */ > > > + tester_test_passed(); > > > break; > > > } > > > } > > > @@ -7225,9 +7284,288 @@ static void test_bsrc_str_1b(void) > > > NULL, test_bcast, &cfg_bsrc_str_vs, IOV_NULL); } > > > > > > +#define BASE_LC3_8_1_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_8_1, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > > I wonder if we couldn't define these as part of lc3.h, in fact the > > LC3_CFG looks awful similar to LC3_CONFIG from lc3.h, so perhaps we > > could do just s/LC3_CFG/LC3_CONFIG and add something like LC3_BASE > for > > example then rename the existing LC3_BASE to LC3_TYPE(_id), anyway I > > can probably do that myself later after merging this just wanted to > > check first if you thought about that already. > > I added LC3_CFG because LC3_CONFIG from lc3.h defines a iovec struct, > while I needed some byte array to include in BASE_LC3. But I do think it > would be useful to add the BASE defines to lc3.h, and they could be used > for iso-tester as well. > Should I update this patch to move the BASE defines in lc3.h? Or should it be done in a separate patch? > > > > > +static struct test_config cfg_bsrc_str_8_1_mbis = { > > > + .cc = LC3_CONFIG_8_1, > > > + .qos = LC3_QOS_8_1_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_8_1_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_8_2_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_8_2, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_8_2_mbis = { > > > + .cc = LC3_CONFIG_8_2, > > > + .qos = LC3_QOS_8_2_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_8_2_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_16_1_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_16_1, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_16_1_mbis = { > > > + .cc = LC3_CONFIG_16_1, > > > + .qos = LC3_QOS_16_1_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_16_1_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_16_2_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_16_2, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_16_2_mbis = { > > > + .cc = LC3_CONFIG_16_2, > > > + .qos = LC3_QOS_16_2_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_16_2_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_24_1_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_24_1, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_24_1_mbis = { > > > + .cc = LC3_CONFIG_24_1, > > > + .qos = LC3_QOS_24_1_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_24_1_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_24_2_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_24_2, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_24_2_mbis = { > > > + .cc = LC3_CONFIG_24_2, > > > + .qos = LC3_QOS_24_2_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_24_2_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_32_1_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_32_1, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_32_1_mbis = { > > > + .cc = LC3_CONFIG_32_1, > > > + .qos = LC3_QOS_32_1_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_32_1_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_32_2_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_32_2, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_32_2_mbis = { > > > + .cc = LC3_CONFIG_32_2, > > > + .qos = LC3_QOS_32_2_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_32_2_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_44_1_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_44_1, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_44_1_mbis = { > > > + .cc = LC3_CONFIG_44_1, > > > + .qos = LC3_QOS_44_1_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_44_1_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_44_2_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_44_2, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_44_2_mbis = { > > > + .cc = LC3_CONFIG_44_2, > > > + .qos = LC3_QOS_44_2_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_44_2_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_48_1_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_1, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_48_1_mbis = { > > > + .cc = LC3_CONFIG_48_1, > > > + .qos = LC3_QOS_48_1_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_48_1_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_48_2_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_2, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_48_2_mbis = { > > > + .cc = LC3_CONFIG_48_2, > > > + .qos = LC3_QOS_48_2_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_48_2_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_48_3_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_3, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_48_3_mbis = { > > > + .cc = LC3_CONFIG_48_3, > > > + .qos = LC3_QOS_48_3_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_48_3_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_48_4_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_4, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_48_4_mbis = { > > > + .cc = LC3_CONFIG_48_4, > > > + .qos = LC3_QOS_48_4_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_48_4_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_48_5_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_5, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_48_5_mbis = { > > > + .cc = LC3_CONFIG_48_5, > > > + .qos = LC3_QOS_48_5_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_48_5_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_LC3_48_6_MBIS \ > > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_6, 0x00, 0x01, 0x00, 0x02, > > > +0x00) > > > + > > > +static struct test_config cfg_bsrc_str_48_6_mbis = { > > > + .cc = LC3_CONFIG_48_6, > > > + .qos = LC3_QOS_48_6_1_B, > > > + .base = UTIL_IOV_INIT(BASE_LC3_48_6_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .streams = 2, > > > +}; > > > + > > > +#define BASE_VS_MBIS \ > > > + BASE(40000, 1, 2, 0xFF, 0x00, 0x00, 0x00, 0x00, \ > > > + VS_CFG, 0x00, 0x01, 0x00, 0x02, 0x00) > > > + > > > +static struct test_config cfg_bsrc_str_vs_mbis = { > > > + .cc = UTIL_IOV_INIT(VS_CC), > > > + .qos = QOS_BCAST, > > > + .base = UTIL_IOV_INIT(BASE_VS_MBIS), > > > + .src = true, > > > + .state_func = bsrc_state_str, > > > + .vs = true, > > > + .streams = 2, > > > +}; > > > + > > > +/* Test Purpose: > > > + * Verify that a Broadcast Source IUT can stream multiple BISes to > > > + * a Broadcast Sink. The verification is performed for each set of > > > + * parameters in turn, as specified in Table 4.82. > > > + * > > > + * Pass verdict: > > > + * If the Codec ID is LC3, the IUT sends encoded LC3 audio data in > > > + * BIS Data PDUs on each synchronized BIS. > > > + * > > > + * If the Codec ID is a vendor-specific Codec ID, the IUT sends BIS > > > + * Data PDUs on each synchronized BIS. The parameters included in > > > +the > > > + * Codec_Specific_Configuration data are as defined in > > > + * TSPX_VS_Codec_Specific_Configuration. > > > + * > > > + * If the Codec ID is LC3, each parameter included in > > > + * Codec_Specific_Configuration data is formatted in an LTV > > > +structure > > > + * with the length, type, and value specified in Table 4.83. > > > + */ > > > +static void test_bsrc_str_2b(void) > > > +{ > > > + define_test("BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 > 8_1]", > > > + NULL, test_bcast, &cfg_bsrc_str_8_1_mbis, IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 > 8_2]", > > > + NULL, test_bcast, &cfg_bsrc_str_8_2_mbis, IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 > > 16_1]", > > > + NULL, test_bcast, &cfg_bsrc_str_16_1_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 > > 16_2]", > > > + NULL, test_bcast, &cfg_bsrc_str_16_2_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 > > 24_1]", > > > + NULL, test_bcast, &cfg_bsrc_str_24_1_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 > > 24_2]", > > > + NULL, test_bcast, &cfg_bsrc_str_24_2_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 > > 32_1]", > > > + NULL, test_bcast, &cfg_bsrc_str_32_1_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 > > 32_2]", > > > + NULL, test_bcast, &cfg_bsrc_str_32_2_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 > > 44.1_1]", > > > + NULL, test_bcast, &cfg_bsrc_str_44_1_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 > > 44.1_2]", > > > + NULL, test_bcast, &cfg_bsrc_str_44_2_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 > > 48_1]", > > > + NULL, test_bcast, &cfg_bsrc_str_48_1_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 > > 48_2]", > > > + NULL, test_bcast, &cfg_bsrc_str_48_2_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 > > 48_3]", > > > + NULL, test_bcast, &cfg_bsrc_str_48_3_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 > > 48_4]", > > > + NULL, test_bcast, &cfg_bsrc_str_48_4_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 > > 48_5]", > > > + NULL, test_bcast, &cfg_bsrc_str_48_5_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 > > 48_6]", > > > + NULL, test_bcast, &cfg_bsrc_str_48_6_mbis, > > > + IOV_NULL); > > > + > > > + define_test("BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS]", > > > + NULL, test_bcast, &cfg_bsrc_str_vs_mbis, IOV_NULL); > > > +} > > > + > > > static void test_bsrc_str(void) > > > { > > > test_bsrc_str_1b(); > > > + test_bsrc_str_2b(); > > > } > > > > > > int main(int argc, char *argv[]) > > > -- > > > 2.39.2 > > > > > > > > > -- > > Luiz Augusto von Dentz > > > Regards, > Iulia Regards, Iulia ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH BlueZ 2/2] test-bap: Add Broadcast Source STR MBIS tests 2024-06-20 14:22 ` Iulia Tanasescu @ 2024-06-20 14:27 ` Luiz Augusto von Dentz 0 siblings, 0 replies; 9+ messages in thread From: Luiz Augusto von Dentz @ 2024-06-20 14:27 UTC (permalink / raw) To: Iulia Tanasescu Cc: andrei.istodorescu, claudia.rosu, linux-bluetooth, mihai-octavian.urzica, vlad.pruteanu Hi Iulia, On Thu, Jun 20, 2024 at 10:22 AM Iulia Tanasescu <iulia.tanasescu@nxp.com> wrote: > > Hi Luiz, > > > -----Original Message----- > > From: Iulia Tanasescu > > Sent: Monday, June 10, 2024 10:24 AM > > To: luiz.dentz@gmail.com > > Cc: Andrei Istodorescu <andrei.istodorescu@nxp.com>; Claudia Cristina > > Draghicescu <claudia.rosu@nxp.com>; Iulia Tanasescu > > <iulia.tanasescu@nxp.com>; linux-bluetooth@vger.kernel.org; Mihai- > > Octavian Urzica <mihai-octavian.urzica@nxp.com>; Vlad Pruteanu > > <vlad.pruteanu@nxp.com> > > Subject: Re: [PATCH BlueZ 2/2] test-bap: Add Broadcast Source STR MBIS > > tests > > > > Hi Luiz, > > > > > -----Original Message----- > > > From: Luiz Augusto von Dentz <luiz.dentz@gmail.com> > > > Sent: Thursday, June 6, 2024 11:29 PM > > > To: Iulia Tanasescu <iulia.tanasescu@nxp.com> > > > Cc: linux-bluetooth@vger.kernel.org; Claudia Cristina Draghicescu > > > <claudia.rosu@nxp.com>; Mihai-Octavian Urzica <mihai- > > > octavian.urzica@nxp.com>; Vlad Pruteanu <vlad.pruteanu@nxp.com>; > > > Andrei Istodorescu <andrei.istodorescu@nxp.com> > > > Subject: Re: [PATCH BlueZ 2/2] test-bap: Add Broadcast Source STR MBIS > > > tests > > > > > > Hi Iulia, > > > > > > On Thu, Jun 6, 2024 at 6:26 AM Iulia Tanasescu > > > <iulia.tanasescu@nxp.com> > > > wrote: > > > > > > > > 4.14.3 Broadcast Audio Stream with Multiple BISes - Source > > > > > > > > Test Purpose: > > > > Verify that a Broadcast Source IUT can stream multiple > > > > BISes to a Broadcast Sink. > > > > > > > > Test Case Configuration: > > > > BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1] > > > > BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2] > > > > BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 16_1] > > > > BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 16_2] > > > > BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 24_1] > > > > BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 24_2] > > > > BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 32_1] > > > > BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 32_2] > > > > BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 44.1_1] > > > > BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 44.1_2] > > > > BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 48_1] > > > > BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 48_2] > > > > BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 48_3] > > > > BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 48_4] > > > > BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 48_5] > > > > BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 48_6] > > > > BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS] > > > > > > > > Pass verdict: > > > > If the Codec ID is LC3, the IUT sends encoded LC3 audio > > > > data in BIS Data PDUs on each synchronized BIS. > > > > > > > > If the Codec ID is a vendor-specific Codec ID, the IUT > > > > sends BIS Data PDUs on each synchronized BIS. The parameters > > > > included in the Codec_Specific_Configuration data are as > > > > defined in TSPX_VS_Codec_Specific_Configuration. > > > > > > > > If the Codec ID is LC3, each parameter included in > > > > Codec_Specific_Configuration data is formatted in an LTV > > > > structure with the length, type, and value specified in > > > > Table 4.83. > > > > > > > > Test Summary > > > > ------------ > > > > BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 8_1] Passed > > > > BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 8_2] Passed > > > > BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 16_1] Passed > > > > BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 16_2] Passed > > > > BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 24_1] Passed > > > > BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 24_2] Passed > > > > BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 32_1] Passed > > > > BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 32_2] Passed > > > > BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 44.1_1] Passed > > > > BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 44.1_2] Passed > > > > BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 48_1] Passed > > > > BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 48_2] Passed > > > > BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 48_3] Passed > > > > BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 48_4] Passed > > > > BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 48_5] Passed > > > > BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 48_6] Passed > > > > BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS] Passed > > > > --- > > > > unit/test-bap.c | 354 > > > > ++++++++++++++++++++++++++++++++++++++++++++++-- > > > > 1 file changed, 346 insertions(+), 8 deletions(-) > > > > > > > > diff --git a/unit/test-bap.c b/unit/test-bap.c index > > > > c37f7676f..30c223d16 100644 > > > > --- a/unit/test-bap.c > > > > +++ b/unit/test-bap.c > > > > @@ -6972,27 +6972,86 @@ static void test_bsnk_str(void) > > > > NULL, test_bcast, &cfg_bsnk_str_vs_mbis, IOV_NULL); > > > > } > > > > > > > > +static void stream_count_config(void *data, void *user_data) { > > > > + struct bt_bap_stream *stream = data; > > > > + uint8_t *streams = user_data; > > > > + > > > > + if (bt_bap_stream_get_state(stream) == > > > BT_BAP_STREAM_STATE_CONFIG) > > > > + (*streams)++; > > > > +} > > > > + > > > > +static void stream_count_enabling(void *data, void *user_data) { > > > > + struct bt_bap_stream *stream = data; > > > > + uint8_t *streams = user_data; > > > > + > > > > + if (bt_bap_stream_get_state(stream) == > > > BT_BAP_STREAM_STATE_ENABLING) > > > > + (*streams)++; > > > > +} > > > > + > > > > +static void stream_enable(void *data, void *user_data) { > > > > + struct bt_bap_stream *stream = data; > > > > + > > > > + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); } > > > > + > > > > +static void stream_start(void *data, void *user_data) { > > > > + struct bt_bap_stream *stream = data; > > > > + > > > > + bt_bap_stream_start(stream, NULL, NULL); } > > > > + > > > > static void bsrc_state_str(struct bt_bap_stream *stream, uint8_t > > old_state, > > > > uint8_t new_state, void *user_data) { > > > > struct test_data *data = user_data; > > > > + uint8_t streams = 0; > > > > > > > > switch (new_state) { > > > > case BT_BAP_STREAM_STATE_CONFIG: > > > > - bt_bap_stream_enable(stream, true, NULL, NULL, NULL); > > > > + queue_foreach(data->streams, stream_count_config, > > > > + &streams); > > > > + > > > > + if (streams == data->cfg->streams) > > > > + /* After all streams have transitioned to CONFIG > > > > + * state, enable each one. > > > > + */ > > > > + queue_foreach(data->streams, stream_enable, > > > > + NULL); > > > > break; > > > > case BT_BAP_STREAM_STATE_ENABLING: > > > > - data->base = bt_bap_stream_get_base(stream); > > > > + queue_foreach(data->streams, stream_count_enabling, > > > &streams); > > > > > > > > - g_assert(data->base); > > > > - g_assert(data->base->iov_len == data->cfg->base.iov_len); > > > > - g_assert(memcmp(data->base->iov_base, data->cfg- > > > >base.iov_base, > > > > - data->base->iov_len) == 0); > > > > + if (streams == 1) { > > > > + /* After the first stream has transitioned to ENABLING > > > > + * state, bt_bap_stream_get_base will generate the > > > > + * BASE from all previously configured streams. > > > > + */ > > > > + data->base = bt_bap_stream_get_base(stream); > > > > + > > > > + g_assert(data->base); > > > > + g_assert(data->base->iov_len == > > > > + data->cfg->base.iov_len); > > > > + g_assert(memcmp(data->base->iov_base, > > > > + data->cfg->base.iov_base, > > > > + data->base->iov_len) == 0); > > > > + } > > > > > > > > - bt_bap_stream_start(stream, NULL, NULL); > > > > + if (streams == data->cfg->streams) > > > > + /* After all streams have transitioned to ENABLING > > > > + * state, start each one. > > > > + */ > > > > + queue_foreach(data->streams, stream_start, > > > > + NULL); > > > > break; > > > > case BT_BAP_STREAM_STATE_STREAMING: > > > > - tester_test_passed(); > > > > + queue_foreach(data->streams, stream_count_streaming, > > > &streams); > > > > + > > > > + if (streams == data->cfg->streams) > > > > + /* Test is completed after all streams have transitioned > > > > + * to STREAMING state. > > > > + */ > > > > + tester_test_passed(); > > > > break; > > > > } > > > > } > > > > @@ -7225,9 +7284,288 @@ static void test_bsrc_str_1b(void) > > > > NULL, test_bcast, &cfg_bsrc_str_vs, IOV_NULL); } > > > > > > > > +#define BASE_LC3_8_1_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_8_1, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > > > I wonder if we couldn't define these as part of lc3.h, in fact the > > > LC3_CFG looks awful similar to LC3_CONFIG from lc3.h, so perhaps we > > > could do just s/LC3_CFG/LC3_CONFIG and add something like LC3_BASE > > for > > > example then rename the existing LC3_BASE to LC3_TYPE(_id), anyway I > > > can probably do that myself later after merging this just wanted to > > > check first if you thought about that already. > > > > I added LC3_CFG because LC3_CONFIG from lc3.h defines a iovec struct, > > while I needed some byte array to include in BASE_LC3. But I do think it > > would be useful to add the BASE defines to lc3.h, and they could be used > > for iso-tester as well. > > > > Should I update this patch to move the BASE defines in lc3.h? Or should > it be done in a separate patch? Yes, please move the BASE defines to lc3.h. > > > > > > > +static struct test_config cfg_bsrc_str_8_1_mbis = { > > > > + .cc = LC3_CONFIG_8_1, > > > > + .qos = LC3_QOS_8_1_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_8_1_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_8_2_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_8_2, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_8_2_mbis = { > > > > + .cc = LC3_CONFIG_8_2, > > > > + .qos = LC3_QOS_8_2_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_8_2_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_16_1_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_16_1, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_16_1_mbis = { > > > > + .cc = LC3_CONFIG_16_1, > > > > + .qos = LC3_QOS_16_1_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_16_1_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_16_2_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_16_2, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_16_2_mbis = { > > > > + .cc = LC3_CONFIG_16_2, > > > > + .qos = LC3_QOS_16_2_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_16_2_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_24_1_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_24_1, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_24_1_mbis = { > > > > + .cc = LC3_CONFIG_24_1, > > > > + .qos = LC3_QOS_24_1_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_24_1_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_24_2_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_24_2, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_24_2_mbis = { > > > > + .cc = LC3_CONFIG_24_2, > > > > + .qos = LC3_QOS_24_2_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_24_2_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_32_1_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_32_1, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_32_1_mbis = { > > > > + .cc = LC3_CONFIG_32_1, > > > > + .qos = LC3_QOS_32_1_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_32_1_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_32_2_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_32_2, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_32_2_mbis = { > > > > + .cc = LC3_CONFIG_32_2, > > > > + .qos = LC3_QOS_32_2_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_32_2_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_44_1_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_44_1, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_44_1_mbis = { > > > > + .cc = LC3_CONFIG_44_1, > > > > + .qos = LC3_QOS_44_1_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_44_1_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_44_2_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_44_2, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_44_2_mbis = { > > > > + .cc = LC3_CONFIG_44_2, > > > > + .qos = LC3_QOS_44_2_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_44_2_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_48_1_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_1, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_48_1_mbis = { > > > > + .cc = LC3_CONFIG_48_1, > > > > + .qos = LC3_QOS_48_1_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_48_1_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_48_2_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_2, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_48_2_mbis = { > > > > + .cc = LC3_CONFIG_48_2, > > > > + .qos = LC3_QOS_48_2_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_48_2_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_48_3_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_3, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_48_3_mbis = { > > > > + .cc = LC3_CONFIG_48_3, > > > > + .qos = LC3_QOS_48_3_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_48_3_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_48_4_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_4, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_48_4_mbis = { > > > > + .cc = LC3_CONFIG_48_4, > > > > + .qos = LC3_QOS_48_4_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_48_4_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_48_5_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_5, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_48_5_mbis = { > > > > + .cc = LC3_CONFIG_48_5, > > > > + .qos = LC3_QOS_48_5_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_48_5_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_LC3_48_6_MBIS \ > > > > + BASE_LC3(40000, 1, 2, LC3_CFG_48_6, 0x00, 0x01, 0x00, 0x02, > > > > +0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_48_6_mbis = { > > > > + .cc = LC3_CONFIG_48_6, > > > > + .qos = LC3_QOS_48_6_1_B, > > > > + .base = UTIL_IOV_INIT(BASE_LC3_48_6_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +#define BASE_VS_MBIS \ > > > > + BASE(40000, 1, 2, 0xFF, 0x00, 0x00, 0x00, 0x00, \ > > > > + VS_CFG, 0x00, 0x01, 0x00, 0x02, 0x00) > > > > + > > > > +static struct test_config cfg_bsrc_str_vs_mbis = { > > > > + .cc = UTIL_IOV_INIT(VS_CC), > > > > + .qos = QOS_BCAST, > > > > + .base = UTIL_IOV_INIT(BASE_VS_MBIS), > > > > + .src = true, > > > > + .state_func = bsrc_state_str, > > > > + .vs = true, > > > > + .streams = 2, > > > > +}; > > > > + > > > > +/* Test Purpose: > > > > + * Verify that a Broadcast Source IUT can stream multiple BISes to > > > > + * a Broadcast Sink. The verification is performed for each set of > > > > + * parameters in turn, as specified in Table 4.82. > > > > + * > > > > + * Pass verdict: > > > > + * If the Codec ID is LC3, the IUT sends encoded LC3 audio data in > > > > + * BIS Data PDUs on each synchronized BIS. > > > > + * > > > > + * If the Codec ID is a vendor-specific Codec ID, the IUT sends BIS > > > > + * Data PDUs on each synchronized BIS. The parameters included in > > > > +the > > > > + * Codec_Specific_Configuration data are as defined in > > > > + * TSPX_VS_Codec_Specific_Configuration. > > > > + * > > > > + * If the Codec ID is LC3, each parameter included in > > > > + * Codec_Specific_Configuration data is formatted in an LTV > > > > +structure > > > > + * with the length, type, and value specified in Table 4.83. > > > > + */ > > > > +static void test_bsrc_str_2b(void) > > > > +{ > > > > + define_test("BAP/BSRC/STR/BV-18-C [BSRC, Multiple BISes, LC3 > > 8_1]", > > > > + NULL, test_bcast, &cfg_bsrc_str_8_1_mbis, IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-19-C [BSRC, Multiple BISes, LC3 > > 8_2]", > > > > + NULL, test_bcast, &cfg_bsrc_str_8_2_mbis, IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-20-C [BSRC, Multiple BISes, LC3 > > > 16_1]", > > > > + NULL, test_bcast, &cfg_bsrc_str_16_1_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-21-C [BSRC, Multiple BISes, LC3 > > > 16_2]", > > > > + NULL, test_bcast, &cfg_bsrc_str_16_2_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-22-C [BSRC, Multiple BISes, LC3 > > > 24_1]", > > > > + NULL, test_bcast, &cfg_bsrc_str_24_1_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-23-C [BSRC, Multiple BISes, LC3 > > > 24_2]", > > > > + NULL, test_bcast, &cfg_bsrc_str_24_2_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-24-C [BSRC, Multiple BISes, LC3 > > > 32_1]", > > > > + NULL, test_bcast, &cfg_bsrc_str_32_1_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-25-C [BSRC, Multiple BISes, LC3 > > > 32_2]", > > > > + NULL, test_bcast, &cfg_bsrc_str_32_2_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-26-C [BSRC, Multiple BISes, LC3 > > > 44.1_1]", > > > > + NULL, test_bcast, &cfg_bsrc_str_44_1_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-27-C [BSRC, Multiple BISes, LC3 > > > 44.1_2]", > > > > + NULL, test_bcast, &cfg_bsrc_str_44_2_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-28-C [BSRC, Multiple BISes, LC3 > > > 48_1]", > > > > + NULL, test_bcast, &cfg_bsrc_str_48_1_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-29-C [BSRC, Multiple BISes, LC3 > > > 48_2]", > > > > + NULL, test_bcast, &cfg_bsrc_str_48_2_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-30-C [BSRC, Multiple BISes, LC3 > > > 48_3]", > > > > + NULL, test_bcast, &cfg_bsrc_str_48_3_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-31-C [BSRC, Multiple BISes, LC3 > > > 48_4]", > > > > + NULL, test_bcast, &cfg_bsrc_str_48_4_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-32-C [BSRC, Multiple BISes, LC3 > > > 48_5]", > > > > + NULL, test_bcast, &cfg_bsrc_str_48_5_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-33-C [BSRC, Multiple BISes, LC3 > > > 48_6]", > > > > + NULL, test_bcast, &cfg_bsrc_str_48_6_mbis, > > > > + IOV_NULL); > > > > + > > > > + define_test("BAP/BSRC/STR/BV-34-C [BSRC, Multiple BISes, VS]", > > > > + NULL, test_bcast, &cfg_bsrc_str_vs_mbis, IOV_NULL); > > > > +} > > > > + > > > > static void test_bsrc_str(void) > > > > { > > > > test_bsrc_str_1b(); > > > > + test_bsrc_str_2b(); > > > > } > > > > > > > > int main(int argc, char *argv[]) > > > > -- > > > > 2.39.2 > > > > > > > > > > > > > -- > > > Luiz Augusto von Dentz > > > > > > Regards, > > Iulia > > Regards, > Iulia -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH BlueZ v2 1/5] shared/lc3: Rename LC3_BASE @ 2024-06-25 7:27 Iulia Tanasescu 2024-06-25 10:55 ` test-bap: Add Broadcast Source STR MBIS tests bluez.test.bot 0 siblings, 1 reply; 9+ messages in thread From: Iulia Tanasescu @ 2024-06-25 7:27 UTC (permalink / raw) To: linux-bluetooth Cc: claudia.rosu, mihai-octavian.urzica, vlad.pruteanu, andrei.istodorescu, luiz.dentz, Iulia Tanasescu This renames LC3_BASE to LC3_TYPE_BASE, so the meaning of the define is more clear. --- src/shared/lc3.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/shared/lc3.h b/src/shared/lc3.h index 95aa21702..abd9b29a3 100644 --- a/src/shared/lc3.h +++ b/src/shared/lc3.h @@ -12,9 +12,9 @@ #define LC3_ID 0x06 -#define LC3_BASE 0x01 +#define LC3_TYPE_BASE 0x01 -#define LC3_FREQ (LC3_BASE) +#define LC3_FREQ LC3_TYPE_BASE #define LC3_FREQ_8KHZ BIT(0) #define LC3_FREQ_11KHZ BIT(1) #define LC3_FREQ_16KHZ BIT(2) @@ -32,7 +32,7 @@ LC3_FREQ_44KHZ | \ LC3_FREQ_48KHZ) -#define LC3_DURATION (LC3_BASE + 1) +#define LC3_DURATION (LC3_TYPE_BASE + 1) #define LC3_DURATION_7_5 BIT(0) #define LC3_DURATION_10 BIT(1) #define LC3_DURATION_ANY (LC3_DURATION_7_5 | LC3_DURATION_10) @@ -40,12 +40,12 @@ #define LC3_DURATION_PREFER_10 BIT(5) -#define LC3_CHAN_COUNT (LC3_BASE + 2) +#define LC3_CHAN_COUNT (LC3_TYPE_BASE + 2) #define LC3_CHAN_COUNT_SUPPORT BIT(0) -#define LC3_FRAME_LEN (LC3_BASE + 3) +#define LC3_FRAME_LEN (LC3_TYPE_BASE + 3) -#define LC3_FRAME_COUNT (LC3_BASE + 4) +#define LC3_FRAME_COUNT (LC3_TYPE_BASE + 4) #define LC3_CAPABILITIES(_freq, _duration, _chan_count, _len_min, _len_max) \ UTIL_IOV_INIT(0x02, LC3_FREQ, _freq, _freq >> 8, \ -- 2.39.2 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* RE: test-bap: Add Broadcast Source STR MBIS tests 2024-06-25 7:27 [PATCH BlueZ v2 1/5] shared/lc3: Rename LC3_BASE Iulia Tanasescu @ 2024-06-25 10:55 ` bluez.test.bot 0 siblings, 0 replies; 9+ messages in thread From: bluez.test.bot @ 2024-06-25 10:55 UTC (permalink / raw) To: linux-bluetooth, iulia.tanasescu [-- Attachment #1: Type: text/plain, Size: 949 bytes --] This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series: PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=865195 ---Test result--- Test Summary: CheckPatch PASS 2.35 seconds GitLint PASS 1.44 seconds BuildEll PASS 24.52 seconds BluezMake PASS 1767.92 seconds MakeCheck PASS 12.93 seconds MakeDistcheck PASS 181.14 seconds CheckValgrind PASS 259.12 seconds CheckSmatch PASS 359.95 seconds bluezmakeextell PASS 121.59 seconds IncrementalBuild PASS 8109.81 seconds ScanBuild PASS 1024.99 seconds --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-06-25 10:55 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-06-06 10:25 [PATCH BlueZ 0/2] test-bap: Add Broadcast Source STR MBIS tests Iulia Tanasescu 2024-06-06 10:25 ` [PATCH BlueZ 1/2] test-bap: Add support to config multiple bsrc streams Iulia Tanasescu 2024-06-06 12:31 ` test-bap: Add Broadcast Source STR MBIS tests bluez.test.bot 2024-06-06 10:25 ` [PATCH BlueZ 2/2] " Iulia Tanasescu 2024-06-06 20:28 ` Luiz Augusto von Dentz 2024-06-10 7:23 ` Iulia Tanasescu 2024-06-20 14:22 ` Iulia Tanasescu 2024-06-20 14:27 ` Luiz Augusto von Dentz -- strict thread matches above, loose matches on Subject: below -- 2024-06-25 7:27 [PATCH BlueZ v2 1/5] shared/lc3: Rename LC3_BASE Iulia Tanasescu 2024-06-25 10:55 ` test-bap: Add Broadcast Source STR MBIS tests bluez.test.bot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox