Skip to content

Commit 141bfed

Browse files
committed
audio: eap: Add EAP library stub for testing
This is used for CI testing and compiling. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
1 parent cc57300 commit 141bfed

File tree

4 files changed

+63
-2
lines changed

4 files changed

+63
-2
lines changed

src/audio/nxp/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ if(CONFIG_COMP_NXP_EAP)
66
zephyr_include_directories(${sof_top_dir}/third_party)
77

88
zephyr_library_sources(eap.c)
9-
zephyr_library_import(EAPLibrary
10-
${sof_top_dir}/eap_sdk/EAP_Library/libEAP16_3_0_13_FP1_RT600.a)
9+
10+
if(CONFIG_COMP_NXP_EAP_STUB)
11+
zephyr_library_sources(eap_stub.c)
12+
else()
13+
zephyr_library_import(EAPLibrary
14+
${sof_top_dir}/eap_sdk/EAP_Library/libEAP16_3_0_13_FP1_RT600.a)
15+
endif()
1116

1217
endif()

src/audio/nxp/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,10 @@ config COMP_NXP_EAP
77
Select for NXP Essential Audio Processing Component.
88
The EAP is a bundle of audio processing blocks for enhancing the tonal
99
and spatial perception of sound in audio applications.
10+
11+
config COMP_NXP_EAP_STUB
12+
tristate "NXP EAP Component stub"
13+
default n
14+
depends on COMP_NXP_EAP
15+
help
16+
Select for NXP EAP stub support.

src/audio/nxp/eap_stub.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// SPDX-License-Identifier: BSD-3-Clause
2+
//
3+
// Copyright 2025 NXP
4+
5+
6+
#include <sof/audio/nxp/eap/eap_lib_defines.h>
7+
#include <nxp/eap/EAP_Includes/EAP16.h>
8+
9+
LVM_ReturnStatus_en LVM_GetVersionInfo(LVM_VersionInfo_st *pVersion)
10+
{
11+
return LVM_SUCCESS;
12+
}
13+
14+
LVM_ReturnStatus_en LVM_GetInstanceHandle(LVM_Handle_t *phInstance,
15+
LVM_MemTab_t *pMemoryTable,
16+
LVM_InstParams_t *pInstParams)
17+
{
18+
return LVM_SUCCESS;
19+
};
20+
21+
LVM_ReturnStatus_en LVM_GetMemoryTable(LVM_Handle_t hInstance, LVM_MemTab_t *pMemoryTable,
22+
LVM_InstParams_t *pInstParams)
23+
{
24+
return LVM_SUCCESS;
25+
}
26+
27+
LVM_ReturnStatus_en LVM_Process(LVM_Handle_t hInstance, const LVM_INT16 *pInData,
28+
LVM_INT16 **pOutData, LVM_UINT16 NumSamples,
29+
LVM_UINT32 AudioTime)
30+
{
31+
return LVM_SUCCESS;
32+
}
33+
34+
LVM_ReturnStatus_en LVM_SetControlParameters(LVM_Handle_t hInstance, LVM_ControlParams_t *pParams)
35+
{
36+
return LVM_SUCCESS;
37+
}

src/include/sof/audio/nxp/eap/EAP_Parameter_presets.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@
33

44
#include <nxp/eap/EAP_Includes/EAP16.h>
55

6+
#ifndef CONFIG_COMP_NXP_EAP_STUB
67
#include <Example_Application/CONFIG_HEADER/EAP_Parameter_AllEffectOff.h>
78
#include <Example_Application/CONFIG_HEADER/EAP_Parameter_AutoVolumeLeveler.h>
89
#include <Example_Application/CONFIG_HEADER/EAP_Parameter_ConcertSound.h>
910
#include <Example_Application/CONFIG_HEADER/EAP_Parameter_LoudnessMaximiser.h>
1011
#include <Example_Application/CONFIG_HEADER/EAP_Parameter_MusicEnhancerRMSLimiter.h>
1112
#include <Example_Application/CONFIG_HEADER/EAP_Parameter_VoiceEnhancer.h>
1213

14+
#else
15+
16+
uint8_t InstParams_allEffectOff[28] = {};
17+
uint8_t ControlParamSet_allEffectOff[216] = {};
18+
uint8_t ControlParamSet_autoVolumeLeveler[216] = {};
19+
uint8_t ControlParamSet_concertSound[216] = {};
20+
uint8_t ControlParamSet_loudnessMaximiser[216] = {};
21+
uint8_t ControlParamSet_musicEnhancerRmsLimiter[216] = {};
22+
uint8_t ControlParamSet_voiceEnhancer[216] = {};
23+
#endif
24+
1325
#endif /* EAP_PARAMETER_PRESETS_H_ */

0 commit comments

Comments
 (0)