linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] shared/bap: add function to get location from PAC
@ 2023-04-22 17:05 Pauli Virtanen
  2023-04-22 17:05 ` [PATCH BlueZ 2/2] bap: add Location parameter to SelectProperties Pauli Virtanen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Pauli Virtanen @ 2023-04-22 17:05 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

Add function to get the PACS Sink/Source Audio Locations field relevant
for a given PAC.
---
 src/shared/bap.c | 14 ++++++++++++++
 src/shared/bap.h |  2 ++
 2 files changed, 16 insertions(+)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 1fff7e0fd..5a12a64d2 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -2442,6 +2442,20 @@ uint8_t bt_bap_pac_get_type(struct bt_bap_pac *pac)
 	return pac->type;
 }
 
+uint32_t bt_bap_pac_get_locations(struct bt_bap_pac *pac)
+{
+	struct bt_pacs *pacs = pac->bdb->pacs;
+
+	switch (pac->type) {
+	case BT_BAP_SOURCE:
+		return pacs->source_loc_value;
+	case BT_BAP_SINK:
+		return pacs->sink_loc_value;
+	default:
+		return 0;
+	}
+}
+
 static void notify_pac_removed(void *data, void *user_data)
 {
 	struct bt_bap_pac_changed *changed = data;
diff --git a/src/shared/bap.h b/src/shared/bap.h
index bd13abef9..0d419aa74 100644
--- a/src/shared/bap.h
+++ b/src/shared/bap.h
@@ -128,6 +128,8 @@ bool bt_bap_remove_pac(struct bt_bap_pac *pac);
 
 uint8_t bt_bap_pac_get_type(struct bt_bap_pac *pac);
 
+uint32_t bt_bap_pac_get_locations(struct bt_bap_pac *pac);
+
 struct bt_bap_stream *bt_bap_pac_get_stream(struct bt_bap_pac *pac);
 
 /* Session related function */
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH BlueZ 2/2] bap: add Location parameter to SelectProperties
  2023-04-22 17:05 [PATCH BlueZ 1/2] shared/bap: add function to get location from PAC Pauli Virtanen
@ 2023-04-22 17:05 ` Pauli Virtanen
  2023-04-22 18:30 ` [BlueZ,1/2] shared/bap: add function to get location from PAC bluez.test.bot
  2023-04-25 21:10 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Pauli Virtanen @ 2023-04-22 17:05 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

Add relevant PACS Location field as a parameter to SelectProperties.

SelectProperties may set Audio_Channel_Allocation, which shall be chosen
from the bits set in Sink/Source Audio Locations (BAP v1.0.1 Sec. 4.4.1,
Sec 4.4.2). Hence, audio server needs to know the supported values,
which it previously could not.
---
 profiles/audio/media.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 540e91bc6..52c4bd80a 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -901,6 +901,7 @@ static int pac_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
 	DBusMessage *msg;
 	DBusMessageIter iter, dict;
 	const char *key = "Capabilities";
+	uint32_t loc;
 
 	bt_bap_pac_get_codec(rpac, NULL, &caps, &metadata);
 	if (!caps)
@@ -932,6 +933,11 @@ static int pac_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
 					DBUS_TYPE_BYTE, &caps->iov_base,
 					caps->iov_len);
 
+	loc = bt_bap_pac_get_locations(rpac);
+	if (loc)
+		g_dbus_dict_append_entry(&dict, "Location", DBUS_TYPE_UINT32,
+									&loc);
+
 	if (metadata) {
 		key = "Metadata";
 		g_dbus_dict_append_basic_array(&dict, DBUS_TYPE_STRING, &key,
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [BlueZ,1/2] shared/bap: add function to get location from PAC
  2023-04-22 17:05 [PATCH BlueZ 1/2] shared/bap: add function to get location from PAC Pauli Virtanen
  2023-04-22 17:05 ` [PATCH BlueZ 2/2] bap: add Location parameter to SelectProperties Pauli Virtanen
@ 2023-04-22 18:30 ` bluez.test.bot
  2023-04-25 21:10 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2023-04-22 18:30 UTC (permalink / raw)
  To: linux-bluetooth, pav

[-- Attachment #1: Type: text/plain, Size: 947 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=742421

---Test result---

Test Summary:
CheckPatch                    PASS      1.05 seconds
GitLint                       PASS      0.69 seconds
BuildEll                      PASS      27.20 seconds
BluezMake                     PASS      988.66 seconds
MakeCheck                     PASS      11.58 seconds
MakeDistcheck                 PASS      152.08 seconds
CheckValgrind                 PASS      248.73 seconds
CheckSmatch                   PASS      336.25 seconds
bluezmakeextell               PASS      99.69 seconds
IncrementalBuild              PASS      1748.36 seconds
ScanBuild                     PASS      1055.93 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH BlueZ 1/2] shared/bap: add function to get location from PAC
  2023-04-22 17:05 [PATCH BlueZ 1/2] shared/bap: add function to get location from PAC Pauli Virtanen
  2023-04-22 17:05 ` [PATCH BlueZ 2/2] bap: add Location parameter to SelectProperties Pauli Virtanen
  2023-04-22 18:30 ` [BlueZ,1/2] shared/bap: add function to get location from PAC bluez.test.bot
@ 2023-04-25 21:10 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2023-04-25 21:10 UTC (permalink / raw)
  To: Pauli Virtanen; +Cc: linux-bluetooth

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Sat, 22 Apr 2023 17:05:56 +0000 you wrote:
> Add function to get the PACS Sink/Source Audio Locations field relevant
> for a given PAC.
> ---
>  src/shared/bap.c | 14 ++++++++++++++
>  src/shared/bap.h |  2 ++
>  2 files changed, 16 insertions(+)

Here is the summary with links:
  - [BlueZ,1/2] shared/bap: add function to get location from PAC
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=5910b7852801
  - [BlueZ,2/2] bap: add Location parameter to SelectProperties
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=2f88c59391b8

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-25 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-22 17:05 [PATCH BlueZ 1/2] shared/bap: add function to get location from PAC Pauli Virtanen
2023-04-22 17:05 ` [PATCH BlueZ 2/2] bap: add Location parameter to SelectProperties Pauli Virtanen
2023-04-22 18:30 ` [BlueZ,1/2] shared/bap: add function to get location from PAC bluez.test.bot
2023-04-25 21:10 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).