Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ALSA: scarlett2: Increase mixer range to +12dB
@ 2024-05-11 16:44 Geoffrey D. Bennett
  2024-05-12  9:43 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Geoffrey D. Bennett @ 2024-05-11 16:44 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Takashi Iwai, linux-sound

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>
---
 sound/usb/mixer_scarlett2.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c
index 2dd03b46964e..1150cf104985 100644
--- a/sound/usb/mixer_scarlett2.c
+++ b/sound/usb/mixer_scarlett2.c
@@ -184,16 +184,16 @@
 /* maximum Bluetooth volume value */
 #define SCARLETT2_MAX_BLUETOOTH_VOLUME 30
 
-/* mixer range from -80dB to +6dB in 0.5dB steps */
+/* mixer range from -80dB to +12dB in 0.5dB steps */
 #define SCARLETT2_MIXER_MIN_DB -80
 #define SCARLETT2_MIXER_BIAS (-SCARLETT2_MIXER_MIN_DB * 2)
-#define SCARLETT2_MIXER_MAX_DB 6
+#define SCARLETT2_MIXER_MAX_DB 12
 #define SCARLETT2_MIXER_MAX_VALUE \
 	((SCARLETT2_MIXER_MAX_DB - SCARLETT2_MIXER_MIN_DB) * 2)
 #define SCARLETT2_MIXER_VALUE_COUNT (SCARLETT2_MIXER_MAX_VALUE + 1)
 
 /* map from (dB + 80) * 2 to mixer value
- * for dB in 0 .. 172: int(8192 * pow(10, ((dB - 160) / 2 / 20)))
+ * for dB in 0 .. 184: int(8192 * pow(10, ((dB - 160) / 2 / 20)))
  */
 static const u16 scarlett2_mixer_values[SCARLETT2_MIXER_VALUE_COUNT] = {
 	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] = {
 	3078, 3261, 3454, 3659, 3876, 4105, 4349, 4606, 4879, 5168,
 	5475, 5799, 6143, 6507, 6892, 7301, 7733, 8192, 8677, 9191,
 	9736, 10313, 10924, 11571, 12257, 12983, 13752, 14567, 15430,
-	16345
+	16345, 17313, 18339, 19426, 20577, 21796, 23088, 24456, 25905,
+	27440, 29066, 30788, 32612
 };
 
 /* Maximum number of analogue outputs */
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: scarlett2: Increase mixer range to +12dB
  2024-05-11 16:44 [PATCH] ALSA: scarlett2: Increase mixer range to +12dB Geoffrey D. Bennett
@ 2024-05-12  9:43 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2024-05-12  9:43 UTC (permalink / raw)
  To: Geoffrey D. Bennett; +Cc: Takashi Iwai, Takashi Iwai, linux-sound

On Sat, 11 May 2024 18:44:17 +0200,
Geoffrey D. Bennett wrote:
> 
> 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>

Applied now.  Thanks.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-12  9:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-11 16:44 [PATCH] ALSA: scarlett2: Increase mixer range to +12dB Geoffrey D. Bennett
2024-05-12  9:43 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox