2024-05-21 11:05:34

by Iulia Tanasescu

[permalink] [raw]
Subject: [PATCH BlueZ 0/3] test-bap: Add Broadcast Sink STR MBIS tests

This patch adds BAP unit tests for Broadcast Sink Streaming with multiple
BISes (4.14.4 Broadcast Sink Receives Audio Data Over Multiple BISes -
page 193).

Iulia Tanasescu (3):
test-bap: Keep streams queue in test_data
test-bap: Add support for multiple bcast streams
test-bap: Add Broadcast Sink STR MBIS tests

unit/test-bap.c | 319 +++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 287 insertions(+), 32 deletions(-)


base-commit: a2438e46f8129d8e08cfb00001a4b63f5616cdda
--
2.39.2



2024-05-21 11:06:00

by Iulia Tanasescu

[permalink] [raw]
Subject: [PATCH BlueZ 1/3] test-bap: Keep streams queue in test_data

Some BAP test configurations require multiple streams to be created
(for example, 4.14.4 Broadcast Sink Receives Audio Data Over Multiple
BISes).

This replaces the stream pointer inside test_data with a queue of
streams, where each created stream is pushed.

Unicast callbacks where the created stream needs to be accessed
already pass the stream reference as parameter, so there is no need
to access it from test_data.
---
unit/test-bap.c | 56 ++++++++++++++++++++++++++++++-------------------
1 file changed, 34 insertions(+), 22 deletions(-)

