-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
audio: codec_adapter: add Waves MaxxEffect API #3938
Closed
+541
−0
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/include/sof/audio/MaxxEffect/Control/Direct/MaxxEffect_Revision.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright(c) 2021 Waves Audio Ltd. All rights reserved. | ||
*/ | ||
|
||
#ifndef MAXX_EFFECT_REVISION_H | ||
#define MAXX_EFFECT_REVISION_H | ||
|
||
#include <stdint.h> | ||
#include "MaxxEffect/MaxxEffect.h" | ||
#include "MaxxEffect/MaxxStatus.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/******************************************************************************* | ||
* Get null-terminated revision string. | ||
* | ||
* @param[in] effect Initialized effect. | ||
* @param[out] revision Revision string. | ||
* @param[out] bytes Revision string size. Optional, use NULL if not needed. | ||
* | ||
* @return 0 if success, otherwise fail | ||
******************************************************************************/ | ||
MaxxStatus_t MaxxEffect_Revision_Get( | ||
MaxxEffect_t* effect, | ||
const char** revision, | ||
uint32_t* bytes); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
53 changes: 53 additions & 0 deletions
53
src/include/sof/audio/MaxxEffect/Control/RPC/MaxxEffect_RPC_Server.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright(c) 2021 Waves Audio Ltd. All rights reserved. | ||
*/ | ||
|
||
#ifndef MAXX_EFFECT_RPC_SERVER_H | ||
#define MAXX_EFFECT_RPC_SERVER_H | ||
|
||
#include <stdint.h> | ||
#include "MaxxEffect/MaxxEffect.h" | ||
#include "MaxxEffect/MaxxStatus.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/******************************************************************************* | ||
* Get required buffers size for communication. | ||
* | ||
* @param[in] effect initialized effect | ||
* @param[out] requestBytes request buffer size | ||
* @param[out] responseBytes response buffer size | ||
* | ||
* @return 0 if success, otherwise fail | ||
******************************************************************************/ | ||
MaxxStatus_t MaxxEffect_GetMessageMaxSize( | ||
MaxxEffect_t* effect, | ||
uint32_t* requestBytes, | ||
uint32_t* responseBytes); | ||
|
||
/******************************************************************************* | ||
* Process request buffer and provide with the response. | ||
* | ||
* @param[in] effect initialized effect | ||
* @param[in] request request buffer | ||
* @param[in] requestBytes request buffer size | ||
* @param[out] response response buffer | ||
* @param[out] responseBytes response buffer size | ||
* | ||
* @return 0 if success, otherwise fail | ||
******************************************************************************/ | ||
MaxxStatus_t MaxxEffect_Message( | ||
MaxxEffect_t* effect, | ||
const void* request, | ||
uint32_t requestBytes, | ||
void* response, | ||
uint32_t* responseBytes); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
106 changes: 106 additions & 0 deletions
106
src/include/sof/audio/MaxxEffect/Initialize/MaxxEffect_Initialize.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright(c) 2021 Waves Audio Ltd. All rights reserved. | ||
*/ | ||
|
||
/******************************************************************************* | ||
* @page Initialization_Default Default Initialization | ||
* | ||
* Refer to the diagram below for the default initialization workflow. | ||
* | ||
* ![Default initialization workflow] | ||
* (Initialize/Default_Initialization.svg) | ||
* | ||
* Example code for the default effect initialization with the interleaved | ||
* stereo streams processing at 48 kHz with Q1.31 fixed-point data samples: | ||
* | ||
* ~~~{.c} | ||
* uint32_t bytes = 0; | ||
* MaxxEffect_t* effect = NULL; | ||
* | ||
* // Get required size for storing MaxxEffect_t handler | ||
* if (0 == MaxxEffect_GetEffectSize(&bytes)) | ||
* { | ||
* // Allocate required size for effect | ||
* effect = (MaxxEffect_t*)malloc(bytes); | ||
* if (NULL != effect) | ||
* { | ||
* // Prepare expected formats | ||
* // Identical for both input and output streams | ||
* MaxxStreamFormat_t const expectedFormat = { | ||
* .sampleRate = 48000, | ||
* .numChannels = 2, | ||
* .samplesFormat = MAXX_BUFFER_FORMAT_Q1_31, | ||
* .samplesLayout = MAXX_BUFFER_LAYOUT_INTERLEAVED | ||
* }; | ||
* | ||
* // Prepare I/O stream format arrays | ||
* MaxxStreamFormat_t const* inputFormats[1]; | ||
* MaxxStreamFormat_t const* outputFormats[1]; | ||
* inputFormats[0] = &expectedFormat; | ||
* outputFormats[0] = &expectedFormat; | ||
* | ||
* // Initialize effect with the expected IO formats | ||
* if (0 == MaxxEffect_Initialize(effect, | ||
* inputFormats, 1, | ||
* outputFormats, 1)) | ||
* { | ||
* // MaxxEffect successfully initialized | ||
* } | ||
* } | ||
* } | ||
* ~~~ | ||
******************************************************************************/ | ||
#ifndef MAXX_EFFECT_INITIALIZE_H | ||
#define MAXX_EFFECT_INITIALIZE_H | ||
|
||
#include <stdint.h> | ||
#include "MaxxEffect/MaxxEffect.h" | ||
#include "MaxxEffect/MaxxStatus.h" | ||
#include "MaxxEffect/MaxxStream.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/******************************************************************************* | ||
* Provides with the required data size for holding @ref MaxxEffect_t handler. | ||
* It is caller responsibility to allocate enough memory (bytes) for effect. | ||
* | ||
* @see MaxxEffect_Initialize for allocated effect initialization | ||
* | ||
* @param[out] bytes required data size | ||
* | ||
* @return 0 if success, otherwise fail | ||
******************************************************************************/ | ||
MaxxStatus_t MaxxEffect_GetEffectSize( | ||
uint32_t* bytes); | ||
|
||
|
||
/******************************************************************************* | ||
* Initializes preallocated @ref MaxxEffect_t handler to the requested scenario. | ||
* Required scenario is determined based on the provided streams formats. | ||
* Supported streams count is defined by specific product. | ||
* | ||
* @see MaxxEffect_GetEffectSize for the required effect size | ||
* | ||
* @param[in] effect pointer to the pre-allocated handler | ||
* @param[in] inputFormats array of pointers to the input formats | ||
* @param[in] inputFormatsCount number of elements in the inputFormats | ||
* @param[in] outputFormats array of pointers to the output formats | ||
* @param[in] outputFormatsCount number of elements in the outputFormats | ||
* | ||
* @return 0 if effect is initialized, non-zero error code otherwise | ||
******************************************************************************/ | ||
MaxxStatus_t MaxxEffect_Initialize( | ||
MaxxEffect_t* effect, | ||
MaxxStreamFormat_t* const inputFormats[], | ||
uint32_t inputFormatsCount, | ||
MaxxStreamFormat_t* const outputFormats[], | ||
uint32_t outputFormatsCount); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright(c) 2021 Waves Audio Ltd. All rights reserved. | ||
*/ | ||
|
||
/******************************************************************************* | ||
* @page CoreConcepts_MaxxEffect MaxxEffect | ||
* | ||
* @ref MaxxEffect_t or simply **effect** - is a Waves algorithms handler, that | ||
* contains: | ||
* @ref MaxxEffect_InternalData_Parameters, | ||
* @ref MaxxEffect_InternalData_Coefficients, | ||
* @ref MaxxEffect_InternalData_States, | ||
* @ref MaxxEffect_InternalData_Meters, etc. required during | ||
* effect life-cycle. It is caller responsibility to allocate enough memory | ||
* for storing effect handler, and to properly initialize it. Refer to the | ||
* @ref Initialization page for handler allocation and initialization. | ||
* | ||
* @section MaxxEffect_InternalData Data structures | ||
* @subsection MaxxEffect_InternalData_Parameters Parameters | ||
* Data segment with algorithms parameters representing some | ||
* configuration available for tuning, e.g. Master Bypass, Mute, Parametric | ||
* EQ band frequency, gain etc. *Parameters preset* is an array of parameter | ||
* ID and float-point value (id, value) pairs. Might not be included in | ||
* MaxxEffect handler. **Updated in the control path.** | ||
* | ||
* @subsection MaxxEffect_InternalData_Coefficients Coefficients | ||
* Data segment with algorithms coefficients such as filters | ||
* difference equations. Computed from parameters and used for processing. | ||
* Single coefficient is represented by its ID and the corresponding buffer. | ||
* *Coefficients preset* is an array of such pairs. | ||
* **Updated in the control path.** | ||
* | ||
* @subsection MaxxEffect_InternalData_States States | ||
* Data segment with algorithms states. | ||
* **Updated in the data path.** | ||
* | ||
* @subsection MaxxEffect_InternalData_Meters Meters | ||
* Data segment with algorithms meters representing measure of some value | ||
* over a period of time, e.g. level, gain reduction, peak, etc. | ||
* **Updated in the data path.** | ||
******************************************************************************/ | ||
#ifndef MAXX_EFFECT_H | ||
#define MAXX_EFFECT_H | ||
|
||
/** | ||
* Waves effect handler. | ||
* | ||
* @see @ref CoreConcepts_MaxxEffect | ||
*/ | ||
typedef void MaxxEffect_t; | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright(c) 2021 Waves Audio Ltd. All rights reserved. | ||
*/ | ||
|
||
#ifndef MAXX_STATUS_H | ||
#define MAXX_STATUS_H | ||
|
||
#include <stdint.h> | ||
|
||
/** | ||
* Non-zero value represents error code type | ||
*/ | ||
typedef int32_t MaxxStatus_t; | ||
|
||
#endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is implied by default isnt it?