Results 1 to 10 of 26

Thread: Unable to achieve a low latency with Focusrite Scarlett 2i2

Hybrid View

  1. #1
    Join Date
    Jan 2013
    Beans
    12

    Unable to achieve a low latency with Focusrite Scarlett 2i2

    Hi,

    I am running Ubuntu Studio 12.04 x64, 3.2.0-23-lowlatency on a Dell i3 M350 (2.27GHz) laptop with 4GB RAM. I typically run with networking disabled.

    I recently bought a Focusrite Scarlett 2i2 to use with Ardour mainly, for some very light multi-tracking. Through trial and error I eventually managed to find JACK settings that allowed me to record without xruns; Frames:1024, Periods:3, Sample Rate: 44100. If I reduce either the frames or periods I do get xruns.

    The estimated latency according to qjackctl is 64msec. This number goes down if I *increase* the sample rate - something I found counter-intuitive at first (although I later found that the latency is calculated as 'Frames * Periods / Sample Rate') - however increasing the sample rate also causes xruns to appear.

    I'd like to try and achieve a lower latency when monitoring through software, as I believe the hardware I'm running is capable of something better, and am finding a noticeable delay when multi-tracking (the audio device does support hardware monitoring, however I find this a bit too quiet, even when the headphone knob is cranked).

    I've attached a screenshot (qjackctl.png) - am I missing anything? It's worth pointing out that Ardour reports a slightly lower latency than qjackctl, however it still feels unusable in its current state.

    Any advice gratefully received.

    ehdee
    Attached Images Attached Images

  2. #2

    Re: Unable to achieve a low latency with Focusrite Scarlett 2i2

    Hi. In my laptop (a Compaq Presario CQ61-304SL) I managed to get 5.33ms of latency with both internal (Intel HDA) end external usb (BehringerUCA202) devices. Any time I setup a new machine, just after the installation, I run the Quickscan script you can find here: http://wiki.linuxmusicians.com/doku...._configuration . Then I proceed to make all the adjustments I need (basically swappiness, making timers readeble by audio group, noatime parameter for filesystems). The lowlatency kernel, default on ubuntu studio, is enought to get good performances and currently I can't get the realtime one working... so I don't suggest to install a realtime kernel. I experienced on my laptop a lot of xruns because IRQ settings. I found a solution disabling all the services I don't need before to make music (every time I have to make music I shut down those services with a script). You should get enough info in the page I linked. A last, have a look at your audio interface manual, sometimes it happen that the setting of sample rate & buffer size has to be matched with some right ones. Here the thread where good guys helped me finding the way... maybe it could help you: http://ubuntuforums.org/showthread.php?t=1976254 .

  3. #3
    Join Date
    Jan 2013
    Beans
    12

    Re: Unable to achieve a low latency with Focusrite Scarlett 2i2

    Hi CrocoDuck,

    Thanks for the reply; just checking in with how I've got on so far.

    After running the Quickscan script I was able to make some tweaks and create an sh file that set some of the other tweaks to the point that I now only get "not good"s for:

    -Kernel with Real-Time Preemption... not found
    -Checking kernel support for tickless timer... not found

    Would both of these be due to be not running the realtime kernel?

    In the other checks section I'm getting a warning about there not being a tmpfs partition mounted, however after further forum searching it would appear that this could be ignored.

    The script also suggests that if I feed it my soundcard IRQ, it will be able to do further checks. I *think* I've done this correctly (using advice from another forum from the guy who wrote the script), but the script gives no further info.

    As an aside, getting the IRQ for the device was tricky. The advice I found was to find out the which bus the device was on (with 'lsusb') and then match this up to /proc/interrupts. The only commonality between the two was the I knew I was looking for Bus 2 and there was an entry in the file that had "ehci_hcd:usb2" in it. Not very conclusive.

    I've not been able to find what the recommended settings are for the audio device. It seems to be touted as being 24bit / 96kHz - I'm not interested in this kind of fidelity, however tried running at 96kHz (with the other changes from above), and found xruns were occurring.

    I reduced the sample rate back to 44.1 and played with the periods / frames however noticed no improvements from before.

    I'm now going to look into your advice regarding IRQ settings. Does it look like I've made any mistakes with any of the above before I do so? If I had a concrete way of determining the IRQ of the device, I'd be able to move forward with more confidence however I've not seen one in any other forums.

    thanks again for the help.

  4. #4

    Re: Unable to achieve a low latency with Focusrite Scarlett 2i2

    Code:
    -Kernel with Real-Time Preemption... not found
    Exactly: It means that you don't have a realtime kernel. He said it is not good... but with a lowlatency one is not so bad (In my opinion, is better to have a lowlatency one those days, expecially on a laptop).

    Code:
    -Checking kernel support for tickless timer... not found
    To enable the tickless function I think you have to recompile the kernel with appropriate options (and maybe it is possible only for realtime kernels)... I never done it and I think is not necessary for a (very) acceptable setup.

    I never fed the script with my soundcard's IRQ. Basically because my laptop's BIOS doesn't let me to modify IRQs, so change things could be too much tricky.

    I think that your setup should be good, all the "not good" and "Warning" you see are the same I left "unsolved" on my machines, and they works very good.

    Have a look at your BIOS settings if you think you have to handle IRQs (remember to carefully change the BIOS settings, make sure to be able to restore the previous situation). In my case the solution was to kill all the other stuff that caused the interrupt to sound related processes, without handle IRQs settings (as i couldn't do it). Speaking about BIOS: maybe there is something you can disable in order to improve performances, as I made with my new desktop computer (in my case I had to disable my Ethernet controllers, not painful as I use wireless network, as the system was usually go mad searching for wired connections causing xruns).

    All the ways I have to probe IRQs are the one I used in the thread I linked.

    Looks so odd you have to deal with so much xruns with your powerful pc... Make sure that other things that use the USB bus are not interfering (webcams and/or other stuff could be disabled in order to test). Could you repost your computer full name model?

  5. #5
    Join Date
    Jan 2013
    Beans
    12

    Re: Unable to achieve a low latency with Focusrite Scarlett 2i2

    Hi,

    The laptop is a Dell Inspiron N5010 (UK FCG04). I've had a look in the BIOS and there's an option to disable the NIC (which actually ends up disabled wired *and* wireless), but not much else in terms of hardware.

    I've modified the disable script slightly from the link you posted to look as follows:

    Code:
    #!/bin/sh
    
    modprobe -r ppdev 
    modprobe -r lp 
    modprobe -r uvcvideo 
    modprobe -r videodev 
    modprobe -r ath9k 
    modprobe -r r8169 
    modprobe -r btusb 
    
    stop bluetooth
    stop cups
    stop networking
    stop network-manager
    
    killall modem-manager 
    killall wpa_supplicant
    In other words I'm using the 'stop' command to disable the various services, which appears to be necessary on the version of Studio that I have installed.

    I'm currently toying over installing 12.10 x64 with the realtime kernel as a last resort, although I'd really rather not at this stage!

    I'm noticing that - much like when you were having the problem - my xruns are appearing at the same point each time ~2min. If I rerecord over a track with xruns from the beginning, new xruns will occur at the same points!

    I'm not sure if IRQs are an issue with my setup; having reread the links I can at least determine that there are no IRQ conflicts. Or at the very least /proc/interrupts is not showing >1 device on the same IRQ.

    Thanks again for your help.

  6. #6

    Re: Unable to achieve a low latency with Focusrite Scarlett 2i2

    Can you repost the output of

    Code:
    cat /proc/asound/cards
    ?

  7. #7

    Re: Unable to achieve a low latency with Focusrite Scarlett 2i2

    As the xruns seems regular (refer to the messages window in qjacktl to view accurate infos and statistics) everything smells like "something causing regular interrupts". I don't have a clear idea on how to understand what could be this "something", except looking at /proc/interrupts (in order to understand what has the same IRQ of your soundcard) and htop to have a look at processes. Have you tried by using your Scarlett into some other USB port? Commonly there are multiple hubs/controller/bus inside the computer, so what happens using a port may not happen in another port. On my desktop computer I have some usb port that are unable to make my external usb drive work properly, especially if I use a longer cable (the hard drive turns on, but the system can't mount it), so the cable could be a protagonist... but as you said... desperation speaking... especially if the xruns are regular...

    Yes, investigating the qjackctl's messages can bring us to understand something.

    So sorry but my english is bad (I'm not a native speaker, as you probably guessed) and I want to make sure about a thing... So I must make you a trivial question : have you installed ubuntu studio on your laptop or are you testing using an USB bootable drive?

    P.S. : lsusb -v can bring us some more info on what is going on USB hardware inside the machine. Run it with your Scarlett plugged. Have another look at our favourite page, http://wiki.linuxmusicians.com/doku...._configuration , paragraph "Solve IRQ Conflict by Unbinding devices". I think that it contains some good hint that can bring us to understand what interferes with the soundcard.
    Last edited by CrocoDuck; January 9th, 2013 at 11:54 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •