Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace15_mtpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ CONFIG_DAI_DMIC_HAS_MULTIPLE_LINE_SYNC=y
CONFIG_DAI_DMIC_HW_IOCLK=38400000
CONFIG_DAI_INIT_PRIORITY=70
CONFIG_DMA_DW_LLI_POOL_SIZE=50
CONFIG_DMA_DW_FIFO_PARTITION=y
CONFIG_DMA_INTEL_ADSP_GPDMA=y
CONFIG_MEMORY_WIN_2_SIZE=12288
CONFIG_MM_DRV_INTEL_ADSP_TLB_REMAP_UNUSED_RAM=y
Expand Down
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace30_ptl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CONFIG_FORMAT_CONVERT_HIFI3=n
CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING=m
CONFIG_GOOGLE_RTC_AUDIO_PROCESSING_MOCK=y
CONFIG_COMP_STFT_PROCESS=y
CONFIG_COMP_BT_CODEC=y

# SOF / infrastructure
CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL=n
Expand Down
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace30_wcl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CONFIG_FORMAT_CONVERT_HIFI3=n
CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING=m
CONFIG_GOOGLE_RTC_AUDIO_PROCESSING_MOCK=y
CONFIG_COMP_STFT_PROCESS=y
CONFIG_COMP_BT_CODEC=y

# SOF / infrastructure
CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL=n
Expand Down
4 changes: 4 additions & 0 deletions src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,7 @@ else() ### library, e.g. testbench ###
)
endif()
endif()

if(CONFIG_COMP_BT_CODEC)
add_subdirectory(bt_codec)
endif()
2 changes: 2 additions & 0 deletions src/audio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -451,4 +451,6 @@ config DAI_VERBOSE_GLITCH_WARNINGS
always emit a warning. This option useful to debug issues with
DAI DMA operation and issues with low-latency scheduling.

rsource "bt_codec/Kconfig"

endmenu
74 changes: 74 additions & 0 deletions src/audio/bt_codec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# SPDX-License-Identifier: BSD-3-Clause

set(LIBLC3_DIR "")
if(DEFINED ZEPHYR_LIBLC3_MODULE_DIR)
if(EXISTS "${ZEPHYR_LIBLC3_MODULE_DIR}/include/lc3.h")
set(LIBLC3_DIR "${ZEPHYR_LIBLC3_MODULE_DIR}")
endif()
endif()

if("${LIBLC3_DIR}" STREQUAL "")
cmake_path(SET LIBLC3_DIR NORMALIZE "${CMAKE_CURRENT_LIST_DIR}/../../../../modules/lib/liblc3")
endif()

zephyr_include_directories(
${LIBLC3_DIR}/include
${LIBLC3_DIR}/src
)

set(LIBLC3_SOURCES
${LIBLC3_DIR}/src/attdet.c
${LIBLC3_DIR}/src/bits.c
${LIBLC3_DIR}/src/bwdet.c
${LIBLC3_DIR}/src/energy.c
${LIBLC3_DIR}/src/lc3.c
${LIBLC3_DIR}/src/ltpf.c
${LIBLC3_DIR}/src/mdct.c
${LIBLC3_DIR}/src/plc.c
${LIBLC3_DIR}/src/sns.c
${LIBLC3_DIR}/src/spec.c
${LIBLC3_DIR}/src/tables.c
${LIBLC3_DIR}/src/tns.c
)

zephyr_compile_definitions(
LC3_PLUS=0
LC3_PLUS_HR=0
)

add_local_sources(sof
bt_codec.c
bt_codec_algos.c
${LIBLC3_SOURCES}
)

set(BT_CODEC_COMPILE_OPTIONS
-O3
-ffast-math
-fno-finite-math-only
-Wno-array-bounds
-Wno-double-promotion
-include
${CMAKE_CURRENT_LIST_DIR}/lc3_math_shim.h
)

# When building with Clang on platforms where hardware FPU is disabled (e.g.
# ACE 3.0 PTL / WCL with CONFIG_FPU=n), strip the Xtensa FP0 feature so liblc3
# and bt_codec emit software floating-point calls instead of hardware FP0
# instructions that fault when CPENABLE bit 0 is cleared.
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT CONFIG_FPU)
list(APPEND BT_CODEC_COMPILE_OPTIONS
-Xclang
-target-feature
-Xclang
-fp
)
endif()

set_source_files_properties(
${CMAKE_CURRENT_LIST_DIR}/bt_codec.c
${CMAKE_CURRENT_LIST_DIR}/bt_codec_algos.c
${LIBLC3_SOURCES}
TARGET_DIRECTORY modules_sof
PROPERTIES COMPILE_OPTIONS "${BT_CODEC_COMPILE_OPTIONS}"
)
11 changes: 11 additions & 0 deletions src/audio/bt_codec/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: BSD-3-Clause

config COMP_BT_CODEC
bool "Bluetooth Transparent Mode DSP Codec components (LC3, mSBC, G.722, SB4)"
depends on COMP_MODULE_ADAPTER && IPC_MAJOR_4
help
Select to include Bluetooth Transparent Mode (0x03) DSP audio codec
offload components for SSP2-BT playback and capture pipelines.
Provides bt_lc3 (Zephyr liblc3 7.5 ms codec), bt_msbc (Bluetooth HFP
H2-framed mSBC), bt_g722 (ITU-T Rec. G.722 SB-ADPCM), and bt_sb4
(experimental 4-band tree-QMF subband ADPCM).
Loading
Loading