Focusrite Scarlett 18i20 2nd Gen mixer driver

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

Moderators: MattKingUSA, khz

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 »

Jorin wrote:
geoffrey wrote: [...]
Outputs here: https://gist.github.com/jorins/46bce342 ... 2feacd7243
[...]
I don't see any significant difference between your usbmon capture and mine, except when yours fails and mine gets a response, although interestingly your capture has error -2 (ENOENT) instead of -110 (ETIMEDOUT) like before:

Code: Select all

ffff969fb4880300 1865259336 S Co:3:009:0 s 21 02 0000 0005 0010 16 = 00000000 00000000 00000000 00000000
ffff969fb4880300 1865259448 C Co:3:009:0 0 16 >
ffff969fb4880300 1865259454 S Ci:3:009:0 s a1 03 0000 0005 0010 16 <
ffff969fb4880300 1870412618 C Ci:3:009:0 -2 0
vs.

Code: Select all

ffff967c9361b0c0 933637178 S Co:092:00 s 21 02 0000 0005 0010 16 = 00000000 00000000 00000000 00000000
ffff967c9361b0c0 933637197 C Co:092:00 0 16 >
ffff967c9361b0c0 933637204 S Ci:092:00 s a1 03 0000 0005 0010 16 <
ffff967c9361b0c0 933637238 C Ci:092:00 0 16 = 00000000 00000000 00000000 00000000
My corresponding lsusb & usbmon output is available at https://gist.github.com/geoffreybennett ... 07687efc6f if you'd like to look and compare. I also included the contents of /sys/kernel/debug/usb/devices; how does that compare to yours?

Any chance you can capture the same while booting a Windows VM with the Focusrite driver so we can see what happens differently with that?
macramole
Established Member
Posts: 23
Joined: Sat Nov 10, 2018 5:35 am
Been thanked: 6 times

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by macramole »

Working good on Linux Mint 19.1

Had some problems with the kernel (no DKMS modules, no NVIDIA drivers) but the Scarlett driver was working perfect, alsamixer showing all the faders.

Thanks for this !
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 »

macramole wrote:Working good on Linux Mint 19.1

Had some problems with the kernel (no DKMS modules, no NVIDIA drivers) but the Scarlett driver was working perfect, alsamixer showing all the faders.

Thanks for this !
Great! Thank you for testing! Can you confirm if all the faders and switches do the right things for you too?
macramole
Established Member
Posts: 23
Joined: Sat Nov 10, 2018 5:35 am
Been thanked: 6 times

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by macramole »

geoffrey wrote:
macramole wrote:Working good on Linux Mint 19.1

Had some problems with the kernel (no DKMS modules, no NVIDIA drivers) but the Scarlett driver was working perfect, alsamixer showing all the faders.

Thanks for this !
Great! Thank you for testing! Can you confirm if all the faders and switches do the right things for you too?
I tried quite a few and everything was working as expected, it wasn't an exhaustive test though. I'd love to have some more time and code a GUI, maybe in a couple of months ! Thanks for your time is great to have better linux support for this gear
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 »

macramole wrote:
geoffrey wrote:
macramole wrote:Working good on Linux Mint 19.1

Had some problems with the kernel (no DKMS modules, no NVIDIA drivers) but the Scarlett driver was working perfect, alsamixer showing all the faders.

Thanks for this !
Great! Thank you for testing! Can you confirm if all the faders and switches do the right things for you too?
I tried quite a few and everything was working as expected, it wasn't an exhaustive test though. I'd love to have some more time and code a GUI, maybe in a couple of months ! Thanks for your time is great to have better linux support for this gear
Thanks again, I appreciate the feedback. If anyone else has tested and can confirm what's working/not working, that will be helpful.
porfyros
Established Member
Posts: 5
Joined: Mon Dec 17, 2018 9:34 pm

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by porfyros »

Hi geoffrey,

Many thanks for your effort!

I am testing on Debian 9.8. I built a kernel based on your code and booted successfully into the system. I 'm afraid I didn't have any luck yet.

After booting, I do "alsamixer -cUSB" and I don't see any fader. When I do "lsusb -v -d 1235:8201" I get:
https://gist.github.com/porfyros/0ec786 ... 5c686dc5bd

Any ideas ?
Jorin
Established Member
Posts: 8
Joined: Fri Apr 12, 2019 5:44 pm

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by Jorin »

geoffrey wrote:
Jorin wrote:
geoffrey wrote: [...]
Outputs here: https://gist.github.com/jorins/46bce342 ... 2feacd7243
[...]
[...]

My corresponding lsusb & usbmon output is available at https://gist.github.com/geoffreybennett ... 07687efc6f if you'd like to look and compare. I also included the contents of /sys/kernel/debug/usb/devices; how does that compare to yours?