diff --git a/unit/test-bap.c b/unit/test-bap.c
index 20609694e..061c7a119 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
@@ -56,7 +56,7 @@ struct test_data {
struct iovec *base;
struct iovec *caps;
struct test_config *cfg;
- struct bt_bap_stream *stream;
+ struct queue *streams;
size_t iovcnt;
struct iovec *iov;
};
@@ -80,6 +80,7 @@ static struct iovec lc3_caps = LC3_CAPABILITIES(LC3_FREQ_ANY, LC3_DURATION_ANY,
data.cfg = _cfg; \
data.iovcnt = ARRAY_SIZE(iov_data(args)); \
data.iov = util_iov_dup(iov, ARRAY_SIZE(iov_data(args))); \
+ data.streams = queue_new(); \
tester_add(name, &data, setup, function, \
test_teardown); \
} while (0)
@@ -373,13 +374,13 @@ static void bap_enable(struct bt_bap_stream *stream,
case BT_BAP_STREAM_STATE_ENABLING:
return;
case BT_BAP_STREAM_STATE_DISABLING:
- id = bt_bap_stream_disable(data->stream, true, bap_disable,
+ id = bt_bap_stream_disable(stream, true, bap_disable,
data);
break;
case BT_BAP_STREAM_STATE_STREAMING:
if (data->cfg->snk)
return;
- id = bt_bap_stream_start(data->stream, bap_start, data);
+ id = bt_bap_stream_start(stream, bap_start, data);
break;
}

@@ -400,7 +401,7 @@ static void bap_qos(struct bt_bap_stream *stream,
if (data->cfg->state > BT_BAP_STREAM_STATE_QOS) {
unsigned int qos_id;

- qos_id = bt_bap_stream_enable(data->stream, true, NULL,
+ qos_id = bt_bap_stream_enable(stream, true, NULL,
bap_enable, data);
g_assert(qos_id);
}
@@ -420,7 +421,7 @@ static void bap_config(struct bt_bap_stream *stream,
if (data->cfg->state > BT_BAP_STREAM_STATE_CONFIG) {
unsigned int qos_id;

- qos_id = bt_bap_stream_qos(data->stream, &data->cfg->qos,
+ qos_id = bt_bap_stream_qos(stream, &data->cfg->qos,
bap_qos, data);
g_assert(qos_id);
}
@@ -431,13 +432,16 @@ static bool pac_found(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
{
struct test_data *data = user_data;
unsigned int config_id;
+ struct bt_bap_stream *stream;

- data->stream = bt_bap_stream_new(data->bap, lpac, rpac,
+ stream = bt_bap_stream_new(data->bap, lpac, rpac,
&data->cfg->qos,
&data->cfg->cc);
- g_assert(data->stream);
+ g_assert(stream);

- config_id = bt_bap_stream_config(data->stream, &data->cfg->qos,
+ queue_push_tail(data->streams, stream);
+
+ config_id = bt_bap_stream_config(stream, &data->cfg->qos,
&data->cfg->cc, bap_config, data);
g_assert(config_id);

@@ -529,15 +533,18 @@ static struct bt_bap_pac_ops bcast_pac_ops = {
static void bsrc_pac_added(struct bt_bap_pac *pac, void *user_data)
{
struct test_data *data = user_data;
+ struct bt_bap_stream *stream;

bt_bap_pac_set_ops(pac, &bcast_pac_ops, NULL);

- data->stream = bt_bap_stream_new(data->bap, pac, NULL,
+ stream = bt_bap_stream_new(data->bap, pac, NULL,
&data->cfg->qos,
&data->cfg->cc);
- g_assert(data->stream);
+ g_assert(stream);

- bt_bap_stream_config(data->stream, &data->cfg->qos,
+ queue_push_tail(data->streams, stream);
+
+ bt_bap_stream_config(stream, &data->cfg->qos,
&data->cfg->cc, NULL, data);
}

@@ -572,6 +579,7 @@ static void bsnk_pac_added(struct bt_bap_pac *pac, void *user_data)
struct bt_bap_pac *lpac;
struct iovec *cc;
struct bt_bap_codec codec = {0};
+ struct bt_bap_stream *stream;

if (data->cfg->vs)
codec.id = 0xff;
@@ -587,12 +595,14 @@ static void bsnk_pac_added(struct bt_bap_pac *pac, void *user_data)

bt_bap_pac_set_ops(pac, &bcast_pac_ops, NULL);

- data->stream = bt_bap_stream_new(data->bap,
+ stream = bt_bap_stream_new(data->bap,
pac, NULL, &data->cfg->qos, cc);

- g_assert(data->stream);
+ g_assert(stream);

- bt_bap_stream_config(data->stream, &data->cfg->qos,
+ queue_push_tail(data->streams, stream);
+
+ bt_bap_stream_config(stream, &data->cfg->qos,
cc, NULL, NULL);

util_iov_free(cc, 1);
@@ -704,6 +714,8 @@ static void test_teardown(const void *user_data)
bt_bap_remove_pac(data->bsnk);
gatt_db_unref(data->db);

+ queue_destroy(data->streams, NULL);
+
tester_teardown_complete();
}

@@ -2643,7 +2655,7 @@ static void state_start_disable(struct bt_bap_stream *stream,

switch (new_state) {
case BT_BAP_STREAM_STATE_STREAMING:
- id = bt_bap_stream_disable(data->stream, true, bap_disable,
+ id = bt_bap_stream_disable(stream, true, bap_disable,
data);
g_assert(id);
break;
@@ -2719,7 +2731,7 @@ static void state_cc_release(struct bt_bap_stream *stream,

switch (new_state) {
case BT_BAP_STREAM_STATE_CONFIG:
- id = bt_bap_stream_release(data->stream, bap_release, data);
+ id = bt_bap_stream_release(stream, bap_release, data);
g_assert(id);
break;
}
@@ -2788,7 +2800,7 @@ static void state_qos_release(struct bt_bap_stream *stream,

switch (new_state) {
case BT_BAP_STREAM_STATE_QOS:
- id = bt_bap_stream_release(data->stream, bap_release, data);
+ id = bt_bap_stream_release(stream, bap_release, data);
g_assert(id);
break;
}
@@ -2827,7 +2839,7 @@ static void state_enable_release(struct bt_bap_stream *stream,

switch (new_state) {
case BT_BAP_STREAM_STATE_ENABLING:
- id = bt_bap_stream_release(data->stream, bap_release, data);
+ id = bt_bap_stream_release(stream, bap_release, data);
g_assert(id);
break;
}
@@ -2866,7 +2878,7 @@ static void state_start_release(struct bt_bap_stream *stream,

switch (new_state) {
case BT_BAP_STREAM_STATE_STREAMING:
- id = bt_bap_stream_release(data->stream, bap_release, data);
+ id = bt_bap_stream_release(stream, bap_release, data);
g_assert(id);
break;
}
@@ -2894,7 +2906,7 @@ static void state_disable_release(struct bt_bap_stream *stream,

switch (new_state) {
case BT_BAP_STREAM_STATE_DISABLING:
- id = bt_bap_stream_release(data->stream, bap_release, data);
+ id = bt_bap_stream_release(stream, bap_release, data);
g_assert(id);
break;
}
@@ -2971,7 +2983,7 @@ static void state_enable_metadata(struct bt_bap_stream *stream,

switch (new_state) {
case BT_BAP_STREAM_STATE_ENABLING:
- id = bt_bap_stream_metadata(data->stream, &iov, bap_metadata,
+ id = bt_bap_stream_metadata(stream, &iov, bap_metadata,
data);
g_assert(id);
break;
@@ -3047,7 +3059,7 @@ static void state_start_metadata(struct bt_bap_stream *stream,

switch (new_state) {
case BT_BAP_STREAM_STATE_STREAMING:
- id = bt_bap_stream_metadata(data->stream, &iov, bap_metadata,
+ id = bt_bap_stream_metadata(stream, &iov, bap_metadata,
data);
g_assert(id);
break;
--
2.39.2


2024-05-21 13:32:20

by bluez.test.bot

[permalink] [raw]
Subject: RE: test-bap: Add Broadcast Sink STR MBIS tests

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=854690

---Test result---

Test Summary:
CheckPatch PASS 1.44 seconds
GitLint PASS 0.88 seconds
BuildEll PASS 24.54 seconds
BluezMake PASS 1701.10 seconds
MakeCheck PASS 13.38 seconds
MakeDistcheck PASS 177.37 seconds
CheckValgrind PASS 250.16 seconds
CheckSmatch PASS 353.02 seconds
bluezmakeextell PASS 119.69 seconds
IncrementalBuild PASS 4655.16 seconds
ScanBuild PASS 988.16 seconds



---
Regards,
Linux Bluetooth

2024-05-21 16:20:43

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH BlueZ 0/3] test-bap: Add Broadcast Sink STR MBIS tests

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <[email protected]>:

On Tue, 21 May 2024 13:55:12 +0300 you wrote:
> This patch adds BAP unit tests for Broadcast Sink Streaming with multiple
> BISes (4.14.4 Broadcast Sink Receives Audio Data Over Multiple BISes -
> page 193).
>
> Iulia Tanasescu (3):
> test-bap: Keep streams queue in test_data
> test-bap: Add support for multiple bcast streams
> test-bap: Add Broadcast Sink STR MBIS tests
>
> [...]

Here is the summary with links:
- [BlueZ,1/3] test-bap: Keep streams queue in test_data
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=41340a74bf83
- [BlueZ,2/3] test-bap: Add support for multiple bcast streams
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=25eaeeb7e1bc
- [BlueZ,3/3] test-bap: Add Broadcast Sink STR MBIS tests
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=c41943fe392d

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html