diff --git a/modules/liblc3/CMakeLists.txt b/modules/liblc3/CMakeLists.txt index 1a662866d12..2499445c3c6 100644 --- a/modules/liblc3/CMakeLists.txt +++ b/modules/liblc3/CMakeLists.txt @@ -1,22 +1,40 @@ if(CONFIG_LIBLC3) - zephyr_library_named(liblc3) -zephyr_library_compile_options(-O3 -std=c11 -ffast-math -Wno-array-bounds) - -zephyr_include_directories(${ZEPHYR_LIBLC3_MODULE_DIR}/include) -zephyr_include_directories(${ZEPHYR_LIBLC3_MODULE_DIR}/src) - -zephyr_library_sources(${ZEPHYR_LIBLC3_MODULE_DIR}/src/attdet.c) -zephyr_library_sources(${ZEPHYR_LIBLC3_MODULE_DIR}/src/bits.c) -zephyr_library_sources(${ZEPHYR_LIBLC3_MODULE_DIR}/src/bwdet.c) -zephyr_library_sources(${ZEPHYR_LIBLC3_MODULE_DIR}/src/energy.c) -zephyr_library_sources(${ZEPHYR_LIBLC3_MODULE_DIR}/src/lc3.c) -zephyr_library_sources(${ZEPHYR_LIBLC3_MODULE_DIR}/src/ltpf.c) -zephyr_library_sources(${ZEPHYR_LIBLC3_MODULE_DIR}/src/mdct.c) -zephyr_library_sources(${ZEPHYR_LIBLC3_MODULE_DIR}/src/plc.c) -zephyr_library_sources(${ZEPHYR_LIBLC3_MODULE_DIR}/src/sns.c) -zephyr_library_sources(${ZEPHYR_LIBLC3_MODULE_DIR}/src/spec.c) -zephyr_library_sources(${ZEPHYR_LIBLC3_MODULE_DIR}/src/tables.c) -zephyr_library_sources(${ZEPHYR_LIBLC3_MODULE_DIR}/src/tns.c) +zephyr_library_compile_options( + -O3 -std=c11 -ffast-math -Wno-array-bounds -Wall -Wextra -Wdouble-promotion -Wvla -pedantic +) +# LC3plus and LC3plusHR support is enabled by default in liblc3. +# In our case, we prefer those to be explicitly enabled by the user if needed. +if(CONFIG_LIBLC3_PLUS) +zephyr_library_compile_options(-DLC3_PLUS=1) +else() +zephyr_library_compile_options(-DLC3_PLUS=0) +endif() + +if(CONFIG_LIBLC3_PLUS_HR) +zephyr_library_compile_options(-DLC3_PLUS_HR=1) +else() +zephyr_library_compile_options(-DLC3_PLUS_HR=0) +endif() + +zephyr_include_directories( + ${ZEPHYR_LIBLC3_MODULE_DIR}/include + ${ZEPHYR_LIBLC3_MODULE_DIR}/src +) + +zephyr_library_sources( + ${ZEPHYR_LIBLC3_MODULE_DIR}/src/attdet.c + ${ZEPHYR_LIBLC3_MODULE_DIR}/src/bits.c + ${ZEPHYR_LIBLC3_MODULE_DIR}/src/bwdet.c + ${ZEPHYR_LIBLC3_MODULE_DIR}/src/energy.c + ${ZEPHYR_LIBLC3_MODULE_DIR}/src/lc3.c + ${ZEPHYR_LIBLC3_MODULE_DIR}/src/ltpf.c + ${ZEPHYR_LIBLC3_MODULE_DIR}/src/mdct.c + ${ZEPHYR_LIBLC3_MODULE_DIR}/src/plc.c + ${ZEPHYR_LIBLC3_MODULE_DIR}/src/sns.c + ${ZEPHYR_LIBLC3_MODULE_DIR}/src/spec.c + ${ZEPHYR_LIBLC3_MODULE_DIR}/src/tables.c + ${ZEPHYR_LIBLC3_MODULE_DIR}/src/tns.c +) endif() diff --git a/modules/liblc3/Kconfig b/modules/liblc3/Kconfig index 11ce2e34a6c..eb33af61794 100644 --- a/modules/liblc3/Kconfig +++ b/modules/liblc3/Kconfig @@ -1,4 +1,5 @@ # Copyright (c) 2022 Bose Corporation +# Copyright (c) 2024 Codecoup # SPDX-License-Identifier: Apache-2.0 config ZEPHYR_LIBLC3_MODULE @@ -9,4 +10,20 @@ config LIBLC3 depends on FPU select REQUIRES_FULL_LIBC help - This option enables the Android liblc3 library for Bluetooth LE Audio + Enable the Low Complexity Communication Codec (LC3) + +if LIBLC3 + +config LIBLC3_PLUS + bool "LC3plus Support [EXPERIMENTAL]" + select EXPERIMENTAL + help + Enable support of 2.5ms and 5ms frame durations. + +config LIBLC3_PLUS_HR + bool "LC3plus High Resolution Support [EXPERIMENTAL]" + select EXPERIMENTAL + help + Enable support of the High-Resolution mode. + +endif diff --git a/west.yml b/west.yml index 0955c3fef05..515566aefa5 100644 --- a/west.yml +++ b/west.yml @@ -276,7 +276,7 @@ manifest: path: modules/lib/hostap revision: e31fa6764a920623202b74e85e3848903351cdcb - name: liblc3 - revision: 1a5938ebaca4f13fe79ce074f5dee079783aa29f + revision: bb85f7dde4195bfc0fca9e9c7c2eed0f8694203c path: modules/lib/liblc3 - name: libmetal revision: 3e8781aae9d7285203118c05bc01d4eb0ca565a7