2023-10-20 14:13:48

by K, Kiran

[permalink] [raw]
Subject: [PATCH v1 1/5] media: Populate location to qos structure

Allow clients to register Location for endpoint.
---
profiles/audio/media.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 1d98ac5a1a70..d0520d3216c9 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -1609,6 +1609,10 @@ static int parse_properties(DBusMessageIter *props, const char **uuid,
if (var != DBUS_TYPE_UINT16)
return -EINVAL;
dbus_message_iter_get_basic(&value, &qos->ppd_max);
+ } else if (strcasecmp(key, "Location") == 0) {
+ if (var != DBUS_TYPE_UINT32)
+ return -EINVAL;
+ dbus_message_iter_get_basic(&value, &qos->location);
}

dbus_message_iter_next(props);
@@ -2799,6 +2803,13 @@ static void app_register_endpoint(void *data, void *user_data)
dbus_message_iter_get_basic(&iter, &qos.ppd_min);
}

+ if (g_dbus_proxy_get_property(proxy, "Location", &iter)) {
+ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32)
+ goto fail;
+
+ dbus_message_iter_get_basic(&iter, &qos.location);
+ }
+
endpoint = media_endpoint_create(app->adapter, app->sender, path, uuid,
delay_reporting, codec,
vendor.cid, vendor.vid, &qos,
--
2.34.1


2023-10-20 14:13:49

by K, Kiran

[permalink] [raw]
Subject: [PATCH v1 2/5] bap: Fix update of sink location value

pac->sink_loc needs to be updated only if there is a change.
---
src/shared/bap.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 925501c48d98..2fd21b81b72d 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -2491,13 +2491,11 @@ static void pacs_sink_location_changed(struct bt_pacs *pacs)

static void pacs_add_sink_location(struct bt_pacs *pacs, uint32_t location)
{
- location |= pacs->sink_loc_value;
-
/* Check if location value needs updating */
if (location == pacs->sink_loc_value)
return;

- pacs->sink_loc_value = location;
+ pacs->sink_loc_value |= location;

pacs_sink_location_changed(pacs);
}
--
2.34.1

2023-10-20 14:13:55

by K, Kiran

[permalink] [raw]
Subject: [PATCH v1 3/5] bap: Do not set default location for sink and source

let the clients register the required location for source
and sink endpoints.
---
src/shared/bap.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 2fd21b81b72d..5cb8b5aba659 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -474,9 +474,8 @@ static struct bt_pacs *pacs_new(struct gatt_db *db)

pacs = new0(struct bt_pacs, 1);

- /* Set default values */
- pacs->sink_loc_value = PACS_SNK_LOCATION;
- pacs->source_loc_value = PACS_SRC_LOCATION;
+ pacs->sink_loc_value = 0;
+ pacs->source_loc_value = 0;
pacs->sink_context_value = PACS_SNK_CTXT;
pacs->source_context_value = PACS_SRC_CTXT;
pacs->supported_sink_context_value = PACS_SUPPORTED_SNK_CTXT;
--
2.34.1

2023-10-20 14:13:56

by K, Kiran

[permalink] [raw]
Subject: [PATCH v1 5/5] media: Parse conext and supported context

Allow clients to register available context and supported context for
bap endpoint.
---
profiles/audio/media.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index d0520d3216c9..69f77a80c8ea 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -1613,6 +1613,15 @@ static int parse_properties(DBusMessageIter *props, const char **uuid,
if (var != DBUS_TYPE_UINT32)
return -EINVAL;
dbus_message_iter_get_basic(&value, &qos->location);
+ } else if (strcasecmp(key, "Context") == 0) {
+ if (var != DBUS_TYPE_UINT16)
+ return -EINVAL;
+ dbus_message_iter_get_basic(&value, &qos->context);
+ } else if (strcasecmp(key, "SupportedContext") == 0) {
+ if (var != DBUS_TYPE_UINT16)
+ return -EINVAL;
+ dbus_message_iter_get_basic(&value,
+ &qos->supported_context);
}

dbus_message_iter_next(props);
@@ -2810,6 +2819,20 @@ static void app_register_endpoint(void *data, void *user_data)
dbus_message_iter_get_basic(&iter, &qos.location);
}

