FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Support & discussion regarding DAWs and MIDI sequencers.

Moderators: MattKingUSA, khz

User avatar
71GA
Established Member
Posts: 33
Joined: Mon Sep 23, 2013 9:37 pm
Location: Slovenia
Contact:

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by 71GA »

I think I got it to work. I chose hw:USB as my output and input and set other parameters like advised
at the beginning of this thread. My current settings which enable me to start JACK are below:

(I posted a screenshot in case any more noobs like myself get in a same trouble)

Image

Does anyone have an idea on how to test if my soundcard realy works with JACK? Still havent figured out how to
set Hydrogen and Ardour - the later wont even start while the former cant start the audio engine...
User avatar
dednikko
Established Member
Posts: 152
Joined: Mon Dec 03, 2012 7:47 am
Location: Dallas, TX
Contact:

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by dednikko »

You should already have jack running when you try to open any program that depends on it. The program should be able to figure out that jack is running and go from there.

If you have audacity installed, make sure it is using the Jack driver (as opposed to ALSA) on the main screen. Play back any audio file there to test and make sure your connections are valid.

I would highly recommend that you ditch Arch if you're having this many problems running the programs. At least give KXStudio or AVLinux a try. You'll probably save countless hours you could instead use making music.
Think like a gun.
User avatar
71GA
Established Member
Posts: 33
Joined: Mon Sep 23, 2013 9:37 pm
Location: Slovenia
Contact:

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by 71GA »

Ok so I started JACK first and then from terminal I started hydrogen just to get some extra debugging info.
Hydrogen seems to fail to set up audio server at startup (settings can be seen from the picture):

Image

The weird part to me can be seen from the terminal where i can read that hydrogen does reckognize JACK
running and is for some reason trying to open "/usr/lib/jack/jack_firewire.so" which it cannot find. One more
thing is weird here. Why does it try to open firewire drivers if imy Scarlet 2i4 is in fact a USB card... :?:

Code: Select all

JACK compiled with System V SHM support.
`ziga-scarlet-2i4' server already active
jackd 0.121.3
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details

could not open driver .so '/usr/lib/jack/jack_firewire.so': libffado.so.2: cannot open shared object file: No such file or directory

JACK compiled with System V SHM support.
`ziga-scarlet-2i4' server already active
(E) JackOutput	init Unknown status with JACK server. 
(E) JackOutput	init Unknown status with JACK server. 
(E) 	H2Core::AudioOutput* H2Core::createDriver(const QString&) Error starting audio driver [audioDriver::init()] 
(E) 	void H2Core::audioEngine_startAudioDrivers() Error starting audio driver 
(E) 	void H2Core::audioEngine_startAudioDrivers() Using the NULL output audio driver 
(E) 	void H2Core::audioEngine_startAudioDrivers() m_pMainBuffer_L == NULL 
(E) 	void H2Core::audioEngine_startAudioDrivers() m_pMainBuffer_R == NULL 
(E) 	void H2Core::audioEngine_setupLadspaFX(unsigned int) nBufferSize=0 
(E) NullDriver	setBpm not implemented yet 
[quote]
If you have audacity installed, make sure it is using the Jack driver
[quote]

So do I have to choose JACK driver with all the applications I want to connect to JACK? What about Ardour which doesn't have this option. It only has theese options:
  • ALSA
  • OSS
  • FreeBoB
  • FFADO
  • NetJACK <----- is this the one to use???
  • Dummy


For audio interface in ardour I chose "USB Audio".
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by Pablo »

So do I have to choose JACK driver with all the applications I want to connect to JACK? What about Ardour which doesn't have this option. It only has theese options: ...
Jack is not a driver in the sense of "hardware driver", it is an audio server in the sense of "sound system" which many apps use. There are apps which use the alsa sound system (sometimes referred to as "pure alsa") or pulseaudio, or jack. Some apps, like ardour, only work via jack.

What you see in ardour's audio configuration is just another front-end to configure the jack audio system. In fact, if you start ardour when jack is up and running you won't see this dialog.

jack can be configured to use different drivers or back-ends. The driver you need for a USB card is alsa, you already know this.

I don't know what confuses H2, but if jack is running it should be OK.
User avatar
dednikko
Established Member
Posts: 152
Joined: Mon Dec 03, 2012 7:47 am
Location: Dallas, TX
Contact:

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by dednikko »

71GA wrote:So do I have to choose JACK driver with all the applications I want to connect to JACK? What about Ardour which doesn't have this option. It only has theese options:

ALSA
OSS
FreeBoB
FFADO
NetJACK <----- is this the one to use???
Dummy
If Ardour is asking you for these options, then Jack is not started. If you use Ardour to start Jack, you would use the ALSA driver. All of the drivers listed there are used by Jack to create compatibility with various programs/hardware. For instance, ALSA is what you need for MOST systems. USB and PCI audio interfaces will consistently use the ALSA driver. FFADO is for Firewire devices. FreeBoB is the precursor to FFADO. Dummy is the fallback if your hardware is unsupported by the previously picked driver. OSS is pretty much unsused for powerful audio apps. I don't understand NetJack, as I've never had a use come up for it. I believe it is for networked audio hardware, but I haven't read Jack documentation at all since I started using prepped distros.
71GA wrote:Ok so I started JACK first and then from terminal I started hydrogen just to get some extra debugging info.
Hydrogen seems to fail to set up audio server at startup
It appears that you have no device selected in that image. Check the "connect to default output pair" box as well. By "default" is should mean what you have selected via Jack.

I also recommend using qjackctl as your Jack interface since you are not using KXStudio. It has easier setup than using Jack via command line, and most people here would be far more familiar with how to use it.

To my (very limited and possibly incorrect) understanding, Jack has several components. Jackdmp, Jack2 and perhaps more. qjackctl bundles up all the options you may need to get it running well in a hurry.

I understand that part of the appeal of Arch is absolute control of what gets installed into your system and how. I would however lean on the many years of work already done by falkTX and GMaq to drastically cut down your time spent on configuration.

Another resource you sould look into is Ardour.org and its forums. Why? Because Paul Davis is the lead programmer of Ardour, and has (had?) a lot to do with designing Jack in the first place.

*I could have been incorrect in some of these details, but I'm hoping our amazing boardmates will correct any mistakes on my part*

That said, if you can figure all this out, more power to you, quite literally.

This is an example of what has been working for me:

Image
Think like a gun.
User avatar
71GA
Established Member
Posts: 33
Joined: Mon Sep 23, 2013 9:37 pm
Location: Slovenia
Contact:

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by 71GA »

I also recommend using qjackctl
I have been using it already :)
If Ardour is asking you for these options, then Jack is not started
Thanks for pointing this out! This was helpful! I have been playing a bit with JACK configuration and tried to compare my integrated card (hw:0) & my Scarlet 2i4 (hw:USB).

In qjackctl I chose driver alsa & hw:USB: At boot Ardour asked me for audio settings which according to @dednikko means that my JACK sound system isn't running. Just to make sure I allso installed Audacity and under "Edit/Pereferences/Devices/Host" there was no JACK entry.

In qjackctl I chose driver alsa & hw:0: At boot Ardour didn't ask me for audio settings so JACK is running and allso in Audacity under "Edit/Pereferences/Devices/Host" there was a JACK entry.

So I have isolated the problem which is that JACK won't start with my Scarlet 2i4 while it normaly starts with my integrated audio card.
I understand that part of the appeal of Arch is absolute control
Apparently not :lol: but because I have a lot of programs working really well on Archlinux I am still interested on solving this problem on Arch. I tried to first update my system but it didn't change a thing. I have read here: http://eldhuset.org/2012/03/04/focusrit ... t-2i2.html that disabling an integrated sound card helped. How do I do this properly?

My kernel is allso the newest version while i have read that it has some problems with USB interfaces.

Code: Select all

[ziga@ziga-pc ~]$ uname -s -r -v
Linux 3.10.14-rt9-1-rt #1 SMP PREEMPT RT Wed Oct 9 06:23:27 UTC 2013
Is it possible that I may only need some libraries?
User avatar
dednikko
Established Member
Posts: 152
Joined: Mon Dec 03, 2012 7:47 am
Location: Dallas, TX
Contact:

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by dednikko »

Ah yes, the kernels after 3.6 and at least through 3.10 have been giving USB interface users a load of trouble. If you can find something older, it will work better.

There is some hope that there are fixes in 3.11 kernels, but I haven't yet upgraded to Saucy Salamander to look closely at it.

The easiest way to disable your onboard audio is to disable it within your BIOS. If it is powered down in there, then it shouldn't even show up in the options for JACK, or ALSA.
Think like a gun.
User avatar
71GA
Established Member
Posts: 33
Joined: Mon Sep 23, 2013 9:37 pm
Location: Slovenia
Contact:

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by 71GA »

The easiest way to disable your onboard audio is to disable it within your BIOS.
I did disable the modules snd_hda_intel and snd_hda_codec_hdmi in kernel - basically I just edited the "/boot/syslinux/syslinux.cfg" file to look like:

Code: Select all

DEFAULT arch
PROMPT 0
TIMEOUT 50

UI menu.c32

MENU TITLE Arch Linux
#MENU BACKGROUND splash.png
MENU COLOR border       30;44   #40ffffff #a0000000 std
MENU COLOR title        1;36;44 #9033ccff #a0000000 std
MENU COLOR sel          7;37;40 #e0ffffff #20ffffff all
MENU COLOR unsel        37;44   #50ffffff #a0000000 std
MENU COLOR help         37;40   #c0ffffff #a0000000 std
MENU COLOR timeout_msg  37;40   #80ffffff #00000000 std
MENU COLOR timeout      1;37;40 #c0ffffff #00000000 std
MENU COLOR msg07        37;40   #90ffffff #a0000000 std
MENU COLOR tabmsg       31;40   #30ffffff #00000000 std

LABEL arch
	MENU LABEL Linux (Arch)
	LINUX ../vmlinuz-linux
	APPEND root=/dev/sda1 rw
	INITRD ../initramfs-linux.img

