#7 Delay between keystroke and sound


When I use vmpk (or vkeybd), there's a significant delay between the keystroke on the keyboard (or screen) and the sound. Is it normal?
For a quick keystroke, the sound comes after the finger is already removed, isn't it unsatisfactory? Can it be improved?

Details :
* Debian testing
* vmpk 0.4.0
* Timidity 2.13.2
* JACK "realtime mode with priority 10


  • Pedro Lopez-Cabanillas

    • status: open --> closed
  • Pedro Lopez-Cabanillas

    The time between the generated MIDI message and the sound coming from the speakers is called "latency" and it is a common problem of all software synthesizers.

    The latency amount depends mainly on the audio buffer size. Reducing this size reduces the latency as well, but increases the risk of artefacts due to buffer underruns. Timidity accepts a "-B" argument to request a buffer size, but it is only useful when using ALSA or OSS audio, not for libao, pulse or jack. If you want to use the jack audio server, then please ask for support in the jack project forums.

    If you start Timidity with this command line:

    $ timidity -iA -B 2,7
    Libao mode: -B option is ignored
    TiMidity starting in ALSA server mode
    Opening sequencer port: 128:0 128:1 128:2 128:3

    This means that timidity has been compiled with libao, and in this case the requested buffer size is ignored. It will be also ignored in jack mode (-Oj). You need to request ALSA audio (-Os) or OSS audio (-Od) instead:

    $ timidity -Os -iA -B 2,6
    Requested buffer size 512, fragment size 256
    ALSA pcm 'default' set buffer size 512, period size 168 bytes
    TiMidity starting in ALSA server mode
    Opening sequencer port: 128:0 128:1 128:2 128:3

    If you can hear audio artifacts with "-B 2,6" then try increasing the buffer size, for instance "-B 2,7" or "-B 2,8".

    Hope this helps.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks