From nobody Sat Jun 13 02:56:56 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3300E3A0B1C for ; Mon, 11 May 2026 10:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778496377; cv=none; b=hxBt4OEEfMy9WEkpskp7YkFAOfIQeJna84Fdyjd+FSi4Ev0SzXcMkVEid0m0mGJQ3yAVu7dxIleN+R8LURQSY0OVPeJkdAk6crMJPSCVyDkohRhE5L7z+jIdqeG/wnSyQDdPtkTdriR+7q36302sIXXaiX72WOOHwWqhhS3dXs8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778496377; c=relaxed/simple; bh=I0cda1uHzh+TihKG3r5oFsdPyz80ZrAsXPTte9S9h50=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=caZ4JCz6qiDt0gjKssbPuSLmgvFbbsFLVxdof3RvbTe0HgH2S/UyMCqItKOYg2vkVMM0NKNLfzHl/8eh/w0E7AnsWjjYCW51Zeks0Y5OG2wnQiLR6L2IJN6zwUT9AMiXA0bCGqQySExSikUw2BXGWIKBMW6A61SBleOnWlrEbeo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AMwv0O+u; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AMwv0O+u" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4891c00e7aeso34796725e9.2 for ; Mon, 11 May 2026 03:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778496374; x=1779101174; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=d/qwpsJlrGzPxaIWkL3whbWWFUARjctPk3DKWRqohVs=; b=AMwv0O+u5YtI1xQdgouO1LGnhYkz8QxsUPpzyDPdkOt4l0ac+VzLL2aTP6qxp5sudK GOIZcgExFS/TUGjFvBNua88yu+xVcknXsx2FwLzcuKSRCTfrW2Rhqk/KuxmSFHI8yY7U PmMPGZDPCj8be6Z3KrLzFevjgoOvfCTBHGnGHBzrsxyQyRjyzsEUaYj3LxOe8V1PA9NN oIFHqWjbjvD7grISW7rHh0/erd13oi/FfnBNL1UQkOS0HdH9O+55tVqDUnd/LtYJCnZj uyIY3qGS12Z/ygnmzXOCbTYuHAIJIBupD2/dme9h65Rn6/6ZM9cNSRaQuG/FKgTT1kii Th2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778496374; x=1779101174; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=d/qwpsJlrGzPxaIWkL3whbWWFUARjctPk3DKWRqohVs=; b=WS0bLqyrMblOw0WDdOKx2Bq6HBHxRnIrRi9YewEbRW1Y0V/mbirqBxVXw79izGKiSV +uIZOSLsm/2acmlUIh5fnn84dedpHB5TLktN5ux/ogEdcTWGsbVthuDMh9ooIM2NAKcP 6Pn4b7+XgjRrGjvii/HKdu0tZsBPVJnKYEavyN8yJUL3+wW+mH1SHJ9rHtWttuNGD1Bc GIH8eRFTPZlwCysIUJMNmaqy58bYSpecCW0Rey1zbKhtXtIfmKKA/2NDjhFxjTfbbqr1 2b9F7yoLgtXobJSx8p8ijj0wC+TtZ/tnJvqhvAmYZBSBXqcNuApqZ5OYWkqqeULg0lMK vw7w== X-Forwarded-Encrypted: i=1; AFNElJ9uOQBtsn8ujKoWhxlkMWpTTQEzS1TmiOF/vxY1pv0fQacxkHom8npx63vNoY2+9IsRatZ4h4iTWCDHy3A=@vger.kernel.org X-Gm-Message-State: AOJu0YzqxfratX4mMWPREjVVxUGDsIhqcBGcOhd7FkXgkjj4Ua+8GAuq wfYFXWDiXLwPuWchqmY0Xtyxo35ShU7nAh6gx6jtvwUiiWaamd7fKKFHMf3yiSsVYeE= X-Gm-Gg: Acq92OEVJ3lzpvw4YAwMwGQ5unyOaxhaJOtYLSPg8SDzzOea6QvBw9RSEg54T7Kkw1g l3ISg7ej87HDzSgwFr2a163TzqIwqeeWYDRoIG4hV2tG1S68nEiW7mnpwqJiwYyQ4dUbtZ0X3op eCx0Nnmz8zHFoOw0TcUSO5TUAPBfW2SNoLuD1AXAhP221dsrv3Q7p+KLf1viFHHVitaafKwzVNh isLELy3/tbR2JmkUaXDJsDKoqvHFOrBNh7HhLQ+01dOTW2UMgBOyRtd694yKzK5SOlQ4xBVn3PQ tCqShvjGtc0S6EvrkFAdTm0RBblCzoWaJpb/K6GTTdiS7FU9TxLu1AVY84cGdch5dH/SiaC/w4z my+oypbjLu2i+kNfiA0TUWir/cCmAOPGZFyR00wUBj95kD3vjHP02wdmkAzRrdX+YXs3fJEcEuH UZtu9lPQpQuCyMo7mj+wmCYWOldpbudZ9K X-Received: by 2002:a05:600d:1:b0:48e:7f1c:8760 with SMTP id 5b1f17b1804b1-48e7f1c87bdmr73341375e9.27.1778496373326; Mon, 11 May 2026 03:46:13 -0700 (PDT) Received: from nob-xt8664 ([109.202.240.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e6db09ccesm58533435e9.20.2026.05.11.03.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 03:46:12 -0700 (PDT) From: Silviu Sandulache To: Luiz Augusto von Dentz , Marcel Holtmann , Johan Hedberg Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Wang , Javier Tia Subject: [PATCH] Bluetooth: btmtk: set HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN for MT6639 Date: Mon, 11 May 2026 11:46:07 +0100 Message-ID: <20260511104607.382060-1-silviu.sandulache@gmail.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The MediaTek MT6639 Bluetooth controller (the BT half of the MT7925/MT7927 WiFi 7 combo silicon shipped on motherboards such as the ASUS ProArt X870E-CREATOR WIFI) advertises support for HCI Enhanced Setup Synchronous Connection (opcode 0x043D) in its supported-commands bitmap, but rejects the command at runtime. This breaks HFP wideband-speech (mSBC): when a Bluetooth headset is connected and the kernel attempts to set up an mSBC eSCO link, the controller responds with an error and the kernel logs: Bluetooth: hciN: HCI Enhanced Setup Synchronous Connection command \ is advertised, but not supported. User-visible symptom: the headset microphone captures pure silence in HFP mode, while A2DP playback works normally. This reproduces on every MT6639-based machine seen so far. A Bluetooth HCI trace captured on Windows on the same hardware (ASUS X870E-CREATOR with the MediaTek WHQL driver, recorded via the ETW BTHPORT provider during an HFP wideband recording session) shows that the Windows driver works around the same firmware bug by issuing the classic Setup Synchronous Connection command (opcode 0x0428) with Transparent air-mode parameters. The classic command sets up an mSBC eSCO link successfully, and the headset streams 16 kHz mono wideband audio over it as expected. HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN exists in the BR/EDR HCI core for exactly this case: when set, hci_setup_sync_conn() falls back to the classic Setup Synchronous Connection command with the same parameters. Setting the quirk for MT6639 makes Linux do what Windows does, restoring wideband HFP. The change is scoped to dev_id =3D=3D 0x6639 to keep it hardware-confirmed on the chip where the bug has been reproduced and the Windows fallback has been observed. Sibling MT79xx variants (MT7921 / MT7922 / MT7925 / MT7961) exhibit the same dmesg signature in community bug reports; if the same fallback proves correct for them, extending the quirk to those chip IDs is straightforward follow-up. Verification on an ASUS ProArt X870E-CREATOR WIFI: - Before patch: profile switch to headset-head-unit (mSBC) is accepted by PipeWire, but the kernel issues HCI_OP_ENHANCED_SETUP_ SYNC_CONN (0x043D), the controller refuses it, no eSCO link is established, the mic captures pure silence. - After patch: the kernel issues HCI_OP_SETUP_SYNC_CONN (0x0428) with Air Coding Format =3D Transparent. The controller responds Synchronous Connect Complete: Status Success, Link type eSCO, Air mode Transparent. SCO data flows over the link. Signed-off-by: Silviu Sandulache --- drivers/bluetooth/btmtk.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index ab34f1d..4bd2e6c 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -1417,6 +1417,19 @@ int btmtk_usb_setup(struct hci_dev *hdev) hci_set_msft_opcode(hdev, 0xFD30); hci_set_aosp_capable(hdev); =20 + /* MT6639 firmware advertises the HCI Enhanced Setup + * Synchronous Connection command (opcode 0x043D) in its + * supported-commands bitmap, but actually rejects it at + * runtime, breaking mSBC wideband HFP (the headset mic + * captures pure silence). The Windows MediaTek driver + * works around this by falling back to the classic Setup + * Synchronous Connection command (opcode 0x0428); setting + * this quirk makes the BR/EDR core do the same fallback. + */ + if (dev_id =3D=3D 0x6639) + hci_set_quirk(hdev, + HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN); + /* Clear BTMTK_FIRMWARE_DL_RETRY if setup successfully */ test_and_clear_bit(BTMTK_FIRMWARE_DL_RETRY, &btmtk_data->flags); =20 --=20 2.54.0