Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ modules/cmn/pcm_mf_cnv/capi/pcm_cnv/api
modules/processing/gain_control/drc/api
modules/processing/gain_control/iir_mbdrc/api
modules/cmn/api
modules/processing/volume_control/capi/gain/api
modules/processing/volume_control/capi/soft_vol/api
modules/cmn/common/internal_api
)
###
### Some strings used for picking inc paths based on arch, tgt/sim & static/shared.
Expand Down
8 changes: 5 additions & 3 deletions arch/linux/configs/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ CONFIG_ARCH_LINUX=y
#
CONFIG_MODULES=y
# CONFIG_MODULES_DEBUG is not set
CONFIG_ENCODER=y
CONFIG_ECHO_CANCELLATION=y
CONFIG_GAIN=m
CONFIG_ENCODER=n
CONFIG_ECHO_CANCELLATION=n
CONFIG_EXAMPLE_GAIN=n
CONFIG_MSIIR=y
CONFIG_CHMIXER=y
CONFIG_PCM_CNV=y
Expand All @@ -20,6 +20,8 @@ CONFIG_PCM_DECODER=y
CONFIG_PCM_ENCODER=y
CONFIG_DRC=y
CONFIG_IIR_MBDRC=y
CONFIG_GAIN=n
CONFIG_SOFT_VOL=n

#
# Signal Processing Framework
Expand Down
10 changes: 8 additions & 2 deletions modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ endif()
if(CONFIG_ECHO_CANCELLATION)
add_subdirectory(examples/echo_cancellation)
endif()
if(CONFIG_GAIN)
add_subdirectory(examples/gain)
if(CONFIG_EXAMPLE_GAIN)
add_subdirectory(examples/gain)
endif()
if(CONFIG_CHMIXER)
add_subdirectory(processing/channel_mixer/build)
Expand All @@ -41,3 +41,9 @@ if(CONFIG_IIR_MBDRC)
add_subdirectory(processing/gain_control/limiter/build)
add_subdirectory(processing/gain_control/iir_mbdrc/build)
endif()
if(CONFIG_GAIN)
add_subdirectory(processing/volume_control/capi/gain/build)
endif()
if(CONFIG_SOFT_VOL)
add_subdirectory(processing/volume_control/capi/soft_vol/build)
endif()
18 changes: 13 additions & 5 deletions modules/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ config MODULES_DEBUG

config ENCODER
tristate "Enable Example Encoder Library"
default y
default n

config ECHO_CANCELLATION
tristate "Enable ECHO Cancellation Library"
default y
default n

config GAIN
tristate "Enable GAIN Library"
default y
config EXAMPLE_GAIN
tristate "Enable EXAMPLE_GAIN Library"
default n

config CH_MIXER
tristate "Enable CH_MIXER Library"
Expand All @@ -44,4 +44,12 @@ config IIR_MBDRC
tristate "Enable IIR_MBDRC Library"
select DRC
default y

config GAIN
tristate "Enable GAIN Library"
default n

config SOFT_VOL
tristate "Enable SOFT_VOL Library"
default n
endmenu
110 changes: 110 additions & 0 deletions modules/cmn/common/internal_api/imcl_module_gain_api.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#ifndef IMCL_MODULE_GAIN_API_H
#define IMCL_MODULE_GAIN_API_H

/**
@file imcl_module_gain_api.h

@brief defines the Intent ID for communicating module's gain
over Inter-Module Control Links (IMCL).

*/

/*==========================================================================
* Copyright (c) Qualcomm Innovation Center, Inc. All Rights Reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
* =========================================================================*/

#define INTENT_ID_GAIN_INFO 0x080010F5
#ifdef INTENT_ID_GAIN_INFO

#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/


/*==============================================================================
Intent ID - INTENT_ID_GAIN_INFO
==============================================================================*/
/**<
Intent ID for the control link to send gain information.
This intent can be used by a module to send its gain to another module.

e.g.
Soft Volume Control sends the target gain to AVC-TX module in voice path.
*/

/* ============================================================================
Param ID
==============================================================================*/
/**<
This parameter is used to send the target gain for each channel.
It may be different than current gain.

*/
#define PARAM_ID_IMCL_TARGET_GAIN 0x080010F6

/*==============================================================================
Param structure defintions
==============================================================================*/
typedef struct imcl_gain_config_t imcl_gain_config_t;