+ if (g_dbus_proxy_get_property(proxy, "Context", &iter)) {
+ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT16)
+ goto fail;
+
+ dbus_message_iter_get_basic(&iter, &qos.context);
+ }
+
+ if (g_dbus_proxy_get_property(proxy, "SupportedContext", &iter)) {
+ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT16)
+ goto fail;
+
+ dbus_message_iter_get_basic(&iter, &qos.supported_context);
+ }
+
endpoint = media_endpoint_create(app->adapter, app->sender, path, uuid,
delay_reporting, codec,
vendor.cid, vendor.vid, &qos,
--
2.34.1

2023-10-20 14:14:01

by K, Kiran

[permalink] [raw]
Subject: [PATCH v1 4/5] bap: Fix reading source codec capabilities

Sink ASE capabilities were read instead of source.
---
src/shared/bap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 5cb8b5aba659..bd00fa210abe 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -2634,7 +2634,7 @@ static void bap_add_source(struct bt_bap_pac *pac)
iov.iov_base = value;
iov.iov_len = 0;

- queue_foreach(pac->bdb->sinks, pac_foreach, &iov);
+ queue_foreach(pac->bdb->sources, pac_foreach, &iov);

pacs_add_source_location(pac->bdb->pacs, pac->qos.location);
pacs_add_source_supported_context(pac->bdb->pacs,
--
2.34.1

2023-10-20 15:51:04

by Pauli Virtanen

[permalink] [raw]
Subject: Re: [PATCH v1 1/5] media: Populate location to qos structure

Hi,

pe, 2023-10-20 kello 19:55 +0530, Kiran K kirjoitti:
> Allow clients to register Location for endpoint.
> ---
> profiles/audio/media.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/profiles/audio/media.c b/profiles/audio/media.c
> index 1d98ac5a1a70..d0520d3216c9 100644
> --- a/profiles/audio/media.c
> +++ b/profiles/audio/media.c
> @@ -1609,6 +1609,10 @@ static int parse_properties(DBusMessageIter *props, const char **uuid,
> if (var != DBUS_TYPE_UINT16)
> return -EINVAL;
> dbus_message_iter_get_basic(&value, &qos->ppd_max);
> + } else if (strcasecmp(key, "Location") == 0) {
> + if (var != DBUS_TYPE_UINT32)
> + return -EINVAL;
> + dbus_message_iter_get_basic(&value, &qos->location);
> }

The name of the key should be "Locations", not "Location", see
doc/org.bluez.MediaEndpoint.rst

>
> dbus_message_iter_next(props);
> @@ -2799,6 +2803,13 @@ static void app_register_endpoint(void *data, void *user_data)
> dbus_message_iter_get_basic(&iter, &qos.ppd_min);
> }
>
> + if (g_dbus_proxy_get_property(proxy, "Location", &iter)) {

Similarly here.

> + if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32)
> + goto fail;
> +
> + dbus_message_iter_get_basic(&iter, &qos.location);
> + }
> +
> endpoint = media_endpoint_create(app->adapter, app->sender, path, uuid,
> delay_reporting, codec,
> vendor.cid, vendor.vid, &qos,

--
Pauli Virtanen

2023-10-20 16:32:53

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v1,1/5] media: Populate location to qos 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=795144

---Test result---

Test Summary:
CheckPatch PASS 2.33 seconds
GitLint PASS 1.64 seconds
BuildEll PASS 28.35 seconds
BluezMake PASS 930.45 seconds
MakeCheck PASS 11.57 seconds
MakeDistcheck PASS 180.89 seconds
CheckValgrind PASS 278.11 seconds
CheckSmatch PASS 381.00 seconds
bluezmakeextell PASS 120.14 seconds
IncrementalBuild PASS 3824.44 seconds
ScanBuild PASS 1143.53 seconds



---
Regards,
Linux Bluetooth

2023-10-20 20:51:16

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH v1 1/5] media: Populate location to qos structure

Hello:

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

On Fri, 20 Oct 2023 19:55:50 +0530 you wrote:
> Allow clients to register Location for endpoint.
> ---
> profiles/audio/media.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)

Here is the summary with links:
- [v1,1/5] media: Populate location to qos structure
(no matching commit)
- [v1,2/5] bap: Fix update of sink location value
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=5f8323f2aaa3
- [v1,3/5] bap: Do not set default location for sink and source
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=932e64206069
- [v1,4/5] bap: Fix reading source codec capabilities
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=a564d6a0d533
- [v1,5/5] media: Parse conext and supported context
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f02e0c8664a6

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