Skip to content

Commit ee939d7

Browse files
committed
audio: tone: Add IPC4 tone implementation
Add a new implementation for IPC4 for the tone module. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent a636d43 commit ee939d7

File tree

17 files changed

+842
-348
lines changed

17 files changed

+842
-348
lines changed

src/arch/host/configs/library_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ CONFIG_COMP_SRC=y
2121
CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y
2222
CONFIG_COMP_STUBS=y
2323
CONFIG_COMP_TDFB=y
24+
CONFIG_COMP_TONE=y
2425
CONFIG_COMP_VOLUME=y
2526
CONFIG_COMP_VOLUME_LINEAR_RAMP=y
2627
CONFIG_COMP_VOLUME_WINDOWS_FADE=y

src/audio/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
121121
add_subdirectory(mic_privacy_manager)
122122
endif()
123123
if(CONFIG_COMP_TONE)
124-
add_local_sources(sof
125-
tone.c
126-
)
124+
add_subdirectory(tone)
127125
endif()
128126
if(CONFIG_ZEPHYR_NATIVE_DRIVERS)
129127
list(APPEND base_files host-zephyr.c)

src/audio/Kconfig

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,6 @@ config COMP_STUBS
9393
Select to force all 3P blocks to link against stubs rather than their libraries. This
9494
should only be used in testing environments like fuzzers or CI.
9595

96-
config COMP_TONE
97-
bool "Tone component"
98-
select CORDIC_FIXED
99-
help
100-
Select for Tone component.
101-
Warning: This component is deprecated and will be removed from SOF v2.8.
102-
10396
config COMP_KPB
10497
bool "KPB component"
10598
default y
@@ -154,6 +147,7 @@ rsource "src/Kconfig"
154147
rsource "tdfb/Kconfig"
155148
rsource "template/Kconfig"
156149
rsource "tensorflow/Kconfig"
150+
rsource "tone/Kconfig"
157151
rsource "up_down_mixer/Kconfig"
158152
rsource "volume/Kconfig"
159153
# --- End Kconfig Sources (alphabetical order) ---

src/audio/tone/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
3+
if(CONFIG_COMP_TONE STREQUAL "m" AND DEFINED CONFIG_LLEXT)
4+
add_subdirectory(llext ${PROJECT_BINARY_DIR}/tone_llext)
5+
add_dependencies(app tone)
6+
else()
7+
if(CONFIG_IPC_MAJOR_3)
8+
add_local_sources(sof tone.c tone-ipc3.c)
9+
elseif(CONFIG_IPC_MAJOR_4)
10+
add_local_sources(sof tone.c tone-ipc4.c)
11+
endif()
12+
endif()

src/audio/tone/Kconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
3+
config COMP_TONE
4+
tristate "Tone component"
5+
default m if LIBRARY_DEFAULT_MODULAR
6+
default y
7+
depends on COMP_MODULE_ADAPTER
8+
depends on IPC_MAJOR_4
9+
select CORDIC_FIXED
10+
help
11+
Select for Tone component. This component is used to generate
12+
audio tones (sine waves) at specified frequencies when the Tone
13+
mode is enabled. The two other modes it supports are silence where
14+
it generates 0s and passthrough where the input is passed to the
15+
output. Warning: This component is untested with IPC_MAJOR_3 and
16+
is unavailable.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2025 Intel Corporation.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
sof_llext_build("tone"
5+
SOURCES ../tone.c ../tone-ipc4.c
6+
LIB openmodules
7+
)

src/audio/tone/llext/llext.toml.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <tools/rimage/config/platform.toml>
2+
#define LOAD_TYPE "2"
3+
#include "../tone.toml"
4+
5+
[module]
6+
count = __COUNTER__

0 commit comments

Comments
 (0)