alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [RESEND PATCH] ALSA: usb-audio: Fix Focusrite Scarlett 6i6 gen1 - input handling
@ 2019-11-24 12:35 Jens Verwiebe
  2019-11-25 15:50 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Jens Verwiebe @ 2019-11-24 12:35 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

The Scarlett 6i6 has no padding on rear inputs 3/4 but a gainstage.
This patch introduces this functionality as to be seen in the mac
or windows scarlett control.
The correct address could already be found in the dump info,
but was never used. Without this patch inputs 3/4 are quite unusable else.
The diff is attached as a textfile as i found this preseverves formatting best.
Diffed and testcompiled against todays kernel master.

Cheers ... Jens

Changelog: The Scarlett 6i6 has no padding on rear inputs 3/4 but a 
gainstage
(Lo/Hi). Adding this functionality according to macOS/Win drivers.

Signed-off-by: Jens Verwiebe <info at jensverwiebe.de>

-- 

Jens Verwiebe
Allerskehre 44 - 22309 Hamburg

Tel.: +49 40 68 78 50
mailto: info@jensverwiebe.de
web: https://www.jensverwiebe.de


[-- Attachment #2: scarlett_6i6_rev1_gain_3+4.txt --]
[-- Type: text/plain, Size: 1635 bytes --]

diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c
index 83715fd8dfd6..9d10cbf1b5ed 100644
--- a/sound/usb/mixer_scarlett.c
+++ b/sound/usb/mixer_scarlett.c
@@ -142,6 +142,7 @@ enum {
 	SCARLETT_OUTPUTS,
 	SCARLETT_SWITCH_IMPEDANCE,
 	SCARLETT_SWITCH_PAD,
+	SCARLETT_SWITCH_GAIN,
 };
 
 enum {
@@ -192,6 +193,15 @@ static const struct scarlett_mixer_elem_enum_info opt_pad = {
 	}
 };
 
+static const struct scarlett_mixer_elem_enum_info opt_gain = {
+	.start = 0,
+	.len = 2,
+	.offsets = {},
+	.names = (char const * const []){
+		"Lo", "Hi"
+	}
+};
+
 static const struct scarlett_mixer_elem_enum_info opt_impedance = {
 	.start = 0,
 	.len = 2,
@@ -652,8 +662,8 @@ static struct scarlett_device_info s6i6_info = {
 		{ .num = 1, .type = SCARLETT_SWITCH_PAD, .name = NULL},
 		{ .num = 2, .type = SCARLETT_SWITCH_IMPEDANCE, .name = NULL},
 		{ .num = 2, .type = SCARLETT_SWITCH_PAD, .name = NULL},
-		{ .num = 3, .type = SCARLETT_SWITCH_PAD, .name = NULL},
-		{ .num = 4, .type = SCARLETT_SWITCH_PAD, .name = NULL},
+		{ .num = 3, .type = SCARLETT_SWITCH_GAIN, .name = NULL},
+		{ .num = 4, .type = SCARLETT_SWITCH_GAIN, .name = NULL},
 	},
 
 	.matrix_mux_init = {
@@ -883,6 +893,15 @@ static int scarlett_controls_create_generic(struct usb_mixer_interface *mixer,
 			if (err < 0)
 				return err;
 			break;
+		case SCARLETT_SWITCH_GAIN:
+			sprintf(mx, "Input %d Gain Switch", ctl->num);
+			err = add_new_ctl(mixer, &usb_scarlett_ctl_enum,
+					  scarlett_ctl_enum_resume, 0x01,
+					  0x08, ctl->num, USB_MIXER_S16, 1, mx,
+					  &opt_gain, &elem);
+			if (err < 0)
+				return err;
+			break;
 		}
 	}
 

[-- Attachment #3: Type: text/plain, Size: 161 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [alsa-devel] [RESEND PATCH] ALSA: usb-audio: Fix Focusrite Scarlett 6i6 gen1 - input handling
  2019-11-24 12:35 [alsa-devel] [RESEND PATCH] ALSA: usb-audio: Fix Focusrite Scarlett 6i6 gen1 - input handling Jens Verwiebe
@ 2019-11-25 15:50 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2019-11-25 15:50 UTC (permalink / raw)
  To: Jens Verwiebe; +Cc: alsa-devel

On Sun, 24 Nov 2019 13:35:44 +0100,
Jens Verwiebe wrote:
> 
> The Scarlett 6i6 has no padding on rear inputs 3/4 but a gainstage.
> This patch introduces this functionality as to be seen in the mac
> or windows scarlett control.
> The correct address could already be found in the dump info,
> but was never used. Without this patch inputs 3/4 are quite unusable else.
> The diff is attached as a textfile as i found this preseverves formatting best.
> Diffed and testcompiled against todays kernel master.
> 
> Cheers ... Jens
> 
> Changelog: The Scarlett 6i6 has no padding on rear inputs 3/4 but a
> gainstage
> (Lo/Hi). Adding this functionality according to macOS/Win drivers.
> 
> Signed-off-by: Jens Verwiebe <info at jensverwiebe.de>

Applied now.  Thanks.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2019-11-25 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-24 12:35 [alsa-devel] [RESEND PATCH] ALSA: usb-audio: Fix Focusrite Scarlett 6i6 gen1 - input handling Jens Verwiebe
2019-11-25 15:50 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).