Page 1 of 2

Focusrite Scarlett 2i4

Posted: Fri Dec 13, 2013 7:39 am
by tomwgf
I have been recording music on linux since 2007 (when i finally got Dreamweaver and Photoshop working in wine and was able to bin MS for work). I used a m-audio Audiophile 24/96 PCI card. There was always a couple of days of swearing while i got audio set up after a new linux install. But it always worked eventually using the ice drivers. And pulse worked with it too, after a bit. Currently i use MINT.

But my (Pentium?) INtel Dual core pc is feeling its age now and anyway i wanted to get a laptop as a replacement, so i thought i would have a go at a USB Soundcard. I am only interested in 2 inputs, and i did not want a top loading one (partner, tidiness, what can i say ) so, i got it down to either an ART Dual Tube Pre or the Scarlett 2i4. Both have a monitor mix (input/playback) that for some reason i feel is important otherwise the 2i2 would have been fine - i am not interested in midi.

The ART has inserts which i really need but there was mention of poor sound quality so i went for the 2i4. Even though i will need something else to provide inserts (another 2i2 or an ART??, daft i know but..).

SO, apologies for the long windedness of this - i bought the 2i4 and plugged it in. Got depressed . didn't turn it on for 2 days. But this is linux so i expected this.

It worked. Sound came out. all sounds good. But there is a lot of clicking/popping going on with some additional light flashing going on on the inputs (?!?). The amount seems to vary.
  • Boot up - lots of clicking pops. But i can live with this
    Turn on - if i turn on the Scarlett after boot up - there are no popsat all (just tried that)
    Movie player - movie player has been behaving oddly for a long time (the buttons look like warning signs and sometimes just does not play. Anyway, there are pops. And when i pause/play
    Ardour - the first time it started up at a normal speed with lots of pops, the second time it took a long time to start - with lots of pops - in fact tried again just now 64 pops - very stereo, bouncing from one side to the other sometimes. 16 pops on first play, none on stop then just 2 on play after that
    Acid 2 in Wine - no pops at all on start up (and there used to be with audiophile card, but 2 pops on play, one on pause/stop
So i hope to write more about this.

But - what is with the pops? I read somewhere it may be todo with latency? is there anything i can do about this. I am considering a clean install from 14 to Mint 16.

Re: Focusrite Scarlett 2i4

Posted: Fri Dec 13, 2013 10:04 am
by tomwgf
I recorded for the first time last night. Using Audacity. It pops at the start of record and at the end - but the pops are not recorded thankfully.
It was a stereo recording - by accident really, it was only mono in but audacity recorded as one side of a stereo recording, so that may count as stereo. All sounded ok, no pops or crackles even when it peaked. I do like the light round the Scarlett input button: green, orange, red (for too much input).

The recoding was 44.1 and 32bit according to audacity. And as i was just hitting the beat against an Audacity made click track i could not hear any latency as i played (thanks to the Monitor mix i suppose) but also on playback it all seemed pretty tight to the beat.

On the down side. i just selected all the tracks (mp3s) of album Howlin by Jagwar Ma to play in movie player and it crashed movie player after the first song had finished. Why is that? My old sound card had no problem with such a basic operation.

YOUTUBE: been listening to Wooden Shjips on youtube - no clicks at all. Strangely.

Re: Focusrite Scarlett 2i4

Posted: Sat Dec 14, 2013 1:00 pm
by tomwgf
TIME TO TRY TO SORT OUT THE POPPING:

so, in a terminal:
cat /proc/asound/cards
gives me:
1 [USB ]: USB-Audio - Scarlett 2i4 USB
Focusrite Scarlett 2i4 USB at usb-0000:00:1a.7-5, high speed

I think that is a good sign - it sees the 2i4. I don't know if high speed means USB2.

next:
lsusb
gives me:
Bus 001 Device 002: ID 1235:800a Novation EMS
Bus 005 Device 002: ID 046d:c517 Logitech, Inc. LX710 Cordless Desktop Laser
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Though my motherboard fact sheet swears blind its all usb 2 it looks like only Bus 1 and 2 are USB 2.

Novation EMS is how Linux sees a Focusrite Scarlett 2i4 so hopefully Bus 001 Device 002 means the 2i4 is on USB2.

I cannot find a /etc/modules.conf but i do have (i am using Linux Mint 14) /etc/modules.conf/alsa-base.conf
so, in a terminal:
sudo gedit alsa-base.conf
gets me this:
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7

# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-ioctl32 ; /sbin/modprobe --quiet --use-blacklist snd-seq ; }
#
# Workaround at bug #499695 (reverted in Ubuntu see LP #319505)
install snd-pcm /sbin/modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-pcm-oss ; : ; }
install snd-mixer /sbin/modprobe --ignore-install snd-mixer $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-mixer-oss ; : ; }
install snd-seq /sbin/modprobe --ignore-install snd-seq $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; /sbin/modprobe --quiet --use-blacklist snd-seq-oss ; : ; }
#
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; : ; }
# Cause optional modules to be loaded above sound card driver modules
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-emu10k1-synth ; }
install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq ; }

