All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] asha: allow LE 2M PHY on the audio channel
@ 2026-10-29  3:00 Kyle Pepper
  2026-10-29  6:31 ` [v3] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Kyle Pepper @ 2026-10-29  3:00 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Luiz Augusto von Dentz

Allow LE 2M alongside LE 1M on the connected audio socket before starting
ASHA. Keep streaming if the kernel cannot set the PHY preference.

Assisted-by: OpenCode:gpt-6.1-sol
Assisted-by: Codex:GPT-6
---
Changes since v2:
- Drop the standalone PHY unit test and its build/ignore entries.
- Reuse the existing test/simple-asha playback script.

Validation: builds without warnings, 35/35 native unit binaries,
and checkpatch pass.

 profiles/audio/asha.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/profiles/audio/asha.c b/profiles/audio/asha.c
index 8e625fd..d862247 100644
--- a/profiles/audio/asha.c
+++ b/profiles/audio/asha.c
@@ -88,6 +88,8 @@ static void connect_cb(GIOChannel *io, GError *err, gpointer user_data)
 	struct connect_data *conn_data = user_data;
 	struct bt_asha_device *asha_dev = conn_data->asha_dev;
 	GError *gerr = NULL;
+	uint32_t phys;
+	int fd;
 
 	if (err) {
 		error("%s", err->message);
@@ -105,6 +107,15 @@ static void connect_cb(GIOChannel *io, GError *err, gpointer user_data)
 		g_error_free(gerr);
 	}
 
+	/*
+	 * Allow LE 2M with LE 1M fallback. Older kernels may lack BT_PHY.
+	 */
+	phys = BT_PHY_LE_1M_TX | BT_PHY_LE_1M_RX |
+			BT_PHY_LE_2M_TX | BT_PHY_LE_2M_RX;
+	fd = g_io_channel_unix_get_fd(io);
+	if (setsockopt(fd, SOL_BLUETOOTH, BT_PHY, &phys, sizeof(phys)) < 0)
+		DBG("Could not set LE 2M PHY preference: %s", strerror(errno));
+
 	asha_dev->io = io;
 
 	bt_asha_start(asha_dev->asha, conn_data->cb,

base-commit: 82667d713949447d7c94725432c61b33689ae68a
-- 
2.56.0



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

end of thread, other threads:[~2026-10-29  6:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29  3:00 [PATCH v3] asha: allow LE 2M PHY on the audio channel Kyle Pepper
2026-10-29  6:31 ` [v3] " bluez.test.bot

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.