#include "spf_begin_pack.h"
struct imcl_gain_config_t
{
uint32_t channel_mask_lsb;
/**< @h2xmle_description {Lower 32 bits of the mask that indicates the corresponding
channel whose maximum tap length is to be set.\n
- Set the bits corresponding to 1 to 31 channels of standard
channel mapping (channels are mapped per standard channel mapping)\n
- Position of the bit to set 1 (left shift)(channel_map) \n}
@h2xmle_default {0}
*/

uint32_t channel_mask_msb;
/**< @h2xmle_description {Upper 32 bits of the mask that indicates the corresponding channel
whose maximum tap length is to be set. \n
- Set the bits corresponding to 32 to 63 channels of standard channel
mapping (channels are mapped per standard channel mapping) \n
- Position of the bit to set 1 (left shift)(channel_map - 32)}
@h2xmle_default {0} */

uint32_t gain;
/**< @h2xmle_description {Gain value for the above channels in Q28 format}
@h2xmle_dataFormat {Q28}
@h2xmle_default {0} */
}
#include "spf_end_pack.h"
;

/* Structure definition for Parameter */
typedef struct param_id_imcl_gain_t param_id_imcl_gain_t;

/** @h2xmlp_parameter {"PARAM_ID_IMCL_TARGET_GAIN",
PARAM_ID_IMCL_TARGET_GAIN}
@h2xmlp_description {This parameter is used to send the target gain for each channel.}
@h2xmlp_toolPolicy {NO_SUPPORT} */

#include "spf_begin_pack.h"
#include "spf_begin_pragma.h"
struct param_id_imcl_gain_t
{
uint32_t num_config;
/**< @h2xmle_description {Number of channels-gain configurations provided}
@h2xmle_range {1..63}
@h2xmle_default {1} */

imcl_gain_config_t gain_data[0];
/**< @h2xmle_description {Payload consisting of all channels-gain pairs }
@h2xmle_variableArraySize {num_config} */
}
#include "spf_end_pragma.h"
#include "spf_end_pack.h"
;

#ifdef __cplusplus
}
#endif /*__cplusplus*/

#endif // INTENT_ID_GAIN_INFO

#endif /* IMCL_MODULE_GAIN_API_H */
68 changes: 68 additions & 0 deletions modules/cmn/common/internal_api/imcl_mute_api.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#ifndef IMCL_MUTE_API_H
#define IMCL_MUTE_API_H

/**
@file imcl_mute_api.h

@brief defines the Intent IDs for communication over Inter-Module Control
Links (IMCL) between TTY modules(1x TTY/CTM/LTE_TTY) and Soft volume Modules

*/

/*==========================================================================
* Copyright (c) Qualcomm Innovation Center, Inc. All Rights Reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
* =========================================================================*/

#define INTENT_ID_MUTE 0x08001195
#ifdef INTENT_ID_MUTE

#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/


/*==============================================================================
Intent ID - INTENT_ID_MUTE
==============================================================================*/
/**<
Intent ID for the control link between TTY module(1x/CTM/LTE_TTY in Rx path) and soft volume module(in Tx path).
TTY module communicates with the soft volume module to indicate whether to
mute or unmute the stream in the Tx path. The parameter - PARAM_ID_IMCL_MUTE
is used for this communication.

*/

/* ============================================================================
Param ID
==============================================================================*/

#define PARAM_ID_IMCL_MUTE 0x08001196
/** @h2xmlp_parameter {"PARAM_ID_IMCL_MUTE", PARAM_ID_IMCL_MUTE}
@h2xmlp_description {Configures the mute flag}
@h2xmlp_toolPolicy {NO_SUPPORT}*/

#include "spf_begin_pack.h"

/* Payload of the PARAM_ID_IMCL_MUTE parameter used
by the Volume Control module */
/* Structure for the mute configuration parameter for a
volume control module. */
struct param_id_imcl_mute_t
{
uint32_t mute_flag;
/**< @h2xmle_description {Specifies whether mute is enabled}
@h2xmle_rangeList {"Disable"= 0;
"Enable"=1}
@h2xmle_default {0} */
}
#include "spf_end_pack.h"
;

#ifdef __cplusplus
}
#endif /*__cplusplus*/

#endif

