Skip to content

Commit

Permalink
ALSA: usb-audio: Fix Focusrite Scarlett 6i6 gen1 - input handling
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Jens Verwiebe <info@jensverwiebe.de>
Link: https://lore.kernel.org/r/384d65cd-5e87-91eb-9fc3-e57226f534c6@jensverwiebe.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Jens Verwiebe authored and Takashi Iwai committed Nov 25, 2019
1 parent 436e255 commit bf2aa5c
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions sound/usb/mixer_scarlett.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ enum {
SCARLETT_OUTPUTS,
SCARLETT_SWITCH_IMPEDANCE,
SCARLETT_SWITCH_PAD,
SCARLETT_SWITCH_GAIN,
};

enum {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit bf2aa5c

Please sign in to comment.