On Thu, Jul 15, 2010 at 1:15 AM, Ralf Mardorf
<ralf.mardorf(a)alice-dsl.net> wrote:
Devin and some others want to know if the drum module
is played before
FluidSynth DSSI is played.
JACK2 doesn't start with -p4096, so I started JACK2 with -Rch -dalsa
-dhw:0 -r44100 -p2048 -n2 to increase the unwanted effect, to get a
clear result.
Without recording it's clear audible that the external drum module
always is played before FluidSynth DSSI is played, plausible regarding
to the audio latency (stupid idea to use such high latency ;), so
there's the need to do an audio test with lower latency, to see if
jitter might change what instrument is played first.
As we discussed yesterday, I don't think this is due to jitter. I
think this is due to the fact that the (necessary) latency imposed by
JACK on audio is not imposed on ALSA MIDI.
The MIDI path to your soft-synth probably looks something like this:
MIDI controller -> MIDI in port -> ALSA -> Fluidsynth
... after which Fluidsynth generates audio that travels a path that's
something like this:
Fluidsynth -> Jack -> audio out ports
Jack will impose a certain amount of latency on the audio before it's
output to the audio out ports. In the case above, I think it would be
around 90 milliseconds or so. There might be some other, minor
latency (i.e. internal buffering, etc.), but IDK, as I haven't seen
the code.
The MIDI path to your external drum module probably looks something like this:
MIDI controller -> MIDI in port -> ALSA -> MIDI out port ->
external drum module
... after which the drum module generates audio that travels a path
that's something like this:
drum module -> drum module out ports
The drum module imposes some sort of latency, but it's clearly not as
high as the latency imposed by JACK with the settings above. Note
that nothing is routed through JACK on the way to the drum module.
Solving this problem is complex. It's unlikely that your drum module
allows you to specify its latency. AFAIK, you can't directly specify
the latency of ALSA MIDI ports, but I have very little experience with
ALSA and could be totally wrong.
If Fluidsynth supports JACK MIDI, then you might solve this problem by
routing your MIDI through JACK using the ALSA 'seq' or 'raw'
interfaces. MIDI that runs through JACK is subject to the same
latency as audio up until it reaches the MIDI drivers, after which
it's up to the driver to sync audio and MIDI if the MIDI port isn't
subject to the same latency as audio. I know that the FFADO driver in
JACK 2 syncs MIDI closely with audio. After looking over the ALSA
drivers, I'm pretty sure they try to sync MIDI with audio too by
adding a delay of `nframes` to the time that the MIDI message goes out
(I could be wrong, as the code for the ALSA MIDI drivers is a bit
complicated).
--
Devin Anderson
devin (at) charityfinders (dot) com
CharityFinders -
http://www.charityfinders.com/
synthclone -
http://synthclone.googlecode.com/