Skip to content

Commit

Permalink
ALSA: scarlett2: Add Focusrite Clarett 8Pre USB support
Browse files Browse the repository at this point in the history
From the driver's point of view, presumably the Focusrite Clarett 8Pre
USB is identical to the Clarett+ 8Pre except for the USB ID. Add
support for this in anticipation of someone being able to test and
confirm.

If this hunch is confirmed, the USB IDs in struct
scarlett2_device_info should be removed and put in to the
scarlett2_devices[] array instead, so that the struct contents do not
need to be duplicated when two devices have identical device
information.
  • Loading branch information
geoffreybennett committed Aug 8, 2022
1 parent 70c2910 commit 3e13665
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions sound/usb/mixer_quirks.c
Expand Up @@ -3238,6 +3238,7 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
case USB_ID(0x1235, 0x8213): /* Focusrite Scarlett 8i6 3rd Gen */
case USB_ID(0x1235, 0x8214): /* Focusrite Scarlett 18i8 3rd Gen */
case USB_ID(0x1235, 0x8215): /* Focusrite Scarlett 18i20 3rd Gen */
case USB_ID(0x1235, 0x8208): /* Focusrite Clarett 8Pre USB */
case USB_ID(0x1235, 0x820c): /* Focusrite Clarett+ 8Pre */
err = snd_scarlett_gen2_init(mixer);
break;
Expand Down
56 changes: 56 additions & 0 deletions sound/usb/mixer_scarlett_gen2.c
Expand Up @@ -925,6 +925,61 @@ static const struct scarlett2_device_info s18i20_gen3_info = {
};

static const struct scarlett2_device_info clarett_8pre_info = {
.usb_id = USB_ID(0x1235, 0x8208),

.config_set = SCARLETT2_CONFIG_SET_CLARETT,
.line_out_hw_vol = 1,
.level_input_count = 2,
.air_input_count = 8,

.line_out_descrs = {
"Monitor L",
"Monitor R",
NULL,
NULL,
NULL,
NULL,
"Headphones 1 L",
"Headphones 1 R",
"Headphones 2 L",
"Headphones 2 R",
},

.port_count = {
[SCARLETT2_PORT_TYPE_NONE] = { 1, 0 },
[SCARLETT2_PORT_TYPE_ANALOGUE] = { 8, 10 },
[SCARLETT2_PORT_TYPE_SPDIF] = { 2, 2 },
[SCARLETT2_PORT_TYPE_ADAT] = { 8, 8 },
[SCARLETT2_PORT_TYPE_MIX] = { 10, 18 },
[SCARLETT2_PORT_TYPE_PCM] = { 20, 18 },
},

.mux_assignment = { {
{ SCARLETT2_PORT_TYPE_PCM, 0, 18 },
{ SCARLETT2_PORT_TYPE_ANALOGUE, 0, 10 },
{ SCARLETT2_PORT_TYPE_SPDIF, 0, 2 },
{ SCARLETT2_PORT_TYPE_ADAT, 0, 8 },
{ SCARLETT2_PORT_TYPE_MIX, 0, 18 },
{ SCARLETT2_PORT_TYPE_NONE, 0, 8 },
{ 0, 0, 0 },
}, {
{ SCARLETT2_PORT_TYPE_PCM, 0, 14 },
{ SCARLETT2_PORT_TYPE_ANALOGUE, 0, 10 },
{ SCARLETT2_PORT_TYPE_SPDIF, 0, 2 },
{ SCARLETT2_PORT_TYPE_ADAT, 0, 4 },
{ SCARLETT2_PORT_TYPE_MIX, 0, 18 },
{ SCARLETT2_PORT_TYPE_NONE, 0, 8 },
{ 0, 0, 0 },
}, {
{ SCARLETT2_PORT_TYPE_PCM, 0, 12 },
{ SCARLETT2_PORT_TYPE_ANALOGUE, 0, 10 },
{ SCARLETT2_PORT_TYPE_SPDIF, 0, 2 },
{ SCARLETT2_PORT_TYPE_NONE, 0, 22 },
{ 0, 0, 0 },
} },
};

static const struct scarlett2_device_info clarett_plus_8pre_info = {
.usb_id = USB_ID(0x1235, 0x820c),

.config_set = SCARLETT2_CONFIG_SET_CLARETT,
Expand Down Expand Up @@ -995,6 +1050,7 @@ static const struct scarlett2_device_info *scarlett2_devices[] = {

/* Supported Clarett+ devices */
&clarett_8pre_info,
&clarett_plus_8pre_info,

/* End of list */
NULL
Expand Down

6 comments on commit 3e13665

@golfliveapp
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @geoffreybennett I have the Focusrite Clarette+ 4Pre. I would love to test it please as it does not run on Linux and I really want to keep the device. Would you be so kind to let me test it so we can get support going. Thank you so much and thanks for your hard work!

@fife13
Copy link

@fife13 fife13 commented on 3e13665 Jul 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi !
It works just fine with my Clarett 8pre USB (not +).
Routing with alsa-scarlett-gui is a dream.
So your hunch was totally justified.
Thanks for all !

PS : The only thing that I miss from the drivers is the switching of toslink in and out to spdif or adat. Everything else is perfect ! Thanks again !

@geoffreybennett
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fife13 can you send me your email address please & I will submit this patch upstream crediting you as the tester.

@geoffreybennett
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@golfliveapp sorry I don't have any Clarett device, so have no way to develop or test for it. To add support for a new similar device (which the 2Pre and 4Pre surely are) you will need to research the features and obtain USB captures to derive the information needed like shown in this commit.

@fife13
Copy link

@fife13 fife13 commented on 3e13665 Sep 4, 2023 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@geoffreybennett
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fife13 dang, something (presumably github) replaced your email address with ***. Can you send me an email again please. I have your previous email, but got a bounce when I sent to that address. Thanks!

Please sign in to comment.