Sunday, December 02, 2018

Re: Qsynth midi latency not low enough... what to do?

On Sat, Dec 01, 2018 at 01:19:00PM -0600, Adam Thompson wrote:
> PROBLEM STATEMENT: driving FluidSynth from a MIDI controller produces ~1/4sec delay between keypress and sound.
>
[...]

> Is sndio(4) suitable for real-time(-ish) performance? Or do I need
> a (OS) platform that does ASIO or JACK? (I mostly play by ear so
> I'm targeting <<0.1sec latency.)

Yes, sndiod is usable (actually designed for) low-latency usage. You
need to change the sndiod buffer size to whatever your system can
handle (depends on CPU, audio interface). I'd recommend to set in
/etc/rc.conf.local

sndiod_flags=-z240

Let us know how it works. If it works, you could try -z120, that's
what I use on my machines.

-z240 sets the block size to 240 samples, at 48000Hz sample frequency,
this corresponds to 48000Hz / 240 = 5ms block. The total end-to-end
latency is typically 3 blocks, so I'd get 5ms * 3 = 15ms.

FWIW, for music, you shouldn't exceed few tenths of ms of latency.

>
> Dmesg follows, just in case anyone spots anything useful in there…
>
> Hardware setup, broadly:
> * Dell Latitude E6430 laptop
> - booting in EFI mode to work around a weird bootloader bug
> * onboard azalia(4) audio (for now) using onboard speakers (for now)
> * Roland A500PRO MIDI controller, connected via USB
> * M-audio Uno USB-MIDI, nothing connected to it yet
> * No-name USB 5.1ch Audio DAC from Amazon, nothing connected to it yet
> - (leaving the M-audio umidi and the "ABC" uaudio devices disconnected makes no difference)
>

The "ABC" USB devices are unlikely to work with small blocks, but
there are fixes comming soon (hopefully).

No comments:

Post a Comment