Any chance you can capture the same while booting a Windows VM with the Focusrite driver so we can see what happens differently with that?
Hey! Been a bit busy with work so I haven't had time to reply as that's a bit of a tall order. Unfortunately I also had to format my Linux partition, and with that went the kernel. I could maybe continue testing next week, as I'll have more time then and will be able to test on my laptop, which is already quite well set up for virtualisation. Here's the interface as seen in my /sys/kernel/debug/usb/devices anyhow, though running kernel 4.19.32-1-MANJARO. The only difference other than the bus and serial number seems to be asterisks at the start of a few lines.

Code: Select all

T:  Bus=03 Lev=02 Prnt=02 Port=04 Cnt=01 Dev#=  4 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  2
P:  Vendor=1235 ProdID=8201 Rev= 4.3b
S:  Manufacturer=Focusrite
S:  Product=Scarlett 18i20 USB
S:  SerialNumber=02004377
C:* #Ifs= 6 Cfg#= 1 Atr=c0 MxPwr=  0mA
A:  FirstIf#= 0 IfCount= 3 Cls=01(audio) Sub=00 Prot=20
I:* If#= 0 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=20 Driver=snd-usb-audio
I:  If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
I:* If#= 1 Alt= 1 #EPs= 2 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
E:  Ad=01(O) Atr=05(Isoc) MxPS= 560 Ivl=125us
E:  Ad=81(I) Atr=11(Isoc) MxPS=   4 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
E:  Ad=01(O) Atr=05(Isoc) MxPS= 832 Ivl=125us
E:  Ad=81(I) Atr=11(Isoc) MxPS=   4 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
E:  Ad=01(O) Atr=05(Isoc) MxPS=1000 Ivl=125us
E:  Ad=81(I) Atr=11(Isoc) MxPS=   4 Ivl=1ms
I:  If#= 2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
I:* If#= 2 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
E:  Ad=82(I) Atr=25(Isoc) MxPS= 504 Ivl=125us
I:  If#= 2 Alt= 2 #EPs= 1 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
E:  Ad=82(I) Atr=05(Isoc) MxPS= 728 Ivl=125us
I:  If#= 2 Alt= 3 #EPs= 1 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
E:  Ad=82(I) Atr=05(Isoc) MxPS=1000 Ivl=125us
I:* If#= 3 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio
I:* If#= 4 Alt= 0 #EPs= 2 Cls=01(audio) Sub=03 Prot=00 Driver=snd-usb-audio
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 5 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=01 Prot=10 Driver=(none)
E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=500us
C:  #Ifs= 6 Cfg#= 1 Atr=c0 MxPwr=  0mA
A:  FirstIf#= 0 IfCount= 3 Cls=01(audio) Sub=00 Prot=20
I:  If#= 0 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=20 Driver=
I:  If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=20 Driver=
I:  If#= 1 Alt= 1 #EPs= 2 Cls=01(audio) Sub=02 Prot=20 Driver=
E:  Ad=01(O) Atr=05(Isoc) MxPS= 560 Ivl=125us
E:  Ad=81(I) Atr=11(Isoc) MxPS=   4 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=01(audio) Sub=02 Prot=20 Driver=
E:  Ad=01(O) Atr=05(Isoc) MxPS= 832 Ivl=125us
E:  Ad=81(I) Atr=11(Isoc) MxPS=   4 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=01(audio) Sub=02 Prot=20 Driver=
E:  Ad=01(O) Atr=05(Isoc) MxPS=1000 Ivl=125us
E:  Ad=81(I) Atr=11(Isoc) MxPS=   4 Ivl=1ms
I:  If#= 2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=20 Driver=
I:  If#= 2 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=20 Driver=
E:  Ad=82(I) Atr=25(Isoc) MxPS= 504 Ivl=125us
I:  If#= 2 Alt= 2 #EPs= 1 Cls=01(audio) Sub=02 Prot=20 Driver=
E:  Ad=82(I) Atr=05(Isoc) MxPS= 728 Ivl=125us
I:  If#= 2 Alt= 3 #EPs= 1 Cls=01(audio) Sub=02 Prot=20 Driver=
E:  Ad=82(I) Atr=05(Isoc) MxPS=1000 Ivl=125us
I:  If#= 3 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=
I:  If#= 4 Alt= 0 #EPs= 2 Cls=01(audio) Sub=03 Prot=00 Driver=
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:  If#= 5 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=01 Prot=10 Driver=
E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=500us
metal bassist
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 »

porfyros wrote:Hi geoffrey,

Many thanks for your effort!

I am testing on Debian 9.8. I built a kernel based on your code and booted successfully into the system. I 'm afraid I didn't have any luck yet.

After booting, I do "alsamixer -cUSB" and I don't see any fader. When I do "lsusb -v -d 1235:8201" I get:
https://gist.github.com/porfyros/0ec786 ... 5c686dc5bd

Any ideas ?
Hi Porfyros, thank you for giving it a go and sending your feedback. Here are some questions which will help narrow down what's happening:

Does audio in/out still work even though the faders haven't appeared?

Can you send through the output of dmesg as well as 'amixer -cUSB'?

Can you capture the output of "usbmon" as per my message to Jorin above: “You can capture USB bus traffic by running "usbmon -fu -s 10000 | grep -v 'Z[io]:'"...”

Also, if you can, could you edit the sound/usb/mixer_scarlett_gen2.c file, snd_scarlett_gen2_controls_create() function and insert some lines like:

Code: Select all

snd_printk(KERN_ERR "Scarlett test 1\n");
to check how far into that function it gets (FYI, you can use "make M=sound/usb modules" to only recompile that module).

Thanks, Geoffrey.
porfyros
Established Member
Posts: 5
Joined: Mon Dec 17, 2018 9:34 pm

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by porfyros »

Hi geoffrey,

I stand corrected and happily report that I have a working setup! So we have a working case for Debian 9.8.

I probably did something wrong when I made the initial configuration for compiling. I retried after your pointers and I can now see all the inputs/outputs!

Next step is to figure out how to use it!

Many thanks!!!

I intend to check the GUIs, I wonder if anybody had any luck trying them out.
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 »

FYI to all, I have been working on an 18i8 Gen 2 driver & will have something ready for testing soon.
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 »

@trrichard @ciolansteen @Philotomy
I finished adding & testing support for the 18i8! Please try it:
https://github.com/geoffreybennett/scar ... /v5.0.10s5
(source + prebuilt RPM and .deb packages available there)

All the volume-level/mixing/routing, line/instrument level and pad functionality is working for me. If it works or doesn't work for you, please let me know. I am trying to get the driver incorporated into the kernel and it's important that it's well tested :-).

If you have an 18i20, please retest with this version too. Volume & volume switch changes will now be saved to the interface's NVRAM.
not_sure_myself
Established Member
Posts: 4
Joined: Thu May 02, 2019 2:02 pm

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by not_sure_myself »

Nice work geoffrey. Do you have any hints on how to find out if the Forte is similar to the Gen1, Gen2 or something else entirely? USBPcap 1.3.0.0 in Windows 7 is giving me empty captures so I'm doing something wrong.
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 »

not_sure_myself wrote:Nice work geoffrey. Do you have any hints on how to find out if the Forte is similar to the Gen1, Gen2 or something else entirely? USBPcap 1.3.0.0 in Windows 7 is giving me empty captures so I'm doing something wrong.
Sorry, I'm not familiar with the Forte or with USBPcap at all. I do my captures from Linux, passing USB through to a VM.
not_sure_myself
Established Member
Posts: 4
Joined: Thu May 02, 2019 2:02 pm

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by not_sure_myself »

Thanks, I'll try a VM and maybe ask again if I have any luck.
gwilherm
Established Member
Posts: 3
Joined: Sat May 04, 2019 8:48 am

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by gwilherm »

geoffrey wrote: I finished adding & testing support for the 18i8! Please try it
Hi geoffrey ! First of all, thank you for your great work ! I own a Scarlett 18i8 2nd gen and I was long time hoping an alsa support of this sound card !
I tried your patch, but unfortunately didn't work for me. I re compiled the kernel because i have 32bit proc, my computer is kinda outdated but has USB 2.0
It runs Ubuntu 16.04.3 "xenial", here is my error message :

Code: Select all

$ alsamixer -cUSB
cannot load mixer controls: Protocol error

Code: Select all

$ dmesg
[  954.318442] usb 1-6: new high-speed USB device number 5 using ehci-pci
[  954.447809] usb 1-6: New USB device found, idVendor=1235, idProduct=8204, bcdDevice= 4.34
[  954.447814] usb 1-6: New USB device strings: Mfr=1, Product=3, SerialNumber=2
[  954.447816] usb 1-6: Product: Scarlett 18i8 USB
[  954.447820] usb 1-6: Manufacturer: Focusrite
[  954.447822] usb 1-6: SerialNumber: 00026443
[  959.722503] usb 1-6: Scarlett Gen 2 USB response result cmd 0 was -110
[  960.124893] usb 1-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x2800, type = 3
[  960.145545] usb 1-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x2800, type = 3
[  960.236514] usb 1-6: 2:3: usb_set_interface failed (-71)
[  960.244898] usb 1-6: 2:3: usb_set_interface failed (-71)
[  960.253280] usb 1-6: 2:3: usb_set_interface failed (-71)
[  960.263533] usb 1-6: 2:3: usb_set_interface failed (-71)
[  960.273031] usb 1-6: 2:3: usb_set_interface failed (-71)
[  960.282034] usb 1-6: 2:3: usb_set_interface failed (-71)
[  960.290526] usb 1-6: 2:3: usb_set_interface failed (-71)
[  965.351758] usb 1-6: 2:3: usb_set_interface failed (-110)
....
I don't know what's wrong and which logs to look at. Can i get some help ?

Many thanks !

PS: I never used the soundcard with windows Focusrite Control app, perhaps internal mixer needs somehow to be initialized ?
Post Reply