LABEL archstudio
	MENU LABEL Linux (Arch) - recording studio
	LINUX ../vmlinuz-linux-rt
	APPEND root=/dev/sda1 rw threadirqs modprobe.blacklist=snd_hda_intel,snd_hda_codec_hdmi
	INITRD ../initramfs-linux-rt.img
and then recompiled a kernel using

Code: Select all

mkinitcpio -p linux
It made no changes ... Scarlett 2i4 still isn't working although now it is the only card listed:

Code: Select all

[ziga@ziga-pc ~]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: USB [Scarlett 2i4 USB], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Oh man it must be the USB drivers...
User avatar
71GA
Established Member
Posts: 33
Joined: Mon Sep 23, 2013 9:37 pm
Location: Slovenia
Contact:

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by 71GA »

One more clue. When i started the qjackctl from terminal i got this error:

Code: Select all

[ziga@ziga-pc ~]$ qjackctl
Unable to load library icui18n "Cannot load library icui18n: (icui18n: cannot open shared object file: No such file or directory)" 


Qjackctl didn't mind this and started nevertheless. But could this be a source to my problems? I have the package icu installed and up to date.
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by Pablo »

Try starting jack from a terminal with the default settings.

Code: Select all

jackd -dalsa -dhw:USB
User avatar
71GA
Established Member
Posts: 33
Joined: Mon Sep 23, 2013 9:37 pm
Location: Slovenia
Contact:

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by 71GA »

Try starting jack from a terminal with the default settings.

Code: Select all

jackd -dalsa -dhw:USB
This worked!

Code: Select all

[ziga@ziga-pc ~]$ jackd -dalsa -dhw:USB
jackd 0.121.3
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details

could not open driver .so '/usr/lib/jack/jack_firewire.so': libffado.so.2: cannot open shared object file: No such file or directory

JACK compiled with System V SHM support.
loading driver ..
creating alsa driver ... hw:USB|hw:USB|1024|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback
It is still complaining about the driver "/usr/lib/jack/jack_firewire.so" but Now when I start Ardour
I don't get the settings menu which means JACK is finaly working :D Just to make sure that JACK
wasn't using my integrated sound card I blacklisted the modules:
  • snd_hda_intel
  • snd_hda_codec_hdmi
to completely disable my integrated card. This isn't realy necessaary but I wanted to make
sure. Well after reboot command "aplay -l" only finds Scarlet 2i4, JACK starts normaly
with default settings mentioned above and Ardour doesn't prompt me for settings.

It works! :D

I don't know what exactly was wrong but I think that I just didn't find the right settings for JACK
and Scarlet 2i4 to live in harmony. May also be that qjackctl is bugged because this is the
first time I executed JACK from the terminal...

I have tried running JACK in real time with a parameter -R:

Code: Select all

jackd -R -dalsa -dhw:USB
and this also works but my latency is quite high and I have to find the optimal settings to lower it. :P
User avatar
71GA
Established Member
Posts: 33
Joined: Mon Sep 23, 2013 9:37 pm
Location: Slovenia
Contact:

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by 71GA »

I had to check and am reporting back to you that this also works on my other computer - Archlinux laptop. So I believe these settings can be universaly applied. I just need to fix the latency problems a bit like said in my previous post.
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by Pablo »

It works! :D
Cool!
I don't know what exactly was wrong but I think that I just didn't find the right settings for JACK
and Scarlet 2i4 to live in harmony. May also be that qjackctl is bugged because this is the
first time I executed JACK from the terminal...
qjackctl normally stores its jackd command at ~/.jackdrc. So take a look at what you were doing in the setup window:

Code: Select all

cat ~/.jackdrc 
Then consult the jackd man page
http://linux.die.net/man/1/jackd
I have tried running JACK in real time with a parameter -R
No need to do so, as realtime is the default mode.
I just need to fix the latency problems a bit like said in my previous post.
Then decrease the period size. It is 1024 by default. 256 is usually low enough. Lower latency means more risk to have xruns so don't aim for perfection but trust your ears. From the terminal, use the -p option:

Code: Select all

jackd -dalsa -dhw:USB -p256
User avatar
71GA
Established Member
Posts: 33
Joined: Mon Sep 23, 2013 9:37 pm
Location: Slovenia
Contact:

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by 71GA »

Thank you all now the sound looks good to me. Here is my 1st demo made yesterday - I was just messing around a bit and will realy finish this project when i buy microphones and a very much desired guitar amp :)

This is it:
https://soundcloud.com/71ga/my-first-session-in-my-arch
jdbazagaruiz
Posts: 2
Joined: Fri Nov 07, 2014 3:21 pm

Re: FOCUSRITE - Scarlet 2i4 - setup (Archlinux)

Post by jdbazagaruiz »

Hey, this post was really helpful. Today I just received the Scarlet 2i2, and will the last piece of advice (running jackd from the command line with those parameters) everything works perfectly well in Slackware 14.1 (both audio input and audio monitoring).

I have the 3.10.17 kernel. I don't notice any latency at all (and I have really tried to hear it, but no way, it sounds with zero latency to my ears).

Good job! Thanks!
Post Reply