[linux-audio-user] My MIDI latency is crap

Werner Schweer ws at seh.de
Tue May 9 06:43:29 EDT 2006

On Tuesday 09 May 2006 09:20, Clemens Ladisch wrote:
> Robert Jonsson wrote:
> > On Monday 08 May 2006 09:08, Clemens Ladisch wrote:
> > > Josh Lawrence wrote:
> > > > I have the local turned off on my keyboard, so that when I play a
> > > > note on the keyboard, the MIDI signal passes through MusE, and back
> > > > to my keyboard's sound generator.
> > >
> > > I tried to look at MuSE's source to see how it implements MIDI Through,
> > > but apparently MuSE doesn't do anything MIDI related.
> >
> > The unfortunate truth is that there are two muse projects. MuSE which you
> > probably looked at, a streaming server I think.. and MusE, a sequencer,
> > which is likely the one being talked about here.
> > http://muse-sequencer.org.
> Oops ...
> > How much latency is 'crap'? To my knowledge MusE reschedules incoming
> > midi events using the best timing source at hand (if available rtc is
> > used, if not, alsa), latency should be negligible.
> It shouldn't be necessary to reschedule the events, they could be sent
> back out immediately; no timer is needed for that.

Its not that easy. If you play a software synthesizer, the received midi 
events can only be processed on the next JACK cycle. To reduce jitter, all
events in MusE are delayed by two JACK cycles. So the minimum midi latency 
is two JACK cycles. Immediate processing of midi events whould mean to align
them to JACK cycle boundaries which is something you do not want.
A musician can easily deal with even huge latencies but not  with jitter.

> Additionally, it seems MusE doesn't use ALSA's timestamps for received
> events but manually looks at the timer when it comes around to reading
> the events. This will somewhat degrade the accuracy of received events.

yes, thats true, but as the receiving thread runs with RT priorities its 
negligible in practice.


More information about the Linux-audio-user mailing list