Subject: [PATCH v2 0/2] Configure BASE using separate structure

Use preset configuration in capabilities.
Configure BASE using separate structure.

Claudia Draghicescu (2):
client/player: Use preset configuration in capabilities. Configure
BASE using separate structure
bap: Use the BASE structure received from upper layer

client/player.c | 24 +++++++++++++++++-------
profiles/audio/bap.c | 13 ++++++++++---
2 files changed, 27 insertions(+), 10 deletions(-)


base-commit: 80107630396d3d3a3984c599e0cb9b015be0499c
--
2.34.1



Subject: [PATCH v2 2/2] bap: Use the BASE structure received from upper layer

From: Claudia Draghicescu <[email protected]>

Use the BASE structure received from upper layer

---
profiles/audio/bap.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 8cbb238ef..5dad748b4 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -74,6 +74,7 @@ struct bap_ep {
struct bt_bap_qos qos;
unsigned int id;
DBusMessage *msg;
+ struct iovec *base;
};

struct bap_data {
@@ -272,7 +273,8 @@ static int parse_array(DBusMessageIter *iter, struct iovec **iov)
}

static int parse_properties(DBusMessageIter *props, struct iovec **caps,
- struct iovec **metadata, struct bt_bap_qos *qos)
+ struct iovec **metadata, struct iovec **base,
+ struct bt_bap_qos *qos)
{
const char *key;
struct bt_bap_io_qos io_qos;
@@ -432,6 +434,10 @@ static int parse_properties(DBusMessageIter *props, struct iovec **caps,
if (var != DBUS_TYPE_ARRAY)
goto fail;
parse_array(&value, &qos->bcast.bcode);
+ } else if (!strcasecmp(key, "BASE")) {
+ if (var != DBUS_TYPE_ARRAY)
+ goto fail;
+ parse_array(&value, base);
}

dbus_message_iter_next(props);
@@ -565,7 +571,8 @@ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg,
ep->qos.ucast.cis_id = BT_ISO_QOS_CIS_UNSET;
}

- if (parse_properties(&props, &ep->caps, &ep->metadata, &ep->qos) < 0) {
+ if (parse_properties(&props, &ep->caps, &ep->metadata,
+ &ep->base, &ep->qos) < 0) {
DBG("Unable to parse properties");
return btd_error_invalid_args(msg);
}
@@ -1247,7 +1254,7 @@ static void bap_connect_io_broadcast(struct bap_data *data, struct bap_ep *ep,
base.base_len = ep->caps->iov_len;

memset(base.base, 0, 248);
- memcpy(base.base, ep->caps->iov_base, base.base_len);
+ memcpy(base.base, ep->base->iov_base, ep->base->iov_len);
DBG("ep %p stream %p ", ep, stream);
ba2str(btd_adapter_get_address(adapter), addr);

--
2.34.1


Subject: [PATCH v2 1/2] client/player: Configure BASE using separate structure

From: Claudia Draghicescu <[email protected]>

Use preset configuration in capabilities.
Configure BASE using separate structure.

---
client/player.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/client/player.c b/client/player.c
index 9bc5f2a36..00ab33084 100644
--- a/client/player.c
+++ b/client/player.c
@@ -1735,6 +1735,7 @@ struct endpoint_config {
struct iovec *meta;
uint8_t target_latency;
const struct codec_qos *qos;
+ struct iovec *base;
};

#define BCODE {0x01, 0x02, 0x68, 0x05, 0x53, 0xf1, 0x41, 0x5a, \
@@ -1766,6 +1767,7 @@ static void append_properties(DBusMessageIter *iter,
const char *key = "Capabilities";
const char *meta = "Metadata";
const char *keyBCode = "BroadcastCode";
+ const char *base = "BASE";

dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "{sv}", &dict);

@@ -1902,6 +1904,14 @@ static void append_properties(DBusMessageIter *iter,
g_dbus_dict_append_entry(&dict, "Timeout", DBUS_TYPE_UINT16,
&bcast_qos.bcast.timeout);

+ bt_shell_printf("BASE:\n");
+ bt_shell_hexdump(cfg->base->iov_base, cfg->base->iov_len);
+
+ g_dbus_dict_append_basic_array(&dict, DBUS_TYPE_STRING, &base,
+ DBUS_TYPE_BYTE,
+ &cfg->base->iov_base,
+ cfg->base->iov_len);
+
bt_shell_printf("BroadcastCode:\n");
bt_shell_hexdump(cfg->ep->bcode->iov_base, cfg->ep->bcode->iov_len);

@@ -2758,15 +2768,15 @@ static void cmd_config_endpoint(int argc, char *argv[])
if (cfg->ep->broadcast) {
iov_append(&cfg->ep->bcode, bcast_qos.bcast.bcode,
sizeof(bcast_qos.bcast.bcode));
- /* Copy capabilities for broadcast*/
- iov_append(&cfg->caps, base_lc3_16_2_1,
- sizeof(base_lc3_16_2_1));
- } else {
- /* Copy capabilities */
- iov_append(&cfg->caps, preset->data.iov_base,
- preset->data.iov_len);
+ /* Copy BASE for broadcast*/
+ iov_append(&cfg->base, base_lc3_16_2_1,
+ sizeof(base_lc3_16_2_1));
}

+ /* Copy capabilities */
+ iov_append(&cfg->caps, preset->data.iov_base,
+ preset->data.iov_len);
+
/* Set QoS parameters */
cfg->qos = &preset->qos;

--
2.34.1


2023-08-07 12:54:58

by bluez.test.bot

[permalink] [raw]
Subject: RE: Configure BASE using separate structure

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

---Test result---

Test Summary:
CheckPatch PASS 1.10 seconds
GitLint PASS 0.71 seconds
BuildEll PASS 27.85 seconds
BluezMake PASS 876.32 seconds
MakeCheck PASS 12.06 seconds
MakeDistcheck PASS 157.70 seconds
CheckValgrind PASS 258.29 seconds
CheckSmatch PASS 344.97 seconds
bluezmakeextell PASS 104.85 seconds
IncrementalBuild PASS 1449.01 seconds
ScanBuild PASS 1072.64 seconds



---
Regards,
Linux Bluetooth

2023-08-07 18:21:28

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] Configure BASE using separate structure

Hi Silviu,

On Mon, Aug 7, 2023 at 4:11 AM Silviu Florian Barbulescu
<[email protected]> wrote:
>
> Use preset configuration in capabilities.
> Configure BASE using separate structure.

Im not really sure why we want to switch to use BASE over
Capabilities, up until now Capabilities is sort of mandatory and is
already profile specific in case you are wondering how can someone
detect what is the format used in Capabilities that is based on the
UUID already.

> Claudia Draghicescu (2):
> client/player: Use preset configuration in capabilities. Configure
> BASE using separate structure
> bap: Use the BASE structure received from upper layer
>
> client/player.c | 24 +++++++++++++++++-------
> profiles/audio/bap.c | 13 ++++++++++---
> 2 files changed, 27 insertions(+), 10 deletions(-)
>
>
> base-commit: 80107630396d3d3a3984c599e0cb9b015be0499c
> --
> 2.34.1
>


--
Luiz Augusto von Dentz

Subject: RE: [EXT] Re: [PATCH v2 0/2] Configure BASE using separate structure

>From: Luiz Augusto von Dentz <[email protected]>
>Sent: Monday, August 7, 2023 8:23 PM
>To: Silviu Florian Barbulescu <[email protected]>
>Cc: [email protected]; Claudia Cristina Draghicescu <[email protected]>; Mihai-Octavian Urzica <[email protected]>; Vlad Pruteanu <[email protected]>; Andrei Istodorescu <[email protected]>; Iulia Tanasescu <[email protected]>
>Subject: [EXT] Re: [PATCH v2 0/2] Configure BASE using separate structure
>
>Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button
>
>
>Hi Silviu,
>
>On Mon, Aug 7, 2023 at 4:11 AM Silviu Florian Barbulescu <[email protected]> wrote:
>>
>> Use preset configuration in capabilities.
>> Configure BASE using separate structure.
>
>Im not really sure why we want to switch to use BASE over Capabilities, up until now Capabilities is sort of mandatory and is already profile specific in case you are wondering how can someone detect what is the format used in Capabilities that is based on the UUID already.

Hi Luiz, we don't intend to switch use BASE over Capabilities, we just want to use both for broadcast. Capabilities for codec capabilities from preset that will be used in transport configuration. BASE is used for the over-the-air payload in Periodic Adv Data which is conformant to Table 3.15: Format of BASE used in Basic Audio Announcements from BAP Specification, also it is used for PTS testing that ask to modify the BASE structure. And we will copy the capabilities preset to the base structure to be sure we have the same codec capabilities in both of them.

>
>> Claudia Draghicescu (2):
>> client/player: Use preset configuration in capabilities. Configure
>> BASE using separate structure
>> bap: Use the BASE structure received from upper layer
>>
>> client/player.c | 24 +++++++++++++++++-------
>> profiles/audio/bap.c | 13 ++++++++++---
>> 2 files changed, 27 insertions(+), 10 deletions(-)
>>
>>
>> base-commit: 80107630396d3d3a3984c599e0cb9b015be0499c
>> --
>> 2.34.1
>>
>
>
>--
>Luiz Augusto von Dentz