I set up my MIDI keyboard with fluidsynth on raspbian, mostly according to this how to.

It all works fine, but I've got a ~1 second latency. Does anybody know how to fix this issue?

RPi model: B
Raspbian image: 2014-01-07-wheezy-raspbian
MIDI Keyboard: Behringer UMA 25S


I'd guess that you're gaining the delay due to some sort of buffering taking place or due to high CPU load. The later you can check by running the top command.

The FluidSynth Wiki suggests three command line options you can use to reduce latency.

-r=RATE (sample rate, default 44100)
-c=NUM  (number of audio buffers, default 16)
-z=SIZE (buffer size, default 64)

These go in the start_fluid script from that page. I'd suggest setting the last two command line options to half their default values, so 8 and 32 respectively and see if that improves performance.

Edit: if sound starts to stutter, increase them until it stops and latency is acceptable. You can change them independently as well.

  • 2
    I would also suggest dropping the sample rate to 22050 if you are using the on-board audio.
    – reCover
    May 25 '18 at 14:47
  • My latency was not one second but long enough to make playing piano really hard. I did not test the 3 settings separately, but together they make the piano keys respond 'immediately'. Problem solved
    – Roland
    Sep 18 at 22:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.