[alsa-devel] Focusrite Scarlett 6i6 gen1 - input handling fix
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.
Cheers ... Jens
Signed-off-by: Jens Verwiebe info@jensverwiebe.de
diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c index 7438e7c..f3bdac3 100644 --- a/sound/usb/mixer_scarlett.c +++ b/sound/usb/mixer_scarlett.c @@ -152,6 +152,7 @@ enum { SCARLETT_OUTPUTS, SCARLETT_SWITCH_IMPEDANCE, SCARLETT_SWITCH_PAD, + SCARLETT_SWITCH_GAIN, };
enum { @@ -202,6 +203,15 @@ struct scarlett_device_info { } };
+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, @@ -664,8 +674,8 @@ static int add_output_ctls(struct usb_mixer_interface *mixer, { .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 = { @@ -895,6 +905,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; } }
Ups, cleanup own indentation/formatting mistake.
Signed-off-by: Jens Verwiebe info@jensverwiebe.de
Okay, hope i got all needed info now right :
The Scarlett 6i6 has no padding on rear inputs 3/4 but a gainstage (Low/Hi). Adding this functionality
Signed-off-by: Jens Verwiebe <info at jensverwiebe.de http://mailman.alsa-project.org/mailman/listinfo/alsa-devel>
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c index 7438e7c..2c86d595 100644 --- a/sound/usb/mixer_scarlett.c +++ b/sound/usb/mixer_scarlett.c @@ -152,6 +152,7 @@ enum { SCARLETT_OUTPUTS, SCARLETT_SWITCH_IMPEDANCE, SCARLETT_SWITCH_PAD, + SCARLETT_SWITCH_GAIN, };
enum { @@ -202,6 +203,15 @@ struct scarlett_device_info { } };
+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, @@ -664,8 +674,8 @@ static int add_output_ctls(struct usb_mixer_interface *mixer, { .num = 1, .type = SCARLETT_SWITCH_PAD, .name = NULL}, :...skipping... commit 415920dc4f6a0c14a08bc832eca89aaf747a7fb9 Author: Jens Verwiebe info@jensverwiebe.de Date: Thu Nov 23 15:37:40 2017 +0100
The Scarlett 6i6 has no padding on rear inputs 3/4 but a gainstage (Low/Hi). Adding this functionality
diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c index 7438e7c..2c86d595 100644 --- a/sound/usb/mixer_scarlett.c +++ b/sound/usb/mixer_scarlett.c @@ -152,6 +152,7 @@ enum { SCARLETT_OUTPUTS, SCARLETT_SWITCH_IMPEDANCE, SCARLETT_SWITCH_PAD, + SCARLETT_SWITCH_GAIN, };
enum { @@ -202,6 +203,15 @@ struct scarlett_device_info { } };
+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, @@ -664,8 +674,8 @@ static int add_output_ctls(struct usb_mixer_interface *mixer, { .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 = { @@ -895,6 +905,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; } }
Am 23.11.2017 um 14:32 schrieb Takashi Iwai:
On Thu, 23 Nov 2017 12:59:29 +0100, Jens Verwiebe wrote:
Ups, cleanup own indentation/formatting mistake.
Could you put the proper changelog as well? The code changes look OK.
thanks,
Takashi _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Hi
I would like to bring up my forgotten patch up a last time here.
See: https://mailman.alsa-project.org/pipermail/alsa-devel/2017-November/127906.h...
I dunno what else would be expected to write in there, i think the text says it all ?
I have this in use for 2 years now, but the interface will be sold now, so last chance to test the commit
if it happens anyway ;-)
Cheers ... Jens
On Tue, 19 Nov 2019 19:30:45 +0100, Jens Verwiebe wrote:
Hi
I would like to bring up my forgotten patch up a last time here.
See: https://mailman.alsa-project.org/pipermail/alsa-devel/2017-November/127906.h...
I dunno what else would be expected to write in there, i think the text says it all ?
I have this in use for 2 years now, but the interface will be sold now, so last chance to test the commit
if it happens anyway ;-)
Cheers ... Jens
Could you simply resubmit the patch for the latest kernel?
thanks,
Takashi
I really dunno what you mean by "last kernel", starting over with pulling the kernel src again, diffing etc. ?
You can simply use the patch as is, it applied fine on kernel 5.3 just and i guess it will on mater too, since nothing changed in mixer_scarlett.c other than hunks moved around.I don't see a reason why we should make all so complicated. I don't wanna put more efford in this anymore, sorry.
Am 19.11.19 um 20:04 schrieb Takashi Iwai:
On Tue, 19 Nov 2019 19:30:45 +0100, Jens Verwiebe wrote:
Hi
I would like to bring up my forgotten patch up a last time here.
See: https://mailman.alsa-project.org/pipermail/alsa-devel/2017-November/127906.h...
I dunno what else would be expected to write in there, i think the text says it all ?
I have this in use for 2 years now, but the interface will be sold now, so last chance to test the commit
if it happens anyway ;-)
Cheers ... Jens
Could you simply resubmit the patch for the latest kernel?
thanks,
Takashi
On Tue, 19 Nov 2019 20:20:44 +0100, Jens Verwiebe wrote:
I really dunno what you mean by "last kernel", starting over with pulling the kernel src again, diffing etc. ?
At best against to the latest Linus tree, and need to confirm that it builds and works.
You can simply use the patch as is, it applied fine on kernel 5.3 just and i guess it will on mater too, since nothing changed in mixer_scarlett.c other than hunks moved around.I don't see a reason why we should make all so complicated. I don't wanna put more efford in this anymore, sorry.
The ML archive doesn't give you an applicable text, it reformats. You need to resubmit an applicable one. That's the only way to revive, sorry.
thanks,
Takashi
Am 19.11.19 um 20:04 schrieb Takashi Iwai:
On Tue, 19 Nov 2019 19:30:45 +0100, Jens Verwiebe wrote:
Hi
I would like to bring up my forgotten patch up a last time here.
See: https://mailman.alsa-project.org/pipermail/alsa-devel/2017-November/127906.h...
I dunno what else would be expected to write in there, i think the text says it all ?
I have this in use for 2 years now, but the interface will be sold now, so last chance to test the commit
if it happens anyway ;-)
Cheers ... Jens
Could you simply resubmit the patch for the latest kernel?
thanks,
Takashi
--
Jens Verwiebe Allerskehre 44 - 22309 Hamburg
Tel.: +49 40 68 78 50 mailto: info@jensverwiebe.de web: https://www.jensverwiebe.de
Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
participants (2)
-
Jens Verwiebe
-
Takashi Iwai