From fbd3baf47e15089a02c1096c5478a6106d35ec20 Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Wed, 12 Jul 2023 18:21:05 -0700 Subject: [PATCH 1/2] audio: waves: fix header include pathing Now that waves headers are published they should not be trying to include local headers or modifying the global scope. Fixup headers so they include like the rest of public headers. Signed-off-by: Curtis Malainey --- src/audio/module_adapter/CMakeLists.txt | 1 - src/audio/module_adapter/module/waves.c | 17 +++++++---------- .../Control/Direct/MaxxEffect_Revision.h | 4 ++-- .../Control/RPC/MaxxEffect_RPC_Server.h | 4 ++-- .../Initialize/MaxxEffect_Initialize.h | 6 +++--- .../MaxxEffect/Process/MaxxEffect_Process.h | 6 +++--- .../audio/MaxxEffect/Process/MaxxEffect_Reset.h | 4 ++-- 7 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/audio/module_adapter/CMakeLists.txt b/src/audio/module_adapter/CMakeLists.txt index a7b5b219a2f6..3bb445ff76d0 100644 --- a/src/audio/module_adapter/CMakeLists.txt +++ b/src/audio/module_adapter/CMakeLists.txt @@ -70,7 +70,6 @@ if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC) add_local_sources(sof module/waves.c) sof_add_static_library(MaxxChrome ${CMAKE_CURRENT_LIST_DIR}/lib/release/libMaxxChrome.a) # folder with Waves API must be among include directories - target_include_directories(sof PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../../include/sof/audio/) endif() if(CONFIG_DTS_CODEC) diff --git a/src/audio/module_adapter/module/waves.c b/src/audio/module_adapter/module/waves.c index 90b3a24a5919..89091b52cc2e 100644 --- a/src/audio/module_adapter/module/waves.c +++ b/src/audio/module_adapter/module/waves.c @@ -4,19 +4,16 @@ // // Author: Oleksandr Strelchenko // + +#include #include #include #include -#include - -#include "MaxxEffect/MaxxEffect.h" -#include "MaxxEffect/MaxxStream.h" -#include "MaxxEffect/MaxxStatus.h" -#include "MaxxEffect/Initialize/MaxxEffect_Initialize.h" -#include "MaxxEffect/Process/MaxxEffect_Process.h" -#include "MaxxEffect/Process/MaxxEffect_Reset.h" -#include "MaxxEffect/Control/RPC/MaxxEffect_RPC_Server.h" -#include "MaxxEffect/Control/Direct/MaxxEffect_Revision.h" +#include +#include +#include +#include +#include #define MAX_CONFIG_SIZE_BYTES (8192) #define NUM_IO_STREAMS (1) diff --git a/src/include/sof/audio/MaxxEffect/Control/Direct/MaxxEffect_Revision.h b/src/include/sof/audio/MaxxEffect/Control/Direct/MaxxEffect_Revision.h index e0faf7464145..eeb47e704b4f 100644 --- a/src/include/sof/audio/MaxxEffect/Control/Direct/MaxxEffect_Revision.h +++ b/src/include/sof/audio/MaxxEffect/Control/Direct/MaxxEffect_Revision.h @@ -6,8 +6,8 @@ #define MAXX_EFFECT_REVISION_H #include -#include "MaxxEffect/MaxxEffect.h" -#include "MaxxEffect/MaxxStatus.h" +#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/include/sof/audio/MaxxEffect/Control/RPC/MaxxEffect_RPC_Server.h b/src/include/sof/audio/MaxxEffect/Control/RPC/MaxxEffect_RPC_Server.h index 666a86562877..984060c4cdc1 100644 --- a/src/include/sof/audio/MaxxEffect/Control/RPC/MaxxEffect_RPC_Server.h +++ b/src/include/sof/audio/MaxxEffect/Control/RPC/MaxxEffect_RPC_Server.h @@ -6,8 +6,8 @@ #define MAXX_EFFECT_RPC_SERVER_H #include -#include "MaxxEffect/MaxxEffect.h" -#include "MaxxEffect/MaxxStatus.h" +#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/include/sof/audio/MaxxEffect/Initialize/MaxxEffect_Initialize.h b/src/include/sof/audio/MaxxEffect/Initialize/MaxxEffect_Initialize.h index 3a3dc2f21701..41a7747a189b 100644 --- a/src/include/sof/audio/MaxxEffect/Initialize/MaxxEffect_Initialize.h +++ b/src/include/sof/audio/MaxxEffect/Initialize/MaxxEffect_Initialize.h @@ -54,9 +54,9 @@ #define MAXX_EFFECT_INITIALIZE_H #include -#include "MaxxEffect/MaxxEffect.h" -#include "MaxxEffect/MaxxStatus.h" -#include "MaxxEffect/MaxxStream.h" +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/include/sof/audio/MaxxEffect/Process/MaxxEffect_Process.h b/src/include/sof/audio/MaxxEffect/Process/MaxxEffect_Process.h index fdcda71fce5a..c9e18aa26d30 100644 --- a/src/include/sof/audio/MaxxEffect/Process/MaxxEffect_Process.h +++ b/src/include/sof/audio/MaxxEffect/Process/MaxxEffect_Process.h @@ -72,9 +72,9 @@ #ifndef MAXX_EFFECT_PROCESS_H #define MAXX_EFFECT_PROCESS_H -#include "MaxxEffect/MaxxEffect.h" -#include "MaxxEffect/MaxxStatus.h" -#include "MaxxEffect/MaxxStream.h" +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/src/include/sof/audio/MaxxEffect/Process/MaxxEffect_Reset.h b/src/include/sof/audio/MaxxEffect/Process/MaxxEffect_Reset.h index bc03347e520c..75ff92947acb 100644 --- a/src/include/sof/audio/MaxxEffect/Process/MaxxEffect_Reset.h +++ b/src/include/sof/audio/MaxxEffect/Process/MaxxEffect_Reset.h @@ -5,8 +5,8 @@ #ifndef MAXX_EFFECT_RESET_H #define MAXX_EFFECT_RESET_H -#include "MaxxEffect/MaxxEffect.h" -#include "MaxxEffect/MaxxStatus.h" +#include +#include #ifdef __cplusplus extern "C" { From 50d5e5b4408e6d57ba555d482688dd31d4545492 Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Thu, 13 Jul 2023 11:24:50 -0700 Subject: [PATCH 2/2] audio: waves: Fix buffer accessors Since 3P code can't be compiled without the library (for now) we rely on reviews for API conversions which unfortunately has proven to not be perfect. Fixup the accessors for the waves module. Fixes: e57883f3c2fd ("buffer: use an accessor to read struct audio_stream::channels") Fixes: f8e4d693b26f ("buffer: use an accessor to read struct audio_stream::rate") Fixes: 017b8ebcde57 ("buffer: use an accessor to read struct audio_stream::frame_fmt") Fixes: 90828e230590 ("buffer: external modules use API to access buffer_fmt") Signed-off-by: Curtis Malainey --- src/audio/module_adapter/module/waves.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/audio/module_adapter/module/waves.c b/src/audio/module_adapter/module/waves.c index 89091b52cc2e..570a68f27b82 100644 --- a/src/audio/module_adapter/module/waves.c +++ b/src/audio/module_adapter/module/waves.c @@ -232,7 +232,7 @@ static int waves_effect_check(struct comp_dev *dev) /* todo use fallback to comp_verify_params when ready */ /* resampling not supported */ - if (src_fmt->rate != audio_stream_get_rate(snk_fmt)) { + if (audio_stream_get_rate(src_fmt) != audio_stream_get_rate(snk_fmt)) { comp_err(dev, "waves_effect_check() source %d sink %d rate mismatch", audio_stream_get_rate(src_fmt), audio_stream_get_rate(snk_fmt)); ret = -EINVAL; @@ -240,7 +240,7 @@ static int waves_effect_check(struct comp_dev *dev) } /* upmix/downmix not supported */ - if (src_fmt->channels != audio_stream_get_channels(snk_fmt)) { + if (audio_stream_get_channels(src_fmt) != audio_stream_get_channels(snk_fmt)) { comp_err(dev, "waves_effect_check() source %d sink %d channels mismatch", audio_stream_get_channels(src_fmt), audio_stream_get_channels(snk_fmt)); ret = -EINVAL; @@ -248,7 +248,7 @@ static int waves_effect_check(struct comp_dev *dev) } /* different frame format not supported */ - if (src_fmt->frame_fmt != audio_stream_get_frm_fmt(snk_fmt)) { + if (audio_stream_get_frm_fmt(src_fmt) != audio_stream_get_frm_fmt(snk_fmt)) { comp_err(dev, "waves_effect_check() source %d sink %d sample format mismatch", audio_stream_get_frm_fmt(src_fmt), audio_stream_get_frm_fmt(snk_fmt)); ret = -EINVAL; @@ -256,7 +256,7 @@ static int waves_effect_check(struct comp_dev *dev) } /* different interleaving is not supported */ - if (source_c->buffer_fmt != sink_c->buffer_fmt) { + if (audio_stream_get_buffer_fmt(src_fmt) != audio_stream_get_buffer_fmt(snk_fmt)) { comp_err(dev, "waves_effect_check() source %d sink %d buffer format mismatch"); ret = -EINVAL; goto out; @@ -268,7 +268,7 @@ static int waves_effect_check(struct comp_dev *dev) goto out; } - if (!layout_is_supported(source_c->buffer_fmt)) { + if (!layout_is_supported(audio_stream_get_buffer_fmt(src_fmt))) { comp_err(dev, "waves_effect_check() non interleaved format not supported"); ret = -EINVAL; goto out; @@ -281,7 +281,7 @@ static int waves_effect_check(struct comp_dev *dev) goto out; } - if (src_fmt->channels != 2) { + if (audio_stream_get_channels(src_fmt) != 2) { comp_err(dev, "waves_effect_check() channels %d not supported", audio_stream_get_channels(src_fmt)); ret = -EINVAL; @@ -325,10 +325,10 @@ static int waves_effect_init(struct processing_module *mod) goto out; } - buffer_format = layout_convert_sof_to_me(source_c->buffer_fmt); + buffer_format = layout_convert_sof_to_me(audio_stream_get_buffer_fmt(src_fmt)); if (buffer_format < 0) { comp_err(dev, "waves_effect_init() sof buffer format %d not supported", - source_c->buffer_fmt); + audio_stream_get_buffer_fmt(src_fmt)); ret = -EINVAL; goto out; }