Skip to content

Commit 6719cd5

Browse files
geoffreybennetttiwai
authored andcommitted
ALSA: scarlett2: Fix Scarlett 4th Gen input gain range again
The 4th Gen input preamp gain range is 0dB to +69dB, although the control values range from 0 to 70. Replace SCARLETT2_MAX_GAIN with SCARLETT2_MAX_GAIN_VALUE and SCARLETT2_MAX_GAIN_DB, and update the TLV again. Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Fixes: a45cf0a ("ALSA: scarlett2: Fix Scarlett 4th Gen input gain range") Message-ID: <Ze7OMA8ntG7KteGa@m.b4.vu> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent a45cf0a commit 6719cd5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

sound/usb/mixer_scarlett2.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,11 @@
174174
/* some gui mixers can't handle negative ctl values */
175175
#define SCARLETT2_VOLUME_BIAS 127
176176

177-
/* maximum preamp input gain */
178-
#define SCARLETT2_MAX_GAIN 70
177+
/* maximum preamp input gain and value
178+
* values are from 0 to 70, preamp gain is from 0 to 69 dB
179+
*/
180+
#define SCARLETT2_MAX_GAIN_VALUE 70
181+
#define SCARLETT2_MAX_GAIN_DB 69
179182

180183
/* mixer range from -80dB to +6dB in 0.5dB steps */
181184
#define SCARLETT2_MIXER_MIN_DB -80
@@ -3466,7 +3469,7 @@ static int scarlett2_input_gain_ctl_info(struct snd_kcontrol *kctl,
34663469
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
34673470
uinfo->count = elem->channels;
34683471
uinfo->value.integer.min = 0;
3469-
uinfo->value.integer.max = SCARLETT2_MAX_GAIN;
3472+
uinfo->value.integer.max = SCARLETT2_MAX_GAIN_VALUE;
34703473
uinfo->value.integer.step = 1;
34713474

34723475
unlock:
@@ -3543,7 +3546,7 @@ static int scarlett2_input_gain_ctl_put(struct snd_kcontrol *kctl,
35433546
}
35443547

35453548
static const DECLARE_TLV_DB_MINMAX(
3546-
db_scale_scarlett2_gain, 0, SCARLETT2_MAX_GAIN * 100
3549+
db_scale_scarlett2_gain, 0, SCARLETT2_MAX_GAIN_DB * 100
35473550
);
35483551

35493552
static const struct snd_kcontrol_new scarlett2_input_gain_ctl = {

0 commit comments

Comments
 (0)