From: Silviu Sandulache <silviu.sandulache@gmail.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
Marcel Holtmann <marcel@holtmann.org>,
Johan Hedberg <johan.hedberg@gmail.com>
Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
Sean Wang <sean.wang@mediatek.com>, Javier Tia <floss@jetm.me>
Subject: [PATCH] Bluetooth: btmtk: set HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN for MT6639
Date: Mon, 11 May 2026 11:46:07 +0100 [thread overview]
Message-ID: <20260511104607.382060-1-silviu.sandulache@gmail.com> (raw)
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 == 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 = 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 <silviu.sandulache@gmail.com>
---
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);
+ /* 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 == 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);
--
2.54.0
next reply other threads:[~2026-05-11 10:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 10:46 Silviu Sandulache [this message]
2026-05-11 11:26 ` Bluetooth: btmtk: set HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN for MT6639 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=20260511104607.382060-1-silviu.sandulache@gmail.com \
--to=silviu.sandulache@gmail.com \
--cc=floss@jetm.me \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=sean.wang@mediatek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox