Do I need any driver for Scarlett 2i2 :: How to improve performance

Still new to all of this? Feel free to post in any of the subforums on this site, but in this subforum newbie questions are especially encouraged!

Moderators: MattKingUSA, khz

Post Reply
FloeHetling
Established Member
Posts: 4
Joined: Sun May 10, 2020 2:59 pm
Location: Tula, Russian Federation
Contact:

Do I need any driver for Scarlett 2i2 :: How to improve performance

Post by FloeHetling »

Greetings!
Googling for various requests on topic gave me no clue if I'm doing everything right, so, please, help me understanding my current state :?

Current state
For now I have fully working Ubuntu Studio 20 (please check full hardware info in my signature)
I've accomplished full automation of startup, my goal was to start a station by powering it on and be able to play live in 2-5 minutes with no access to the keyboard, mouse and monitor. So now I can.

A Question
Can I improve my station further?
For example, I am running my USB audio interface (Scarlett 2i2) with buffer size of 128. I want to decrease that value to minimise the latency but I am afraid that will increase XRuns. Carla says I have 13% of DSP load in idle state.
I am not sure I am using my Scarlett 2i2 at its full potential.
I mean, I did nothing with it, I just plugged it in. Maybe I should do some adjustments?

JACK
In my qJackCtl on Settings tab there's ALSA selected with Interface set as (default), Sample rate set as 44100, Frames/Period is 1024 and Periods/Buffer is 3. Carla shows it as system device. Also, latency is 69.7 ms. I can live this way but I will be happy to make it smaller and increase overall stability.


Steps I've done so far
1) I followed this guide. Some adjustments were in place as Ubuntu Studio already does a lot of stuff. My first attempt was a LUbuntu with lowlatency kernel - and it was hell. Distros are better when you're noob.
2) I learned about IRQs and disabled all unnecessary hardware from BIOS including internal audio interface (HDAudio), internal LAN interface (I am using WAN card so I don't need both), HPET was been turned off - so I enabled it.
3) noatime was a miracle fix. My system speeded up drastically.
4) I can't mess with CPU Governor. I don't know why. If I change it from Ubuntu Studio 20 GUI it resets to 'on demand' when I reopen the settings window. Also, realTimeConfigQuickScan suggests things I can't do - neither cpupower nor cpufreq-set are persist in my system.
Atom 330 supports no speedstep and always runs at its maximum, I believe

Additional info
Here's full output of that script:

Code: Select all

== GUI-enabled checks ==
Checking if you are root... no - good
Checking filesystem 'noatime' parameter... 5.4.0 kernel - good
(relatime is default since 2.6.30)
cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: No such file or directory
cat: /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor: No such file or directory
cat: /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor: No such file or directory
cat: /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor: No such file or directory
Checking CPU Governors... CPU 0: '' CPU 1: '' CPU 2: '' CPU 3: ''  - not good
Set CPU Governors to 'performance' with 'cpupower frequency-set -g performance' or 'cpufreq-set -c <cpunr> -g performance' (Debian/Ubuntu)
See also: http://linuxmusicians.com/viewtopic.php?f=27&t=844
Checking swappiness... 10 - good
Checking for resource-intensive background processes... none found - good
Checking checking sysctl inotify max_user_watches... < 524288 - not good
increase max_user_watches by adding 'fs.inotify.max_user_watches = 524288' to /etc/sysctl.conf and rebooting
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#sysctlconf
Checking access to the high precision event timer... readable - good
Checking access to the real-time clock... readable - good
Checking whether you're in the 'audio' group... yes - good
Checking for multiple 'audio' groups... no - good
Checking the ability to prioritize processes with chrt... yes - good
Checking kernel support for high resolution timers... found - good
Kernel with Real-Time Preemption... not found - not good
Kernel without 'threadirqs' parameter or real-time capabilities found
For more information, see https://wiki.linuxaudio.org/wiki/system_configuration#do_i_really_need_a_real-time_kernel
Checking if kernel system timer is high-resolution... found - good
Checking kernel support for tickless timer... found - good
== Other checks ==
Checking filesystem types... ok.
Checking for devices at IRQ 18... did not find multiple. ok.
I will be happy for any information. Thank you in advance!
My workstation specs:
Intel Atom CPU D425 @ 1.80GHz 4096m RAM
Ubuntu Studio 20.04 LTS (GNU/Linux 5.4.0-29-lowlatency x86_64)
Focusrite Scarlett 2i2 1st gen
Novation Launch Control 1st gen
M-Audio KeyRig 49
CASIO CTK-481 via Roland UM-ONE interface
User avatar
bluebell
Established Member
Posts: 1927
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 113 times
Been thanked: 122 times

Re: Do I need any driver for Scarlett 2i2 :: How to improve performance

Post by bluebell »

Try a sample rate of 48000 instead of 44100.

Simply try a buffer size of 96 and 64.

It depends on the application software how much realtime CPU it uses, how big your buffer must be and if it must be a power of 2.

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

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

Re: Do I need any driver for Scarlett 2i2 :: How to improve performance

Post by GMaq »

Hi,

Looks like your CPU frequency isn't set to 'Performance'.. On Debian and Ubuntu systems used for audio work you should have 'cpufrequtils' installed and have your CPU set for performance.. This is controlled in the cpufrequtils file in /etc/default/cpufrequtils

Here's mine as an example:
ENABLE="true"
GOVERNOR="performance"
MAX_SPEED="0"
MIN_SPEED="0"
Also you should have your "periods/buffer" set to "3" in your JACK Settings for USB Audio devices..

To be honest if you can pull off 128 frames per period reliably with a USB Audio device and a 1.6Ghz atom CPU you're doing VERY well..
Post Reply