Focusrite Scarlett 2i2 on Linux

Discuss your workplace, instruments, amps, and any other gear.

Moderators: MattKingUSA, khz

User avatar
milo
Established Member
Posts: 1242
Joined: Wed Sep 06, 2017 2:55 am
Location: Southern Utah, USA
Has thanked: 275 times
Been thanked: 218 times
Contact:

Focusrite Scarlett 2i2 on Linux

Post by milo »

I just wrote a review and basic tutorial for how to get the Focusrite Scarlett 2i2 USB audio interface working on a Linux home studio: https://alansanderson.band/2017/09/04/f ... me-studio/

It is not overly technical, and is definitely aimed at newbies. Enjoy!
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: Focusrite Scarlett 2i2 on Linux

Post by Pablo »

Nice review and songs!

A suggestion if you don't have speakers connected to the Focusrite,
so you want to capture with the Focusrite and, at the same time,
hear through the computer speakers.

I have recorded lately in a similar situation. What I do is choosing the
USB card as the Interface in the Parameters tab. Then, in the advanced
tab, I select "Capture only" in the Audio field. No need to define
the input and output device fields as you have already selected the interface
in the other tab.

For the computer speakers to work, I then use "alsa_out" like this:

Setup --> Options tab: Execute script after start up:

alsa_out -dhw:PCH &

Now, jack and ardour will see "alsa out: playback" ports, which are the computer speakers.

For a technical background on this, see:
http://jackaudio.org/faq/multiple_devices.html
You mention using solution number 4 but
"this approach will not do any clock drift correction, so as the two devices drift over time, you may get glitches in the audio stream. Nevertheless, it can be an easy if unreliable way to set up JACK so that, for example, it records from a USB microphone and plays back via a builtin audio device".

The solution I described above is the number 1: "If you are using JACK on Linux and want to use additional devices that have ALSA driver support (i.e. most PCI, USB and Bluetooth devices), then this is the best option".

For editing and mixing with the computer speakers, when I don't need the USB card, I prefer to start jack with the interface PCH (the onboard audio card) in "playback only mode" and, of course, disable the "script after startup".

Sure, it is better to connect an amplifier and a pair of speakers to the USB card. In this case, I just start jack the simple way; Interface: hw:USB in Duplex audio mode (again, there is no need for choosing input and output devices separately in the advanced tab)

Regards, Pablo
User avatar
milo
Established Member
Posts: 1242
Joined: Wed Sep 06, 2017 2:55 am
Location: Southern Utah, USA
Has thanked: 275 times
Been thanked: 218 times
Contact:

Re: Focusrite Scarlett 2i2 on Linux

Post by milo »

Thank you for the reference. I will play with that tonight and see if I can get option #1 working. If so then I will revise the article.

But in my case of using the same device as input and output, isn't that using the same clock? How can I get clock drift using my setup?
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: Focusrite Scarlett 2i2 on Linux

Post by Pablo »

You are right. There is not clock drifting if you use the same device for input and output. That said, just using hw:USB in the interface field (and the default audio dúplex mode) should be enough to get the USB card ready for input and output.

Also, now that I have read your blog post again and understood better, you just need to use alsa_out for your laptop speakers to work. There is no need to restart jack with another configuration. alsa_out will add the laptop speakers as a new jack client.

As a first time test, once your USB device is up and running (input and output, of course), type in a terminal:
alsa_out -dhw:PCH
and then connect ardour master outputs to both system playbacks and alsa_out playbacks

Next time, you can add said command (with an ampersand in the end, just in case) to qjackctl's options
User avatar
milo
Established Member
Posts: 1242
Joined: Wed Sep 06, 2017 2:55 am
Location: Southern Utah, USA
Has thanked: 275 times
Been thanked: 218 times
Contact:

Re: Focusrite Scarlett 2i2 on Linux

Post by milo »

The alsa_out command definitely works from the command line, and that will be very useful. Thanks for showing that to me.

Strangely, the "Interface" field on the qjackctl settings window is greyed out. That is why I had to dig deeper and find the Output Device and Input Device settings on the Advanced tab. Maybe it's a configuration issue, but I guess I don't really care as long as my setup is working.

Thanks again for your thoughts!
b4ne1
Posts: 2
Joined: Thu Jul 09, 2020 10:42 pm

Re: Focusrite Scarlett 2i2 on Linux

Post by b4ne1 »

Milo,

I've tried this and I can't get it to work. I am a newbie to Linux but am determined to make it work. I will not go back to Windows!
Thanks for any help or replies.
User avatar
milo
Established Member
Posts: 1242
Joined: Wed Sep 06, 2017 2:55 am
Location: Southern Utah, USA
Has thanked: 275 times
Been thanked: 218 times
Contact:

Re: Focusrite Scarlett 2i2 on Linux

Post by milo »

Is this a new device you've recently purchased? The blog post was written about a 2nd gen device, and I haven't tested a 3rd gen device.

What specifically are you trying to do, and at what point are you stuck?
kc8oye
Posts: 2
Joined: Sun Mar 14, 2021 2:27 am

