[Wine] Kontakt doesn't respond to Akai USB MIDI Keyboard

jordan triplesquarednine at gmail.com
Tue Sep 7 19:15:29 CDT 2010


> I can use kontakt with wine (wineasio, etc), but it is difficult to achieve
> low latency for playing with a midi keyboard without pops and clicks. I have
> even tried wine with the wine-rt patch. Could you provide some information
> about your system (cpu, memory, audio interface) and jack and kontakt/wine
> configuration?

The clicks and pops could be caused by poor irqbalancing, shared IRQs
or something is getting higher priority
than your audio stuff, and causing interference. one of your
schedulers might need some adjusting, depending.
how about your alsa.conf??? any of your own configurations.
One that might be important in this context is:

"options snd_usb_audio nrpacks=1"  - usb runs at full speed (if your
midi-keyboard/audio device is using USB).

Do you use anything in /etc/fstab to speed up your HD, as well as
minimizing disk-writes? this may affect Kontakt,
as it can potentially be accessing your harddisk, quite a bit. are you
using DFD in Kontakt, or running samples from memory (from memory is
often better, although it will eat up your RAM) I minimize my DFD

as i do not own m-audio, i am not sure of the best settings there, i
would experiment, or look around forums for the ideal settings. i
would use lower quality settings, with lowest latency and work my way
up from 44100-16bit to 96-24bit.

Right now, i am using;   ( i say right now, because i am building a
much faster, rackmount PC )

Dell Inspiron 6400, 1.6 CoreDuo, 1gig DDR2 ram. 320gig SATA.
I have an IntelHDA(STAC9200) and an Edirol FA-101(firewire).
(Not very high-specs but works just fine, this was my testing ground
before i bought my rack.)

Fedora 13 (with Planet CCRMA packages, minus the CCRMA kernel)
my kernel: 2.6.34-zen2.i686  (Zen-kernel compiled,
customized/optimized by me) with some CFLAGS for optimizations, like
compiling native to my CPU only, and i select only modules my system
requires ("make localmodconfig") I also use some fairly harsh
optimizations, which i can't recommend. i have to modify kernel code,
before compiling, so that it doesn't break and not boot, and so my
wireless driver works properly. lol.

-kernel with preemption enabled, but I do NOT use igno-molnar's
rt-patches, nor rtirq.
-I do NOT use Irqbalance ( i balance them manually, and save my
configuration in /etc/rc.local for startup)
-I use the "BFS cpu-scheduler", finely-tuned for low-latency. (again
tuning saved in rc.local for startup)
-I use BFQ IO-scheduler, tuned for optimal IO operation on a SMP
system. (again rc.local)

Jack 1.9.6 (compiled myself)
-"classic Jack", as in no jackdbus or ladish...
- I use Jack-midi always, unless i am using wineASIO with a standalone
app. wineASIO uses ALSA-midi.
  which is usually fine if i am playing keyboard live, just keep
jack's frames small.
- start jackd/qjackctl with: "/usr/bin/jackd -P89 -p128 -t8000 -dalsa
-dhw:0 -r44100 -p128 -n2 -P -Xseq" (intelHDA).
  (i also disable audio in, in alsamixer, as if i am recording
audio-in i won't be using IntelHDA anyway)
- i'll have get back to you on my firewire startup (it's not in front
of me, right now).
- * I also run Qjackctl with the command 'schedtool -I -e qjackctl'.
what this does is use a feature in BFS, that will give jackd and all
of it's threads a higher priority. it is called SCHED_ISO. Jack's main
thread will use FIFO, but all others will use SCHED_ISO, which has a
global setting of "75" on my machine.

In my kernel config, for Zen-kernel(www.zen-kernel.org), there is a
setting to SCHED_ISO on X(xorg). I DONT use this setting, as my audio
needs priority above everything. this way i experience smooth audio,
no interference from my system. I can even use wireless while making
music, without it causing xruns.(which is known to happen).

*** Wine 1.3.1 (compiled by me, standard version/not RT-wine)
- i only select features i am using. ie: no pulseadio, ISDN, etc.
- Useful Registry Keys: AlsaDriver--->UseDirectHW
- Only ALSA selected in winecfg
- all debugging turned off. either in the registry or "WINEDBG=-all".
- Winetricks, when needed too.
-other performance tweaks, i can't think of off-hand.

