public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* RE: adapter: add DisableDiscoveryOnConnect option for combo chip coexistence
  2026-04-18 13:27 [PATCH] " StefanCondorache
@ 2026-04-18 14:06 ` bluez.test.bot
  0 siblings, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-04-18 14:06 UTC (permalink / raw)
  To: linux-bluetooth, condorachest

[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----

error: patch failed: client/mgmt.c:67
error: client/mgmt.c: patch does not apply
error: patch failed: mesh/prov-initiator.c:18
error: mesh/prov-initiator.c: patch does not apply
error: patch failed: src/device.c:72
error: src/device.c: patch does not apply
error: patch failed: src/gatt-database.c:54
error: src/gatt-database.c: patch does not apply
error: patch failed: src/shared/gatt-client.c:25
error: src/shared/gatt-client.c: patch does not apply
error: patch failed: src/shared/gatt-helpers.c:20
error: src/shared/gatt-helpers.c: patch does not apply
error: patch failed: src/shared/ringbuf.c:21
error: src/shared/ringbuf.c: patch does not apply
error: patch failed: src/shared/uhid.c:26
error: src/shared/uhid.c: patch does not apply
error: patch failed: src/shared/vcp.h:23
error: src/shared/vcp.h: patch does not apply
error: patch failed: tools/advtest.c:39
error: tools/advtest.c: patch does not apply
error: patch failed: tools/btgatt-server.c:48
error: tools/btgatt-server.c: patch does not apply
error: patch failed: tools/hcitool.c:34
error: tools/hcitool.c: patch does not apply
error: patch failed: tools/parser/rfcomm.h:33
error: tools/parser/rfcomm.h: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch

Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth


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

* [PATCH] adapter: add DisableDiscoveryOnConnect option for combo chip coexistence
@ 2026-04-18 14:11 StefanCondorache
  2026-04-18 15:47 ` bluez.test.bot
  0 siblings, 1 reply; 3+ messages in thread
From: StefanCondorache @ 2026-04-18 14:11 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: luiz.dentz, StefanCondorache

On systems with combo chips (shared Wi-Fi/Bluetooth antenna), background
LE scanning for auto-connect devices competes with active connections,
causing audio stuttering and Wi-Fi packet loss due to antenna
multiplexing via Packet Traffic Arbitration (PTA).

Add a DisableDiscoveryOnConnect boolean option to the [General] section
of main.conf. When enabled and an active connection exists, the option
suppresses adding devices to the kernel auto-connect list in
adapter_auto_connect_add() on kernels supporting KERNEL_CONN_CONTROL,
and gates trigger_passive_scanning() on older kernels.

The option defaults to false to preserve existing behavior.

Signed-off-by: StefanCondorache <condorachest@gmail.com>
---
 src/adapter.c | 24 ++++++++++++++++++++++++
 src/btd.h     |  2 ++
 src/main.c    |  4 ++++
 src/main.conf |  6 ++++++
 4 files changed, 36 insertions(+)

diff --git a/src/adapter.c b/src/adapter.c
index 6df66b3e0..4a18adfe0 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1594,6 +1594,18 @@ static void trigger_passive_scanning(struct btd_adapter *adapter)
 	if (!adapter->connect_list)
 		return;
 
+	/*
+	 * If the user has enabled DisableDiscoveryOnConnect, suppress
+	 * passive scanning whenever there is at least one active connection.
+	 * This prevents antenna multiplexing conflicts on combo chips where
+	 * Wi-Fi and Bluetooth share the same 2.4 GHz radio, which causes
+	 * audio drops and Wi-Fi packet loss during background scans.
+	 */
+	if (btd_opts.disable_discovery_on_connect && adapter->connections) {
+		DBG("suppress passive scan: active connection present");
+		return;
+	}
+
 	adapter->passive_scan_timeout = timeout_add_seconds(CONN_SCAN_TIMEOUT,
 					passive_scanning_timeout, adapter,
 					NULL);
@@ -5717,6 +5729,18 @@ void adapter_auto_connect_add(struct btd_adapter *adapter,
 		return;
 	}
 
