Hello community,
here is the log from the commit of package fluidsynth for openSUSE:Factory checked in at 2019-11-01 15:13:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fluidsynth (Old)
and /work/SRC/openSUSE:Factory/.fluidsynth.new.2990 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fluidsynth"
Fri Nov 1 15:13:18 2019 rev:47 rq:743582 version:2.0.8
Changes:
--------
--- /work/SRC/openSUSE:Factory/fluidsynth/fluidsynth.changes 2019-10-14 12:32:35.516098292 +0200
+++ /work/SRC/openSUSE:Factory/.fluidsynth.new.2990/fluidsynth.changes 2019-11-01 15:13:21.916694587 +0100
@@ -1,0 +2,9 @@
+Mon Oct 28 16:20:41 UTC 2019 - Tom Mbrt
+
+- Update to 2.0.8
+ * fix incorrect behavior of `fluid_sample_set_sound_data()`
+ * fix voices being mixed incorrectly, causing audible crackle esp.
+ at sample-rates >48kHz
+ * make sure that defining `NDEBUG` disables assertions
+
+-------------------------------------------------------------------
Old:
----
fluidsynth-2.0.7.tar.gz
New:
----
fluidsynth-2.0.8.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ fluidsynth.spec ++++++
--- /var/tmp/diff_new_pack.8YYPY9/_old 2019-11-01 15:13:22.860695818 +0100
+++ /var/tmp/diff_new_pack.8YYPY9/_new 2019-11-01 15:13:22.868695829 +0100
@@ -24,7 +24,7 @@
%endif
Name: fluidsynth
-Version: 2.0.7
+Version: 2.0.8
Release: 0
Summary: A Real-Time Software Synthesizer That Uses Soundfont(tm)
License: LGPL-2.1-or-later
++++++ fluidsynth-2.0.7.tar.gz -> fluidsynth-2.0.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fluidsynth-2.0.7/CMakeLists.txt new/fluidsynth-2.0.8/CMakeLists.txt
--- old/fluidsynth-2.0.7/CMakeLists.txt 2019-09-27 16:53:27.000000000 +0200
+++ new/fluidsynth-2.0.8/CMakeLists.txt 2019-10-27 17:07:43.000000000 +0100
@@ -29,7 +29,7 @@
# FluidSynth package version
set ( FLUIDSYNTH_VERSION_MAJOR 2 )
set ( FLUIDSYNTH_VERSION_MINOR 0 )
-set ( FLUIDSYNTH_VERSION_MICRO 7 )
+set ( FLUIDSYNTH_VERSION_MICRO 8 )
set ( VERSION "${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}" )
set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" )
@@ -44,7 +44,7 @@
# This is not exactly the same algorithm as the libtool one, but the results are the same.
set ( LIB_VERSION_CURRENT 2 )
set ( LIB_VERSION_AGE 2 )
-set ( LIB_VERSION_REVISION 0 )
+set ( LIB_VERSION_REVISION 1 )
set ( LIB_VERSION_INFO
"${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fluidsynth-2.0.7/doc/Doxyfile new/fluidsynth-2.0.8/doc/Doxyfile
--- old/fluidsynth-2.0.7/doc/Doxyfile 2019-09-27 16:53:27.000000000 +0200
+++ new/fluidsynth-2.0.8/doc/Doxyfile 2019-10-27 17:07:43.000000000 +0100
@@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = libfluidsynth
-PROJECT_NUMBER = 2.0.7
+PROJECT_NUMBER = 2.0.8
OUTPUT_DIRECTORY = api
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fluidsynth-2.0.7/doc/fluidsynth-v20-devdoc.txt new/fluidsynth-2.0.8/doc/fluidsynth-v20-devdoc.txt
--- old/fluidsynth-2.0.7/doc/fluidsynth-v20-devdoc.txt 2019-09-27 16:53:27.000000000 +0200
+++ new/fluidsynth-2.0.8/doc/fluidsynth-v20-devdoc.txt 2019-10-27 17:07:43.000000000 +0100
@@ -8,8 +8,8 @@
\author David Henningsson
\author Tom Moebert
\author Copyright © 2003-2019 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
-\version Revision 2.0.7
-\date 2019-09-25
+\version Revision 2.0.8
+\date 2019-10-27
All the source code examples in this document are in the public domain; you can use them as you please. This document is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ . The FluidSynth library is distributed under the GNU Lesser General Public License. A copy of the GNU Lesser General Public License is contained in the FluidSynth package; if not, visit http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -21,6 +21,7 @@
- \ref Disclaimer
- \ref Introduction
+- \ref NewIn2_0_8
- \ref NewIn2_0_7
- \ref NewIn2_0_6
- \ref NewIn2_0_5
@@ -65,6 +66,9 @@
- FluidSynth is open source, in active development. For more details, take a look at http://www.fluidsynth.org
+\section NewIn2_0_8 Whats new in 2.0.8?
+
+- fluid_sample_set_sound_data() caused broken sound when copying sample data
\section NewIn2_0_7 Whats new in 2.0.7?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fluidsynth-2.0.7/src/rvoice/fluid_rvoice_mixer.c new/fluidsynth-2.0.8/src/rvoice/fluid_rvoice_mixer.c
--- old/fluidsynth-2.0.7/src/rvoice/fluid_rvoice_mixer.c 2019-09-27 16:53:27.000000000 +0200
+++ new/fluidsynth-2.0.8/src/rvoice/fluid_rvoice_mixer.c 2019-10-27 17:07:43.000000000 +0100
@@ -360,14 +360,14 @@
}
/**
- * Mix data down to buffers
+ * Mix samples down from internal dsp_buf to output buffers
*
* @param buffers Destination buffer(s)
* @param dsp_buf Mono sample source
- * @param start_block Block to start mixing at
+ * @param start_block starting sample in dsp_buf
* @param sample_count number of samples to mix following \c start_block
* @param dest_bufs Array of buffers to mixdown to
- * @param dest_bufcount Length of dest_bufs
+ * @param dest_bufcount Length of dest_bufs (i.e count of buffers)
*/
static void
fluid_rvoice_buffers_mix(fluid_rvoice_buffers_t *buffers,
@@ -375,9 +375,11 @@
int start_block, int sample_count,
fluid_real_t **dest_bufs, int dest_bufcount)
{
+ /* buffers count to mixdown to */
int bufcount = buffers->count;
int i, dsp_i;
+ /* if there is nothing to mix, return immediatly */
if(sample_count <= 0 || dest_bufcount <= 0)
{
return;
@@ -386,6 +388,7 @@
FLUID_ASSERT((uintptr_t)dsp_buf % FLUID_DEFAULT_ALIGNMENT == 0);
FLUID_ASSERT((uintptr_t)(&dsp_buf[start_block * FLUID_BUFSIZE]) % FLUID_DEFAULT_ALIGNMENT == 0);
+ /* mixdown for each buffer */
for(i = 0; i < bufcount; i++)
{
fluid_real_t *FLUID_RESTRICT buf = get_dest_buf(buffers, i, dest_bufs, dest_bufcount);
@@ -398,11 +401,17 @@
FLUID_ASSERT((uintptr_t)buf % FLUID_DEFAULT_ALIGNMENT == 0);
+ /* mixdown sample_count samples in the current buffer buf
+ Note, that this loop could be unrolled by FLUID_BUFSIZE elements */
#pragma omp simd aligned(dsp_buf,buf:FLUID_DEFAULT_ALIGNMENT)
-
- for(dsp_i = (start_block * FLUID_BUFSIZE); dsp_i < sample_count; dsp_i++)
+ for(dsp_i = 0; dsp_i < sample_count; dsp_i++)
{
- buf[dsp_i] += amp * dsp_buf[dsp_i];
+ // Index by blocks (not by samples) to let the compiler know that we always start accessing
+ // buf and dsp_buf at the FLUID_BUFSIZE*sizeof(fluid_real_t) byte boundary and never somewhere
+ // in between.
+ // A good compiler should understand: Aha, so I don't need to add a peel loop when vectorizing
+ // this loop. Great.
+ buf[start_block * FLUID_BUFSIZE + dsp_i] += amp * dsp_buf[start_block * FLUID_BUFSIZE + dsp_i];
}
}
}
@@ -417,30 +426,42 @@
fluid_rvoice_t *rvoice, fluid_real_t **dest_bufs,
unsigned int dest_bufcount, fluid_real_t *src_buf, int blockcount)
{
- int i, total_samples = 0, start_block = 0;
+ int i, total_samples = 0, last_block_mixed = 0;
for(i = 0; i < blockcount; i++)
{
+ /* render one block in src_buf */
int s = fluid_rvoice_write(rvoice, &src_buf[FLUID_BUFSIZE * i]);
-
if(s == -1)
{
- start_block += s;
- s = FLUID_BUFSIZE;
- }
-
- total_samples += s;
+ /* the voice is silent, mix back all the previously rendered sound */
+ fluid_rvoice_buffers_mix(&rvoice->buffers, src_buf, last_block_mixed,
+ total_samples - (last_block_mixed*FLUID_BUFSIZE),
+ dest_bufs, dest_bufcount);
- if(s < FLUID_BUFSIZE)
+ last_block_mixed = i+1; /* future block start index to mix from */
+ total_samples += FLUID_BUFSIZE; /* accumulate samples count rendered */
+ }
+ else
{
- break;
+ /* the voice wasn't quiet. Some samples have been rendered [0..FLUID_BUFSIZE] */
+ total_samples += s;
+ if(s < FLUID_BUFSIZE)
+ {
+ /* voice has finished */
+ break;
+ }
}
}
- fluid_rvoice_buffers_mix(&rvoice->buffers, src_buf, -start_block, total_samples - ((-start_block)*FLUID_BUFSIZE), dest_bufs, dest_bufcount);
+ /* Now mix the remaining blocks from last_block_mixed to total_sample */
+ fluid_rvoice_buffers_mix(&rvoice->buffers, src_buf, last_block_mixed,
+ total_samples - (last_block_mixed*FLUID_BUFSIZE),
+ dest_bufs, dest_bufcount);
if(total_samples < blockcount * FLUID_BUFSIZE)
{
+ /* voice has finished */
fluid_finish_rvoice(buffers, rvoice);
}
}
@@ -602,7 +623,7 @@
static int
fluid_mixer_buffers_init(fluid_mixer_buffers_t *buffers, fluid_rvoice_mixer_t *mixer)
{
- const int samplecount = FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT;
+ static const int samplecount = FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT;
buffers->mixer = mixer;
buffers->buf_count = mixer->buffers.buf_count;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fluidsynth-2.0.7/src/sfloader/fluid_sfont.c new/fluidsynth-2.0.8/src/sfloader/fluid_sfont.c
--- old/fluidsynth-2.0.7/src/sfloader/fluid_sfont.c 2019-09-27 16:53:27.000000000 +0200
+++ new/fluidsynth-2.0.8/src/sfloader/fluid_sfont.c 2019-10-27 17:07:43.000000000 +0100
@@ -608,7 +608,7 @@
goto error_rec;
}
- FLUID_MEMSET(sample->data, 0, storedNbFrames);
+ FLUID_MEMSET(sample->data, 0, storedNbFrames * sizeof(short));
FLUID_MEMCPY(sample->data + SAMPLE_LOOP_MARGIN, data, nbframes * sizeof(short));
if(data24 != NULL)
@@ -627,7 +627,7 @@
/* pointers */
/* all from the start of data */
sample->start = SAMPLE_LOOP_MARGIN;
- sample->end = SAMPLE_LOOP_MARGIN + storedNbFrames - 1;
+ sample->end = SAMPLE_LOOP_MARGIN + nbframes - 1;
}
else
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fluidsynth-2.0.7/src/utils/fluid_sys.c new/fluidsynth-2.0.8/src/utils/fluid_sys.c
--- old/fluidsynth-2.0.7/src/utils/fluid_sys.c 2019-09-27 16:53:27.000000000 +0200
+++ new/fluidsynth-2.0.8/src/utils/fluid_sys.c 2019-10-27 17:07:43.000000000 +0100
@@ -195,6 +195,29 @@
return FLUID_FAILED;
}
+void* fluid_alloc(size_t len)
+{
+ void* ptr = malloc(len);
+
+#if defined(DEBUG) && !defined(_MSC_VER)
+ // garbage initialize allocated memory for debug builds to ease reproducing
+ // bugs like 44453ff23281b3318abbe432fda90888c373022b .
+ //
+ // MSVC++ already garbage initializes allocated memory by itself (debug-heap).
+ //
+ // 0xCC because
+ // * it makes pointers reliably crash when dereferencing them,
+ // * floating points are still some valid but insanely huge negative number, and
+ // * if for whatever reason this allocated memory is executed, it'll trigger
+ // INT3 (...at least on x86)
+ if(ptr != NULL)
+ {
+ memset(ptr, 0xCC, len);
+ }
+#endif
+ return ptr;
+}
+
/**
* Convenience wrapper for free() that satisfies at least C90 requirements.
* Especially useful when using fluidsynth with programming languages that do not provide malloc() and free().
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fluidsynth-2.0.7/src/utils/fluid_sys.h new/fluidsynth-2.0.8/src/utils/fluid_sys.h
--- old/fluidsynth-2.0.7/src/utils/fluid_sys.h 2019-09-27 16:53:27.000000000 +0200
+++ new/fluidsynth-2.0.8/src/utils/fluid_sys.h 2019-10-27 17:07:43.000000000 +0100
@@ -739,4 +739,6 @@
#define FLUID_DEFAULT_ALIGNMENT (64U)
+void* fluid_alloc(size_t len);
+
#endif /* _FLUID_SYS_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fluidsynth-2.0.7/src/utils/fluidsynth_priv.h new/fluidsynth-2.0.8/src/utils/fluidsynth_priv.h
--- old/fluidsynth-2.0.7/src/utils/fluidsynth_priv.h 2019-09-27 16:53:27.000000000 +0200
+++ new/fluidsynth-2.0.8/src/utils/fluidsynth_priv.h 2019-10-27 17:07:43.000000000 +0100
@@ -126,12 +126,13 @@
* SYSTEM INTERFACE
*/
-#define FLUID_MALLOC(_n) malloc(_n)
+#define FLUID_MALLOC(_n) fluid_alloc(_n)
#define FLUID_REALLOC(_p,_n) realloc(_p,_n)
-#define FLUID_NEW(_t) (_t*)malloc(sizeof(_t))
-#define FLUID_ARRAY_ALIGNED(_t,_n,_a) (_t*)malloc((_n)*sizeof(_t) + ((unsigned int)_a - 1u))
-#define FLUID_ARRAY(_t,_n) FLUID_ARRAY_ALIGNED(_t,_n,1u)
#define FLUID_FREE(_p) fluid_free(_p)
+
+#define FLUID_NEW(_t) (_t*)FLUID_MALLOC(sizeof(_t))
+#define FLUID_ARRAY_ALIGNED(_t,_n,_a) (_t*)FLUID_MALLOC((_n)*sizeof(_t) + ((unsigned int)_a - 1u))
+#define FLUID_ARRAY(_t,_n) FLUID_ARRAY_ALIGNED(_t,_n,1u)
#define FLUID_FOPEN(_f,_m) fopen(_f,_m)
#define FLUID_FCLOSE(_f) fclose(_f)
#define FLUID_FREAD(_p,_s,_n,_f) fread(_p,_s,_n,_f)
@@ -224,7 +225,7 @@
#define M_LN10 2.3025850929940456840179914546844
#endif
-#ifdef DEBUG
+#if defined(DEBUG) && !defined(NDEBUG)
#define FLUID_ASSERT(a) g_assert(a)
#else
#define FLUID_ASSERT(a)