#endif /* IMCL_MUTE_API_H */
79 changes: 79 additions & 0 deletions modules/cmn/common/internal_api/imcl_p_eq_vol_api.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#ifndef IMCL_P_EQ_VOL_API_H
#define IMCL_P_EQ_VOL_API_H
/**
@file imcl_p_eq_vol_api.h

@brief defines the Intent IDs for communication over Inter-Module Control
Links (IMCL) betweeen Soft Volume Module and Popless Equalizer module
*/

/*==========================================================================
Copyright (c) Qualcomm Innovation Center, Inc. All Rights Reserved.
SPDX-License-Identifier: BSD-3-Clause-Clear
* =========================================================================*/

#define INTENT_ID_P_EQ_VOL_HEADROOM 0x08001118
#ifdef INTENT_ID_P_EQ_VOL_HEADROOM

#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/


/**< Header - Any IMCL message between soft volume module and Popless equalizer
* will have the following header followed by the actual payload.
* The peers have to parse the header accordingly*/

typedef struct vol_imcl_header_t
{
// specific purpose understandable to the IMCL peers only
uint32_t opcode;

// Size (in bytes) for the payload specific to the intent.
uint32_t actual_data_len;

} vol_imcl_header_t;


#define MIN_INCOMING_IMCL_PARAM_SIZE_P_EQ_VOL (sizeof(vol_imcl_header_t) + sizeof(intf_extn_param_id_imcl_incoming_data_t))

/*==============================================================================
Intent ID - INTENT_ID_P_EQ_VOL_HEADROOM
==============================================================================*/
// Intent ID for the control link between Soft Vol and Popless Equalizer.


/* ============================================================================
Param ID
==============================================================================*/

#define PARAM_ID_P_EQ_VOL_HEADROOM 0x08001117

/*==============================================================================
Param structure defintions
==============================================================================*/
/* Type definition for the above structure. */
typedef struct p_eq_vol_headroom_param_t p_eq_vol_headroom_param_t;
/** @h2xmlp_parameter {"PARAM_ID_P_EQ_VOL_HEADROOM", PARAM_ID_P_EQ_VOL_HEADROOM}
@h2xmlp_description { Headroom in millibels communicated from popless equalizer to soft vol module\n}
@h2xmlp_toolPolicy {NO_SUPPORT} */

#include "spf_begin_pack.h"
struct p_eq_vol_headroom_param_t
{
uint32_t headroom_in_millibels;
/**< @h2xmle_description {Headroom requirement of the module.}
@h2xmle_default {0x0} */

}
#include "spf_end_pack.h"
;


#ifdef __cplusplus
}
#endif /*__cplusplus*/

#endif // INTENT_ID_P_EQ_VOL_HEADROOM

#endif /* #ifndef IMCL_P_EQ_VOL_API_H*/
24 changes: 12 additions & 12 deletions modules/examples/gain/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Copyright (c) Qualcomm Innovation Center, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear

set(gain_sources
capi/src/capi_gain_module.c
capi/src/capi_gain_module_utils.c
lib/src/gain_module_lib.c
set(example_gain_sources
capi/src/capi_example_gain_module.c
capi/src/capi_example_gain_module_utils.c
lib/src/example_gain_module_lib.c
)

set(gain_includes
set(example_gain_includes
capi/inc
lib/inc
api
Expand All @@ -16,18 +16,18 @@ set(gain_includes
)

spf_module_sources(
KCONFIG CONFIG_GAIN
NAME gain
KCONFIG CONFIG_EXAMPLE_GAIN
NAME example_gain
MAJOR_VER 1
MINOR_VER 0
AMDB_ITYPE "capi"
AMDB_MTYPE "generic"
AMDB_MID "0x0700106F"
AMDB_TAG "capi_gain_module"
AMDB_MOD_NAME "MODULE_ID_GAIN_MODULE"
AMDB_TAG "capi_example_gain_module"
AMDB_MOD_NAME "MODULE_ID_EXAMPLE_GAIN_MODULE"
AMDB_FMT_ID1 "MEDIA_FMT_ID_EXAMPLE"
SRCS ${gain_sources}
INCLUDES ${gain_includes}
H2XML_HEADERS api/gain_module_api.h
SRCS ${example_gain_sources}
INCLUDES ${example_gain_includes}
H2XML_HEADERS api/example_gain_module_api.h
CFLAGS ""
)
Loading
Loading