SOLVED: Linux - crackling - USB interface needed?

Configure and optimize you computer for Audio.
Post Reply New Topic
RELATED
PRODUCTS

Post

ISSUE: I am starting the plunge into LIVE virtual synths thru my Lenovo laptop using Ubuntu Studio 13.10. I have some latency issues but the biggest problem is crackling -- whether i run ZynAddSubFX or FOO-YC20 or QSynth, using straight ALSA or JACK.

EQUIPMENT: I have two internal cards, HD Audio-Generic and HDA ATI SB. Of course, i choose the soundblaster. I'm using a Kurzweil PC2 hooked to the laptop (Lenovo S-205) thru an old Yamaha UX-16 USB-to-MIDI interface. The laptop programs augment the sounds on the Kurzweil.

SOLUTION?? I am gathering that the problem is that the SB card is just to wimpy -- plus my USB hookup may cause some of the latency issues...so do i need something like a Tascam US-122 or US-122Mk II? I note these are touted as recording devices -- again, my concern is all performance use. I don't have a lot of money to throw at this, but i see that these are available used for a reasonable price -- other equipment suggestions welcome!!! (IF hardware is the cause of my problems.)

THANK YOU for your thoughts!
Last edited by Subito Piano on Mon Mar 10, 2014 2:25 am, edited 1 time in total.
"God is love" I John 4:8

Post

Hi, look at the text file /etc/security/limits.conf

It should contain these lines near or at the end:

@audio - rtprio 99
@audio - nice -10
@audio - memlock unlimited

(use the character spacing of your existing file,
when adding or editing these lines to it.)

Now your rtprio setting of 99 means you can maximize
the priority setting in qjackctl, to 89 (eighty nine,
not 99)

Your user will have to be a member of the audio group,
for @audio settings to be relevant.

Install htop to live-monitor what is running in your audio sessions.
It is good luck to have all network, webcam, power management
and cpu scaling etc turned off, as these can bring crackles.
(make sure you still run your fans when the management is off)
Also, check that your sample rates are uniform in all apps in
your session, don't want extra math being performed.

An RT or low-latency kernel should be installed and used,
and the RT setting ticked in qjackctl. The qjackctl settings for
'Periods Buffer', should NOT be 3, unless you have a
usb soundcard. Use 4, or 2. Try complex zynaddsubfx patches,
made using 3 or 4 parts, to test.

Have you tried the various linux audio/video distros?
You can download the .iso images, burn to cd/dvd,
and boot them into ram, using your computer 'early boot' option
atstartup.

avlinux a solid debian based system, with excellent support.
kxstudio -repostories can be added to debian/ubuntu systems,
with lots of new session management apps to try.
artistX -jumbo colection, ubuntu based, live dvd is big download
pclinuxOS 'e17 audio' iso by Only Human -fits on a CD,
beauty on a stable OS.
Studio 1337 -this one is a commercial release, sold on usbstick, preconfigured with RT kernel, wine (for windows vsts) and runs in ram,
for great speed and low low latencies.

Most mainstream distros can do good audio these days,
configuring a supported soundcard and killing off unwanted
startup apps, makes a huge difference.
Cheers
Last edited by glokraw on Mon Feb 03, 2014 11:17 am, edited 3 times in total.

Post

About the difference between a soundcard for recording
Vs performance, you can't separate them very far, you want
stability, i/o options, and quality ad/da convertors, and those
don't come sold separately, this side of being rich.

http://wiki.linuxaudio.org/wiki/hardware_support

has info on audio devices that are known to work in linux,
and perhaps some caveats/solutions.
A pci soundcard in a desktop, will fare better than similar
spec usb cards, and notbe as prone to theft and breakage,
if you put some thought into the woodwork and hauling
of a performance setup.
Cheers

Post

THANK YOU BOTH. Will work on this with the info supplied and post results -- I may not be able to work on this until the weekend but I'll let you know. Blessings...!
"God is love" I John 4:8

Post

SUCCESS!!!! Image

First -- i think i forgot to mention i'm using Ubuntu Studio. I tried AV/Linux and it just wouldn't work for me...and Puppy Studio 4, but again, some issues. Ubuntu may be bloated and slow, but it seems to "just work."

I edited the /etc/security/limits.conf file as suggested, plus the other measures (used indicator-cpufrequency to get highest performance), rebooted, still no go....

...then messed around with Jack's sample rates and priority and frames/period -- still no go, even booting with the "noacpi" option. Mind you, it crackles with me just using the computer (typing) keyboard to play the notes -- not even with a usb connection. :(

Then i set ZASFX's buffer size to 128 and the oscillator size to 256 -- with Jack set at 64 frames/period -- and IT WORKS! It doesn't care if i use a complex sound and hold down all the keys i can get -- it just works. :)

So i'm theorizing that the low buffer size did the trick, at least for ZASFX -- BUT EVERYTHING works perfectly -- Foo-YC20, QSynth, MonoBristol, and ZASF -- and they are ALL open at once, so your tips seem to have been what was needed, plus the buffer setting for Zyn. I'll have to play around with the settings later to see what affects what and which ones i can return to the default settings...but since it's going on 3AM, it'll wait. Hopefully the midi-usb interface will turn out to be a non-issue.

THANK YOU SO MUCH!! :clap:
"God is love" I John 4:8

Post

Glad you're making music! Another thing to watch for,
is that switching around system usb devices can 're-number' them.
so a previous choice in qjackctl that may have been hw:0,
later appears as hw:1,0 or some such.

commands

aplay -l
arecord -l

