summaryrefslogtreecommitdiffstats
path: root/voice_processing/voice_processing.c
diff options
context:
space:
mode:
authorwjiang <wjiang@codeaurora.org>2014-03-28 12:29:58 +0800
committerSteve Kondik <steve@cyngn.com>2016-03-23 22:06:58 -0700
commit9828fdc5c7183c627eccd752c731541d61311ea4 (patch)
tree7ce68d1b36d729ce3b0f08b288463c5a80a94a6e /voice_processing/voice_processing.c
parent3e55a8628681cc32c38d97f11b5e44881d56bc96 (diff)
downloadandroid_hardware_qcom_audio-9828fdc5c7183c627eccd752c731541d61311ea4.tar.gz
android_hardware_qcom_audio-9828fdc5c7183c627eccd752c731541d61311ea4.tar.bz2
android_hardware_qcom_audio-9828fdc5c7183c627eccd752c731541d61311ea4.zip
post_proc: Squash upstream changes
post_proc: disable effect immediately when routed to invalid devices Offload effect is still perceived when invalid output device is connected. We should send disable command immediately once phone is routed to unexpected device and forbid effect enablement during temporary disabled state. Change-Id: I26d4ccfd77037a879622b0437ae3916ff0071a69 CRs-Fixed: 630408 post_proc: disable Bassboost and Virtualizer for USB_ACCESSORY USB_ACCESSORY is not intended to be applied with SA+ bassboost and virtualizer, so add into invalid devices list. CRs-Fixed: 659191 Change-Id: If1f3421f9935ce624dc21895d9244d36d195b2bd post_proc: fix post and pre process KW issues KW issue fix includes: - handle memory allocation failure - array index boundary check Change-Id: I083952ba58d348a5b650601a83e6f492b0d686bb post_proc: Fix improper datatype of EQ preset band level value unsigned int causes negative band level turn out to be extreme large value, which results in EQ works abnormally due to unexpected parameter sent. Change-Id: I81120c604f4e9f23b25d5a45a7b0294fea63d207 CRs-Fixed: 696825 post_proc: add support for virtualizer capability query Add extra virtualizer interfaces to keep align with aosp design. Extended capabilities include: - Stub interface to allow querying speaker angles. - Force set output device as specific virtualize mode. - Query virtualize mode Stub function remains to be refined in sync with upcoming aosp changes. Change-Id: I3316f6d944db1c9954eda7643a5ce433defa1a6c CRs-Fixed: 810294 post_proc: remove unnecessary command size check Up bound check for command size of EFFECT_CMD_SET_PARAM is not applicable for DSP effect bundle. Remove the check to avoid parameter not taking effect. Change-Id: I7e8f73377699f11bdc1f62a05f6bea03c9c24151 CRs-Fixed: 816053 post_proc: explicitly disable virtualizer module if strength is 0 0 stength in DSP virtualizer is not equivalent to disable state as down mix is still happening for multichannel inputs. For better user experience, explicitly disable virtualizer module when strength is 0. Change-Id: Ic2884ac7010e4f835df871719d546c0c05173f4b CRs-Fixed: 872772 post_proc: fix reverb processing issue when preset is set to NONE Reverb effects are getting applied even after setting reverb preset to REVERB_PRESET_NONE. Preset NONE is used by client and is supposed to be equivalent to disabled state, even though this preset is not supported in DSP. Fix this issue by avoiding enable command from post processing HAL to DSP when preset NONE is in use. CRs-Fixed: 868041 Change-Id: Iad626a7400246e80a97a926234cfb7756ec6083e post_proc: fix crash in offload effect bundle during stop output Effect bundle stop() frees mixer contol before doing module stop(), whereas module's stop() still needs this control to send disable command down the layer. Crash is observed if memory associated with effect control is reused and gets altered by the time mixer control is completed. Move mixer control's deletion after module's stop() to fix this issue. CRs-Fixed: 860604 Change-Id: Ia8b6d5f847b69392afbda1ba77fc740a47aba25d
Diffstat (limited to 'voice_processing/voice_processing.c')
-rw-r--r--voice_processing/voice_processing.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/voice_processing/voice_processing.c b/voice_processing/voice_processing.c
index b3f97c6a..90034115 100644
--- a/voice_processing/voice_processing.c
+++ b/voice_processing/voice_processing.c
@@ -409,6 +409,10 @@ static struct session_s *get_session(int32_t id, int32_t sessionId, int32_t io
}
session = (struct session_s *)calloc(1, sizeof(struct session_s));
+ if (session == NULL) {
+ ALOGE("get_session() fail to allocate memory");
+ return NULL;
+ }
session_init(session);
session->id = sessionId;
session->io = ioId;
@@ -683,6 +687,10 @@ static int lib_create(const effect_uuid_t *uuid,
return -EINVAL;
}
id = uuid_to_id(&desc->type);
+ if (id >= NUM_ID) {
+ ALOGW("lib_create: fx not found type: %08x", desc->type.timeLow);
+ return -EINVAL;
+ }
session = get_session(id, sessionId, ioId);