# Load saa7134-alsa instead of saa7134 (which gets dragged in by it anyway)
install saa7134 /sbin/modprobe --ignore-install saa7134 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist saa7134-alsa ; : ; }
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options saa7134-alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
options snd-usb-audio index=-2
options snd-usb-caiaq index=-2
options snd-usb-ua101 index=-2
options snd-usb-us122l index=-2
options snd-usb-usx2y index=-2
# Ubuntu #62691, enable MPU for snd-cmipci
options snd-cmipci mpu_port=0x330 fm_port=0x388
# Keep snd-pcsp from being loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2

Now it strikes me that
1. i have no idea what # autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
etc.. is on about

2. that
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2
may not be a good thing
and its there twice.

So i am going to remove one of them and change the other to options snd-usb-audio index=-1
following these instructions: http://crunchbang.org/forums/viewtopic.php?id=9852

i am then going to restart, see how that goes. then i will add:
options snd-usb-audio nrpacks=1
following these instructions: https://wiki.archlinux.org/index.php/Ad ... SB_devices (right at the bottom under Crackling sound with USB devices)

and restart.
Sadly that was a bit disappointing. After each restart Audacity still pops 60 or so times before starting, and all the other pops still happen. Further searches are needed - unless anyone has any ideas??

Re: Focusrite Scarlett 2i4

Posted: Sat Dec 14, 2013 9:28 pm
by Pablo
Have you tried with other kernels? Also, take a look at /proc/interrupts. Maybe, the USB bus is sharing IRQ with other devices that get on its way. Try in other USB sockets.

Re: Focusrite Scarlett 2i4

Posted: Sat Dec 14, 2013 9:56 pm
by tomwgf
hi pablo

thanks for replying.

this is what my interrupts say:
CPU0 CPU1
0: 43 0 IO-APIC-edge timer
1: 994 970 IO-APIC-edge i8042
8: 0 1 IO-APIC-edge rtc0
9: 0 0 IO-APIC-fasteoi acpi
12: 2 2 IO-APIC-edge i8042
16: 58944 65113 IO-APIC-fasteoi uhci_hcd:usb3, pata_marvell, nouveau
18: 7328046 7321806 IO-APIC-fasteoi ehci_hcd:usb1, uhci_hcd:usb5, uhci_hcd:usb8
19: 0 0 IO-APIC-fasteoi uhci_hcd:usb7
21: 0 0 IO-APIC-fasteoi uhci_hcd:usb4
22: 35993 36312 IO-APIC-fasteoi ata_piix, ata_piix
23: 5740 5783 IO-APIC-fasteoi ehci_hcd:usb2, uhci_hcd:usb6
44: 111792 111525 PCI-MSI-edge eth0
NMI: 3172 3067 Non-maskable interrupts
LOC: 3471942 3047214 Local timer interrupts
SPU: 0 0 Spurious interrupts
PMI: 3172 3067 Performance monitoring interrupts
IWI: 0 0 IRQ work interrupts
RTR: 0 0 APIC ICR read retries
RES: 617499 204035 Rescheduling interrupts
CAL: 752 970 Function call interrupts
TLB: 10151 10167 TLB shootdowns
TRM: 0 0 Thermal event interrupts
THR: 0 0 Threshold APIC interrupts
MCE: 0 0 Machine check exceptions
MCP: 57 57 Machine check polls
ERR: 0
MIS: 0

I have just tried a different USB - still pops sadly.
I am not quite ready to try a new Kernal yet - though some looks interesting.

Tried Jack this afternoon - that stopped the popping but any time i pressed play in Audacity or Movie player the program would stop ( not crash just stick?) with no audio.

Re: Focusrite Scarlett 2i4

Posted: Sun Dec 15, 2013 9:05 am
by Pablo
Tried Jack this afternoon - that stopped the popping but any time i pressed play in Audacity or Movie player the program would stop ( not crash just stick?) with no audio.
Did you tell Audacity to use jack for audio I/O ? It is in the preferences. About Movie player, I am not sure, but I doubt it has jack support by default. You could try mplayer which has very good jack support and you can run it in a terminal, so it is good for testing purposes.

I suggest this test. Open two terminal windows. In one of them,
Kill pulseaudio:

Code: Select all

echo autospawn = no >> ~/.pulse/client.conf && pulseaudio -k
If the above doesn't work with a "no such file or directory error", try instead:

Code: Select all

echo autospawn = no >> ~/.config/pulse/client.conf && pulseaudio -k
Now, in the same terminal, start jack with the default parameters

