Skip to content

Commit 762e6af

Browse files
geoffreybennetttiwai
authored andcommitted
ALSA: scarlett2: Increase mixer range to +12dB
The values loaded into the mixer are 16-bit values, with 8192 representing 0dB, going up to a current maximum of 16345 (+6dB). All supported interfaces have no problem going up to 32612 (+12dB), so update SCARLETT2_MIXER_MAX_DB and scarlett2_mixer_values[] to allow for this. Tested with: - Scarlett 2nd Gen 6i6, 18i8, 18i20 - Scarlett 3rd Gen 4i4, 8i6, 18i8, 18i20 - Scarlett 4th Gen Solo, 2i2, 4i4 - Clarett+ 2Pre, 4Pre, 8Pre - Vocaster One and Two Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Link: https://lore.kernel.org/r/Zj+gYT4F2XeKTD93@m.b4.vu Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent d5ca9ad commit 762e6af

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sound/usb/mixer_scarlett2.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,16 @@
184184
/* maximum Bluetooth volume value */
185185
#define SCARLETT2_MAX_BLUETOOTH_VOLUME 30
186186

187-
/* mixer range from -80dB to +6dB in 0.5dB steps */
187+
/* mixer range from -80dB to +12dB in 0.5dB steps */
188188
#define SCARLETT2_MIXER_MIN_DB -80
189189
#define SCARLETT2_MIXER_BIAS (-SCARLETT2_MIXER_MIN_DB * 2)
190-
#define SCARLETT2_MIXER_MAX_DB 6
190+
#define SCARLETT2_MIXER_MAX_DB 12
191191
#define SCARLETT2_MIXER_MAX_VALUE \
192192
((SCARLETT2_MIXER_MAX_DB - SCARLETT2_MIXER_MIN_DB) * 2)
193193
#define SCARLETT2_MIXER_VALUE_COUNT (SCARLETT2_MIXER_MAX_VALUE + 1)
194194

195195
/* map from (dB + 80) * 2 to mixer value
196-
* for dB in 0 .. 172: int(8192 * pow(10, ((dB - 160) / 2 / 20)))
196+
* for dB in 0 .. 184: int(8192 * pow(10, ((dB - 160) / 2 / 20)))
197197
*/
198198
static const u16 scarlett2_mixer_values[SCARLETT2_MIXER_VALUE_COUNT] = {
199199
0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
@@ -209,7 +209,8 @@ static const u16 scarlett2_mixer_values[SCARLETT2_MIXER_VALUE_COUNT] = {
209209
3078, 3261, 3454, 3659, 3876, 4105, 4349, 4606, 4879, 5168,
210210
5475, 5799, 6143, 6507, 6892, 7301, 7733, 8192, 8677, 9191,
211211
9736, 10313, 10924, 11571, 12257, 12983, 13752, 14567, 15430,
212-
16345
212+
16345, 17313, 18339, 19426, 20577, 21796, 23088, 24456, 25905,
213+
27440, 29066, 30788, 32612
213214
};
214215

215216
/* Maximum number of analogue outputs */

0 commit comments

Comments
 (0)