alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Jens Verwiebe <info@jensverwiebe.de>
To: alsa-devel@alsa-project.org
Subject: Re: Focusrite Scarlett 6i6 gen1 - input handling fix
Date: Thu, 23 Nov 2017 15:50:24 +0100	[thread overview]
Message-ID: <b0f3ca28-9369-137e-0cde-48bc520549a8@jensverwiebe.de> (raw)
In-Reply-To: <s5ho9nt3yu7.wl-tiwai@suse.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
>

-- 

Jens Verwiebe
Allerskehre 44 - 22309 Hamburg

Tel.: +49 40 68 78 50
mobile: +49 172 400 49 07
mailto:info@jensverwiebe.de
web:http://www.jensverwiebe.de

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

  reply	other threads:[~2017-11-23 14:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-23 10:28 Focusrite Scarlett 6i6 gen1 - input handling fix Jens Verwiebe
2017-11-23 11:59 ` Jens Verwiebe
2017-11-23 13:32   ` Takashi Iwai
2017-11-23 14:50     ` Jens Verwiebe [this message]
2019-11-19 18:30     ` [alsa-devel] Focusrite Scarlett 6i6 gen1 - input handling fix, ping Jens Verwiebe
2019-11-19 19:04       ` Takashi Iwai
2019-11-19 19:20         ` Jens Verwiebe
2019-11-19 21:03           ` Takashi Iwai
2017-11-23 15:04 Focusrite Scarlett 6i6 gen1 - input handling fix Jens Verwiebe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0f3ca28-9369-137e-0cde-48bc520549a8@jensverwiebe.de \
    --to=info@jensverwiebe.de \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).