Code: Select all

jackd -dalsa -dhw:USB

In the other terminal, play an audio file

Code: Select all

mplayer -ao jack audiofile.wav
Take notes, stop mplayer, stop jack (Control-C). Now, start pulseaudio in the first terminal

Code: Select all

echo autospawn = yes >> ~/.pulse/client.conf && pulseaudio -D
And play the same file in the other terminal with pulseaudio instead of jack

Code: Select all

mplayer -ao pulse audiofile.wav
Take notes. Now see if there are jack-pulse interaction problems. Start jack again (without killing pulseaudio this time):

Code: Select all

jackd -dalsa -dhw:USB

And in the other terminal, try mplayer with jack again.

Code: Select all

mplayer -ao jack audiofile.wav

Re: Focusrite Scarlett 2i4

Posted: Sun Dec 15, 2013 10:11 am
by tomwgf
Hi Pablo

i did this, and though Jack produces errors both times:
Cannot create thread 1 Operation not permitted
Cannot create thread 1 Operation not permitted
Cannot create thread 1 Operation not permitted
JACK server starting in realtime mode with priority 10
Cannot lock down 82274202 byte memory area (Cannot allocate memory)
audio_reservation_init
Acquire audio card Audio0
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
Cannot use real-time scheduling (RR/10)(1: Operation not permitted)
AcquireSelfRealTime error

Mplayer played music successfully all 3 times: Jack, Pulse and Pulse with Jack

Re: Focusrite Scarlett 2i4

Posted: Sun Dec 15, 2013 10:25 pm
by Pablo
Hi

You (the user which runs jackd, more precisely) need realtime and memlock privileges, which only root has got by default in standard distros.

How to do this depends on the distro, but for MInt I guess it should be:

Code: Select all

 sudo dpkg-reconfigure -p high jackd2
And make sure you are in the audio group

Code: Select all

sudo usermod -a -G audio <username>
You need to reboot for this change to take effect.

I am not saying this is the cause of all your problems with the Scarlett but this is a must, otherwise jack is not working as it should.

Re: Focusrite Scarlett 2i4

Posted: Mon Dec 16, 2013 9:20 pm
by tomwgf
HI Pablo
i have done this and restarted the computer.
then started qjackctl and started Audacity - but still get the same frozen transport.
should i be starting jack2 instead?
tom

Re: Focusrite Scarlett 2i4

Posted: Tue Dec 17, 2013 10:10 am
by Permababy
Have you tried Ubuntu Studio? You can try the live boot with a USB stick. The real-time kernel of Ubuntu Studio might make a difference, it's worth a try.

Re: Focusrite Scarlett 2i4

Posted: Tue Dec 17, 2013 10:35 am
by tomwgf
HI Pablo
Funnily enough i used to a few years ago. But then i stopped - can't remember why. I do like the clean desktop you get with Mint but presumably Ubuntu Studio has a fairly light desktop.
Thanks for all your help
tom

Re: Focusrite Scarlett 2i4

Posted: Wed Dec 18, 2013 12:50 am
by nreese
My Focusrite Scarlett works fine with Ubuntu Studio - the new realtime kernel has made a big difference - no more JACK xruns!

Re: Focusrite Scarlett 2i4

Posted: Wed Jan 08, 2014 3:14 am
by kenske
Hi tomwgf, did you ever figure this out? I just got my 2i4 as well, and though this issue isn't a deal breaker, it is starting to get annoying.

Thanks!

Re: Focusrite Scarlett 2i4

Posted: Wed Jan 08, 2014 9:15 am
by tomwgf
hi kenske
sorry to hear you have the same problem - though relieved its not just me.

the short answer is no, i haven't sorted it out. i bought the Art USB Dual Tube Pre (also usb2) and that worked without problem. But the reason why i didn't buy the Art at the beginning is that it has tiny knobs front and back and a mini headphone socket (though it does have effects sends and a built in compressor).

I still have the focusrite. But i am hoping this year to buy a new pc and then i will try ubuntu studio and see if the realtime kernel is the problem, basically, see if it works as it should.

and then i will decide which to keep (both?? use the art just as a tube preamp / dI - an expensive solution).

If you can, i would suggest trying ubuntustudio??

Re: Focusrite Scarlett 2i4

Posted: Fri Feb 14, 2014 5:03 pm
by Aistis
I had pops, clicks, flashing, jack not starting and an array of other problems. Half of them were solved by upgrading to a newer version of kernel and the last ones dissapeared when i played with the alsa configuration file. As i understand it was giving the priority to the onboard sound card (which i switched off) and that made the system restart the audio card every time i started a new program. After i tried this http://crunchbang.org/forums/viewtopic.php?id=9852 there are no more pops and cracks (well, actually there are, but only when i start the computer, or shut it down).