Skip to content

Bluetooth: btintel, msft, sco, iso, l2cap: support SSP audio hardware offload - #6031

Draft
lgirdwood wants to merge 7 commits into
thesofproject:topic/sof-devfrom
lgirdwood:sof-bt
Draft

lgirdwood wants to merge 7 commits into
thesofproject:topic/sof-devfrom
lgirdwood:sof-bt

Conversation

@lgirdwood

@lgirdwood lgirdwood commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Summary

This series enables full Bluetooth SSP (SSP2-BT, Data_Path_ID = 0x01) hardware and Transparent-mode audio offload across HFP/eSCO (BTPROTO_SCO), LE Audio CIS/BIS (BTPROTO_ISO), and A2DP (BTPROTO_L2CAP) on Intel Bluetooth controllers paired with Sound Open Firmware (SOF) DSPs:

  1. Bluetooth: btintel: configure offload on operational boot (dc45683418df):
    • Calls btintel_configure_offload() when booting directly in operational firmware state (BTINTEL_IMG_OP) and sets HCI_OFFLOAD_CODECS_ENABLED so BT_CODEC socket discovery is active immediately.
  2. Bluetooth: sco: support Enhanced Accept Synchronous Connection (743e0b03a5c0):
    • Implements HCI_OP_ENHANCED_ACCEPT_SYNC_CONN (0x043e) and hci_accept_sync() so incoming eSCO/SCO connections on BT_CODEC-configured sockets configure the controller data path (0x0c83) and accept synchronous links over SSP2-BT instead of legacy HCI PCM.
  3. Bluetooth: btintel: enable DDC offload codecs and ACL/ISO paths (b1336bc95213):
    • Writes DDC 0x0130 (0x3f) and 0x0120 (0x0b) via 0xfc8b during btintel_configure_offload() so 0x100d / 0x100e expose SCO, LE Audio ISO, and A2DP offload capabilities, and configures SSP presets in btintel_get_codec_config_data().
  4. Bluetooth: iso, l2cap: support BT_CODEC offload and data path (198a7de7a83d):
    • Adds BT_CODEC getsockopt() / setsockopt() discovery and selection on BTPROTO_ISO (HCI_TRANSPORT_LE_CIS / LE_BIS) and BTPROTO_L2CAP (HCI_TRANSPORT_ACL), and updates hci_iso_setup_path() to configure 0x0c83 and 0x206e (HCI_LE_Setup_ISO_Data_Path) for offloaded ISO streams.
  5. Bluetooth: msft: support AVDTP A2DP hardware offload over SSP (c9028e599d53):
    • Implements Microsoft HCI vendor extension (0xfc1e) subcommands 0x07..0x0b (Avdtp_Capabilities_Configuration, Avdtp_Open, Avdtp_Start, Avdtp_Suspend, Avdtp_Close) when MSFT_FEATURE_MASK_AVDTP (BIT(10)) is advertised, registering offloaded SBC (0x00) and AAC (0x02) capabilities under HCI_TRANSPORT_ACL and managing stream lifecycle on BTPROTO_L2CAP sockets.
  6. Bluetooth: hci_conn, btintel: support u-law and A-law SCO offload (2e0ede4f3900):
    • Configures 8 kHz SSP preset 0x00 for 0x00 (G.711 u-law), 0x01 (G.711 A-law), 0x02 (CVSD), 0x03 (Transparent), and 0x04 (Linear PCM), and passes the selected coding format ID in hci_enhanced_setup_sync() and hci_enhanced_accept_sync().
  7. Bluetooth: hci_conn, iso, btintel: support LE CIS LC3 SSP offload (55bbf62a067b):
    • Configures 16 kHz SSP preset 0x01 for CIS_LINK/BIS_LINK, populates Bluetooth SIG LC3 LTV Codec_Specific_Configuration (Sampling_Frequency, Frame_Duration, Octets_Per_Codec_Frame) in hci_iso_setup_path() when offloading BT_CODEC_LC3 (0x06), and propagates BT_CODEC onto hcon->codec in iso_conn_ready() for CIS Peripheral offload.

Hardware Validation (Over-the-Air DSP-to-DSP SSP2-BT hw:0,20)

Validated bi-directionally (500 Hz TX on Wildcat Lake ladybird [ibt-1190-01a1-pci] ↔ 1000 Hz TX on Panther Lake damsel-fly [ibt-00a0-0041-pci] and Arrow Lake dragon-fly [BE200]):

# Transport Protocol / Codec ladybird RX FFT (1000 Hz TX) damsel-fly RX FFT (500 Hz TX) Status
1 A2DP (BTPROTO_L2CAP) Controller SBC (0x00) (48 kHz 2ch) 999.97 Hz (RMS 14119.6) 499.35 Hz (RMS 14135.0) PASS
2 A2DP (BTPROTO_L2CAP) Controller AAC (0x02) (48 kHz 2ch) 1000.08 Hz (RMS 13707.5) 500.57 Hz (RMS 13727.3) PASS
3 HFP/eSCO (BTPROTO_SCO) Controller mSBC (0x05) (16 kHz 1ch) 999.90 Hz (RMS 14142.7) 500.08 Hz (RMS 14123.5) PASS
4 HFP/eSCO (BTPROTO_SCO) Controller CVSD (0x02) (8 kHz 1ch) 1000.14 Hz (RMS 10833.2) 499.37 Hz (RMS 13668.5) PASS
5 HFP/eSCO (BTPROTO_SCO) Controller G.711 u-law (0x00) (8 kHz 1ch) 1000.00 Hz (RMS 14006.2) 499.86 Hz (RMS 14177.9) PASS
6 HFP/eSCO (BTPROTO_SCO) Controller G.711 A-law (0x01) (8 kHz 1ch) 1000.29 Hz (RMS 14098.8) 500.57 Hz (RMS 14261.1) PASS
7 HFP/eSCO (BTPROTO_SCO) Transparent (0x03) Raw PCM + SOF DSP (LC3, mSBC, G.722, aptX) 999.77..1000.45 Hz (RMS >14100) 499.86..500.08 Hz (RMS >14100) PASS
8 LE Audio CIS (BTPROTO_ISO) Controller LC3 (0x06) (16 kHz 1ch) 1000.03 Hz (RMS 15343.7) 499.89 Hz (RMS 15503.1) PASS

