Focusrite Scarlett 18i20 2nd Gen mixer driver

Talk about your MIDI interfaces, microphones, keyboards...

Moderators: MattKingUSA, khz

Post Reply
geoffrey
Established Member
Posts: 252
Joined: Mon Jul 30, 2018 2:08 am
Has thanked: 33 times
Been thanked: 169 times

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by geoffrey »

ciolansteen wrote:@geoffrey Ok i finally managed to build your driver in linux-rt on archlinux. (created a patch for this. if anyone is interested i can provide it or upload it to github).
Hi ciolansteen, that's great news! I'm not familiar with linux-rt; is your patch something that I can integrate into mine, or is it only applicable to linux-rt? Probably be good if you could upload it anyway in case it is useful to someone.
ciolansteen wrote:Everything works, except:
Either i'm dumb or i just cannot figure out how to switch from instrument to line and enable/disable pad for the first two input channels (if that's even possible).
It is possible. After starting "alsamixer -cUSB" press F4 to switch to the Capture controls view, scroll right to the "Line In 1 Level" control, and press Up/Down to change. Further right there are the other Pad/Level controls for the first four inputs.
ciolansteen wrote:Another issue - right channel of the 1st headphones output mutes when changing anything but volume faders. The setting remains after power off / on, reboot etc. The only way to reenable that channel is to factory reset the card via windows focusrite control program

card - Scarlett 18i8 mk2
That's pretty strange; the right channel of the 1st headphone output is output #4 of 6 and I don't know why that would be any different from the other 5 outputs. Can you confirm that the routing for every other output works correctly? E.g. on the Playback controls view of alsamixer (F3) set the Analogue Output 1-6 controls all to "Analogue 1", plug something into analogue input 1, and you should be able to hear that 1 input in all 6 outputs (Main L&R, Headphone 1&2 L&R). Then change all 6 outputs to have "PCM 1" as their input, and you should get only the left channel of anything you play from your computer in every output.
ciolansteen wrote:And thanks for the hard work, man! This really is amazing! :)
No problem. Thanks for helping test & I hope we can get yours working 100%!
geoffrey
Established Member
Posts: 252
Joined: Mon Jul 30, 2018 2:08 am
Has thanked: 33 times
Been thanked: 169 times

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by geoffrey »

dawitti wrote:@geoffrey Thanks for your hard work!

Since I own a 6i6 2nd gen I'd like to get the mixer working too :)
What can I do to add support for the 6i6?
I have basic understanding of C and C++ but no experience in kernel development.

Martin
Hi Martin, thanks for your message! Let's move the discussion for this over to this thread I created for the 18i8 and 6i6: viewtopic.php?f=6&t=19975
geoffrey
Established Member
Posts: 252
Joined: Mon Jul 30, 2018 2:08 am
Has thanked: 33 times
Been thanked: 169 times

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by geoffrey »

Hi all,

I have released a new version of the Scarlett 2nd Gen mixer driver: https://github.com/geoffreybennett/scar ... /v5.1.15s7

The Gen 2 6i6, 18i8, and 18i20 are all supported now, with the following controls:
- Master volume knob indicator (18i20 only)
- Mute and dim switches (18i20 only)
- Volume controls for the analogue HW outputs
- HW/SW volume switches for the 10 analogue HW outputs (18i20 only)
- Line Level/Instrument Level and Pad controls (6i6 and 18i8 only)
- Output mux (where the sound for the HW outputs comes from; defaults to PCM outputs)
- Capture mux (where the sound for PCM recording comes from; defaults to HW inputs)
- Matrix mux (where the sound going into the mixer comes from; 18 inputs default off)
- Mixer matrix (18 inputs * 10 outputs = 180 controls)
- Level meters

The driver is disabled by default so it won't accidentally break anyone's setup. To enable it, you now need to create a file /etc/modprobe.d/scarlett.conf containing the line "options snd_usb_audio scarlett_gen2_mixer_enable=1" (then unload/reload the driver or reboot).

Please test and let me know how you go! Even just an ack that it didn't break anything for you would be great.

Thanks,
Geoffrey
User avatar
xkr47
Established Member
Posts: 11
Joined: Fri Jul 19, 2019 5:50 pm
Contact:

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by xkr47 »

Hi Geoffrey,

Amazing work! Thanks for being patient and devoting your time for this! Been planning to buy an usb interface for some time and this lets allows me to get the bigger Scarlett versions (thinkign of 18i8 right now) instead of having to consider other brands.

Do you have a https://patreon.com/ account or similar so we could support your awesome work?

Also, is the latest version of the patch in this url? https://patchwork.kernel.org/patch/11048081/ - comparing with github it seems the above one is newer with at least suspend/resume support added?

I wanted to ask about the NVRAM save - which is a great idea! - it seems your driver will save settings to NVRAM after no mixer settings have been changed for 2 seconds? Is it okay to save "so often"? I am wondering if the NVRAM can wear out too soon if it is used too much.. IFF this is the case, would it be enough to save say every 5 minutes? Ok so the computer might crash etc and it would be nice to not lose settings in this case. One option could maybe be making it a module parameter (with some default value) in which case it can also be edited "live" later through /sys/ if I've understood correctly. So if your computer crashes a lot you can pick a smaller interval :) Or maybe you already investigated this from the windows mixer behaviour and that's where the 2 seconds came from :)

Again, thanks a million for your work and good luck in the final polishing of the driver!

I guess the dkms driver mentioned here would also be great for a lot of people not being able to use the latest and greatest kernel just yet because of e.g. distribution limitations etc.

- xkr47
User avatar
xkr47
Established Member
Posts: 11
Joined: Fri Jul 19, 2019 5:50 pm
Contact:

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by xkr47 »

There was already an old issue in x42/scarlett-mixer for supporting 2nd gen mixers, so I asked for it to be reopened.
geoffrey
Established Member
Posts: 252
Joined: Mon Jul 30, 2018 2:08 am
Has thanked: 33 times
Been thanked: 169 times

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by geoffrey »

xkr47 wrote:Hi Geoffrey,

Amazing work! Thanks for being patient and devoting your time for this! Been planning to buy an usb interface for some time and this lets allows me to get the bigger Scarlett versions (thinkign of 18i8 right now) instead of having to consider other brands.
Thank you, and you're welcome! I'm no audio aficionado, but I think the Scarlett interfaces are pretty cool, and the input routing that you can do with the Linux driver is really useful. Now we just need a GUI for it!
xkr47 wrote:Do you have a https://patreon.com/ account or similar so we could support your awesome work?
Oh, no need for that really, but thanks for the offer. I'm just happy that people are trying it out and providing feedback. Though, if someone wants to throw a Gen 3 Scarlett my way :D then I'll certainly do my best to write a driver for it!
xkr47 wrote:Also, is the latest version of the patch in this url? https://patchwork.kernel.org/patch/11048081/ - comparing with github it seems the above one is newer with at least suspend/resume support added?
Well spotted! That 17/Jul/2019 post is the most recent version, although there'll be another one soon as requested by Takashi. The differences from the version on github are really minor which is why I haven't asked here for people to retest yet.
xkr47 wrote:I wanted to ask about the NVRAM save - which is a great idea! - it seems your driver will save settings to NVRAM after no mixer settings have been changed for 2 seconds? Is it okay to save "so often"? I am wondering if the NVRAM can wear out too soon if it is used too much.. IFF this is the case, would it be enough to save say every 5 minutes? Ok so the computer might crash etc and it would be nice to not lose settings in this case. One option could maybe be making it a module parameter (with some default value) in which case it can also be edited "live" later through /sys/ if I've understood correctly. So if your computer crashes a lot you can pick a smaller interval :) Or maybe you already investigated this from the windows mixer behaviour and that's where the 2 seconds came from :)
Hehe, yes I'm emulating the Focusrite Control behaviour. 2 seconds after a change with no further changes, the new settings will be saved.
xkr47 wrote:Again, thanks a million for your work and good luck in the final polishing of the driver!
You're welcome, and thank you again!
xkr47 wrote:I guess the dkms driver mentioned here would also be great for a lot of people not being able to use the latest and greatest kernel just yet because of e.g. distribution limitations etc.
Yes, I agree that would be great, even for people not on the latest and greatest kernel, because it looks like the driver should make it in to Linux 5.4 which if I understand the release cycle correctly is not due until Nov/2019.
User avatar
xkr47
Established Member
Posts: 11
Joined: Fri Jul 19, 2019 5:50 pm
Contact:

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by xkr47 »

:idea: This page needs a lot of love: https://alsa-project.org/wiki/Matrix:Vendor-Focusrite

Unless someone more knowledgeable has time to look at it, I might give it a shot..
User avatar
cjoke
Established Member
Posts: 15
Joined: Thu Jul 25, 2019 8:03 pm
Location: Norway
Has thanked: 3 times
Contact:

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by cjoke »

This will end my dualboot! Thanks :D
I have 18i20 and octopre 2gen and using HWmonitoring 16 preamps for liverecordings. Routing the line outputs to an external analogue mixer. This is a gamechanger for me!

