MainStage 3: Reducing latency in MainStage 3
Minimizing latency in MainStage 3
MainStage offers three settings that influence the amount of latency for the system.
- I/O Buffer Size
- I/O Safety Buffer
- Driver Latency Slider
To access the settings, choose MainStage > Preferences and click the Audio button along the top of the preferences panel. Then, click the Advanced Settings button.
I/O Buffer Size
The first and most important of the settings is the I/O Buffer Size drop-down menu.
For audio channel strips, this sets both an input buffer and an output buffer. For software instrument channel strips, it sets only an output buffer as there is no audio input for these channel strips. The buffer size may range from 16 to 1024 samples.
As you make changes to the I/O Buffer Size, you will see a large change in the Current Roundtrip Latency as displayed in milliseconds along the bottom of the Advanced Audio Settings panel. The output latency is also shown in parenthesis. This is useful for determining the latency when you play through software instrument channel strips.
Smaller settings result in a shorter latency, but may mean you can use fewer channel strips and plug-ins simultaneously before you notice unwanted artifacts as you play. Set the I/O Buffer Size based on your particular usage of channel strips and plug-ins, and the processing power offered by your computer. If you use lots of power hungry plug-ins, you may have to use a larger buffer size than if you stick to less processing intensive plug-ins, or fewer simultaneous channel strips.
I/O Safety Buffer
The next setting is the I/O Safety Buffer. When you enable this setting, MainStage adds an additional output buffer to protect against overloads due to unexpected CPU spikes. Its size is equal to the I/O Buffer Size setting but only affects the output buffer. For example, if you find there is too much latency with an I/O Buffer Size of 256 samples but you hear dropouts or other audio glitches with an I/O Buffer Size of 128 samples, try setting I/O Buffer Size to 128 and enable the I/O Safety Buffer. This will yield somewhat more latency than 128 samples without the Safety Buffer, but less than 256 samples without it.
Driver Latency Slider
Next is the Driver Latency slider. By default, the slider is set to the maximum possible value, equal to the current I/O Buffer Size. In the illustration below, MainStage is set to a 128 Sample Buffer Size. Each buffer is represented by a white block. As MainStage finishes processing a 128 sample buffer, the buffer (represented by the gray blocks) is passed to the Core Audio driver which passes it to the audio hardware output.
If you move the Driver Latency slider one notch to the left, to 64 samples, the latency for the system goes down by several milliseconds:
The diagram below shows what is happening:
MainStage is still processing audio in 128 sample sized buffers, but rather than waiting the full 128 samples to pass each buffer to the Core Audio driver, it now only waits 64 samples before it begins to pass the buffer to the driver.
As with the I/O Buffer Size, lower Driver Latency settings may lead to dropouts or other audio glitches. The minimum setting possible for a particular system is primarily determined by the audio driver. The Driver Latency setting has no effect on the number of plug-ins or channel strips you can run.