Receive volume is slowly goes down using LoudnessEnhancer

61 views
Skip to first unread message

Naaman Sittsamer

unread,
Jun 8, 2015, 4:38:00 AM6/8/15
to andro...@googlegroups.com
I'm not sure that this is the right forum for this issue.... but for now -

Hi,
I'm using LoudnessEnhancer audio effect for voice calls.
I've found out that on a long call (few hours) the output volume is slowly goes down, until it's very hard to hear anything.
After digging into the code I think the problem is in the DRC module (dynamic_range_compression.cpp).
When monitoring "compressor_gain_" we can see that its maximal value decreases in time (starts at 1.0).
I think the reason for that is the math-limitations of the processor compared to the source code (the theoretical algorithm).
E.g. - the machine cannot truly handle 0.008333333333333333217685101601546193705871701240539550781250f that the Taylor approximation function is using.

A workaround for this issue is something like -

@@ -121,6 +121,8 @@ void AdaptiveDynamicRangeCompression::Compress(float *x1, float *x2) {

   }

   compressor_gain_ *=

       math::ExpApproximationViaTaylorExpansionOrder5(state_ - prev_state);

+  if ((compressor_gain_ > 0.999f) && (compressor_gain_ < 1.001f))

+         compressor_gain_ = 1.0f;

   *x1 *= compressor_gain_;


Is it a known issue?

Thanks,
Naaman

Phil Burk

unread,
Jun 8, 2015, 7:56:27 PM6/8/15
to andro...@googlegroups.com
Hello Naaman,

Thanks for pointing this out. It does look like there might be some issues with the code that could cause a drift over time.
I have filed a bug internally for Android. We will investigate.

Thanks,
Phil Burk

Naaman Sittsamer

unread,
Jun 9, 2015, 2:09:51 AM6/9/15
to andro...@googlegroups.com
Hi Phil,
I'll be happy if you could (later) share Android analysis for this issue, especially if there's a patch to fix it.

Thanks,
Naaman
Reply all
Reply to author
Forward
0 new messages