diff --git a/.cirrus.yml b/.cirrus.yml index 99bbd6c..ebdb49d 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,8 +3,8 @@ task: name: FreeBSD freebsd_instance: matrix: + image_family: freebsd-14-0 image_family: freebsd-13-2 - image_family: freebsd-12-4 install_script: pwd && ls -la && pkg update --force && pkg install -y cmake glib alsa-lib ladspa portaudio pulseaudio pkgconf sdl2 diff --git a/CMakeLists.txt b/CMakeLists.txt index ac12df8..606bf8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ set ( PACKAGE "fluidsynth" ) # FluidSynth package version set ( FLUIDSYNTH_VERSION_MAJOR 2 ) set ( FLUIDSYNTH_VERSION_MINOR 3 ) -set ( FLUIDSYNTH_VERSION_MICRO 4 ) +set ( FLUIDSYNTH_VERSION_MICRO 5 ) set ( VERSION "${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}" ) set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" ) @@ -62,7 +62,7 @@ set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" ) # This is not exactly the same algorithm as the libtool one, but the results are the same. set ( LIB_VERSION_CURRENT 3 ) set ( LIB_VERSION_AGE 2 ) -set ( LIB_VERSION_REVISION 2 ) +set ( LIB_VERSION_REVISION 3 ) set ( LIB_VERSION_INFO "${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" ) @@ -102,7 +102,7 @@ option ( enable-openmp "enable OpenMP support (parallelization of soundfont deco # Platform specific options if ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" ) - option ( enable-lash "compile LASH support (if it is available)" on ) + option ( enable-lash "compile LASH support (if it is available)" off ) option ( enable-alsa "compile ALSA support (if it is available)" on ) endif ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" ) @@ -600,6 +600,7 @@ unset ( LASH_SUPPORT CACHE ) if ( enable-lash ) find_package ( LASH ${LASH_MINIMUM_VERSION} ) if ( LASH_FOUND ) + message ( WARNING "LASH support has been deprecated and will be removed in fluidsynth 2.4.0" ) set ( LASH_SUPPORT 1 ) add_definitions ( -DHAVE_LASH ) list( APPEND PC_REQUIRES_PRIV "lash-1.0") diff --git a/cmake_admin/FindInstPatch.cmake b/cmake_admin/FindInstPatch.cmake index e775045..1128926 100644 --- a/cmake_admin/FindInstPatch.cmake +++ b/cmake_admin/FindInstPatch.cmake @@ -37,7 +37,7 @@ find_path( find_library( InstPatch_LIBRARY - NAMES "instpatch-1.0" + NAMES "instpatch-1.0" "instpatch-2" HINTS "${PC_INSTPATCH_LIBDIR}") # Get version from pkg-config or read the config header diff --git a/cmake_admin/FindOpus.cmake b/cmake_admin/FindOpus.cmake index 0258d45..bf77e29 100644 --- a/cmake_admin/FindOpus.cmake +++ b/cmake_admin/FindOpus.cmake @@ -53,13 +53,13 @@ find_library( # Get the version from pkg-config if(PC_OPUS_VERSION) - set(Opus_VERSION "${PC_OPUS_VERSION}") + set(Opus_VERSION "${PC_OPUS_VERSION}.0") set(OPUS_VERSION "${Opus_VERSION}") set(OPUS_VERSION_STRING "${Opus_VERSION}") string(REPLACE "." ";" _opus_version_list "${Opus_VERSION}") list(GET _opus_version_list 0 OPUS_VERSION_MAJOR) list(GET _opus_version_list 1 OPUS_VERSION_MINOR) - list(GET _opus_version_list 2 OPUS_VERSION_PATCH) + list(GET _opus_version_list 2 OPUS_VERSION_PATCH) # might be missing if zero, hence adding the .0 above else() message(STATUS "Unable to get Opus version without pkg-config.") set(Opus_VERSION) diff --git a/cmake_admin/FindSndFile.cmake b/cmake_admin/FindSndFile.cmake index d77333b..271bb06 100644 --- a/cmake_admin/FindSndFile.cmake +++ b/cmake_admin/FindSndFile.cmake @@ -50,7 +50,7 @@ find_path( find_library( _sndfile_library - NAMES "sndfile" + NAMES "sndfile" "sndfile-1" HINTS "${PC_SNDFILE_LIBDIR}") # Get version from pkg-config or read the config header @@ -69,7 +69,8 @@ elseif(SndFile_INCLUDE_DIR) endif() # Check the features SndFile was built with -if(PC_SNDFILE_FOUND) +# 2024-01-02: Recent versions of libsndfile don't seem to provide a pkgconfig file and older version who did are lacking private libraries like OGG. +if(FALSE) #PC_SNDFILE_FOUND if("vorbis" IN_LIST PC_SNDFILE_STATIC_LIBRARIES) set(SndFile_WITH_EXTERNAL_LIBS TRUE) endif() diff --git a/cmake_admin/Findmpg123.cmake b/cmake_admin/Findmpg123.cmake index 76e0412..3cb3516 100644 --- a/cmake_admin/Findmpg123.cmake +++ b/cmake_admin/Findmpg123.cmake @@ -92,7 +92,7 @@ find_package_handle_standard_args( # Create the targets foreach(_component libmpg123 libout123 libsyn123) if(mpg123_${_component}_FOUND AND NOT TARGET MPG123::${_component}) - add_library(MPG123::${_component}) + add_library(MPG123::${_component} UNKNOWN IMPORTED) set_target_properties( MPG123::${_component} PROPERTIES IMPORTED_LOCATION "${mpg123_${_component}_LIBRARY}" diff --git a/doc/fluidsynth-v20-devdoc.txt b/doc/fluidsynth-v20-devdoc.txt index 38b82e0..ed0a7d6 100644 --- a/doc/fluidsynth-v20-devdoc.txt +++ b/doc/fluidsynth-v20-devdoc.txt @@ -8,8 +8,8 @@ \author David Henningsson \author Tom Moebert \author Copyright © 2003-2023 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert -\version Revision 2.3.4 -\date 2023-09-24 +\version Revision 2.3.5 +\date 2024-01-11 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 https://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 https://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. diff --git a/doc/fluidsynth.1 b/doc/fluidsynth.1 index ad66951..5140312 100644 --- a/doc/fluidsynth.1 +++ b/doc/fluidsynth.1 @@ -13,7 +13,7 @@ .\" along with this program; see the file LICENSE. If not, write to .\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. .\" -.TH FluidSynth 1 "Jan 1, 2022" +.TH FluidSynth 1 "Jan 1, 2024" .\" Please update the above date whenever this man page is modified. .\" .\" Some roff macros, for reference: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9a1f914..181b8ae 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -499,10 +499,6 @@ if ( TARGET PipeWire::PipeWire AND PIPEWIRE_SUPPORT ) # because pw_init() etc. target_link_libraries ( fluidsynth PRIVATE PipeWire::PipeWire ) endif() -if ( TARGET InstPatch::libinstpatch AND LIBINSTPATCH_SUPPORT ) - target_link_libraries ( fluidsynth PRIVATE InstPatch::libinstpatch ) -endif() - if ( TARGET LASH::LASH AND LASH_SUPPORT ) target_link_libraries ( fluidsynth PRIVATE LASH::LASH ) endif() @@ -552,12 +548,19 @@ set (GENTAB_BDIR ${CMAKE_CURRENT_BINARY_DIR}/gentables) # To fix cross-compiling fluidsynth from Win32 to ARM (using vcpkg), we need to pass the current generator # on to the external project, otherwise (for some unknown reason) the target compiler will be used rather # than the host compiler. +# +# Some use-cases however cannot rely on this logic, therefore, FLUID_HOST_COMPILER can be specified to +# force using a particular host compiler, see https://github.com/FluidSynth/fluidsynth/issues/1301 +if ( FLUID_HOST_COMPILER ) + set ( EXPLICIT_HOST_COMPILER_STR "-DCMAKE_C_COMPILER=${FLUID_HOST_COMPILER}" ) +endif () + ExternalProject_Add(gentables DOWNLOAD_COMMAND "" SOURCE_DIR ${GENTAB_SDIR} BINARY_DIR ${GENTAB_BDIR} CONFIGURE_COMMAND - "${CMAKE_COMMAND}" -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE} -G "${CMAKE_GENERATOR}" -B "${GENTAB_BDIR}" "${GENTAB_SDIR}" + "${CMAKE_COMMAND}" -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE} ${EXPLICIT_HOST_COMPILER_STR} -G "${CMAKE_GENERATOR}" -B "${GENTAB_BDIR}" "${GENTAB_SDIR}" BUILD_COMMAND "${CMAKE_COMMAND}" --build "${GENTAB_BDIR}" INSTALL_COMMAND ${GENTAB_BDIR}/make_tables.exe "${FluidSynth_BINARY_DIR}/" diff --git a/src/drivers/fluid_pipewire.c b/src/drivers/fluid_pipewire.c index b96019e..70f47ac 100644 --- a/src/drivers/fluid_pipewire.c +++ b/src/drivers/fluid_pipewire.c @@ -154,6 +154,7 @@ new_fluid_pipewire_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t char *media_category = NULL; float *buffer = NULL; const struct spa_pod *params[1]; + struct pw_properties *props; drv = FLUID_NEW(fluid_pipewire_audio_driver_t); @@ -196,7 +197,7 @@ new_fluid_pipewire_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t goto driver_cleanup; } - struct pw_properties *props = pw_properties_new(PW_KEY_MEDIA_TYPE, media_type, PW_KEY_MEDIA_CATEGORY, media_category, PW_KEY_MEDIA_ROLE, media_role, NULL); + props = pw_properties_new(PW_KEY_MEDIA_TYPE, media_type, PW_KEY_MEDIA_CATEGORY, media_category, PW_KEY_MEDIA_ROLE, media_role, NULL); pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%d/%d", period_size, (int) sample_rate); pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%d", (int) sample_rate); @@ -294,6 +295,11 @@ void delete_fluid_pipewire_audio_driver(fluid_audio_driver_t *p) fluid_pipewire_audio_driver_t *drv = (fluid_pipewire_audio_driver_t *)p; fluid_return_if_fail(drv); + if (drv->pw_loop) + { + pw_thread_loop_lock(drv->pw_loop); + } + if(drv->pw_stream) { pw_stream_destroy(drv->pw_stream); @@ -301,6 +307,7 @@ void delete_fluid_pipewire_audio_driver(fluid_audio_driver_t *p) if(drv->pw_loop) { + pw_thread_loop_unlock(drv->pw_loop); pw_thread_loop_destroy(drv->pw_loop); } diff --git a/src/fluidsynth.c b/src/fluidsynth.c index 2352f0d..81de1a8 100644 --- a/src/fluidsynth.c +++ b/src/fluidsynth.c @@ -29,9 +29,6 @@ #define GETOPT_SUPPORT 1 #endif -#ifdef LIBINSTPATCH_SUPPORT -#include -#endif #include "fluid_lash.h" #ifdef SYSTEMD_SUPPORT @@ -1222,7 +1219,7 @@ void print_welcome() { printf("FluidSynth runtime version %s\n" - "Copyright (C) 2000-2023 Peter Hanappe and others.\n" + "Copyright (C) 2000-2024 Peter Hanappe and others.\n" "Distributed under the LGPL license.\n" "SoundFont(R) is a registered trademark of Creative Technology Ltd.\n\n", fluid_version_str()); diff --git a/src/midi/fluid_midi.c b/src/midi/fluid_midi.c index 10561d2..0c51623 100644 --- a/src/midi/fluid_midi.c +++ b/src/midi/fluid_midi.c @@ -1644,7 +1644,7 @@ fluid_player_handle_reset_synth(void *data, const char *name, int value) static int check_for_on_notes(fluid_synth_t *synth) { fluid_voice_t* v[1024]; - int i, res=FALSE; + unsigned int i, res=FALSE; fluid_synth_get_voicelist(synth, v, FLUID_N_ELEMENTS(v), -1); for(i=0; ichannel_type = (120 <= bankmsb) ? CHANNEL_TYPE_DRUM : CHANNEL_TYPE_MELODIC; + chan->channel_type = (120 == bankmsb || 126 == bankmsb || 127 == bankmsb) ? CHANNEL_TYPE_DRUM : CHANNEL_TYPE_MELODIC; return; } diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index 07cca12..e635983 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -202,16 +202,16 @@ void fluid_synth_settings(fluid_settings_t *settings) fluid_settings_register_int(settings, "synth.verbose", 0, 0, 1, FLUID_HINT_TOGGLED); fluid_settings_register_int(settings, "synth.reverb.active", 1, 0, 1, FLUID_HINT_TOGGLED); - fluid_settings_register_num(settings, "synth.reverb.room-size", FLUID_REVERB_DEFAULT_ROOMSIZE, 0.0f, 1.0f, 0); - fluid_settings_register_num(settings, "synth.reverb.damp", FLUID_REVERB_DEFAULT_DAMP, 0.0f, 1.0f, 0); - fluid_settings_register_num(settings, "synth.reverb.width", FLUID_REVERB_DEFAULT_WIDTH, 0.0f, 100.0f, 0); - fluid_settings_register_num(settings, "synth.reverb.level", FLUID_REVERB_DEFAULT_LEVEL, 0.0f, 1.0f, 0); + fluid_settings_register_num(settings, "synth.reverb.room-size", FLUID_REVERB_DEFAULT_ROOMSIZE, 0.0, 1.0, 0); + fluid_settings_register_num(settings, "synth.reverb.damp", FLUID_REVERB_DEFAULT_DAMP, 0.0, 1.0, 0); + fluid_settings_register_num(settings, "synth.reverb.width", FLUID_REVERB_DEFAULT_WIDTH, 0.0, 100.0, 0); + fluid_settings_register_num(settings, "synth.reverb.level", FLUID_REVERB_DEFAULT_LEVEL, 0.0, 1.0, 0); fluid_settings_register_int(settings, "synth.chorus.active", 1, 0, 1, FLUID_HINT_TOGGLED); fluid_settings_register_int(settings, "synth.chorus.nr", FLUID_CHORUS_DEFAULT_N, 0, 99, 0); - fluid_settings_register_num(settings, "synth.chorus.level", FLUID_CHORUS_DEFAULT_LEVEL, 0.0f, 10.0f, 0); - fluid_settings_register_num(settings, "synth.chorus.speed", FLUID_CHORUS_DEFAULT_SPEED, 0.1f, 5.0f, 0); - fluid_settings_register_num(settings, "synth.chorus.depth", FLUID_CHORUS_DEFAULT_DEPTH, 0.0f, 256.0f, 0); + fluid_settings_register_num(settings, "synth.chorus.level", FLUID_CHORUS_DEFAULT_LEVEL, 0.0, 10.0, 0); + fluid_settings_register_num(settings, "synth.chorus.speed", FLUID_CHORUS_DEFAULT_SPEED, 0.1, 5.0, 0); + fluid_settings_register_num(settings, "synth.chorus.depth", FLUID_CHORUS_DEFAULT_DEPTH, 0.0, 256.0, 0); fluid_settings_register_int(settings, "synth.ladspa.active", 0, 0, 1, FLUID_HINT_TOGGLED); fluid_settings_register_int(settings, "synth.lock-memory", 1, 0, 1, FLUID_HINT_TOGGLED); @@ -223,12 +223,12 @@ void fluid_synth_settings(fluid_settings_t *settings) fluid_settings_register_int(settings, "synth.polyphony", 256, 1, 65535, 0); fluid_settings_register_int(settings, "synth.midi-channels", 16, 16, 256, 0); - fluid_settings_register_num(settings, "synth.gain", 0.2f, 0.0f, 10.0f, 0); + fluid_settings_register_num(settings, "synth.gain", 0.2, 0.0, 10.0, 0); fluid_settings_register_int(settings, "synth.audio-channels", 1, 1, 128, 0); fluid_settings_register_int(settings, "synth.audio-groups", 1, 1, 128, 0); fluid_settings_register_int(settings, "synth.effects-channels", 2, 2, 2, 0); fluid_settings_register_int(settings, "synth.effects-groups", 1, 1, 128, 0); - fluid_settings_register_num(settings, "synth.sample-rate", 44100.0f, 8000.0f, 96000.0f, 0); + fluid_settings_register_num(settings, "synth.sample-rate", 44100.0, 8000.0, 96000.0, 0); fluid_settings_register_int(settings, "synth.device-id", 0, 0, 127, 0); #ifdef ENABLE_MIXER_THREADS fluid_settings_register_int(settings, "synth.cpu-cores", 1, 1, 256, 0);