pcm: softvol: Allow up to 90 dB of gain

The gain algorithm used in softvol can handle gain factors of up to
32767 which is slightly more than 90 dB, so allow a max_dB of 90 dB.
This doesn't affect existing asound.conf files, but does allow a
max_dB of up to 90 dB when needed.

Tested using Audacity that there is no undue distorsion or other
artefacts when 90 dB of gain is applied to a suitable signal (i.e.
a signal quiet enough not be clipped whan applying 90 dB of gain).

Signed-off-by: Ricard Wanderlof <ricardw@axis.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Ricard Wanderlof 2018-04-18 17:03:09 +02:00 committed by Takashi Iwai
parent 4493f6a560
commit 23a20cda11

View file

@ -59,7 +59,11 @@ typedef struct {
#define PRESET_RESOLUTION 256
#define PRESET_MIN_DB -51.0
#define ZERO_DB 0.0
#define MAX_DB_UPPER_LIMIT 50
/*
* The gain algorithm as it stands supports gain factors up to 32767, which
* is a fraction more than 90 dB, so set 90 dB as the maximum possible gain.
*/
#define MAX_DB_UPPER_LIMIT 90
static const unsigned int preset_dB_value[PRESET_RESOLUTION] = {
0x00b8, 0x00bd, 0x00c1, 0x00c5, 0x00ca, 0x00cf, 0x00d4, 0x00d9,