LMMS / LMMS/lmms

Noticeable delay between audio and MIDI output on Windows

Open
#5,384 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
10.4k
Forks
1.3k
Avg merge
2d 13h
Merged PRs (30d)
7

Description

### Bug Summary
On Windows machine, when LMMS plays audio and MIDI tracks in parallel, there is a big noticeable delay between hardware synthesizer output and LMMS audio output

#### Steps to reproduce
Select WASAPI as audio backend with a typical buffer size (256 samples)
Create a track with a few note (four quarter in a measure for example)
Connect this track to an internal sound generator (if possible a drum machine like kicker)
Connect the same track to a MIDI OUT interface driving an external synthesizer
Start sequencer

#### Expected behavior
"Beats" from hardware synth audio output shall match (or with a delay of maximum one buffer duration) "beats" produced by LMMS internal audio engine. For example, a single "kick" note should produce two time matching sounds between the external and internal source

#### Actual behavior
A single note played by LMMS produce delayed beats between MIDI and internal audio engine. The same note played by LMMS sequencer produces a "bom bom" sound (one "bom" being the kick sound produced by hardware synth, one "bom" being produced by LMMS audio engine)
Therefore, palying MIDI in parallel between internal and external synthesizers is almost impossible to achieve, as the result is a delayed copy of the song between the two systems (computer and synth)
I estimate the delay between internal engine and external synth between 20 to 30 ms, even if I set the buffer size to the minimum (64 samples being not realistic on Windows, as it will create a lot of clicks)

#### Screenshot

#### LMMS version used
1.2.1

#### Logs

Click to expand


Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue in LMMS 1.2.1 on Windows using WASAPI, a 256-sample buffer, an internal generator, and a MIDI OUT synthesizer. Start by tracing the audio and MIDI output scheduling paths involved when the sequencer starts. Done means hardware and internal beats are aligned, with no more than one buffer of delay, and the reproduction steps no longer show a 20–30 ms offset.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.