On Mon, 15 Jan 2018 14:49:38 +0100, Ricard Wanderlof wrote:
On Mon, 15 Jan 2018, Takashi Iwai wrote:
Ok, my suggestion would be set MAX_DB_UPPER_LIMIT to 90 dB. 90 dB comes out as 31622, which still is manageable when shifted up by VOL_SCALE_SHIFT (= 16), fitting in a 32-bit int. Thus it works in MULTI_DIV_short() too, where it is multiplied with the 16-bit sample value yielding an int.
I'll try it out and prepare a patch.
Well, but +90dB gain doesn't look like a normal usage pattern. Why do you have to use softvol plugin for achieving that specific purpose?
The usecase we have actually calls for 55 dB of gain maximum, but I was thinking that looking at the code the maths can actually handle 90 dB so it would be good 'reasonable limit' - it's a nice round number and fits in 16 bits (signed).
The usecase we have is using digital MEMS microphones ((2S connected, with no integral amplification) and when the sound source is far away, a fair amount of gain can be needed.
But why do you need 90dB? "Because it can" is no good reason to increase such a safe limit.
Takashi