Focusrite Scarlett 2nd and 3rd Gen mixer driver

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

Moderators: MattKingUSA, khz

geoffrey
Established Member
Posts: 250
Joined: Mon Jul 30, 2018 2:08 am
Has thanked: 33 times
Been thanked: 163 times

New Gen 2 & 3 mixer driver upstreamed

Post by geoffrey »

The driver has now made it in to Linus's tree: https://git.kernel.org/pub/scm/linux/ke ... linux.git/
https://git.kernel.org/pub/scm/linux/ke ... 9849adf2e0
This means that it will be a part of 5.14-rc1 which I believe is about a week away.
FluxTape
Established Member
Posts: 3
Joined: Wed Aug 26, 2020 1:18 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Focusrite Scarlett 2nd and 3rd Gen mixer driver

Post by FluxTape »

geoffrey wrote: Sun Jul 04, 2021 2:14 pm
FluxTape wrote: Sun Jul 04, 2021 12:22 pm Just tested https://github.com/geoffreybennett/scar ... v5.12.13s1 with my 8i6 gen 3. I use Arch linux with the zen kernel and just replaced the /sound/usb folder with the one from github when compiling. I hope that is all that's needed (besides scarlett.conf of course).
The "INST" switch in alsamixer is working but "AIR", "PAD" and the 48V switches are not. They show up but can't be toggled.

For now I'm switching back to kernel 5.11.16 with sadko4u's 5.11 patch, which has been working flawlessly for me.
Hi FluxTape,

Thanks for trying it out! I'm guessing you were using the Up/Down arrows to try to change the Air/Pad/48V switches? Can you try again and this time press the spacebar and see if that makes it work? Up/Down arrows will change the Level switches between Line/Inst, but do nothing for the Air/Pad/48V switches. Similarly, on the Playback page, you need to press "M" to toggle the on/off controls.

Yeah, alsamixer is weird. You use Up/Down for enumerated controls (ones with a list of values), Spacebar for Capture on/off controls, and "M" for Playback on/off controls. Use the wrong key and nothing will happen.

Regards,
Geoffrey.
Ah yes spacebar absolutely worked! I was aware of "M" for toggle, but didn't know about spacebar.
So far everything seems to work, I will report back if I notice any issues
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Re: Focusrite Scarlett 2nd and 3rd Gen mixer driver

Post by wolftune »

This testing got me to embrace qasmixer and it is so much better for me. I suggest you install it and try it.
Aaron Wolf
Music teacher, scholar
http://wolftune.com
geoffrey
Established Member
Posts: 250
Joined: Mon Jul 30, 2018 2:08 am
Has thanked: 33 times
Been thanked: 163 times

ALSA Scarlett Gen 2/3 Mixer GUI Preview

Post by geoffrey »

