Focusrite Scarlett 18i20 2nd Gen mixer driver

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

Moderators: MattKingUSA, khz

gwilherm
Established Member
Posts: 3
Joined: Sat May 04, 2019 8:48 am

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by gwilherm »

I answer to myself after reading what you wrote to Jorin, here is verbose lsusb and usbmon (i started capture before to plug) :
https://gist.github.com/gwilherm/d28c57 ... 29b556762e
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 »

gwilherm wrote:I answer to myself after reading what you wrote to Jorin, here is verbose lsusb and usbmon (i started capture before to plug) :
https://gist.github.com/gwilherm/d28c57 ... 29b556762e
Thank you for testing. It looks like you're running into the same problem that Jorin had, for which I don't have a solution yet. The only things that I can think of at the moment to explain the error are: 1) maybe you've got an older firmware version and I've only tested with newer firmware or 2) that there's something that the Focusrite driver does to initialise the mixer as you're suggesting.

Any chance you can do the same usbmon capture while booting a VM with the Focusrite driver so we can see what happens differently with that? Install the Focusrite driver before connecting the interface, then get a capture of what happens the *first* time you plug the interface in. Perhaps my driver will "just work" after that, or maybe you'll need to do a firmware update first, or perhaps none of this will help. If you can find out, that will be great to know.

@Jorin, have you ever used your Scarlett interface with the Focusrite Control app? If not, this is an interesting point in common. Obviously I have had to use both of my interfaces with the FC app in order to find out what it does, and maybe that upgrades or initialises the interface in some way.

@gwilherm, @Jorin, can you let me know: even though the new mixer functionality doesn't work, does it stop the previously-working recording/playback functionality from working? If it does, I'll need to add an option to disable the mixer unless we can find out what's happening.

Thanks,
Geoffrey.
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: @gwilherm, @Jorin, can you let me know: even though the new mixer functionality doesn't work, does it stop the previously-working recording/playback functionality from working? If it does, I'll need to add an option to disable the mixer unless we can find out what's happening.
I'm affraid that recording/playback is broken with this patch..
In pulseaudio as soon as i plug the soundcard the pulseaudio panel just displays : "Establishing connection to PulseAudio. Please wait..."
In jack :

Code: Select all

Sat May  4 22:06:53 2019: ERROR: Failed to acquire device name : Audio1 error : Method "RequestRelease" with signature "i" on interface "org.freedesktop.ReserveDevice1" doesn't exist
Sat May  4 22:06:53 2019: ERROR: Audio device hw:USB cannot be acquired...
Sat May  4 22:06:53 2019: ERROR: Cannot initialize driver
Sat May  4 22:06:53 2019: ERROR: JackServer::Open failed with -1
Sat May  4 22:06:53 2019: ERROR: Failed to open server
Sat May  4 22:06:53 2019: Saving settings to "/home/gwilherm/.config/jack/conf.xml" ...
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
I also just experienced Firefox total freeze for 1 min that stopped exactly when i unplugged the soundcard (i don't know if its really related because as i said my computer is quite old)

I'll try to find a windows image to run a VM as you said,
Thank you for your help
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 »

Capture via VM worked. So far I've only looked at the few seconds from device connection. Unless I'm misreading it (which I could well be) it's using a superset of the Gen1 commands listed in scarlett_mixer.c.
Andre
Established Member
Posts: 4
Joined: Wed Nov 07, 2018 6:18 pm

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by Andre »

Hi Geoffrey, Good work!. I tested the analog hardware inputs, mute/dim switches and main volume. They all work as expected.
Also the input volume can be read-out and used as a volume indicator.
What puzzles me is the custom mix. As far as I' ve seen with the (Windows) focusrite control application, you can configure one custom mix of up to 18 channels (depending on selected samplerate). The available outputs can be switched between hardware/software/custom.
All channels having 'custom' selected share the same mixer configuration.
Is this a part you still have to investigate or are the different mixer settings a kind of duplicates of one 'master' ?
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 »

Andre wrote:Hi Geoffrey, Good work!. I tested the analog hardware inputs, mute/dim switches and main volume. They all work as expected.
Also the input volume can be read-out and used as a volume indicator.
What puzzles me is the custom mix. As far as I' ve seen with the (Windows) focusrite control application, you can configure one custom mix of up to 18 channels (depending on selected samplerate). The available outputs can be switched between hardware/software/custom.
All channels having 'custom' selected share the same mixer configuration.
Is this a part you still have to investigate or are the different mixer settings a kind of duplicates of one 'master' ?
Hi Andre!

Thank you for testing! Custom mixes are fully implemented in my driver. I think this is what you need to know in order to understand/use them:
  • The mixer has 18 inputs which are configured with the "Mixer Input 01" through "Mixer Input 18" selections.
  • In alsamixer you will need to press F3 and F4 to switch between the playback and capture controls to get to all the settings.
  • The mixer has 10 outputs "Mix A" through "Mix J", and you use the "Mix A Input 01" through "Mix J Input 18" volume controls to control the amount of each input that gets mixed into each output.
  • The mixer outputs are used by selecting "Mix A" through "Mix J" with the output selection controls (Analogue Output 01-10, ADAT Output 1-8, and S/PDIF Output 1-2)
  • The Linux driver has more functionality than the Windows focusrite control application. The mixer outputs can also be connected to the PCM inputs and to other mixer inputs!
  • The Linux driver is also harder to use as there is no nice GUI yet for configuration.
I hope the above helps. If you still need assistance or have any other questions, please let me know!

Regards,
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 would like to share my success running your latest kernel (ver.3) under Ubuntu 18.04.

I believe like other people have shared so far, working with the alsamixer is quite challenging.

In search of what a GUI should be able to do, I wanted to see how the original Focusrite control application works. My motivation was to check it out and get some idea on what it does and what would it take to make one.

Now for the questions part :)

