All of lore.kernel.org
 help / color / mirror / Atom feed
From: Silviu Florian Barbulescu <silviu.barbulescu@nxp.com>
To: linux-bluetooth@vger.kernel.org
Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com,
	vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com,
	luiz.dentz@gmail.com, iulia.tanasescu@nxp.com
Subject: [PATCH BlueZ 1/1] player: Adjust SDU size based on the number of locations
Date: Thu, 21 Mar 2024 18:12:55 +0200	[thread overview]
Message-ID: <20240321161255.24892-2-silviu.barbulescu@nxp.com> (raw)
In-Reply-To: <20240321161255.24892-1-silviu.barbulescu@nxp.com>

Adjust the SDU size based on the number of locations/channels
 that is being requested.

---
 client/player.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/client/player.c b/client/player.c
index ab33bfc46..7856be3b5 100644
--- a/client/player.c
+++ b/client/player.c
@@ -3574,6 +3574,7 @@ static void config_endpoint_channel_location(const char *input, void *user_data)
 	struct endpoint_config *cfg = user_data;
 	char *endptr = NULL;
 	uint32_t location;
+	uint8_t channels = 1;
 
 	if (!strcasecmp(input, "n") || !strcasecmp(input, "no"))
 		goto add_meta;
@@ -3590,6 +3591,13 @@ static void config_endpoint_channel_location(const char *input, void *user_data)
 	iov_append_ltv(&cfg->caps, LC3_CONFIG_CHAN_ALLOC_LEN,
 			LC3_CONFIG_CHAN_ALLOC, &location);
 
+	/* Adjust the SDU size based on the number of
+	 * locations/channels that is being requested.
+	 */
+	channels = __builtin_popcount(location);
+	if (channels > 1)
+		cfg->qos.bcast.io_qos.sdu *= channels;
+
 add_meta:
 	/* Add metadata */
 	bt_shell_prompt_input(cfg->ep->path, "Enter Metadata (value/no):",
-- 
2.39.2


  reply	other threads:[~2024-03-21 16:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 16:12 [PATCH BlueZ 0/1] Adjust SDU size based on the number of locations Silviu Florian Barbulescu
2024-03-21 16:12 ` Silviu Florian Barbulescu [this message]
2024-03-21 17:41   ` bluez.test.bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240321161255.24892-2-silviu.barbulescu@nxp.com \
    --to=silviu.barbulescu@nxp.com \
    --cc=andrei.istodorescu@nxp.com \
    --cc=iulia.tanasescu@nxp.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=mihai-octavian.urzica@nxp.com \
    --cc=vlad.pruteanu@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.