MuseScore icon indicating copy to clipboard operation
MuseScore copied to clipboard

[MU4 Issue] High latency with MIDI input, no audio output API selections (i.e. ASIO)

Open AwsomeTyper opened this issue 2 years ago • 4 comments
trafficstars

Describe the bug There is a lot of latency and delay between midi input and sound output in MU4.

Previously, in MU3 it was possible to reduce latency and midi input lag by using ASIO over Windows DirectSound or WASAPI. However, in MU4 there is no option at all to select an Audio Output API.

Screenshots MU3 I/O settings image

MU4 I/O settings image

Solution Would it be possible to add back the functionality of selecting and audio output API so I would be able to use a program such as ASIO4ALL to reduce midi input latency?

Platform information

  • OS: Windows 11 22h2

Additional information This is the second issue report I've ever made and am still getting used to GitHub so I apologize if I formatted this incorrectly or posted it in the wrong place.

AwsomeTyper avatar Dec 19 '22 01:12 AwsomeTyper

Related to (if not contained by) https://github.com/musescore/MuseScore/issues/13052

jeetee avatar Dec 19 '22 16:12 jeetee

FYI, MuseScore does use a WASAPI driver. About ASIO, I just found that we probably wouldn't even have the possibility to support it, because of licensing reasons (https://forums.steinberg.net/t/asio-license-and-open-source-software/696630, https://manual.audacityteam.org/man/asio_audio_interface.html#Non-distributable_ASIO_support_in_Audacity). Not sure how it's available in MS3 then; I guess this is handled by the PortAudio library?

The delay is probably caused by Muse Sounds, rather than by the audio driver. This is a known issue and will hopefully be better in the future.

cbjeukendrup avatar Dec 19 '22 16:12 cbjeukendrup

@cbjeukendrup Thank you for your response and the information. It does look like MU4 is unable to have ASIO for licensing reasons because MU4 is GPLv3, but so is MU3... Would it be possible to include the PortAudio library in MU4 then? Also, based on some quick research, JACK audio connection kit (which MU3 also supported) also reduces latency with MIDI input so maybe that could be included in MU4 as well.

I understand some of the delay is caused by Muse Sounds and it will get better over time as issues are fixed; however, I had similar delay issues with MU3 which were fixed by using ASIO over WASAPI or other APIs.

AwsomeTyper avatar Dec 19 '22 17:12 AwsomeTyper

I don't expect we'll go back to PortAudio, since it would be a big change again and now we have a "native" driver for each OS. But we'll see; if the native drivers turn out to give too many issues, we may think again.

cbjeukendrup avatar Dec 19 '22 17:12 cbjeukendrup

I'm using an M-Audio 192|6 as the audio output as the system audio, so I don't think ASIO is the problem. It's probably Muse Sounds. There is a delay when hitting a note on the keyboard that is very noticeable. The buffer size can't be switch to less than 1024 in the MuseScore4. The ASIO buffer is set to much less than that. It would be nice to have less delay while the score is not playing. Just to try out a phrase. Maybe processing could be reduced in that scenario?

linuxgeek avatar Dec 19 '22 21:12 linuxgeek

I am on an iMac with M1 chip (Ventura 13.2) and using AKAI LPK25 for input and there is a horrible latency issue with MU4. Did not have it on MU3.

MacUzerNJ avatar Jan 31 '23 22:01 MacUzerNJ

Just a thought on ASIO - Would it be possible to have a non-GPL implementation lib wrapping around ASIO with a license allowing for the redistribution of its headers (as long as those do not contain Steinberg code itself?) I am still very interested in ASIO support, because especially big scores tend to lag much mure in MU4 and consume much more CPU esp. with Muse sounds and I suspect quite alot of the latency comes from using the WASAPI mixer instead of being able to offload work to an ASIO compatible soundcard, I may be wrong though

heisluft avatar Jul 06 '23 12:07 heisluft

Duplicate of https://github.com/musescore/MuseScore/issues/16112 and https://github.com/musescore/MuseScore/issues/13052 (but that doesn't mean we're not going to fix it).

RomanPudashkin avatar Jul 01 '24 07:07 RomanPudashkin