will list your souncard choices within brackets, like

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ICH [Intel ICH], device 0: Intel ICH [Intel ICH]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: ICH [Intel ICH], device 2: Intel ICH - IEC958 [Intel ICH - IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: M2496 [M Audio Audiophile 24/96], device 0: ICE1712 multi [ICE1712 multi]
Subdevices: 0/1
Subdevice #0: subdevice #0

You can use the bracketed brand names in qjackctl,
click the > widgets by Input Device/Output Device,
and choose, or type in, these names. This way, you can
easily switch input devices, for example, from a 5 pin midi keyboard,
to a usb guitar device.
Cheers

Post

Follow-up: I had several issues after my last post, including losing all sound completely (eventually i found i could simply remove ~/.config/pulse and reboot). Anyway, the latency/distortion tradeoff seems to be centered around Patchage and PulseAudio. Distortion stopped when i set Patchage to 1024 FPS (!!!) -- but latency issues crept in, as you might imagine. Small, but not acceptable for many sounds. I don't know of a substitute for Patchage to connect the softsynths to audio output BUT i did find out how to temporarily disable Pulse -- that allowed me to set Patchage at 512 FPS for really thick sounds (pads for which latency is not a major issue) and even 256 FPS for other sounds where latency becomes a problem (e.g., the MonoBristol Vox Continental emulator). So -- i'm getting there. Too bad there's no universal manual Image but each person's setup is different...
"God is love" I John 4:8

Post

the qjackctl gui for jackd/softsynths/hardware connections also has
the important audio settings in one place to configure.
With your limits.conf priority set at 99, you can set system priority for jackd
at 89, which sets it above system tasks that might mess
with your sound processing. I've had it that way for
(dinosaur alert) almost a decade. I'm not sure if running patchage
while qjackctl is running, is of any benefit, unless you strongly prefer
it's connection gui. Here are qjackctl videos, remove the #

#http://www.youtube.com/watch?v=2cfb-CFgFGU

#http://www.youtube.com/watch?v=n5BzyN95NfQ

#http://www.youtube.com/watch?v=tqzyjDeEAw4

I don't know what kernel is default in ubuntu studio,
this article may shed light on updating procedures.

https://help.ubuntu.com/community/Ubunt ... m%20Ubuntu

It mentions this

sudo apt-get install linux-lowlatency linux-lowlatency-pae

to insure a fast audio friendly kernel is available as a boot option,
which will yield the best audio results, in most setups.
Cheers

Post

It's the low latency kernel in Ubuntu Studio...and i probably mentioned that i know Ubuntu i sluggish but other distros work not... :-/

I only use Patchage for connecting audio out to system playback. If there's a lighter GUI to do that (or easy commandline program), i'm all ears!
"God is love" I John 4:8

Post

PS -- Yes, i followed your instructions for Jackd before most anything else. (thanks again)
"God is love" I John 4:8

Post

In qjackctl gui, click connect,'System' appears in the connections tab,
on the right and left panels, double click each, to show their stereo l/r
and any multiple i/o tracks provided by your audio hardware, labeled 'capture'
on the left, and 'playback' on the right, so you
don't need patchage running to create those connections.

The Midi tab is for 'jack midi' instead of alsa midi. the command
a2jmidid can be installed, and after jackd/qjackctl is running, run with

a2jmidid -j default

A new midi port will then appear. Yoshimi synth, and others, will use this,
instead of the midi ports shown in the Alsa tab. If your alsa tab shows
both midi and midi-thru ports, you may have to connect them, midi to midi-thru,
to send midi data to the jack-midi devices.
Cheers

Post

Very strange -- when i use Qjackctl to control everything, i can tweak the FPS but even at 1024 it distorts. Once i start Patchage i can bring the FPS down to 256 w/o problems.

Also -- I've been running a2jmidid from the "run" box -- but what are the "-j" and "default" options in terminal?
"God is love" I John 4:8

Post

It may be time to look at promoting audio above all else,
when in a session. In the bios, Network, off, power management off,
screen management off, webcam off, cpu's set to consume all cycles.

htop lets you kill processes, if you find a startup hog running,
a quick google will confirm if other musicians have been
mud wrestling with it.

You can look at textfile jackd.rc, that qjackctl saves, and even use it as a command to start the sound server, in a terminal, insert your file after /usr/bin

/usr/bin/jackd -P89 -dalsa -r44100 -p256 -n2 -D -Chw:M2496 -Phw:M2496

(yours will read slightly different, only use n3 with usb devices)
Then you can start patchage, without qjackctl, if it's working better.

http://www.linuxdsp.co.uk/archive/archived_lv2_plugins/

Scroll down at this linuxdsp link, for jp1, another patchbay, that allows saving jackd connections. Not actively developed, but still works fine, just unzip,
and drag to /usr/bin, or other folder in your path, and start
with terminal command:

jp1_i386

or the architecture version for 586/686, as you choose from the archive.

Sometimes samplerate settings get mismatched by evil software,
after synaptic is used to update some items. Just noticed this
again today. Only the vigilant will survive :x :evil: :x :wink:

Post

Very good -- thank you! I created a second user "music" for my live softsynth needs -- no network, kills pulseaudio on startup, etc. At this point, it seems to be simply a matter of tweaking FPS, buffer size, oscillator rates and all that stuff in ZASFX and the other programs -- and keeping CPU usage down, of course. I think I'm well on my way, so I'll marked this solved and sign off this thread. THANK YOU!! :tu:
"God is love" I John 4:8

Post Reply

Return to “Computer Setup and System Configuration”