From e44615ff6022239850a3ea459ad6e07b44c37544 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 24 Aug 2012 14:17:34 -0700 Subject: Reduce THD when equalizer is ON. Increase headroom in LVM bundle to reduce THD when equalizer is ON with high band gains. Also add a workaround for a bug in headroom parameter control. Change-Id: I1d67c9ae475f6cf852c2e0e49bacfc82a5e484fd --- media/libeffects/lvm/lib/Bundle/src/LVM_Init.c | 4 +++- media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'media/libeffects/lvm') diff --git a/media/libeffects/lvm/lib/Bundle/src/LVM_Init.c b/media/libeffects/lvm/lib/Bundle/src/LVM_Init.c index 20370b7..dd34fb5 100644 --- a/media/libeffects/lvm/lib/Bundle/src/LVM_Init.c +++ b/media/libeffects/lvm/lib/Bundle/src/LVM_Init.c @@ -557,7 +557,9 @@ LVM_ReturnStatus_en LVM_GetInstanceHandle(LVM_Handle_t *phInstance, */ pInstance->Params.OperatingMode = LVM_MODE_OFF; pInstance->Params.SampleRate = LVM_FS_8000; - pInstance->Params.SourceFormat = LVM_MONO; +// FIXME: Workaround to avoid reset of headroom parameters on first call to LVM_Process. +// pInstance->Params.SourceFormat = LVM_MONO; + pInstance->Params.SourceFormat = LVM_STEREO; pInstance->Params.SpeakerType = LVM_HEADPHONES; pInstance->Params.VC_EffectLevel = 0; pInstance->Params.VC_Balance = 0; diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp index 1a45e35..32ee89e 100644 --- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp +++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp @@ -698,10 +698,10 @@ int LvmBundle_init(EffectContext *pContext){ /* Set the headroom parameters */ HeadroomBandDef[0].Limit_Low = 20; HeadroomBandDef[0].Limit_High = 4999; - HeadroomBandDef[0].Headroom_Offset = 3; + HeadroomBandDef[0].Headroom_Offset = 0; HeadroomBandDef[1].Limit_Low = 5000; HeadroomBandDef[1].Limit_High = 24000; - HeadroomBandDef[1].Headroom_Offset = 4; + HeadroomBandDef[1].Headroom_Offset = 0; HeadroomParams.pHeadroomDefinition = &HeadroomBandDef[0]; HeadroomParams.Headroom_OperatingMode = LVM_HEADROOM_ON; HeadroomParams.NHeadroomBands = 2; -- cgit v1.1