In btintel_bootloader_setup_tlv(), when the controller is already
running operational firmware (ver->img_type == BTINTEL_IMG_OP, such
as across a warm reboot or module reload), execution jumps to the
finish: label and previously skipped btintel_configure_offload().
Move btintel_configure_offload() to finish: so offload callbacks are
always registered.

Additionally, set HCI_OFFLOAD_CODECS_ENABLED when 0xfc86 reports
HFP/SCO offload support (preset[0] & 0x03) so local offload codecs
are queried during hci_dev_open_sync().

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add HCI_OP_ENHANCED_ACCEPT_SYNC_CONN (0x043e) and hci_accept_sync()
so incoming eSCO/SCO connections on sockets configured with BT_CODEC
(data_path != 0) configure the controller data path (0x0c83) and
accept the synchronous connection over the offloaded PCM/SSP
transport instead of falling back to legacy
HCI_OP_ACCEPT_SYNC_CONN_REQ (0x0429).

Also allow setting BT_CODEC on listening SCO sockets and inherit
codec settings onto accepted child sockets.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Enable DDC 0x0130 (0x3f: LC3, SCO, A2DP SBC/AAC, LE Audio vendor
codec, and controller delay reporting) and DDC 0x0120 (0x0b: SCO,
LE ISO, and A2DP offload use cases) via HCI_Intel_Write_DDC (0xfc8b)
during btintel_configure_offload() so
HCI_Read_Local_Supported_Codecs_v2 (0x100d) and
HCI_Read_Local_Supported_Codec_Capabilities (0x100e) report all
hardware offload codecs supported by operational firmware.

Extend btintel_get_codec_config_data() to configure 16 kHz SCO
presets (0x01) for non-CVSD SCO codecs and 48 kHz 16-bit stereo SSP
offload (preset 0x22) for ACL and LE CIS/BIS links.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add BT_CODEC getsockopt and setsockopt support to BTPROTO_ISO (for
HCI_TRANSPORT_LE_CIS and HCI_TRANSPORT_LE_BIS offload codecs such as
LC3 and vendor LE Audio codecs) and BTPROTO_L2CAP (for
HCI_TRANSPORT_ACL A2DP offload codecs such as Intel SBC 0x0002:0x0000
and AAC 0x0002:0x0002).

Update hci_iso_setup_path() to configure the controller data path
(0x0c83) and pass the offloaded data_path, codec ID, and vendor
CID/VID to HCI_LE_Setup_ISO_Data_Path (0x206e) when offload is
enabled.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Implement Microsoft HCI vendor extension (0xfc1e) subcommands
0x07..0x0b (HCI_VS_MSFT_Avdtp_Capabilities_Configuration, Avdtp_Open,
Avdtp_Start, Avdtp_Suspend, and Avdtp_Close) when
MSFT_FEATURE_MASK_AVDTP (BIT(10)) is advertised by the controller.

During msft_do_open(), query subcommand 0x07 and register the
controller's offloaded AVDTP Media Codec Service Capabilities (SBC
0x00 and MPEG-2,4 AAC 0x02) into hdev->local_codecs under
HCI_TRANSPORT_ACL.

When setsockopt(SOL_BLUETOOTH, BT_CODEC) is called on a BTPROTO_L2CAP
socket, invoke msft_avdtp_open() to open and start hardware A2DP
offload on the controller's SSP TDM interface, and automatically
suspend and close the stream when the L2CAP channel is released.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Configure 8 kHz SSP PCM preset 0x00 in btintel_get_codec_config_data()
for 8 kHz synchronous codecs (0x00 u-law, 0x01 A-law, 0x02 CVSD, 0x03
Transparent, and 0x04 Linear PCM) while keeping 16 kHz preset 0x01
for 0x05 mSBC.

Update hci_enhanced_setup_sync() and hci_enhanced_accept_sync() to
pass the requested over-the-air coding format ID for G.711 u-law
(0x00) and A-law (0x01) connections instead of hardcoding CVSD (0x02).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Configure 16 kHz SSP offload preset 0x01 for LE CIS and BIS links in
btintel_get_codec_config_data().

When setting up an offloaded LE Audio ISO data path (path != 0) with
BT_CODEC_LC3 (0x06), populate the mandatory Bluetooth SIG LC3 LTV
Codec_Specific_Configuration (Sampling_Frequency, Frame_Duration, and
Octets_Per_Codec_Frame) derived from conn->iso_qos in
hci_iso_setup_path() so the controller's hardware LC3 encoder and
decoder accept HCI_LE_Setup_ISO_Data_Path (0x206e).

Also propagate the listening socket's BT_CODEC configuration onto
hcon->codec in iso_conn_ready() so incoming CIS Peripheral connections
configure the offloaded SSP data path as well.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@lgirdwood lgirdwood changed the title Bluetooth: btintel, msft, sco, iso, l2cap: support SSP audio hardware offload (HFP/eSCO, LE Audio ISO, A2DP AVDTP) Bluetooth: btintel, msft, sco, iso, l2cap: support SSP audio hardware offload Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants