Focusrite Scarlett Second Generation

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

Moderators: MattKingUSA, khz

wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Re: Focusrite Scarlett Second Generation

Post by wolftune »

To confirm from above: I have a 2i2 and the post above saying it has no hi-Z is wrong. It has hi-Z on both channels and a physical switch for everything.
Aaron Wolf
Music teacher, scholar
http://wolftune.com
Musicmaker
Established Member
Posts: 47
Joined: Sun Oct 19, 2014 2:34 pm
Been thanked: 5 times

Re: Focusrite Scarlett Second Generation

Post by Musicmaker »

daeavelwyn wrote:Hi guys,

The Focusrite Scarlett 18i20 works on linux, BUT you can"t access the internal mixer. I don't know if it's an ALSA driver issue or an AlsaJsonGAteway / Mixer issue. Any helps would be really welcomed.

Here are some links about this subject :
https://focusritedevelopmentteam.wordpr ... -products/ <= see the comments at the end of the post

About AlsaJsonGateway and AlsaJsonMixer :
https://github.com/fulup-bzh/AlsaJsonMixer/issues/4
https://github.com/fulup-bzh/AlsaJsonMixer/issues/5
https://github.com/fulup-bzh/AlsaJsonGateway/issues/5
Is that the 2nd gen or 1st gen ? the 1st gen works fine. Did you try ALSAMIXER and setup the correct configuration ?
daeavelwyn
Established Member
Posts: 30
Joined: Mon May 06, 2013 6:08 am

Re: Focusrite Scarlett Second Generation

Post by daeavelwyn »

@Musicmaker : It's for the 18i20 second gen, as mentionned in one of my other post, using a 18i8 1st gen works perfectly :)
Musicmaker
Established Member
Posts: 47
Joined: Sun Oct 19, 2014 2:34 pm
Been thanked: 5 times

Re: Focusrite Scarlett Second Generation

Post by Musicmaker »

Hi, if it works but the controls not show in alsamixer, then it looks to me Focusrte Gen 2 broke ALSA support ,
Just having audio only would be the same situation I had before the kernel was updated for for 18i20 support in the ALSA code.
Guess FR created a new USB device ID and they may have changed descriptors as well..
If it does not work in Fulups code but the controls are visible in alsamixer, then I think the Device ID just needs to be add in Fulips code.
My 1st gen 18i20 is Bus 003 Device 006: ID 1235:800c Focusrite-Novation Scarlett 18i20
If you publish your Device ID if its different, then perhaps the ALSA driver team can add the ID in the kernel. hopefully FR did not change the descriptors but probably they changed some items for higher bitrate support.
I asked the ALSA team before how to pull the ALSA sources, change/recomplie the ALSA driver, but never got a response. there is no tutorial to DIY this.
One idea could be to pull the ALSA source, make a change in the code to add the Gen 2 ID and create a pull request. (without testing)
For the moment, this means I will hold off replace my 1st Gen.

You can find an extensive discussion here. suggest you seek help from the experts on that blog and discuss it further there.
http://focusritedevelopmentteam.wordpre ... n-products
https://focusritedevelopmentteam.wordpr ... -products/
fulup-bzh
Posts: 2
Joined: Fri Apr 17, 2015 9:52 pm

Re: Focusrite Second Generation & AlsaJsonGateway

Post by fulup-bzh »

Until ALSA/Pulse are updated to support the notion of external Mixer, we have no other option than using custom UI to interact with on board DSP Mixer.

This being said, It is important to understand that AlsaJsonGateway and AlsaJsonMixer are two very difference things.
  • AlsaJsonGateway is independent of any board and support any sound card out of box. AlsaJsonGateway simply exposes ALSA driver capabilities over a REST interface. As a result AlsaJsonGateway like AlsaMixer or any other Alsa client will support any board as exposed by ALSA.
  • AlsaJsonMixer on the other hand is dedicated to Focusrite. It requires customisation for every new board and currently only support Focusrite-v1. Luckily until now most Focusrite boards use very similar ALSA protocols and moving from one model to the other one as been pretty simple. I do not own a second generation board, hopefully it require only minimal changes. Nevertheless even minimal changes have to be made and test by someone.
The only clean way to deal with those smart sound card is to leverage USB gadget interface and present two USB profiles within one single interface. One profile using ALSA the other one using an ethernet for controlling the board through TCP/IP. We know it's technically possible because this is what MicroChip audio network does. Unfortunatly it is not the direction chosen by Foscusrit
tschjns
Established Member
Posts: 5
Joined: Tue Nov 01, 2016 2:20 pm

Re: Focusrite Scarlett Second Generation

Post by tschjns »

A Focusrite 18i8 2nd Gen arrived here just today.

Basic recording with Audacity worked right out of the box.

Sadly, I wasn't able to get anything else to work:
No output from monitor or headphone jacks.
In Alsamixer, the only option available is "Internal<ClockSource>", no faders or anything else there. Does this mean, that the audio-interface is not compatible with ALSA yet? If so, then why was Audacity able to record stuff via the Focusrite?