A tease...
scarlett-solo-tease.png
scarlett-solo-tease.png (20.27 KiB) Viewed 19584 times
scarlett-2i2-tease.png
scarlett-2i2-tease.png (22.2 KiB) Viewed 19584 times
scarlett-4i4-tease.png
scarlett-4i4-tease.png (37.05 KiB) Viewed 19584 times
(yes, what you see above works)
(no, it's not ready to use yet)
(yes, it holds great promise)
<strike>(also, I have no idea what I'm doing... anybody else know how to program GTK 4 in C and can help me please??)</strike>I think I've figured out what I'm doing now...
Last edited by geoffrey on Thu Jul 08, 2021 3:07 pm, edited 1 time in total.
diuk
Posts: 1
Joined: Tue Jul 06, 2021 11:49 am
Has thanked: 3 times

Re: ALSA Scarlett Gen 2/3 Mixer GUI Preview

Post by diuk »

geoffrey wrote: Mon Jul 05, 2021 3:06 pm A tease...
scarlett-solo-tease.png
scarlett-2i2-tease.png
scarlett-4i4-tease.png
(yes, what you see above works)
(no, it's not ready to use yet)
(yes, it holds great promise)
(also, I have no idea what I'm doing... anybody else know how to program GTK 4 in C and can help me please??)
Incredible! Thank u so much for ur work Geoggrey, im exited about this
geoffrey
Established Member
Posts: 250
Joined: Mon Jul 30, 2018 2:08 am
Has thanked: 33 times
Been thanked: 163 times

ALSA Scarlett Gen 2/3 Mixer GUI Preview 2

Post by geoffrey »

It looked better in my head (I'm no graphic artist), but this is still pretty cool...
scarlett-4i4-tease-2.png
scarlett-4i4-tease-2.png (84.94 KiB) Viewed 19532 times
User avatar
sysrqer
Established Member
Posts: 2516
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 319 times
Been thanked: 147 times
Contact:

Re: Focusrite Scarlett 2nd and 3rd Gen mixer driver

Post by sysrqer »

That's amazing geoffrey! I find the current alsamixer and qasmixer really confusing so this will be a very welcome addition.
alfadir
Posts: 2
Joined: Thu Nov 28, 2019 8:40 pm

Re: Focusrite Scarlett 2nd and 3rd Gen mixer driver

Post by alfadir »

Great progress,
thank you very much.

I am running the 5.12.13s1+ debian kernel with the Debian Sid.
I have a Scarlett 8i6 USB gen 3.

Code: Select all

idVendor=1235, idProduct=8213, bcdDevice= 6.45
I have been able to use the Focusrite quite ok, but now at some point something changed.
I am not sure if something changed with switching to windows at some point or if it comes from the new drivers.
I can only hear the left channel from the outputs, which was not the case before. (Monitor1,2 and line 1 on the back)

But lets take a step back.
When I started with the focusrite I found a way to use it via jackd.
So I used Jack, but to get access to the applications in Debian (Firefox or Skype or Zoom) I use Pulseaudio plugin

Code: Select all

pactl load-module module-jack-sink channels=2; 
pactl load-module module-jack-source channels=2; 
pacmd set-default-sink jack_out
My setup is simple. I have a Heil PR40 microphone with a FetHead to improve the sound sensitivity (powered off the 48V)
I have a headset on Monitor 1 and a speaker set on Monitor 2.
I have not done any changes to the alsa setup, and I assume I need to do something here to fit all the new knobs to the system.

In Jack i see capture - 1-10 and playback 1-6, using Capture-1 puts my mic into the applications
But the pulse audio only the left channel comes through. I suspect the playback 2 is not properly connected in
to what it should be ?
jack.png
jack.png (38.28 KiB) Viewed 19513 times
Or how do you use the system best ? With some more elaborate alsa configuraiton ?
It would be nice to set up that the names are correct in Jack, that would make it easier to connect things.

Also how are the large monitor knob working ? at this stage it does not affect the sound as I can hear it.
Possibly I have to do some setting here as well.

Well, I just would like to know a bit deeper how to set it up in the system. If this fits better in a new post, let me know.

Fred
geoffrey
Established Member
Posts: 250
Joined: Mon Jul 30, 2018 2:08 am
Has thanked: 33 times
Been thanked: 163 times

Re: Focusrite Scarlett 2nd and 3rd Gen mixer driver

Post by geoffrey »

alfadir wrote: Fri Jul 09, 2021 8:42 am Great progress,
thank you very much.

I am running the 5.12.13s1+ debian kernel with the Debian Sid.
Hi Fred!

Thanks for helping to test!
alfadir wrote: Fri Jul 09, 2021 8:42 am I have a Scarlett 8i6 USB gen 3.

Code: Select all

idVendor=1235, idProduct=8213, bcdDevice= 6.45
I have been able to use the Focusrite quite ok, but now at some point something changed.
I am not sure if something changed with switching to windows at some point or if it comes from the new drivers.
I can only hear the left channel from the outputs, which was not the case before. (Monitor1,2 and line 1 on the back)
If you plug headphones into line 1 and hear something, but from line 2 you hear nothing then it's likely a volume, mute, or routing problem that you can fix in alsamixer...
alfadir wrote: Fri Jul 09, 2021 8:42 am But lets take a step back.
When I started with the focusrite I found a way to use it via jackd.
So I used Jack, but to get access to the applications in Debian (Firefox or Skype or Zoom) I use Pulseaudio plugin

Code: Select all

pactl load-module module-jack-sink channels=2; 
pactl load-module module-jack-source channels=2; 
pacmd set-default-sink jack_out
My setup is simple. I have a Heil PR40 microphone with a FetHead to improve the sound sensitivity (powered off the 48V)
I have a headset on Monitor 1 and a speaker set on Monitor 2.
I have not done any changes to the alsa setup, and I assume I need to do something here to fit all the new knobs to the system.

In Jack i see capture - 1-10 and playback 1-6, using Capture-1 puts my mic into the applications
But the pulse audio only the left channel comes through. I suspect the playback 2 is not properly connected in
to what it should be ?
Please try:
- Run alsamixer
- Press F6, select your 8i6
- Use Left/Right arrows to scroll between controls
- Check that the first 4 volumes on the Playback (F3) page are all the way up and the first 4 mute buttons are Off ("MM" = Mute Off which is what you want). Use the "M" key to toggle
- Scroll to the right past all the Mix volume controls and find the Analogue 1-4 controls
- Using the Up/Down arrows to change the Analogue output routing controls:
- Set Analogue 1 & Analogue 3 both to PCM 1 (that's the Jack Playback 1 output)
- Set Analogue 2 & Analogue 4 both to PCM 2 (that's the Jack Playback 2 output)
alfadir wrote: Fri Jul 09, 2021 8:42 am Or how do you use the system best ? With some more elaborate alsa configuraiton ?
It would be nice to set up that the names are correct in Jack, that would make it easier to connect things.
Sorry, I don't know much about Jack configuration.
alfadir wrote: Fri Jul 09, 2021 8:42 am Also how are the large monitor knob working ? at this stage it does not affect the sound as I can hear it.
Possibly I have to do some setting here as well.
The large monitor knob controls the volume for the line 1 & 2 outputs on the back.
There is no physical volume control knob for the line 3 & 4 outputs on the back.
All of the analogue outputs (front and back) are affected by the corresponding Analogue 1-4 volume and mute controls in alsamixer.
alfadir wrote: Fri Jul 09, 2021 8:42 am Well, I just would like to know a bit deeper how to set it up in the system. If this fits better in a new post, let me know.
Here is okay, thanks. I hope it helped!

Regards,
Geoffrey.
mauser
Established Member
Posts: 145
Joined: Wed Oct 08, 2008 3:58 pm
Has thanked: 1 time
Been thanked: 7 times

Re: Focusrite Scarlett 2nd and 3rd Gen mixer driver

Post by mauser »

Hey Geoffrey,

is your UI strictly thought for the 2nd / 3rd gen devices or are you planning to support also the first generation? I played around with x42's scarlett mixer as well as the web-based AlsaJsonGateway. Both were quite useful, but the first one does not support all controls and the latter is quite instable (and i would prefer a "native" appliaction). If you would choose to include also the first gen devices, i could help with testing (18i8 and a 18i20) and adjusting the code.
geoffrey
Established Member
Posts: 250
Joined: Mon Jul 30, 2018 2:08 am
Has thanked: 33 times
Been thanked: 163 times

Re: Focusrite Scarlett 2nd and 3rd Gen mixer driver

Post by geoffrey »

mauser wrote: Sat Jul 10, 2021 10:29 am Hey Geoffrey,

is your UI strictly thought for the 2nd / 3rd gen devices or are you planning to support also the first generation? I played around with x42's scarlett mixer as well as the web-based AlsaJsonGateway. Both were quite useful, but the first one does not support all controls and the latter is quite instable (and i would prefer a "native" appliaction). If you would choose to include also the first gen devices, i could help with testing (18i8 and a 18i20) and adjusting the code.
Hi mauser,

My UI is designed specifically for the 2nd/3rd gen devices as that's what I have. Writing software for devices I don't have is (as I discovered) quite tricky, and I don't want to do it anymore :-). If I get donated Gen 1 hardware, then I will add support for it. Or, I'll be releasing the UI as free software and anyone else with the hardware and some C coding skills can add support.

Regards,
Geoffrey.
mauser
Established Member
Posts: 145
Joined: Wed Oct 08, 2008 3:58 pm
Has thanked: 1 time
Been thanked: 7 times

Re: Focusrite Scarlett 2nd and 3rd Gen mixer driver

Post by mauser »

My UI is designed specifically for the 2nd/3rd gen devices as that's what I have. Writing software for devices I don't have is (as I discovered) quite tricky, and I don't want to do it anymore :-). If I get donated Gen 1 hardware, then I will add support for it. Or, I'll be releasing the UI as free software and anyone else with the hardware and some C coding skills can add support.
That's totally understandable. I would love to see this published as free software!
JamesPeters
Established Member
Posts: 188
Joined: Fri Jun 29, 2018 6:35 pm
Has thanked: 8 times
Been thanked: 15 times

Re: Focusrite Scarlett 2nd and 3rd Gen mixer driver

Post by JamesPeters »

Since kernel 5.14 rc1 was available in the kernel manager of Manjaro (the distro I'm using), I installed it and tested this new support for 3rd gen Focusrite Scarlett devices. It seems to work propery in all regards for the device I have (2i2). Performance in ALSA at low latency seems to be approximately the same as it was before (which is good, because it worked well before).

Here's what I did to get the features to appear in Alsamixer and Qasmixer (for anyone else reading who wants to try this, at this point in time):
  1. Have kernel 5.14 installed (at the time of writing it's 5.14 rc1).
  2. Use the lsusb command in terminal to get some info for the 2i2 to use in the next step. My output of that command was:

    Code: Select all

    Bus 005 Device 002: ID 1235:8210 Focusrite-Novation Scarlett 2i2 Camera
    
  3. Add the following line into the file /etc/modprobe.d/scarlett.conf (using the numbers obtained from step 2):

    Code: Select all

    options snd_usb_audio vid=0x1235 pid=0x8210 device_setup=1
  4. Reboot.
After that, all the device's features appeared in Alsamixer and Qasmixer. All controls work properly, including persistence of all of them after shutting down and restarting the computer. (Note: the scarlett.conf file didn't exist on my system, so I created one in that location with that info inside it.)

I assume once kernel 5.14 is officially released, the other steps won't be required to have this functionality exposed for the device. (Correct me if I'm wrong please.)

When doing a loopback test for latency in Reaper, I noticed that the total roundtrip latency seems to be slightly higher on average (half a millisecond at 44.1 KHz with 32-sample buffer size and 4 periods). The roundtrip latency seems to change a little bit every time the audio driver is restarted in the DAW anyway (that's the way it's always been for my systems in any distro I've used, and I'm told it's normal for ALSA by a source I trust); because of this I don't know if other factors are involved or if this slight increase in latency has anything to do with this new functionality for the 2i2. But my previous testing of this involved multiple tests and settling on an average number, and I repeated that testing today to arrive at a new slightly higher average number than before. I figured I'd mention it here just in case it's useful feedback to provide.

Thank you, Geoffrey!
geoffrey
Established Member
Posts: 250
Joined: Mon Jul 30, 2018 2:08 am
Has thanked: 33 times
Been thanked: 163 times

Re: Focusrite Scarlett 2nd and 3rd Gen mixer driver

Post by geoffrey »

Hi JamesPeters,

Thanks for testing!

In answer to your questions...
JamesPeters wrote: Thu Jul 15, 2021 4:33 pm I assume once kernel 5.14 is officially released, the other steps won't be required to have this functionality exposed for the device. (Correct me if I'm wrong please.)
5.14 will still need the device_setup=1 option to activate the mixer controls. Hopefully we can remove that for 5.15 or 5.16 as I've had no more reports that enabling the mixer controls breaks anything anymore.
JamesPeters wrote: Thu Jul 15, 2021 4:33 pm When doing a loopback test for latency in Reaper, I noticed that the total roundtrip latency seems to be slightly higher on average (half a millisecond at 44.1 KHz with 32-sample buffer size and 4 periods). The roundtrip latency seems to change a little bit every time the audio driver is restarted in the DAW anyway (that's the way it's always been for my systems in any distro I've used, and I'm told it's normal for ALSA by a source I trust); because of this I don't know if other factors are involved or if this slight increase in latency has anything to do with this new functionality for the 2i2. But my previous testing of this involved multiple tests and settling on an average number, and I repeated that testing today to arrive at a new slightly higher average number than before. I figured I'd mention it here just in case it's useful feedback to provide.
Any changes to the latency are unrelated to my work with the mixer controls, and coincidently in 5.14 there should be a reduction in the latency of the USB audio driver: https://www.phoronix.com/scan.php?page= ... 5.14-Try-2
JamesPeters wrote: Thu Jul 15, 2021 4:33 pm Thank you, Geoffrey!
You're welcome! :)
furanku
Posts: 2
Joined: Tue Jul 20, 2021 6:55 pm

Re: Focusrite Scarlett 2nd and 3rd Gen mixer driver

Post by furanku »

Hi, I'm new here!

First of all: A biiig Thank You! to geoffrey for all the work!

I have some problems with my 18i20 2nd Gen. When I try to play a sound all I get is a clicking noise and another click approx. one second later. No error messages. I'm using Gentoo:

Code: Select all

# uname -a
Linux FranksStudiorechner 5.13.3-gentoo #1 SMP Tue Jul 20 19:27:15 CEST 2021 x86_64 Intel(R) Core(TM) i9-7940X CPU @ 3.10GHz GenuineIntel GNU/Linux
I tried before Version 5.10.49 and now replaced mixer_scarlett_gen2.c from your GitHub repository in the linux source tree, all with the same result. Just klicking noises.

Code: Select all

# dmesg|grep -A 5 -B 5 Scarlett
[    1.084170] systemd[1]: systemd 248 running in system mode. (+PAM -AUDIT -SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID -CURL -ELFUTILS -FIDO2 +IDN2 -IDN -IPTC +KMOD -LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY -P11KIT -QRENCODE -BZIP2 +LZ4 -XZ -ZLIB +ZSTD -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
[    1.084348] hub 2-4:1.0: 4 ports detected
[    1.097613] systemd[1]: Detected architecture x86-64.
[    1.100886] usb 3-1: New USB device found, idVendor=1235, idProduct=8201, bcdDevice= 6.75
[    1.100893] usb 3-1: New USB device strings: Mfr=1, Product=3, SerialNumber=2
[    1.100896] usb 3-1: Product: Scarlett 18i20 USB
[    1.100898] usb 3-1: Manufacturer: Focusrite
[    1.100900] usb 3-1: SerialNumber: 03002682
[    1.110211] systemd[1]: Hostname set to <FranksStudiorechner>.
[    1.138087] 10-gentoo-path (274) used greatest stack depth: 13128 bytes left
[    1.153249] systemd-fstab-g (282) used greatest stack depth: 13064 bytes left
--
[    2.792350] usb 1-8: SerialNumber: 3AADE92A_40161378
[    2.793429] random: crng init done
[    2.793430] random: 1 urandom warning(s) missed due to ratelimiting
[    5.437043] e1000e 0000:00:1f.6 enp0s31f6: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx
[    5.437122] IPv6: ADDRCONF(NETDEV_CHANGE): enp0s31f6: link becomes ready
[    5.542615] usb 3-1: Focusrite Scarlett Gen 2/3 Mixer Driver enabled v5.12.13s3 pid=0x8201
[    5.551633] hid-generic 0003:2B06:0015.0005: hidraw4: USB HID v1.11 Device [TEControl Breath Controller 5.0-15260BCE] on usb-0000:00:14.0-4.3/input2
[    5.551766] usbcore: registered new interface driver snd-usb-audio
[    5.615496] usb 1-4.4: new high-speed USB device number 9 using xhci_hcd
[    5.694938] usb 1-4.4: New USB device found, idVendor=05e3, idProduct=0610, bcdDevice=92.26
[    5.694948] usb 1-4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
I see all devices in the alsa mixer (but can't change Master HW).

Frank
Post Reply