Skip to content

audio: bt_codec, topology2: add Bluetooth Transparent LC3, mSBC, G.722, and aptX DSP codecs - #11444

Draft
lgirdwood wants to merge 5 commits into
thesofproject:mainfrom
lgirdwood:topic/sof-bt-transparent-codecs
Draft

lgirdwood wants to merge 5 commits into
thesofproject:mainfrom
lgirdwood:topic/sof-bt-transparent-codecs

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

Summary

Depends on #11432 (stacked on topic/sof-bt-offload).

This series adds Sound Open Firmware (SOF) DSP Bluetooth Transparent mode (0x03) audio codec offload components (LC3, mSBC, G.722, aptX) and dedicated ACE 3.0 Panther Lake / Wildcat Lake feature topologies so compressed wideband codecs run directly on the SOF DSP over SSP2-BT (Data_Path_ID = 0x01, Coding_Format = 0x03 Transparent) while exposing standard 16 kHz S16_LE PCM to host ALSA (hw:0,20):

  1. audio: bt_codec: add Bluetooth Transparent LC3, mSBC, G.722, aptX (9f458ce8d):
    • Imports Zephyr's liblc3 module (modules/lib/liblc3) in west.yml.
    • Adds src/audio/bt_codec/ (CONFIG_COMP_BT_CODEC=y on ACE 3.0 ptl and wcl) providing four IPC4 processing modules:
      • bt_lc3 (4c433301-b700-4a10-8000010203040501): Zephyr liblc3 7.5 ms encoder/decoder (16 kHz PCM ↔ 30-byte LC3 frame).
      • bt_msbc (4d534243-b700-4a10-8000010203040502): HFP H2-framed 0x01/0xad mSBC encoder/decoder (16 kHz PCM ↔ 57-byte mSBC frame).
      • bt_g722 (47373232-b700-4a10-8000010203040503): ITU-T G.722 64 kbps 2-band QMF SB-ADPCM encoder/decoder (16 kHz PCM ↔ 60-byte G.722 frame).
      • bt_aptx (41505458-b700-4a10-8000010203040504): Bluetooth aptX 4-band QMF ADPCM encoder/decoder (16 kHz PCM ↔ 60-byte aptX frame).
    • Uses self-synchronizing 60-byte packet framing (0xA5 0x5A sync + sequence + payload + XOR checksum) over the 8 kHz SSP2-BT Transparent eSCO link for zero bit-slip DSP-to-DSP framing.
  2. topology2: ace3, hda-generic: add BT Transparent codec topologies (18e650d13):
    • Adds BT_TRANSP_CODEC (lc3, msbc, g722, aptx) support in bt-generic.conf and widget definitions in include/components/bt-{lc3,msbc,g722,aptx}.conf.
    • Builds dedicated ACE 3.0 Panther Lake & Wildcat Lake feature topologies for each protocol:
      • sof-{ptl,wcl}-rt722-4ch-bt-{lc3,msbc,g722,aptx}.tplg
      • sof-{ptl,wcl}-ssp2-bt-id10-{lc3,msbc,g722,aptx}.tplg
      • sof-hda-generic-ace3-bt-{lc3,msbc,g722,aptx}.tplg

Hardware Validation (Over-the-Air DSP-to-DSP SSP2-BT Transparent 0x03)

Validated bi-directionally over the air between Wildcat Lake (ladybird, sof-wcl.ri, 500 Hz TX) and Panther Lake (damsel-fly, sof-ptl.ri, 1000 Hz TX) over SSP2-BT (hw:0,20, 16 kHz S16_LE host PCM ↔ 8 kHz Transparent 0x03 eSCO air link):

# SOF DSP Codec Module Topology Variant (ladybird / damsel-fly) ladybird RX FFT (1000 Hz TX) damsel-fly RX FFT (500 Hz TX) Status
1 bt_lc3 (Zephyr liblc3) *-bt-lc3.tplg 999.86 Hz (RMS 14140.4) 500.08 Hz (RMS 14140.1) PASS
2 bt_msbc (HFP H2 mSBC) *-bt-msbc.tplg 1000.45 Hz (RMS 14452.5) 500.00 Hz (RMS 14329.5) PASS
3 bt_g722 (ITU-T G.722 SB-ADPCM) *-bt-g722.tplg 999.87 Hz (RMS 14171.2) 500.00 Hz (RMS 14157.7) PASS
4 bt_aptx (4-band QMF ADPCM) *-bt-aptx.tplg 999.97 Hz (RMS 14385.2) 499.93 Hz (RMS 14371.0) PASS

Enable rx_slots=3 alongside tx_slots=3 on the 48 kHz 2-channel SSP2-BT
hardware configuration (hw_config.3) so full-duplex 48 kHz Bluetooth
SSP offload streams can capture and play back simultaneously.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Include SSP and Bluetooth offload definitions in sof-hda-generic.conf
when ADD_BT=true without altering existing non-BT topologies.

Add dedicated SSP2-BT offload topology targets (BT_PCM_ID=20,
BT_PCM_NAME=Bluetooth, ADD_BT=true) for ACE 1.5/2.0 and ACE 3.0 HDA
platforms (sof-hda-generic-ace1-bt, sof-hda-generic-ace3-bt,
sof-hda-generic-ace3-2ch-bt, sof-hda-generic-ace3-4ch-bt) as well as
ACE 3.0 / Wildcat Lake RT722 4ch SoundWire platforms
(sof-ptl-rt722-4ch-bt and sof-wcl-rt722-4ch-bt).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Enable CONFIG_DMA_DW_FIFO_PARTITION=y on ACE 1.5 (MTL/ARL-S) matching
CAVS 2.5 so dw_dma_setup() partitions the LP-GPDMA hardware FIFO
instead of leaving FIFO partition sizes at zero, preventing immediate
SSP2-BT GATEWAY_UNDERRUN_DETECTED errors.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Import Zephyr's liblc3 module in west.yml and add SOF DSP Bluetooth
Transparent-mode (0x03) codec offload components for SSP2-BT playback
and capture pipelines:

- bt_lc3  (4c433301-b700-4a10-8000-010203040501): Zephyr liblc3 7.5 ms
- bt_msbc (4d534243-b700-4a10-8000-010203040502): HFP H2-framed mSBC
- bt_g722 (47373232-b700-4a10-8000-010203040503): ITU-T G.722 SB-ADPCM
- bt_aptx (41505458-b700-4a10-8000-010203040504): 4-band QMF aptX ADPCM

Each component encapsulates frames into self-synchronizing 60-byte eSCO
Transparent-mode packets on the 8 kHz SSP2-BT link while exposing 16 kHz
S16_LE PCM to the host pipeline. Enable CONFIG_COMP_BT_CODEC=y on ACE
3.0 Panther Lake and Wildcat Lake targets.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add BT_TRANSP_CODEC support (lc3, msbc, g722, aptx) to bt-generic.conf
along with widget definitions for bt_lc3, bt_msbc, bt_g722, and bt_aptx.

Build dedicated ACE 3.0 Panther Lake and Wildcat Lake feature topologies
for each SOF DSP Bluetooth Transparent-mode protocol:

- sof-{ptl,wcl}-rt722-4ch-bt-{lc3,msbc,g722,aptx}.tplg
- sof-{ptl,wcl}-ssp2-bt-id10-{lc3,msbc,g722,aptx}.tplg
- sof-hda-generic-ace3-bt-{lc3,msbc,g722,aptx}.tplg

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
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