Table of Contents

Dealing with Latencies

In this page we'll try to describe where latencies occur, how we can measure and how we can compensate them.

Latency Diagram

Places where latencies occur are marked dark yellow:

This picture was generated as a PNG-export of the DIA-file contained in rosegarden_latencies.tar

Measuring/Determining Latencies

ALSA MIDI Input

This can't be measured automatically and it depends on the source (software or hardware). It can probably left neglected. In future releases it could be user-definable (default: 0 ms) for each defined MIDI input device separately.

ALSA MIDI Output

This can't be measured automatically and it depends on the destination (software or hardware). It can probably left neglected. In future releases it could be user-definable (default: 0 ms) for each defined MIDI output device separately.

JACK Input

See http://jackaudio.org/files/docs/html/group__LatencyFunctions.html.

Todo: how?

JACK Output

See http://jackaudio.org/files/docs/html/group__LatencyFunctions.html.

Todo: how?

LADSPA-Plugins

Only a loaded and not bypassed plugin adds some latency.

Todo: how?

Compensate Latencies

Compensate Output-Latencies

After each change regarding plugins, routing (to subgroup or master) or settings the maximum output latency of all instruments should be calculated. It should be safe to do this before every PLAY or RECORD action.

The difference between the maximum and the actual latency for a given instrument should then added to this instrument by delaying it by that difference.

Compensate Input-Latencies

The maximum output latency of all instruments should be calculated as described above.

The recorded material should be shifted to the past by the maximum output latency plus a potential (user set) input latency.