Improving latency on Ubuntu Studio / Wine

Started by monty, June 24, 2025, 13:53:50

Previous topic - Next topic

monty

Hi all,

Im running OpenMPT via Wine on Ubuntu Studio LTS on a gen2 lenovo t14 i5.

baseline performance when selecting the WASAPI driver in sound card settings is 30ms latency.  If i try to apply lower latency settings, e.g., 20ms,  it stil doesnt go any lower than 30ms

I got the experimental WINE native output up and running,  but selecting the respective drivers via Sound Card settings provided worse performance  than the WASAPI drivers (x3 cpu usage at same latency value,  would allow a lower latency setting but with bad stuttering)

From here, I tried changing Wine's default audio driver from pulse to alsa which allowed me to select the Sound Card option for ALSA and apply latency values of 20ms with lower cpu usage now,  but the overall performance became unstable and OpenMPT would hang.

Im an absolute noob with Linux and am definitely over my head trying to mess with this stuff, but if anyone has any guidance it would be much appreciated.  If there's any additional info I can provide that would be useful,  by all means let me know

many thanks in advance




manx

#1
Disclaimer: I am not running a modern version of Ubuntu Studio myself.

Do you know if Ubuntu Studio is routing PulseAudio through PulseAudio or JACK or PipeWire?

A few thing to try;
  • when using the OpenMPT Wine integration, make sure you are using the PulseAudio backend in OpenMPT ("PulseAudio - Default Device (Wine/Native)")
  • set "Period" lower than the default 10ms, try 5ms, or even just 1ms
  • match the OpenMPT sample rate to the sample rate that PulseAudio or JACK or PipeWire are using internally

IcarusDream

#2
Honestly, your methods (trying native output and experimenting with ALSA) don't seem to be unreasonable.
I've managed to get to 20 with "MME built in analog stereo" on a similar machine, without impacting the performance of sampled instruments, but anything below that seems to introduce stuttering and lag.
WINE's audio API translation layers introduce additional overheads which are heavier on the CPU (to lesser or larger extent, depending on the software). These aren't news.
Also, If I'm not wrong, OpenMPT uses single threaded processing, which certainly can affect the performance if you use external plugins, especially under WINE.

Quote from: manx on June 25, 2025, 09:07:49
  • when using the OpenMPT Wine integration, make sure you are using the PulseAudio backend in OpenMPT ("PulseAudio - Default Device (Wine/Native)")
  • set "Period" lower than the default 10ms, try 5ms, or even just 1ms
  • match the OpenMPT sample rate to the sample rate that PulseAudio or JACK or PipeWire are using internally
These methods work fairly well on my Desktop setup, however OP is using a mid-range Laptop. I have a fairly similar model to his, and the only method that allowed me to get lower latency was with the "MME built in analog stereo" option, which isn't the best in terms of performance when it comes to projects reliant on external plugins.