During my research I ran into some related questions I couldn't figure out. Every advice is most appreciated.
1. Why can't I just use Wine or a similar application to run the "Focusrite Control" software to configure the internal mixer?
2. There were some articles about reverse-engineering the protocol used by the soundcard and the Focusrite-software. Considered, I could figure that out - would I be able to use the device's full functionality? How would I need to use the information?
3. In the first generation of Scarletts, could all the internal routing be done via alsamixer?
4. Is there a chance that Fulup's mixer will do the trick, even if Alsamixer doesn't display any options?
User avatar
Arnd
Established Member
Posts: 13
Joined: Sat Aug 06, 2016 8:05 pm

Re: Focusrite Scarlett Second Generation

Post by Arnd »

I received my Focusrite 18i8 2nd generation last Friday and I'm really pleased. The USB implementation seems to be much better compared to my 1st generation 2i4. I use an old Lenove S10-2 netboot for recording (openSUSE 13.2, Ardour 5.4) and the 2i4 caused sometimes overruns while recording 2 channels. Using the same setup with the 2nd generation 18i8 and recording 8 channels there are no overruns at all (recording for approx. 2 hours) and the CPU load of this 2 core Atom was only at 40-45%...

When I attached the 18i8 (2nd gen) to my Linux system, the outputs where directly routed (1-2 to monitor out, 3-4 to headphone 1, 5-6 to headphone 2) and I could playback from Ardour (or any other application) which out a problem (selecting the right outputs of course). Direct monitoring was of course not working (as this requires to use "Focusrite Control" to define the mixing).

You don't need any mixer control to record or playback as the Scarlett (as a USB class compliant device) reports how many inputs (18) and outputs (8) it has and these can and will be used by ALSA out of the box.

Regarding the "Focusrite Control" windows program, I first tried to use it from within a virtual machine (Windows 10 running under KVM). While setting the clock rate with the ASIO tool was working as was recording and playback with Ardour and Ableton, "Focusrite Control" always reported "No Hardware Connected". When using it in a native Windows 10 it works flawlessly.

In regard to tschjns' questions:
  1. As "Focusrite Control" is not working from within a virtual machine it will most probably not work with Wine. Why? Only Focusrite knows what they have programmed into "Focusrite Control".
  2. I did some USB debugging when trying the virtual machine approach, but "Focusrite Control" did not cause any USB traffic to the 18i8 (most propably because it thought there was no 18i8 connected). I'll do some tracing within Windows 10 later this week. How to use the information? Reverse engineer which USB data packets are used to control the internal mixer, then change the corresponding kernel driver, which currently already handles the internal mixer of the 1st generation Scarletts (sound/usb/mixer_scarlett.c).
  3. As my 2i4 has no internal mixer I can't say for sure but according to the kernel source it looks like it.
  4. I think that without the changes to the linux kernel driver there won't be any support from tools like alsamixer or Fulup's mixer. The driver will tell ALSA which mixer controls are available to talk to the Scarlett. Alsamixer (or any other mixer application) will use the information in ALSA to create a user interface and control the mixer through ALSA.
Arnd
User avatar
Arnd
Established Member
Posts: 13
Joined: Sat Aug 06, 2016 8:05 pm

Re: Focusrite Scarlett Second Generation

Post by Arnd »

Just a brief update:

I started debugging of the USB data exchanged between "Focusrite Control" and my 2nd generation 18i8:
  • There are significant differences to the 1st generation protocol, therefore it will not be sufficient to make minor changes to the existing Scarlett mixer code in the Linux USB sound driver
  • The protocol seems to be more complex and also seems to follow a different design approach
  • Up to now I identified parts of the following functions:
    • Setting the sample rate
    • Changing between line and instrument input
    • Enabling and disabling the input pad
    • Change the sync mode (internal, SPDIF, ADAT)
    Getting the current state (incl. indication whether the interface is locked to the word clock) seems to be more difficult
  • I would assume that there are dependencies between the firmware loaded to the 2nd generation Scarlett interface and the protocol (and the firmware can only be updated by "Focusrite Control")
There won't be a quick solution as debugging is time consuming:
  • Start the trace
  • Perform one change (change mixer, change fader, mute, solo, ...), use one function or feed one input or output signal to the Scarlett
  • Stop the trace
  • Analyze the trace and find the command sequence as well as the bit / byte / bytes which changed due to the change
  • Debug the next change...
Arnd
tschjns
Established Member
Posts: 5
Joined: Tue Nov 01, 2016 2:20 pm

Re: Focusrite Scarlett Second Generation

Post by tschjns »

After a little more testing, I found that all the Inputs and Outputs can indeed be used via Ardour or Jack without a problem. So recording actually works fine, just like Arnd wrote, and the problems I was experiencing were a result of my limited knowledge. :wink:
What I still don't understand is this: if Jack and Ardour are running on top of ALSA, why are those applications capable of using the In-/Outputs of the device but Alsamixer isn't?