My setup, isnt exactly run of the mill or the standard for RT,
pro-audio in Linux. But on this machine, my method works awesome. I do
know how to optimize the standard schedulers + RT, and i still do
compare the two, but the way i am doing it, seems to be best for me. I
can make music for hours and hours without problems, and i can record
tracks in ardour just great...

> Also, when using larger buffers and driving kontakt from a software
> sequencer, e.g. tuxguitar, I usually get distortions when playing chords.

interesting, i've never used tux-guitar. I do experience distortion on
chords if alsamixer is set higher than about 75-80% (80% is actually
100% gain, so above and beyond that, is actually over-driven in ALSA).
i would try lowering your gain, and also the gain in Kontact, until it
doesn't distort anymore. if that isn't the case, use smaller frames.
I always use 128, even when running 3-4 synths with FX, or editing
12tracks in ardour, while recording a synthline..
I only use larger frames, when doing "post-production", like FX,
automation and mastering.
my "craptop" with "the dreaded intelHDA"(so they say) almost is always
happy with 128frames. I keep mentioning the IntelHDA, because i
actually use it more than Firewire. As carrying around the FA-101 to a
jam, isn't really required. it is only handy for recording multiple
audio tracks at once.
I use a combination of "jacker" - a small midi-tracker for some
sequencing (it's very lite) and i use seq24 sometimes as well. then, i
just record right into ardour, with some cut and paste techniques,
bouncing tracks.
the kind of thing you do on slower machines. (like i used to do in
Protools on my old G4 mac)

> I use a dual core Athlon 5200+, 3gb ram, M-Audio 2496 with 32 bit real time
> kernel PAE (AV Linux 4). I mostly run kontakt as a VST plugin with vsthost,
> since I cannot "see" the midi inputs when running as standalone.

Nice hardware :)

as Standalone with WineASIO - you need to have midi-seq enabled in
Jackd. then you will see midi, under the ALSA tab in Jack. From my own
experience, i would say either run it as a standalone with lower
frames(alsa-midi needs smaller frames to be more accurate), or use it
with FST, which will give you Jack-midi. using the rt-wine shouldn't
really matter,  in fact FIFO scheduling Windows applications is a good
way to cause a soft/hard lockups of your system, if a plugin glitches

if you do run them with FIFO, don't run them with a high number...
VSThost is great, but you might want to use SAVIhost instead. Lots of
plugins may cause xruns in VSThost that won't give you issues with
SAVIhost/FST/or as a standalone Windows app(WineASIO).
I don't use any windows VST host for this reason alone.....

> Could you also post which instruments/libraries/NI plugins you use and work
> fine?

I own NI Komplete. I mainly use Battery3, Massive, Absynth, but also
FM8, GuitarRig, Kontact.
Some of them cause xruns on startup, Battery works flawless, no xruns,
except when switching kits.
Massive and Absynth work the best. Massive never causes xruns, even at
64frames. Abynsth only causes 2xruns on startup. these three are my
favorites. Kontakt i use alot too, in various forms, ie: "gariton
personal orcestra" or with the stock Kontakt programs.  I also use
M-tron Pro a lot, it works great, and almost never causes xruns, has
only happened 2-3 times(ever) when i was switching programs. Kore2
player may also work for you depending, but my system can't keep up,
it is too slow for that. ( i can use it, but it has crashed once or
twice, or i get splashes of xruns). But my machine is old, so i am not

all of the NI synths i usually run standalone (as i am playing them by
hand and recording), while if i was sequencing i would for sure be
using FST for Jack-midi or a2j. I always run Battery3 with FST.

Beyond that (as i could go on listing plugins forever). the easist way
to find out what plugins are well-supported in Wine/linux, is to take
a good look through www.kvr-audio.com. ANY plugin that is "Recepter
Compatible" will run perfectly fine. this is because the Receptor is
built on linux and wine. There are many many others that will work as
well, because Receptor uses an older, probably custom version of Wine.
And newer versions of wine, probably can support more. but there will
be some trial and error, here. just so you know!

I hope that helps.


More information about the wine-users mailing list