Scarlett 6i6 and low-latency setup for live performance

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

Moderators: MattKingUSA, khz

Post Reply
User avatar
HardGroove
Established Member
Posts: 3
Joined: Fri Mar 14, 2014 12:10 pm

Scarlett 6i6 and low-latency setup for live performance

Post by HardGroove »

Hi LinuxMusicians,

Few months ago I bought Focusrite Scarlett 6i6 usb audio interface, and I am using it on KXStudio - Ubuntu 12.04.4 LTS with 3.8.0-32-lowlatency Kernel.
It works fine, but my main target is, to set it up on lowest latency as possible, so I could do live performance using pure data and other programs combined together.
For some reason I get xruns while testing the system, and no matter what settings I do, it always gives me some xruns.
While doing small research about this situation, I found old video: http://www.youtube.com/watch?v=zzvyV1hyDYc
The guy in that video somehow recompiled the kernel and had it working with 2.9msec latency without xruns.
Since that video is very old, I been thinking, could it be solution for me, to get rid of xruns and have super low latency for my live performance.
Or maybe it is already done in todays Linux Distributions...

My jack configuration:
Buffer Size: 128
Sample Rate: 48k
Periods: 2
Forced 16bit
My cpu scaling is set to Performance
User is in Audio Group.
Kernel - 3.8.0-32-lowlatency

real-time priority (-r) 95
max locked memory (kbytes, -l) unlimited

CPU:
Toshiba Satellite L850-13R with
Intel® Core™ i7-3610QM CPU @ 2.30GHz × 8
8GB ram DDR3

Computer is fast enough to do the job... Also I tested in with all usb ports.

These Jack settings gives me 5.33msec latency, which is almost ok for my needs and I can do the job, but it gives some amount of xruns that grows in time... Setting lower buffer size, I get crazy amount of xruns.
Since I am new in Linux, didn't do much after get KXStudio installed. Maybe I am missing something?

Thanks.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Scarlett 6i6 and low-latency setup for live performance

Post by CrocoDuck »

Hi! You can improve the performances with some configuration. Check this: http://wiki.linuxaudio.org/wiki/system_configuration . I think you can skip the part regarding the kernel.
I suggest to mount your filesystem with the noatime parameter if ext, set the swappiness to 10, edit limits.conf as suggested, set /etc/default/rtirq to give the higher priority to the usb soundcard, kill unwanted processes using the script under "Example script for needed disables".
User avatar
HardGroove
Established Member
Posts: 3
Joined: Fri Mar 14, 2014 12:10 pm

Re: Scarlett 6i6 and low-latency setup for live performance

Post by HardGroove »

Hi CrocoDuck,

I followed some of your advices:

I mounted my file system with the noatime parameter, that give very crazy improvement! I managed to set jack with 96k, 128, 2. In result I got 2.67msec latency!
I get much less interrupts, and basically it works OK, while using Pure Data.
I edited limits.conf, with their recommendation (real-time priority (-r) 95, changed to 90)
rtirq, was set to 90 already, same as in their example.
killing unwanted processes crashed my system, so I left it as it is.

however, I still get some xruns, depends what I do, sometimes it stays as 0, sometimes I get some. But was thinking, does real-time priority not taking to much CPU power if its set to 90 or more? I use Cadence to start jack, and default is set to 10. I didn’t noticed much difference...
Also if I change rtirq to 95 or more, could it improve my audio card work?
Anyway, noatime was very good suggestion, it did something, and now I can get Max from my audio interface.
If there is more suggestions, let me know!

Thanks.
User avatar
GMaq
Established Member
Posts: 2824
Joined: Fri Sep 25, 2009 1:42 pm
Has thanked: 530 times
Been thanked: 572 times

Re: Scarlett 6i6 and low-latency setup for live performance

Post by GMaq »

Hi,

My recent experience with a Presonus 1818VSL which is also a multi-input USB Audio device has shown without a doubt an RT Preempt Kernel can make a marked difference. It seems that PCI and FireWire are much less affected and many times will perform almost identically with lowlatency vs. RT especially if rtirq is present but by moving to an RT Kernel I have cut my latency settings and xruns easily in half with RT Preempt when using my VSL and this is on an (AV Linux) system that has all the usual speed tweaks already done . In some testing I have also noted a pronounced difference with a Scarlett 2i2 on various systems with RT as well.

Just something to consider...
User avatar
HardGroove
Established Member
Posts: 3
Joined: Fri Mar 14, 2014 12:10 pm

Re: Scarlett 6i6 and low-latency setup for live performance

Post by HardGroove »

Hi GMaq,

I was thinking about RT Kernel, but seems to be that there are no stable version of RT Kernel for KXStudio - Ubuntu 12.04.4 LTS, or at least I cannot find it. They moved to low-latency kernel for a reason.

Anyway, I been testing some parameters for a last time and found out one thing, that ALSA MIDI Bridge, if its set to auto-start on boot, cause lots of xruns... I noticed that once I switched it off from auto-start and reboot the system, it will work perfectly. Another interesting thing, If I start it manually after some time, it works fine w/o xruns. So in result, I did 2 hours life performance, with 128/96k/2 parameters with 0 Xruns!!! So with this parameters I should have 2.67msec latency (128/96k*2=0.002666667), At least what QJackCtl shows me :)

So for people that search for help, I do recommend mount your filesystem with the noatime parameter (if your hard drive is formatted to EXT format) as CrocoDuck suggested, switch off your Wifi and blue-tooth functions, and turn off ALSA MIDI Bridge from Auto-start, you can do that in Cadence application.

Thank you all for the suggestions and help!
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Scarlett 6i6 and low-latency setup for live performance

Post by CrocoDuck »

Glad you found a good setup :D . You may want to run the quickscan script to find some other thing to optimize: http://wiki.linuxaudio.org/wiki/system_ ... #quickscan . If you didn't find it on the site yet, here a little tutorial I wrote referring to Archbang linux (but you can try the tips with every distro): http://linuxmusicians.com/viewtopic.php?f=19&t=10837 .
william
Posts: 1
Joined: Fri Jul 11, 2014 10:52 pm

Re: Scarlett 6i6 and low-latency setup for live performance

Post by william »

Hello HardGroove,

I'm considering to buy the 6i6 but I see several stories on the internet about it not working with linux. You gave me the impression that it works just out of the box with a low latency-kernel. Do I understand you correct? Does the 6i6 fully function within linux, including assigning output to different channels?
I hope I can use the 6i6 with OpenSUSE 13.1 (with low latency kernel 3.11).

Thank you for you reply in advance,

Kind regards,
William
hellalive
Established Member
Posts: 91
Joined: Mon Nov 29, 2010 7:10 pm

Re: Scarlett 6i6 and low-latency setup for live performance

Post by hellalive »

Hi, I'm interested in this too. Did you try all input/output on the card (even the SPDIF ones)? Do you see everything in alsamixer?
He had a lot of nithing to say, we'll miss him
Post Reply