Thread (9 messages) flat view 9 messages, 3 authors, 2021-11-19

RE: [PATCH v1 1/5] avdtp: Add a flag in struct avdtp to control a2dp offload

From: K, Kiran <hidden>
Date: 2021-11-19 08:12:40

Hi Luiz,
-----Original Message-----
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Sent: Tuesday, November 16, 2021 1:15 AM
To: K, Kiran <redacted>
Cc: linux-bluetooth@vger.kernel.org; Srivatsa, Ravishankar
[off-list ref]; Tumkur Narayan, Chethan
[off-list ref]; Von Dentz, Luiz
[off-list ref]
Subject: Re: [PATCH v1 1/5] avdtp: Add a flag in struct avdtp to control a2dp
offload

Hi Kiran,

On Mon, Nov 15, 2021 at 11:42 AM Luiz Augusto von Dentz
[off-list ref] wrote:
quoted
Hi Kiran,

On Mon, Nov 15, 2021 at 1:36 AM Kiran K [off-list ref] wrote:
quoted
Define a flag in struct avdtp and set it based on the definition of
env variable USE_OFFLOAD
---
 profiles/audio/avdtp.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c index
d3dfbf96dda3..b6feac0ba4d5 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -409,6 +409,9 @@ struct avdtp {

        /* Attempt stream setup instead of disconnecting */
        gboolean stream_setup;
+
+       /* use offload for transport */
+       gboolean use_offload;
 };

 static GSList *state_callbacks = NULL; @@ -2425,6 +2428,7 @@ struct
avdtp *avdtp_new(GIOChannel *chan, struct btd_device *device,
                                                        struct queue
*lseps)  {
        struct avdtp *session;
+       char *use_offload;

        session = g_new0(struct avdtp, 1);
@@ -2436,6 +2440,10 @@ struct avdtp *avdtp_new(GIOChannel *chan,
struct btd_device *device,

        session->version = get_version(session);

+       use_offload = getenv("USE_OFFLOAD");
+       if (use_offload && !strncmp(use_offload, "1", 1))
+               session->use_offload = TRUE;
+
We already have a configuration for experimental flags:

https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/src/main.conf#
n118
Correction, we may need to introduce yet another experimental UUID given
the UUID above is just about codec offload not MSFT A2DP offload which
may require a completely different set of commands.
Ok. I will introduce a new UUID for a2dp offload codecs.
quoted
So you just have to check if experimental is enabled, or the offload
UUID, in adapter.c, also perhaps we should have something like
btd_adapter_experimental_is_enabled(adapter, uuid) so it would take
care of doing all the checking if that had been enabled in the kernel
or not.
quoted
        if (!chan)
                return session;

--
2.17.1

--
Luiz Augusto von Dentz


--
Luiz Augusto von Dentz
Thanks,
Kiran
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help