Thanks again! :)
Love, people, music, beer and lot of other stuff.
geoffrey
Established Member
Posts: 252
Joined: Mon Jul 30, 2018 2:08 am
Has thanked: 33 times
Been thanked: 169 times

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by geoffrey »

I have some excellent news ppls! The driver is now queued for Linux 5.4!

Code: Select all

Date: Sun, 28 Jul 2019 17:49:57 +0200
From: Takashi Iwai <tiwai@suse.de>
To: "Geoffrey D. Bennett" <g@b4.vu>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH V7] ALSA: usb-audio: Scarlett Gen 2 mixer interface

On Sun, 28 Jul 2019 17:12:45 +0200, Geoffrey D. Bennett wrote:
> Add mixer quirk for the Focusrite Scarlett 6i6, 18i8, and 18i20 Gen 2
> audio interfaces. Although the interfaces are USB compliant,
> additional input/output level controls and hardware routing/mixing
> functionality are available using proprietary USB requests.
> 
> Signed-off-by: Geoffrey D. Bennett <g@b4.vu>

Applied now.  Thanks!

Takashi
But, do note that I've disabled the new driver by default as I've had three reports of it not working, because when it doesn't work, you can't get any audio in/out of the interface. In order to fix this, I need someone with one of those interfaces to get a USB capture of the Focusrite driver initialising the interface (based on the serial #s I've seen, I think that they are older Scarlett Gen 2 interfaces).

Thanks for your assistance everyone!
User avatar
sysrqer
Established Member
Posts: 2520
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 319 times
Been thanked: 148 times
Contact:

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by sysrqer »

This is great news!
geoffrey
Established Member
Posts: 252
Joined: Mon Jul 30, 2018 2:08 am
Has thanked: 33 times
Been thanked: 169 times

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by geoffrey »

cjoke wrote:This will end my dualboot! Thanks :D
I have 18i20 and octopre 2gen and using HWmonitoring 16 preamps for liverecordings. Routing the line outputs to an external analogue mixer. This is a gamechanger for me!

Thanks again! :)
YW cjoke! The Linux driver is perfect for this purpose. Although alsamixer is a terrible interface for setting it up, once it's done you can save your different configurations in separate files with: "alsactl store USB -f $FILE" and then "alsactl restore" to easily load/switch between them.
User avatar
xkr47
Established Member
Posts: 11
Joined: Fri Jul 19, 2019 5:50 pm
Contact:

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by xkr47 »

geoffrey wrote:I have some excellent news ppls! The driver is now queued for Linux 5.4!

But, do note that I've disabled the new driver by default as I've had three reports of it not working, because when it doesn't work, you can't get any audio in/out of the interface. In order to fix this, I need someone with one of those interfaces to get a USB capture of the Focusrite driver initialising the interface (based on the serial #s I've seen, I think that they are older Scarlett Gen 2 interfaces).
Wonderful news! Well done Geoffrey! Also good call on disabling by default.

1. How is the driver enabled?
2. Do you know, has the 2nd gen had many revisions?
User avatar
xkr47
Established Member
Posts: 11
Joined: Fri Jul 19, 2019 5:50 pm
Contact:

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by xkr47 »

Ah, found instructions how to enable from the patch:

Code: Select all

+			"Focusrite Scarlett Gen 2 Mixer Driver disabled; "
+			"use options snd_usb_audio device_setup=1 "
+			"to enable and report any issues to g at b4.vu");
User avatar
dawitti
Established Member
Posts: 9
Joined: Wed Mar 14, 2018 3:23 pm
Location: Austria
Contact:

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by dawitti »

@geoffrey Wow, that's amazing! Thanks!
User avatar
cjoke
Established Member
Posts: 15
Joined: Thu Jul 25, 2019 8:03 pm
Location: Norway
Has thanked: 3 times
Contact:

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by cjoke »

sysrqer wrote:This is great news!
Nice one :)

Here is my usbmon output , lsusb -v -d some:id and dmesg as requested @geoffrey
I recon my 18i20 device is not the newest. But I ran out and downloaded the newest focusritepanelcontroll app/driver as soon as I bought device 1 month ago. I also, is an owner of focusrite octopre. I booted up in windows and did run factory defaults

Heres the output :

"Your message contains 223310 characters.
The maximum number of allowed characters is 60000." ;)

So here's the link
https://tinyurl.com/yxbzjeo3

cheers :)
Love, people, music, beer and lot of other stuff.
Post Reply