From d70232dcd82e404de91d91fefbc16608e18b7a5e Mon Sep 17 00:00:00 2001 From: soyer Date: Mon, 5 May 2025 23:31:23 +0200 Subject: [PATCH] Remove startup sound artefact Limit the number of processed frames to chunksize / 2 (#912) The tg_mixer cannot process more franes, So if it has to process more, uninitialized frames will be played, which causes strange sounds, e.g. at startup. Closes #908 --- src/minidexed.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 4a4ce46..40c69b7 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -1305,6 +1305,10 @@ void CMiniDexed::ProcessSound (void) unsigned nFrames = m_nQueueSizeFrames - m_pSoundDevice->GetQueueFramesAvail (); if (nFrames >= m_nQueueSizeFrames/2) { + // only process the minimum number of frames (== chunksize / 2) + // as the tg_mixer cannot process more + nFrames = m_nQueueSizeFrames / 2; + if (m_bProfileEnabled) { m_GetChunkTimer.Start ();