summaryrefslogtreecommitdiffstats
path: root/include/hardware/audio_effect.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-12-20 17:40:51 -0800
committerEric Laurent <elaurent@google.com>2012-01-13 15:18:47 -0800
commit66861e374070e50b11ae262e84854c16b297153d (patch)
tree2e5be84f59ddb55522136d1e1277a066d036e462 /include/hardware/audio_effect.h
parent9fc1eaed52e5ff4bf188aec5dba00c6e1c37bad5 (diff)
downloadhardware_libhardware-66861e374070e50b11ae262e84854c16b297153d.zip
hardware_libhardware-66861e374070e50b11ae262e84854c16b297153d.tar.gz
hardware_libhardware-66861e374070e50b11ae262e84854c16b297153d.tar.bz2
audio effects: add auxiliary channel feature
Added API to query and configure effects supporting auxiliary channels. An auxiliary channel contains an additional audio signal helping in the processing of the main channel. An example is a dual mic noise suppressor were the main channel contains the signal from the main mic and the aux channel containss the signal from the sub mic. Change-Id: Ibb7a19d7f492720ebad0be45f78f996e0beba272
Diffstat (limited to 'include/hardware/audio_effect.h')
-rw-r--r--include/hardware/audio_effect.h78
1 files changed, 77 insertions, 1 deletions
diff --git a/include/hardware/audio_effect.h b/include/hardware/audio_effect.h
index 3dd75ab..201cefb 100644
--- a/include/hardware/audio_effect.h
+++ b/include/hardware/audio_effect.h
@@ -410,6 +410,9 @@ enum effect_command_e {
EFFECT_CMD_SET_INPUT_DEVICE, // set capture device (see audio.h, audio_devices_t)
EFFECT_CMD_GET_CONFIG, // read effect engine configuration
EFFECT_CMD_GET_CONFIG_REVERSE, // read configure effect engine reverse stream configuration
+ EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS,// get all supported configurations for a feature.
+ EFFECT_CMD_GET_FEATURE_CONFIG, // get current feature configuration
+ EFFECT_CMD_SET_FEATURE_CONFIG, // set current feature configuration
EFFECT_CMD_FIRST_PROPRIETARY = 0x10000 // first proprietary command code
};
@@ -581,7 +584,7 @@ enum effect_command_e {
//--------------------------------------------------------------------------------------------------
// command format:
// size: sizeof(uint32_t)
-// data: audio_mode_e
+// data: audio_mode_t
//--------------------------------------------------------------------------------------------------
// reply format:
// size: 0
@@ -643,6 +646,65 @@ enum effect_command_e {
// size: sizeof(effect_config_t)
// data: effect_config_t
//==================================================================================================
+// command: EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS
+//--------------------------------------------------------------------------------------------------
+// description:
+// Queries for supported configurations for a particular feature (e.g. get the supported
+// combinations of main and auxiliary channels for a noise suppressor).
+// The command parameter is the feature identifier (See effect_feature_e for a list of defined
+// features) followed by the maximum number of configuration descriptor to return.
+// The reply is composed of:
+// - status (uint32_t):
+// - 0 if feature is supported
+// - -ENOSYS if the feature is not supported,
+// - -ENOMEM if the feature is supported but the total number of supported configurations
+// exceeds the maximum number indicated by the caller.
+// - total number of supported configurations (uint32_t)
+// - an array of configuration descriptors.
+// The actual number of descriptors returned must not exceed the maximum number indicated by
+// the caller.
+//--------------------------------------------------------------------------------------------------
+// command format:
+// size: 2 x sizeof(uint32_t)
+// data: effect_feature_e + maximum number of configurations to return
+//--------------------------------------------------------------------------------------------------
+// reply format:
+// size: 2 x sizeof(uint32_t) + n x sizeof (<config descriptor>)
+// data: status + total number of configurations supported + array of n config descriptors
+//==================================================================================================
+// command: EFFECT_CMD_GET_FEATURE_CONFIG
+//--------------------------------------------------------------------------------------------------
+// description:
+// Retrieves current configuration for a given feature.
+// The reply status is:
+// - 0 if feature is supported
+// - -ENOSYS if the feature is not supported,
+//--------------------------------------------------------------------------------------------------
+// command format:
+// size: sizeof(uint32_t)
+// data: effect_feature_e
+//--------------------------------------------------------------------------------------------------
+// reply format:
+// size: sizeof(uint32_t) + sizeof (<config descriptor>)
+// data: status + config descriptor
+//==================================================================================================
+// command: EFFECT_CMD_SET_FEATURE_CONFIG
+//--------------------------------------------------------------------------------------------------
+// description:
+// Sets current configuration for a given feature.
+// The reply status is:
+// - 0 if feature is supported
+// - -ENOSYS if the feature is not supported,
+// - -EINVAL if the configuration is invalid
+//--------------------------------------------------------------------------------------------------
+// command format:
+// size: sizeof(uint32_t) + sizeof (<config descriptor>)
+// data: effect_feature_e + config descriptor
+//--------------------------------------------------------------------------------------------------
+// reply format:
+// size: sizeof(uint32_t)
+// data: status
+//==================================================================================================
// command: EFFECT_CMD_FIRST_PROPRIETARY
//--------------------------------------------------------------------------------------------------
// description:
@@ -713,6 +775,20 @@ enum effect_buffer_access_e {
};
+// feature identifiers for EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS command
+enum effect_feature_e {
+ EFFECT_FEATURE_AUX_CHANNELS, // supports auxiliary channels (e.g. dual mic noise suppressor)
+ EFFECT_FEATURE_CNT
+};
+
+// EFFECT_FEATURE_AUX_CHANNELS feature configuration descriptor. Describe a combination
+// of main and auxiliary channels supported
+typedef struct channel_config_s {
+ uint32_t main_channels; // channel mask for main channels
+ uint32_t aux_channels; // channel mask for auxiliary channels
+} channel_config_t;
+
+
// Values for bit field "mask" in buffer_config_t. If a bit is set, the corresponding field
// in buffer_config_t must be taken into account when executing the EFFECT_CMD_SET_CONFIG command
#define EFFECT_CONFIG_BUFFER 0x0001 // buffer field must be taken into account