LMMS / LMMS/lmms

Clicks when playback is stopped or paused

Open
#6,885 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
10.4k
Forks
1.3k
Avg merge
2d 13h
Merged PRs (30d)
7

Description

### Bug Summary
Playing a track and pressing pause or stop can lead to audible clicks. This is likely caused by an immediate stop of the audio output.

#### Steps to reproduce
1. Add a TripleOscillator to the song editor.
2. Activate the volume envelope of the TripleOscillator in such a way that it does not produce any clicks. Example:
* Hold: 0
* Decay: 0,5
* Sustain: 1
* Release: 0,1
* Amount: 1
3. Add a clip with a long and low note, e.g. A3, to the track with the TripleOsciallator.
4. Start playback and press pause or stop. Repeat several times if needed.

#### Expected behavior
The sound fades out quickly but without a click.

Please refer to the first half of [this comment](https://github.com/LMMS/lmms/issues/3086#issuecomment-1729895366) for the results of some experiments on how REAPER handles these events. I don't want to repeat all of this here. The gist of it is that pause stops the sound immediately and without clicks whereas stop lets instruments and effects ring out.

Stop seems to send a note-off event to all instruments but keeps processing the audio coming from the tracks.

Pause seems to retain as much state as possible and then continues from that state if playing is resumed. The fact that this does not create any clicks seems to indicate that REAPER does not immediately stop when the pause event is received but that it at least keeps processing to fill a buffer that's long enough so that a quick fade-out can be applied.

#### Actual behavior
A click is heard. Because we have ensured that the instrument is not the source of the clicks this is likely caused by the implementation of the pause and stop events.

#### Affected LMMS versions
Master. At the time of writing at commit f0aa2862d7e.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with a TripleOscillator, the specified volume envelope, and a long low note, then inspect the implementation of the pause and stop events. Compare the audio behavior with the expected quick fade-out on pause and instruments and effects ringing out on stop; done means repeated pause and stop actions produce no audible click.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.