ALSA: scarlett2: Fix Scarlett 4th Gen input gain range
BugLink: https://bugs.launchpad.net/bugs/2060097
[ Upstream commit a45cf0a0834779c741ac204c0320469e9aaef006 ]
The input gain range TLV was declared as -70dB to 0dB, but the preamp
gain range is actually 0dB to +70dB. Rename SCARLETT2_GAIN_BIAS to
SCARLETT2_MAX_GAIN and update the TLV to fix.
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Fixes: 0a995e38dc ("ALSA: scarlett2: Add support for software-controllable input gain")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Message-ID: <9168317b5ac5335943d3f14dbcd1cc2d9b2299d0.1710047969.git.g@b4.vu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 8358dffff18fdde1f77bc84bd3be206e27e02452)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
This commit is contained in:
committed by
Roxana Nicolescu
parent
710ac19cda
commit
0f688b96ed
@@ -173,7 +173,9 @@
|
||||
|
||||
/* some gui mixers can't handle negative ctl values */
|
||||
#define SCARLETT2_VOLUME_BIAS 127
|
||||
#define SCARLETT2_GAIN_BIAS 70
|
||||
|
||||
/* maximum preamp input gain */
|
||||
#define SCARLETT2_MAX_GAIN 70
|
||||
|
||||
/* mixer range from -80dB to +6dB in 0.5dB steps */
|
||||
#define SCARLETT2_MIXER_MIN_DB -80
|
||||
@@ -3464,7 +3466,7 @@ static int scarlett2_input_gain_ctl_info(struct snd_kcontrol *kctl,
|
||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
|
||||
uinfo->count = elem->channels;
|
||||
uinfo->value.integer.min = 0;
|
||||
uinfo->value.integer.max = SCARLETT2_GAIN_BIAS;
|
||||
uinfo->value.integer.max = SCARLETT2_MAX_GAIN;
|
||||
uinfo->value.integer.step = 1;
|
||||
|
||||
unlock:
|
||||
@@ -3541,7 +3543,7 @@ unlock:
|
||||
}
|
||||
|
||||
static const DECLARE_TLV_DB_MINMAX(
|
||||
db_scale_scarlett2_gain, -SCARLETT2_GAIN_BIAS * 100, 0
|
||||
db_scale_scarlett2_gain, 0, SCARLETT2_MAX_GAIN * 100
|
||||
);
|
||||
|
||||
static const struct snd_kcontrol_new scarlett2_input_gain_ctl = {
|
||||
|
||||
Reference in New Issue
Block a user