From 3c6f2c1c635123029040d939f2407b4886b5c46f Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Thu, 13 Jul 2023 17:03:05 -0700 Subject: [PATCH] audio: igo: add igo stub library Added for CI and fuzz testing Also remove exec permissions on related source files Signed-off-by: Curtis Malainey --- src/audio/Kconfig | 10 ++++++++++ src/audio/igo_nr/CMakeLists.txt | 4 ++++ src/audio/igo_nr/igo_nr.c | 0 src/audio/igo_nr/igo_nr_stub.c | 27 +++++++++++++++++++++++++++ zephyr/CMakeLists.txt | 4 ++++ 5 files changed, 45 insertions(+) mode change 100755 => 100644 src/audio/igo_nr/igo_nr.c create mode 100644 src/audio/igo_nr/igo_nr_stub.c diff --git a/src/audio/Kconfig b/src/audio/Kconfig index 46b2d85a5..9f0bb84d7 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -478,12 +478,22 @@ config COMP_LEGACY_INTERFACE config COMP_IGO_NR bool "IGO NR component" select COMP_BLOB + select COMP_IGO_NR_STUB if COMP_STUBS default n help This option enables Intelligo non-speech noise reduction. The feature links to a proprietary binary libigonr.a that currently is supported on different Xtensa DSP platforms. Please email info@intelli-go.com for any questions about the binary. +config COMP_IGO_NR_STUB + bool "IGO NR component" + select COMP_BLOB + depends on COMP_IGO_NR + default n + help + This option builds the IGO adapter with a stub library, it should only be used for + testing or CI purposes. + config COMP_RTNR bool "RTNR component" select COMP_BLOB diff --git a/src/audio/igo_nr/CMakeLists.txt b/src/audio/igo_nr/CMakeLists.txt index 475d5c319..49f9af9a2 100644 --- a/src/audio/igo_nr/CMakeLists.txt +++ b/src/audio/igo_nr/CMakeLists.txt @@ -1,4 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause add_local_sources(sof igo_nr.c) +if (CONFIG_COMP_IGO_NR_STUB) +add_local_sources(sof igo_nr_stub.c) +else () sof_add_static_library(IGOChrome ${CMAKE_CURRENT_LIST_DIR}/libigonr.a) +endif () diff --git a/src/audio/igo_nr/igo_nr.c b/src/audio/igo_nr/igo_nr.c old mode 100755 new mode 100644 diff --git a/src/audio/igo_nr/igo_nr_stub.c b/src/audio/igo_nr/igo_nr_stub.c new file mode 100644 index 000000000..12882740d --- /dev/null +++ b/src/audio/igo_nr/igo_nr_stub.c @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2023 Google LLC. All rights reserved. +// +// Author: Curtis Malainey + +#include + +enum IgoRet IgoLibGetInfo(struct IgoLibInfo *info) +{ + return IGO_RET_OK; +} + +enum IgoRet IgoLibInit(void *handle, + const struct IgoLibConfig *config, + void *param) +{ + return IGO_RET_OK; +} + +enum IgoRet IgoLibProcess(void *handle, + const struct IgoStreamData *in, + const struct IgoStreamData *ref, + const struct IgoStreamData *out) +{ + return IGO_RET_OK; +} diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 56ca7fa71..3606b2bf3 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -682,6 +682,10 @@ zephyr_library_sources_ifdef(CONFIG_COMP_IGO_NR ${SOF_AUDIO_PATH}/igo_nr/igo_nr.c ) +zephyr_library_sources_ifdef(CONFIG_COMP_IGO_NR_STUB + ${SOF_AUDIO_PATH}/igo_nr/igo_nr_stub.c +) + zephyr_library_sources_ifdef(CONFIG_COMP_RTNR ${SOF_AUDIO_PATH}/rtnr/rtnr.c )