+	/*
+	 * If DisableDiscoveryOnConnect is enabled, suppress adding devices
+	 * to the kernel auto-connect list while an active connection exists.
+	 * On combo chips (shared Wi-Fi/Bluetooth antenna), the kernel's
+	 * background scanning for auto-connect devices competes with active
+	 * connections, causing audio drops and Wi-Fi packet loss.
+	 */
+	if (btd_opts.disable_discovery_on_connect && adapter->connections) {
+		DBG("suppress kernel auto-connect: active connection present");
+		return;
+	}
+
 	bdaddr = device_get_address(device);
 	bdaddr_type = btd_device_get_bdaddr_type(device);
 
diff --git a/src/btd.h b/src/btd.h
index c84a600d1..07c4d85ba 100644
--- a/src/btd.h
+++ b/src/btd.h
@@ -144,6 +144,8 @@ struct btd_opts {
 	bool		experimental;
 	bool		testing;
 	bool		filter_discoverable;
+	bool		disable_discovery_on_connect;
+
 	struct queue	*kernel;
 
 	uint16_t	did_source;
diff --git a/src/main.c b/src/main.c
index 818f7c06e..d7ddf5643 100644
--- a/src/main.c
+++ b/src/main.c
@@ -92,6 +92,7 @@ static const char *supported_options[] = {
 	"KernelExperimental",
 	"RemoteNameRequestRetryDelay",
 	"FilterDiscoverable",
+	"DisableDiscoveryOnConnect",
 	NULL
 };
 
@@ -1072,6 +1073,8 @@ static void parse_general(GKeyFile *config)
 					0, UINT32_MAX);
 	parse_config_bool(config, "General", "FilterDiscoverable",
 						&btd_opts.filter_discoverable);
+	parse_config_bool(config, "General", "DisableDiscoveryOnConnect",
+					&btd_opts.disable_discovery_on_connect);
 }
 
 static void parse_gatt_cache(GKeyFile *config)
@@ -1283,6 +1286,7 @@ static void init_defaults(void)
 	btd_opts.name_request_retry_delay = DEFAULT_NAME_REQUEST_RETRY_DELAY;
 	btd_opts.secure_conn = SC_ON;
 	btd_opts.filter_discoverable = true;
+	btd_opts.disable_discovery_on_connect = false;
 
 	btd_opts.defaults.num_entries = 0;
 	btd_opts.defaults.br.page_scan_type = 0xFFFF;
diff --git a/src/main.conf b/src/main.conf
index d31dd1b8f..22507c465 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -157,6 +157,12 @@
 # some stacks) or when testing bad/unintended behavior.
 #FilterDiscoverable = true
 
+# Disables background LE passive scanning when an active connection is
+# established. Recommended for combo chips (shared Wi-Fi/Bluetooth antenna)
+# to prevent audio stuttering and packet loss caused by antenna multiplexing.
+# Defaults to false.
+#DisableDiscoveryOnConnect = false
+
 [BR]
 # The following values are used to load default adapter parameters for BR/EDR.
 # BlueZ loads the values into the kernel before the adapter is powered if the
-- 
2.53.0


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

* RE: adapter: add DisableDiscoveryOnConnect option for combo chip coexistence
  2026-04-18 14:11 [PATCH] adapter: add DisableDiscoveryOnConnect option for combo chip coexistence StefanCondorache
@ 2026-04-18 15:47 ` bluez.test.bot
  0 siblings, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-04-18 15:47 UTC (permalink / raw)
  To: linux-bluetooth, condorachest

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

---Test result---

Test Summary:
CheckPatch                    PASS      0.50 seconds
GitLint                       PASS      0.34 seconds
BuildEll                      PASS      20.26 seconds
BluezMake                     PASS      609.83 seconds
MakeCheck                     PASS      19.27 seconds
MakeDistcheck                 PASS      236.90 seconds
CheckValgrind                 PASS      277.51 seconds
CheckSmatch                   WARNING   322.18 seconds
bluezmakeextell               PASS      166.35 seconds
IncrementalBuild              PASS      595.91 seconds
ScanBuild                     PASS      922.27 seconds

Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/main.c: note: in included file (through src/device.h):


https://github.com/bluez/bluez/pull/2054

---
Regards,
Linux Bluetooth


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

end of thread, other threads:[~2026-04-18 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-18 14:11 [PATCH] adapter: add DisableDiscoveryOnConnect option for combo chip coexistence StefanCondorache
2026-04-18 15:47 ` bluez.test.bot
  -- strict thread matches above, loose matches on Subject: below --
2026-04-18 13:27 [PATCH] " StefanCondorache
2026-04-18 14:06 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox