3 ms·
I tried to hook up a midi keyboard to a raspberry pi, for my kid to practice piano but it didn’t work well. Was Ubuntu Mate with timidity soft synth. Latency
by mixmastamyk 5y ago
I tried to hook up a midi keyboard to a raspberry pi, for my kid to practice piano but it didn’t work well. Was Ubuntu Mate with timidity soft synth. Latency was about half a second from key press to sound which made it unplayable. Not sure what else could be done but hopefully this project is a solution.
- cjaybo 5y agoI haven't tried it but you might look into AVLinux, it's supposed to be more real-time performance friendly.
- ta988 5y agoit could be yes, but there are a lot of variables to take into account here. what audio system were you using what were the settings.
- mixmastamyk 5y agoWhatever is standard with ubuntu, pulse audio with defaults I believe. At some point I installed jack but it didnt seem to help. I gave up as several hours were all I had to spare. :-/
- PaulDavisThe1st 5y agoI use an RPi4 for a high end self-built e-piano (StudioLogic weighted key controller, Pianoteq for synthesis, ART monitors, HifiBerry pro-audio DAC). Latency is fine, but you won't get the same results with stock Ubuntu Mate. The "solutions" don't involve Pipewire per se, although in the future that might be the technology in use.
- mixmastamyk 5y agoI don’t understand what is “stock” in this scenario.
- PaulDavisThe1st 5y ago"stock ubuntu" means "ubuntu as configured automatically after installing it".
- mixmastamyk 5y agoThanks. In debug mode I saw midi messages immediately so don't think it had anything to do with the keyboard itself or the input connection. The delay seemed to be on sound output. The only thing that seems pertinent to the discussion is perhaps the "pianotec" which I'm not familiar with. Is that improving on stock Ubuntu somehow?
- PaulDavisThe1st 5y agoPianoteq is a proprietary physical modelling synth (it computes the sound of a piano for every note; no samples). That is not relevant. Lowering latency consists of balancing two opposing "forces". To lower it, you "simply" need to tell the software that you're using to use a small buffer size. This reduces the time between the MIDI event arriving in the software and the software producing some sound corresponding to that event. However, there are limits on how low you can go, some caused by hardware and some caused by software. The kernel configuration itself can play a role, along with a variety of different devices and device drivers. This document tries to help you understand the sorts of system (hardware-ish) issues that can prevent you from reducing the buffer size: https://manual.ardour.org/setting-up-your-system/the-right-computer-system-for-digital-audio/ https://manual.ardour.org/setting-up-your-system/the-right-c... Ensuring that your software runs with realtime scheduling (SCHED_FIFO) is where it can be necessary to adjust stock Ubuntu systems to give you permission to do this (you are not allowed to do so by default). In addition, the software you're using (Timidity) will not necessarily do this by itself. If you want to know more, I'd suggest visiting linuxmusicians.com and using their forums.