I installed windows 10 under a VM and after quite some effort and I managed to get Focusrite control working. Overall buggy experience and not what one calls stable. Did other people have the same experience?

The second and probably more interesting question, is whether we can have a more clear picture of how everything works (like your previous post). I have a few ideas on how to approach the challenge of creating a GUI but I feel like I 'm missing critical information (like the mixing interface you described).

Is it possible to draw up a few schematics as to how things work?
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,

I would like to share my success running your latest kernel (ver.3) under Ubuntu 18.04.

I believe like other people have shared so far, working with the alsamixer is quite challenging.

In search of what a GUI should be able to do, I wanted to see how the original Focusrite control application works. My motivation was to check it out and get some idea on what it does and what would it take to make one.

Now for the questions part :)

I installed windows 10 under a VM and after quite some effort and I managed to get Focusrite control working. Overall buggy experience and not what one calls stable. Did other people have the same experience?

The second and probably more interesting question, is whether we can have a more clear picture of how everything works (like your previous post). I have a few ideas on how to approach the challenge of creating a GUI but I feel like I 'm missing critical information (like the mixing interface you described).

Is it possible to draw up a few schematics as to how things work?
Hi porfyros,

I ran FC in the same manner as you and it worked pretty fine. Sometimes it didn't see the interface and I had to restart/reconnect/something but I'm not sure if that was the fault of the VM or Windows or what. When it was running it didn't crash on me.

There is a schematic in the source code near the top:
https://github.com/geoffreybennett/scar ... ett_gen2.c

Hopefully this is the critical info you're missing, but do let me know if you need some further explanation.

My vision/wishlist for a GUI includes:
- be able to select which inputs and outputs are actually used, select which are stereo pairs, and name them (this would be in one tab, a once-off sort of configuration, at least until you plug different things into the interface)
- a separate tab would show the I/Os which are used + the mixer and you could click/drag to connect channels from those three together
- traditional mixer interface view with knobs (for the mixer matrix) and sliders (for the volume controls and for one row of the mixer matrix)
- MIDI support for a mixing control surface

Regards,
Geoffrey.
Andre
Established Member
Posts: 4
Joined: Wed Nov 07, 2018 6:18 pm

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by Andre »

High Geoffrey,
I'm getting a good picture of the mixer, which indeed is the most challenging part.
Now I started building a GUI application to make live easier. The outputs already work as expected.
Output volume can be changed both from the hardware volume knob on the front as well as from the software faders.
As soon as I've got the mixer implemented i will post the source on github.
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 Andre,

I was playing around on creating a GUI too. I managed to use pyalsaaudio, which is a python library to talk to alsa https://larsimmisch.github.io/pyalsaaudio/, and then create an html/css based interface to talk to the library.

Can you share a bit more on what you intend to use for the GUI ?
Andre
Established Member
Posts: 4
Joined: Wed Nov 07, 2018 6:18 pm

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by Andre »

Hi Porfyros,

Nice to hear more people are interested in gettting a GUI interface to this audio interface.
I started building a C++ application, using QT Creator as IDE/front-end design tool.

The application is working roughly at this moment.
When started it shows a tabwidget with all 20 possible outputs. On the tab you'll find:
- radio buttons for mono/stereo
- checkboxes for Dim/Mute
- Combobox for selecting the input
- Volume slider (hardware controlled thus reflecting the position from the hardware volume knob/software controlled)
- Volume bar, showing the actual output volume

The top menu has an option for configuring the input matrix. This works quite similar to the way focusritecontrol on Windows is working. The top menu also gives access to the 10 different matrix configurations, allowing to set the volume for each of the inputs.

As soon as mos of the functions have proven to work as the should, I will post the source on github.
Unicornblender
Established Member
Posts: 4
Joined: Thu Apr 18, 2019 1:11 am

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by Unicornblender »

We could use this for the 2i2 cards also. It’s a very popular card, probably their best selling model so far. But 2i2 and alsamixer has never liked each other.
There is no plan B..
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 »

Unicornblender wrote:We could use this for the 2i2 cards also. It’s a very popular card, probably their best selling model so far. But 2i2 and alsamixer has never liked each other.
My understanding was that the Solo, 2i2, and 2i4 don't have software controls like the 6i6, 18i8, and 18i20 do; they only have hardware controls, so my driver isn't (and can't be) applicable. https://support.focusrite.com/hc/en-gb/ ... 2-and-2i4- says: "The Scarlett Solo, 2i2, and 2i4 are not compatible with Scarlett MixControl or Focusrite Control. All of the controls for these devices are hardware based instead."
ciolansteen
Established Member
Posts: 5
Joined: Fri Oct 26, 2018 8:22 pm

Re: Focusrite Scarlett 18i20 2nd Gen mixer driver

Post by ciolansteen »

@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).
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).

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

And thanks for the hard work, man! This really is amazing! :)
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 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
Post Reply