From b0ca5bd9ad0db22891090ef142d08ff91f96a30e Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 30 May 2013 18:24:47 -0700 Subject: [PATCH] Add specific AEC effect descriptor Use a specific AEC effect implementor UUID to distinguish flo from other implementations based on QCOM Fluence. Bug: 9126576. Change-Id: If3f2d0d9a84112929b2d06df3a7f28c3575895d7 --- audio_effects.conf | 149 ++++++++++++++++++ device-common.mk | 7 + voice_processing/Android.mk | 21 +++ .../voice_processing_descriptors.c | 61 +++++++ 4 files changed, 238 insertions(+) create mode 100644 audio_effects.conf create mode 100644 voice_processing/Android.mk create mode 100644 voice_processing/voice_processing_descriptors.c diff --git a/audio_effects.conf b/audio_effects.conf new file mode 100644 index 0000000..72ef1d5 --- /dev/null +++ b/audio_effects.conf @@ -0,0 +1,149 @@ +# List of effect libraries to load. Each library element must contain a "path" element +# giving the full path of the library .so file. +# libraries { +# { +# path +# } +# } +libraries { + bundle { + path /system/lib/soundfx/libbundlewrapper.so + } + reverb { + path /system/lib/soundfx/libreverbwrapper.so + } + visualizer { + path /system/lib/soundfx/libvisualizer.so + } + downmix { + path /system/lib/soundfx/libdownmix.so + } + qcom_pre_processing { + path /system/lib/soundfx/libqcomvoiceprocessing.so + } +} + +# Default pre-processing library. Add to audio_effect.conf "libraries" section if +# audio HAL implements support for default software audio pre-processing effects +# +# pre_processing { +# path /system/lib/soundfx/libaudiopreprocessing.so +# } + +# list of effects to load. Each effect element must contain a "library" and a "uuid" element. +# The value of the "library" element must correspond to the name of one library element in the +# "libraries" element. +# The name of the effect element is indicative, only the value of the "uuid" element +# designates the effect. +# The uuid is the implementation specific UUID as specified by the effect vendor. This is not the +# generic effect type UUID. +# effects { +# { +# library +# uuid +# } +# ... +# } + +effects { + bassboost { + library bundle + uuid 8631f300-72e2-11df-b57e-0002a5d5c51b + } + virtualizer { + library bundle + uuid 1d4033c0-8557-11df-9f2d-0002a5d5c51b + } + equalizer { + library bundle + uuid ce772f20-847d-11df-bb17-0002a5d5c51b + } + volume { + library bundle + uuid 119341a0-8469-11df-81f9-0002a5d5c51b + } + reverb_env_aux { + library reverb + uuid 4a387fc0-8ab3-11df-8bad-0002a5d5c51b + } + reverb_env_ins { + library reverb + uuid c7a511a0-a3bb-11df-860e-0002a5d5c51b + } + reverb_pre_aux { + library reverb + uuid f29a1400-a3bb-11df-8ddc-0002a5d5c51b + } + reverb_pre_ins { + library reverb + uuid 172cdf00-a3bc-11df-a72f-0002a5d5c51b + } + visualizer { + library visualizer + uuid d069d9e0-8329-11df-9168-0002a5d5c51b + } + downmix { + library downmix + uuid 93f04452-e4fe-41cc-91f9-e475b6d1d69f + } + aec { + library qcom_pre_processing + uuid 1c04e560-c720-11e2-9525-0002a5d5c51b + } +} + +# Default pre-processing effects. Add to audio_effect.conf "effects" section if +# audio HAL implements support for them. +# +# agc { +# library pre_processing +# uuid aa8130e0-66fc-11e0-bad0-0002a5d5c51b +# } +# aec { +# library pre_processing +# uuid bb392ec0-8d4d-11e0-a896-0002a5d5c51b +# } +# ns { +# library pre_processing +# uuid c06c8400-8e06-11e0-9cb6-0002a5d5c51b +# } + +# Audio preprocessor configurations. +# The pre processor configuration consists in a list of elements each describing +# pre processor settings for a given input source. Valid input source names are: +# "mic", "camcorder", "voice_recognition", "voice_communication" +# Each input source element contains a list of effects elements. The name of the effect +# element must be the name of one of the effects in the "effects" list of the file. +# Each effect element may optionally contain a list of parameters and their +# default value to apply when the pre processor effect is created. +# A parameter is defined by a "param" element and a "value" element. Each of these elements +# consists in one or more elements specifying a type followed by a value. +# The types defined are: "int", "short", "float", "bool" and "string" +# When both "param" and "value" are a single int, a simple form is allowed where just +# the param and value pair is present in the parameter description +# pre_processing { +# { +# { +# { +# param { +# int|short|float|bool|string +# [ int|short|float|bool|string ] +# ... +# } +# value { +# int|short|float|bool|string +# [ int|short|float|bool|string ] +# ... +# } +# } +# { } +# ... +# } +# ... +# } +# ... +# } + +# +# TODO: add default audio pre processor configurations after debug and tuning phase +# diff --git a/device-common.mk b/device-common.mk index df95240..14ee964 100644 --- a/device-common.mk +++ b/device-common.mk @@ -176,6 +176,13 @@ PRODUCT_PACKAGES += \ audio.r_submix.default \ libaudio-resampler +# Voice processing +PRODUCT_PACKAGES += \ + libqcomvoiceprocessing \ + libqcomvoiceprocessingdescriptors +PRODUCT_COPY_FILES += \ + device/asus/flo/audio_effects.conf:system/vendor/etc/audio_effects.conf + PRODUCT_PACKAGES += \ hci_qcomm_init diff --git a/voice_processing/Android.mk b/voice_processing/Android.mk new file mode 100644 index 0000000..45db19c --- /dev/null +++ b/voice_processing/Android.mk @@ -0,0 +1,21 @@ +ifneq ($(filter flo deb,$(TARGET_DEVICE)),) + +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + voice_processing_descriptors.c + +LOCAL_C_INCLUDES += \ + $(call include-path-for, audio-effects) + +LOCAL_MODULE := libqcomvoiceprocessingdescriptors + +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/soundfx + +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) + +endif \ No newline at end of file diff --git a/voice_processing/voice_processing_descriptors.c b/voice_processing/voice_processing_descriptors.c new file mode 100644 index 0000000..d51a3f8 --- /dev/null +++ b/voice_processing/voice_processing_descriptors.c @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +//------------------------------------------------------------------------------ +// Effect descriptors +//------------------------------------------------------------------------------ + +// UUIDs for effect types have been generated from http://www.itu.int/ITU-T/asn1/uuid.html +// as the pre processing effects are not defined by OpenSL ES + +// Acoustic Echo Cancellation +const effect_descriptor_t qcom_product_aec_descriptor = { + { 0x7b491460, 0x8d4d, 0x11e0, 0xbd61, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // type + { 0x1c04e560, 0xc720, 0x11e2, 0x9525, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // uuid + EFFECT_CONTROL_API_VERSION, + (EFFECT_FLAG_TYPE_PRE_PROC|EFFECT_FLAG_DEVICE_IND), + 0, + 0, + "Acoustic Echo Canceler", + "Qualcomm Fluence for Flo" +}; + +// Noise suppression +const effect_descriptor_t qcom_product_ns_descriptor = { + { 0x58b4b260, 0x8e06, 0x11e0, 0xaa8e, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // type + { 0x4bb6faa0, 0xc720, 0x11e2, 0x91f5, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // uuid + EFFECT_CONTROL_API_VERSION, + (EFFECT_FLAG_TYPE_PRE_PROC|EFFECT_FLAG_DEVICE_IND), + 0, + 0, + "Noise Suppression", + "Qualcomm Fluence for Flo" +}; + +//ENABLE_AGC +// Automatic Gain Control +//const effect_descriptor_t qcom_product_agc_descriptor = { +// { 0x0a8abfe0, 0x654c, 0x11e0, 0xba26, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // type +// { 0x6e8188c0, 0xc720, 0x11e2, 0x830f, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // uuid +// EFFECT_CONTROL_API_VERSION, +// (EFFECT_FLAG_TYPE_PRE_PROC|EFFECT_FLAG_DEVICE_IND), +// 0, +// 0, +// "Automatic Gain Control", +// "Qualcomm Fluence for Flo" +//}; +