Another question: In Ardour, there are all the right options for setting the Scarlett's sample rate, up to 192 kHz. How can this possibly be with the protocol changed? Or is this still a class-compliance-thing?

@Arnd: Thanks for the explanations. Even if there is no quick solution, what you're doing sounds very interesting to me and I would like to learn more about your approach, especially which applicatons you use. :D
User avatar
Arnd
Established Member
Posts: 13
Joined: Sat Aug 06, 2016 8:05 pm

Re: Focusrite Scarlett Second Generation

Post by Arnd »

There is a difference between ALSA and alsamixer:
  • ALSA is the audio framework linking applications (like jack, Ardour, Audacity, alsamixer...) to the sound hardware.
  • alsamixer is an ALSA application accessing the mixer functionality provided by ALSA and the hardware driver
Sound hardware (like the Scarlett 18i8) usually contains the following components / building blocks:
  • An interface to the computer (like USB)
  • Input ADC converting incoming analogue signals to digital data (microphone in, line in, instrument in)
  • Output DAC converting outgoing digital data to analogue signals (monitor out, headphone out)
  • Controls to set certain functionality (pad, input impedance, clock source, ...)
  • Mixer control to control the routing of audio between inputs, outputs and computer as well as to control builtin faders, panning, muting, ...
  • MIDI device
In order to use all of these functions it is necessary that they are supported by a device driver. Functions implemented as class compliant (like describing how many and which inputs and outputs are available) will be available out of the box. Vendor specific functions (like the mixer, which substantially different between different vendors) require specific code in the device driver to allow ALSA to use these functions. Without this support applications like alsamixer are not aware of them and can't use them.

So, Jack, Ardour & Co. are accessing the available inputs (ADCs) and outputs (DACs), which are known to ALSA because the Scarlett is class compliant. Alsamixer just handles the mixer component (it will not play or record audio) and for this there is no support for the 2nd generation Scarlett.

I use Wireshark to trace the USB traffic between the "Focusrite Control", the Scarlett Windows driver and the Scarlett itself. The trace contains just data packets (ie. all the bytes exchanged over USB) and the analysis is performed manually to understand the structure and meaning of the data bytes.
Arnd
tschjns
Established Member
Posts: 5
Joined: Tue Nov 01, 2016 2:20 pm

Re: Focusrite Scarlett Second Generation

Post by tschjns »

Thank you very much for the clarification. It made things a lot clearer for me.
Dam
Established Member
Posts: 3
Joined: Sat Dec 31, 2016 8:42 am

Re: Focusrite Scarlett Second Generation

Post by Dam »

tschjns wrote:After a little more testing, I found that all the Inputs and Outputs can indeed be used via Ardour or Jack without a problem. So recording actually works fine, just like Arnd wrote, and the problems I was experiencing were a result of my limited knowledge. :wink:
Hi, I've just bought a Scarlett 18i20 2nd generation (and I suppose that the configuration in linux should be similar to the 18i8). Using Ardour in AVLinux I can record only at 44.1 or 48 kHz, and only using ALSA (not JACK) as "Audio system" in audio/midi settings (the windows that opens as soon as you create a new project). If I select JACK (or even ALSA) with 88,2 or 96 kHz no sound comes from the input.
How did you configure Ardour? Can the Scarlett 2nd generation be used also in JACK? And do you have some suggestions to achieve 96 kHz?
Thanks a lot for your support.
jamescaf
Established Member
Posts: 6
Joined: Mon Nov 28, 2016 1:11 am

Re: Focusrite Scarlett Second Generation

Post by jamescaf »

I'm on AVLinux 2016, I recently acquired an 18i8 first gen, and all my audio inputs and outputs for the device appear in Jack. I can make connections to the inputs and outputs in Ardour, and I see the meters are active when I feed sound in, but I cannot get any audio out to the headphone jacks (3,4,5 and 6 if I'm correct) even when I make the proper connections in a Jack patchbay. Anyone have any ideas? Thanks!
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Re: Focusrite Scarlett Second Generation

Post by wolftune »

jamescaf wrote:I'm on AVLinux 2016, I recently acquired an 18i8 first gen, and all my audio inputs and outputs for the device appear in Jack. I can make connections to the inputs and outputs in Ardour, and I see the meters are active when I feed sound in, but I cannot get any audio out to the headphone jacks (3,4,5 and 6 if I'm correct) even when I make the proper connections in a Jack patchbay. Anyone have any ideas? Thanks!
This really shouldn't be posted to a thread about the 2nd gen. Please make a new thread if you want to discuss further. But there are web-based interfaces to control the 1st gen, and all the settings are available in terminal via alsamixer.
Aaron Wolf
Music teacher, scholar
http://wolftune.com
jamescaf
Established Member
Posts: 6
Joined: Mon Nov 28, 2016 1:11 am

Re: Focusrite Scarlett Second Generation

Post by jamescaf »

My apologies, I ended up solving my problem with alsamixer.
Post Reply