Re: Focusrite Scarlett 2i2 on Linux

Post by kc8oye »

i have had my Scarlett 2i2 working under windows 10.. but i can't get my linux Mint laptop to recognize it.. (2i2 connection like flickers a lot, but never comes on solid) any ideas?
73 de kc8oye
--tim
kc8oye
Posts: 2
Joined: Sun Mar 14, 2021 2:27 am

Re: Focusrite Scarlett 2i2 on Linux

Post by kc8oye »

update: it was a bad USB cable. switched to the original, but too short cable and it worked just fine.
one small problem, I'm using the 2nd input for better cable routing.. and under linux, if I set audacity to one channel mono recording, it will only record from the 1st input.. whereas windows will switch to whichever port i'm using.. oh well I can live with that.
User avatar
milo
Established Member
Posts: 1242
Joined: Wed Sep 06, 2017 2:55 am
Location: Southern Utah, USA
Has thanked: 275 times
Been thanked: 218 times
Contact:

Re: Focusrite Scarlett 2i2 on Linux

Post by milo »

Glad you got it working :)
User avatar
bluebell
Established Member
Posts: 1909
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Re: Focusrite Scarlett 2i2 on Linux

Post by bluebell »

kc8oye wrote: Sun Mar 14, 2021 3:28 am update: it was a bad USB cable. switched to the original, but too short cable and it worked just fine.
one small problem, I'm using the 2nd input for better cable routing.. and under linux, if I set audacity to one channel mono recording, it will only record from the 1st input.. whereas windows will switch to whichever port i'm using.. oh well I can live with that.
You can set up "fixed patch points" with jack_thru where you connect stuff to as you want. Then you can connect Audacity to those points. I use "main", "vocmic", "gitmix", "synth1" fpr Audacity.
a.jpg
a.jpg (103.62 KiB) Viewed 33270 times

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

ubuntourist
Established Member
Posts: 5
Joined: Thu Dec 26, 2019 1:30 pm
Has thanked: 1 time

Re: Focusrite Scarlett 2i2 on Linux

Post by ubuntourist »

I'm running Pop! OS 22.04 with Pipewire. When using my LogiTech Logi Zone 750 headset as both input and output, everything works. (In particular, Jamulus and Reaper, but other stuff as well.) The 2i2, on the other hand...

I've enabled the Focusrite ALSA driver in /etc/modprobe.d/alsa_base.conf and dmesg finds it.

I've configured JACK via QJackCtl to use "hw:USB Scarlet 2i2 USB (hw:4)" as the interface.

The mic works great. However, the headphones work for a "while" (sometimes 3 minutes, sometimes longer) and then they just... stop. (Nothing wrong with the headphones. I've tested them on a Yamaha keyboard to verify that they were not the source of trouble.)

I'm not sure where I should look for trouble.

tseaver
Established Member
Posts: 398
Joined: Mon Mar 13, 2017 6:07 am
Has thanked: 11 times
Been thanked: 98 times

Re: Focusrite Scarlett 2i2 on Linux

Post by tseaver »

@ubuntourist

However, the headphones work for a "while" (sometimes 3 minutes, sometimes longer) and then they just... stop. (Nothing wrong with the headphones. I've tested them on a Yamaha keyboard to verify that they were not the source of trouble.)

I'm not sure where I should look for trouble.

That is, indeed, odd. I've been using a variety of Focusrite Scarlett interfaces (from the gen1 2i2, to the gen3 solo, to a gen1 18i20), and have never experienced that kind of issue: on the fancier one, I have seen odd behavior where the internal signal routing gets reset on a system restart to some weird state (see my scarlett_yaml script for how I work around it), but that shouldn't obtain for your interface: it doesn't have software-configurable signal routing.

I've never had the headphone jacks quit working after some period of time (with no reboot in play).

Ubuntu, Mixbus32C; acoustic blues / country / jazz
User avatar
bluebell
Established Member
Posts: 1909
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Re: Focusrite Scarlett 2i2 on Linux

Post by bluebell »

ubuntourist wrote: Sun Apr 02, 2023 6:35 pm

The mic works great. However, the headphones work for a "while" (sometimes 3 minutes, sometimes longer) and then they just... stop. (Nothing wrong with the headphones. I've tested them on a Yamaha keyboard to verify that they were not the source of trouble.)

I'm not sure where I should look for trouble.

Is it only the headphones or are the line outputs affected as well?

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

ubuntourist
Established Member
Posts: 5
Joined: Thu Dec 26, 2019 1:30 pm
Has thanked: 1 time

Re: Focusrite Scarlett 2i2 on Linux

Post by ubuntourist »

bluebell wrote: Mon Apr 10, 2023 7:35 am
ubuntourist wrote: Sun Apr 02, 2023 6:35 pm

The mic works great. However, the headphones work for a "while" (sometimes 3 minutes, sometimes longer) and then they just... stop. (Nothing wrong with the headphones. I've tested them on a Yamaha keyboard to verify that they were not the source of trouble.)

I'm not sure where I should look for trouble.

Is it only the headphones or are the line outputs affected as well?

Line outputs as well.

Post Reply