From fa5173cbaefed60121db057bad7be7686165f7cc Mon Sep 17 00:00:00 2001 From: Tom M Date: Fri, 29 Dec 2023 13:06:53 +0100 Subject: [PATCH 01/20] Implement MSGS-style Drum Note Cut (#1199) Address #1196 --- src/synth/fluid_synth.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index e635983ac..84960619d 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -6846,15 +6846,30 @@ fluid_synth_release_voice_on_same_note_LOCAL(fluid_synth_t *synth, int chan, && (fluid_voice_get_key(voice) == key) && (fluid_voice_get_id(voice) != synth->noteid)) { + enum fluid_midi_channel_type type = synth->channel[chan]->channel_type; + /* Id of voices that was sustained by sostenuto */ if(fluid_voice_is_sostenuto(voice)) { synth->storeid = fluid_voice_get_id(voice); } - /* Force the voice into release stage except if pedaling - (sostenuto or sustain) is active */ - fluid_voice_noteoff(voice); + switch(type) + { + case CHANNEL_TYPE_DRUM: + /* release the voice, this should make riding hi-hats or snares sound more + * realistic (Discussion #1196) */ + fluid_voice_off(voice); + break; + case CHANNEL_TYPE_MELODIC: + /* Force the voice into release stage except if pedaling (sostenuto or sustain) is active. + * This gives a more realistic sound to pianos and possibly other instruments (see PR #905). */ + fluid_voice_noteoff(voice); + break; + default: + FLUID_LOG(FLUID_ERR, "This should never happen: unknown channel type %d", (int)type); + break; + } } } } From bd04f3f6c81a114f3ad52c8e29be3b44dccd010f Mon Sep 17 00:00:00 2001 From: Alberto Salvia Novella Date: Tue, 2 Jan 2024 14:38:13 +0100 Subject: [PATCH 02/20] Make settings more pleasing, natural and subtler (#1287) --- AUTHORS | 7 +++++-- doc/fluidsettings.xml | 17 +++++++++-------- src/synth/fluid_synth.c | 2 +- src/synth/fluid_synth.h | 24 ++++++++++++------------ 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/AUTHORS b/AUTHORS index 8854b4bde..a130be0b3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -40,8 +40,11 @@ summary of contributions. changes and bug fixes and got the synthesizer to actually work. Most importantly, he used it on stage to make music. -* S. Christian Collins did much testing of FluidSynth in regards to - EMU10K1 compatibility and provided many synthesis fixes in that regard. +* S. Christian Collins provided many tests and fixes on EMU10K1 + compatibility. He also supplied reference chorus and reverb settings for + developing the default ones. + +* Alberto Salvia Novella developed the default chorus and reverb settings. * Stephane Letz from Grame wrote most of the MidiShare driver, all of the PortAudio driver, ported iiwusynth to MacOS X, and sent in many diff --git a/doc/fluidsettings.xml b/doc/fluidsettings.xml index 69ddaf0c3..c805077e4 100644 --- a/doc/fluidsettings.xml +++ b/doc/fluidsettings.xml @@ -47,7 +47,7 @@ Developers: chorus.depth num - 8.0 + 4.25 (since version 2.4.0),
8.0 (2.3.x and older)
0.0 256.0 @@ -57,7 +57,8 @@ Developers: chorus.level num - 2.0 + 0.6 (since version 2.4.0),
2.0 (2.3.x and older)
+ 0.0 10.0 @@ -77,7 +78,7 @@ Developers: chorus.speed num - 0.3 + 0.2 (since version 2.4.0),
0.3 (2.3.x and older)
0.1 5.0 @@ -140,7 +141,7 @@ Developers: gain num - 0.2 + 0.6 (since version 2.4.0),
0.2 (2.3.x and older)
0.0 10.0 @@ -312,7 +313,7 @@ Developers: reverb.damp num - 0.0 + 0.3 (since version 2.4.0),
0.0 (2.3.x and older)
0.0 1.0 @@ -322,7 +323,7 @@ Developers: reverb.level num - 0.9 + 0.7 (since version 2.4.0),
0.9 (2.3.x and older)
0.0 1.0 @@ -332,7 +333,7 @@ Developers: reverb.room-size num - 0.2 + 0.5 (since version 2.4.0),
0.2 (2.3.x and older)
0.0 1.0 @@ -342,7 +343,7 @@ Developers: reverb.width num - 0.5 + 0.8 (since version 2.4.0),
0.5 (2.3.x and older)
0.0 100.0 diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index 84960619d..807564303 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -223,7 +223,7 @@ 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.2, 0.0, 10.0, 0); + fluid_settings_register_num(settings, "synth.gain", 0.6, 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); diff --git a/src/synth/fluid_synth.h b/src/synth/fluid_synth.h index cb838e924..7dbcdc556 100644 --- a/src/synth/fluid_synth.h +++ b/src/synth/fluid_synth.h @@ -41,21 +41,21 @@ * * DEFINES */ -#define FLUID_NUM_PROGRAMS 128 -#define DRUM_INST_BANK 128 +#define FLUID_NUM_PROGRAMS 128 +#define DRUM_INST_BANK 128 -#define FLUID_UNSET_PROGRAM 128 /* Program number used to unset a preset */ +#define FLUID_UNSET_PROGRAM 128 /* Program number used to unset a preset */ -#define FLUID_REVERB_DEFAULT_ROOMSIZE 0.2f /**< Default reverb room size */ -#define FLUID_REVERB_DEFAULT_DAMP 0.0f /**< Default reverb damping */ -#define FLUID_REVERB_DEFAULT_WIDTH 0.5f /**< Default reverb width */ -#define FLUID_REVERB_DEFAULT_LEVEL 0.9f /**< Default reverb level */ +#define FLUID_REVERB_DEFAULT_DAMP 0.3f /**< Default reverb damping */ +#define FLUID_REVERB_DEFAULT_LEVEL 0.7f /**< Default reverb level */ +#define FLUID_REVERB_DEFAULT_ROOMSIZE 0.5f /**< Default reverb room size */ +#define FLUID_REVERB_DEFAULT_WIDTH 0.8f /**< Default reverb width */ -#define FLUID_CHORUS_DEFAULT_N 3 /**< Default chorus voice count */ -#define FLUID_CHORUS_DEFAULT_LEVEL 2.0f /**< Default chorus level */ -#define FLUID_CHORUS_DEFAULT_SPEED 0.3f /**< Default chorus speed */ -#define FLUID_CHORUS_DEFAULT_DEPTH 8.0f /**< Default chorus depth */ -#define FLUID_CHORUS_DEFAULT_TYPE FLUID_CHORUS_MOD_SINE /**< Default chorus waveform type */ +#define FLUID_CHORUS_DEFAULT_DEPTH 4.25f /**< Default chorus depth */ +#define FLUID_CHORUS_DEFAULT_LEVEL 0.6f /**< Default chorus level */ +#define FLUID_CHORUS_DEFAULT_N 3 /**< Default chorus voice count */ +#define FLUID_CHORUS_DEFAULT_SPEED 0.2f /**< Default chorus speed */ +#define FLUID_CHORUS_DEFAULT_TYPE FLUID_CHORUS_MOD_SINE /**< Default chorus waveform type */ /*************************************************************** * From 652df6f7d823ad6d7595889012eb71eeeaf1f5f8 Mon Sep 17 00:00:00 2001 From: derselbst Date: Mon, 25 Mar 2024 19:04:25 +0100 Subject: [PATCH 03/20] Fix signedness warning --- src/midi/fluid_midi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/midi/fluid_midi.c b/src/midi/fluid_midi.c index 10561d216..0c516238d 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; i Date: Mon, 25 Mar 2024 19:06:32 +0100 Subject: [PATCH 04/20] Fix ISO C warning --- src/drivers/fluid_pipewire.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/fluid_pipewire.c b/src/drivers/fluid_pipewire.c index b96019e87..ee75fd8e3 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); From 0901883d07efc7900038407a1cc8ec58e852a72d Mon Sep 17 00:00:00 2001 From: Marcus Weseloh Date: Tue, 26 Mar 2024 14:55:55 +0100 Subject: [PATCH 05/20] Stop the pipewire loop before destroying the stream Should fix #1305 --- src/drivers/fluid_pipewire.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/drivers/fluid_pipewire.c b/src/drivers/fluid_pipewire.c index ee75fd8e3..0b46765b3 100644 --- a/src/drivers/fluid_pipewire.c +++ b/src/drivers/fluid_pipewire.c @@ -295,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_stop(drv->pw_loop); + } + if(drv->pw_stream) { pw_stream_destroy(drv->pw_stream); From 05880963e812d94687c2855c26dddd829626e2c0 Mon Sep 17 00:00:00 2001 From: Marcus Weseloh Date: Tue, 26 Mar 2024 15:07:33 +0100 Subject: [PATCH 06/20] Lock thread loop before destroying stream Better fix for #1305 --- src/drivers/fluid_pipewire.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/fluid_pipewire.c b/src/drivers/fluid_pipewire.c index 0b46765b3..70f47ac58 100644 --- a/src/drivers/fluid_pipewire.c +++ b/src/drivers/fluid_pipewire.c @@ -297,7 +297,7 @@ void delete_fluid_pipewire_audio_driver(fluid_audio_driver_t *p) if (drv->pw_loop) { - pw_thread_loop_stop(drv->pw_loop); + pw_thread_loop_lock(drv->pw_loop); } if(drv->pw_stream) @@ -307,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); } From 56932cdc1fc6f2eb922e3bc71f1057587c338f72 Mon Sep 17 00:00:00 2001 From: derselbst Date: Tue, 26 Mar 2024 18:19:50 +0100 Subject: [PATCH 07/20] Deprecate LASH support Closes #1285 --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea8bbda11..918cec18b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ( STATUS "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") From a3b88ccfa41e0cecaf95af44af73d39dc1f47df0 Mon Sep 17 00:00:00 2001 From: derselbst Date: Tue, 26 Mar 2024 18:23:16 +0100 Subject: [PATCH 08/20] Make it a WARNING --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 918cec18b..606bf8e57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -600,7 +600,7 @@ unset ( LASH_SUPPORT CACHE ) if ( enable-lash ) find_package ( LASH ${LASH_MINIMUM_VERSION} ) if ( LASH_FOUND ) - message ( STATUS "Lash support has been deprecated and will be removed in fluidsynth 2.4.0" ) + 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") From 895f07de2d5e3f4f13d6ef3877e4ffdd1065f739 Mon Sep 17 00:00:00 2001 From: derselbst Date: Tue, 26 Mar 2024 18:27:45 +0100 Subject: [PATCH 09/20] Fix XG drum bank selection logic Fixes #1307 --- src/synth/fluid_chan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/synth/fluid_chan.c b/src/synth/fluid_chan.c index 0f2eecb44..84ca446b7 100644 --- a/src/synth/fluid_chan.c +++ b/src/synth/fluid_chan.c @@ -325,7 +325,7 @@ fluid_channel_set_bank_msb(fluid_channel_t *chan, int bankmsb) /* XG bank, do drum-channel auto-switch */ /* The number "120" was based on several keyboards having drums at 120 - 127, reference: https://lists.nongnu.org/archive/html/fluid-dev/2011-02/msg00003.html */ - chan->channel_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; } From 72cc6b3e8a0b1a4d1081849411e72e0d316828d8 Mon Sep 17 00:00:00 2001 From: derselbst Date: Tue, 26 Mar 2024 18:41:16 +0100 Subject: [PATCH 10/20] Remove LASH --- CMakeLists.txt | 13 --- FluidSynthConfig.cmake.in | 5 -- cmake_admin/FindLASH.cmake | 84 ------------------ cmake_admin/report.cmake | 6 -- contrib/fluidsynth.spec | 3 +- doc/fluidsynth.1 | 3 - src/CMakeLists.txt | 13 --- src/bindings/fluid_lash.c | 170 ------------------------------------- src/bindings/fluid_lash.h | 41 --------- src/config.cmake | 3 - src/drivers/fluid_alsa.c | 15 ---- src/drivers/fluid_jack.c | 15 ---- src/fluidsynth.c | 37 +------- 13 files changed, 2 insertions(+), 406 deletions(-) delete mode 100644 cmake_admin/FindLASH.cmake delete mode 100644 src/bindings/fluid_lash.c delete mode 100644 src/bindings/fluid_lash.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 606bf8e57..584f2e2ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,7 +102,6 @@ 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)" off ) option ( enable-alsa "compile ALSA support (if it is available)" on ) endif ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" ) @@ -507,7 +506,6 @@ endif(ASTYLE) set ( ALSA_MINIMUM_VERSION 0.9.1 ) set ( DBUS_MINIMUM_VERSION 1.11.12 ) set ( GLIB2_MINUMUM_VERSION 2.6.5 ) -set ( LASH_MINIMUM_VERSION 0.3 ) set ( LIBINSTPATCH_MINIMUM_VERSION 1.1.0 ) set ( LIBSNDFILE_MINIMUM_VERSION 1.0.0 ) set ( PIPEWIRE_MINIMUM_VERSION 0.3 ) @@ -596,17 +594,6 @@ if ( enable-pipewire ) endif() endif ( enable-pipewire ) -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") - endif ( LASH_FOUND ) -endif ( enable-lash ) - unset ( SYSTEMD_SUPPORT CACHE ) if ( enable-systemd ) find_package ( Systemd ) diff --git a/FluidSynthConfig.cmake.in b/FluidSynthConfig.cmake.in index 498846f10..0d251d957 100644 --- a/FluidSynthConfig.cmake.in +++ b/FluidSynthConfig.cmake.in @@ -28,7 +28,6 @@ set(FLUIDSYNTH_SUPPORT_DBUS @DBUS_SUPPORT@) set(FLUIDSYNTH_SUPPORT_GETOPT @HAVE_GETOPT_H@) set(FLUIDSYNTH_SUPPORT_IPV6 @IPV6_SUPPORT@) set(FLUIDSYNTH_SUPPORT_LADSPA @LADSPA_SUPPORT@) -set(FLUIDSYNTH_SUPPORT_LASH @LASH_SUPPORT@) set(FLUIDSYNTH_SUPPORT_NETWORK @NETWORK_SUPPORT@) set(FLUIDSYNTH_SUPPORT_READLINE @READLINE_SUPPORT@) set(FLUIDSYNTH_SUPPORT_SYSTEMD @SYSTEMD_SUPPORT@) @@ -92,10 +91,6 @@ if(NOT FLUIDSYNTH_IS_SHARED) message(WARN "LADSPA support was built in but gmodule could not be found.") endif() - if(FLUIDSYNTH_SUPPORT_LASH AND NOT TARGET LASH::LASH) - find_dependency(LASH @LASH_MINIMUM_VERSION@) - endif() - if(FLUIDSYNTH_SUPPORT_LIBINSTPATCH AND NOT TARGET InstPatch::libinstpatch) find_dependency(InstPatch @LIBINSTPATCH_MINIMUM_VERSION@) endif() diff --git a/cmake_admin/FindLASH.cmake b/cmake_admin/FindLASH.cmake deleted file mode 100644 index 7cbcbaa3d..000000000 --- a/cmake_admin/FindLASH.cmake +++ /dev/null @@ -1,84 +0,0 @@ -#[=======================================================================[.rst: -FindLASH -------- - -Finds the LASH library. - -Imported Targets -^^^^^^^^^^^^^^^^ - -This module provides the following imported targets, if found: - -``LASH::LASH`` - The LASH library - -Result Variables -^^^^^^^^^^^^^^^^ - -This will define the following variables: - -``LASH_FOUND`` - True if the system has the LASH library. -``LASH_VERSION`` - The version of the LASH library which was found. - -#]=======================================================================] - -# Use pkg-config if available -find_package(PkgConfig QUIET) -pkg_check_modules(PC_LASH QUIET lash-1.0) - -# Find the headers and library -find_path( - LASH_INCLUDE_DIR - NAMES "lash/lash.h" - HINTS "${PC_LASH_INCLUDEDIR}" - PATH_SUFFIXES "lash-1.0") - -find_library( - LASH_LIBRARY - NAMES "lash" - HINTS "${PC_LASH_LIBDIR}") - -# Get version from pkg-config or read the config header -if(PC_LASH_VERSION) - set(LASH_VERSION "${PC_LASH_VERSION}") -else() - if(NOT LASH_FIND_VERSION) - set(_assumed_version "0.5.0") - else() - set(_assumed_version "${LASH_FIND_VERSION}") - endif() - message( - NOTICE - "LASH does not expose its version outside of pkg-config. Assuming version ${_assumed_version}, expect failure if your version is lower." - ) - set(LASH_VERSION ${_assumed_version}) -endif() - -# Handle transitive dependencies -if(PC_LASH_FOUND) - get_target_properties_from_pkg_config("${LASH_LIBRARY}" "PC_LASH" "_lash") -else() - set(_lash_link_libraries "Jack::Jack" "Threads::Threads" "ALSA::ALSA" "uuid") -endif() - -# Forward the result to CMake -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args( - LASH - REQUIRED_VARS "LASH_LIBRARY" "LASH_INCLUDE_DIR" - VERSION_VAR "LASH_VERSION") - -if(LASH_FOUND AND NOT TARGET LASH::LASH) - add_library(LASH::LASH UNKNOWN IMPORTED) - set_target_properties( - LASH::LASH - PROPERTIES IMPORTED_LOCATION "${LASH_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${_lash_compile_options}" - INTERFACE_INCLUDE_DIRECTORIES "${LASH_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${_lash_link_libraries}" - INTERFACE_LINK_DIRECTORIES "${_lash_link_directories}") -endif() - -mark_as_advanced(LASH_INCLUDE_DIR LASH_LIBRARY) diff --git a/cmake_admin/report.cmake b/cmake_admin/report.cmake index 882b8d6d6..85b375454 100644 --- a/cmake_admin/report.cmake +++ b/cmake_admin/report.cmake @@ -153,12 +153,6 @@ else ( LADSPA_SUPPORT ) set ( MISC_REPORT "${MISC_REPORT} LADSPA support: no\n" ) endif ( LADSPA_SUPPORT ) -if ( LASH_SUPPORT ) - set ( MISC_REPORT "${MISC_REPORT} LASH support: yes (NOTE: GPL library)\n" ) -else ( LASH_SUPPORT ) - set ( MISC_REPORT "${MISC_REPORT} LASH support: no\n" ) -endif ( LASH_SUPPORT ) - if ( NETWORK_SUPPORT ) set ( MISC_REPORT "${MISC_REPORT} NETWORK Support: yes\n" ) else ( NETWORK_SUPPORT ) diff --git a/contrib/fluidsynth.spec b/contrib/fluidsynth.spec index e5fb75e04..b34da6742 100644 --- a/contrib/fluidsynth.spec +++ b/contrib/fluidsynth.spec @@ -79,8 +79,7 @@ This package contains the shared library for Fluidsynth. %build %cmake \ - -DFLUID_DAEMON_ENV_FILE=%{_fillupdir}/sysconfig.%{name} \ - -Denable-lash=0 + -DFLUID_DAEMON_ENV_FILE=%{_fillupdir}/sysconfig.%{name} %cmake_build %check diff --git a/doc/fluidsynth.1 b/doc/fluidsynth.1 index 5140312d1..9debe59db 100644 --- a/doc/fluidsynth.1 +++ b/doc/fluidsynth.1 @@ -98,9 +98,6 @@ Attempt to connect the jack outputs to the physical ports .B \-K, \-\-midi\-channels=[num] The number of midi channels [default = 16] .TP -.B \-l, \-\-disable\-lash -Don't connect to LASH server -.TP .B \-L, \-\-audio\-channels=[num] The number of stereo audio channels [default = 1] .TP diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 808b8b8f8..771075adf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -77,10 +77,6 @@ if ( OSS_SUPPORT ) set ( fluid_oss_SOURCES drivers/fluid_oss.c ) endif ( OSS_SUPPORT ) -if ( LASH_SUPPORT ) - set ( fluid_lash_SOURCES bindings/fluid_lash.c bindings/fluid_lash.h ) -endif ( LASH_SUPPORT ) - if ( DART_SUPPORT ) set ( fluid_dart_SOURCES drivers/fluid_dart.c ) endif ( DART_SUPPORT ) @@ -237,7 +233,6 @@ add_library ( libfluidsynth-OBJ OBJECT ${fluid_dbus_SOURCES} ${fluid_jack_SOURCES} ${fluid_pipewire_SOURCES} - ${fluid_lash_SOURCES} ${fluid_midishare_SOURCES} ${fluid_opensles_SOURCES} ${fluid_oboe_SOURCES} @@ -390,10 +385,6 @@ if ( TARGET PipeWire::PipeWire AND PIPEWIRE_SUPPORT ) target_link_libraries ( libfluidsynth-OBJ PUBLIC PipeWire::PipeWire ) endif() -if ( TARGET LASH::LASH AND LASH_SUPPORT ) - target_link_libraries ( libfluidsynth-OBJ PUBLIC LASH::LASH ) -endif() - if ( TARGET dbus-1 AND DBUS_SUPPORT ) target_link_libraries ( libfluidsynth-OBJ PUBLIC dbus-1 ) endif() @@ -499,10 +490,6 @@ if ( TARGET PipeWire::PipeWire AND PIPEWIRE_SUPPORT ) # because pw_init() etc. target_link_libraries ( fluidsynth PRIVATE PipeWire::PipeWire ) endif() -if ( TARGET LASH::LASH AND LASH_SUPPORT ) - target_link_libraries ( fluidsynth PRIVATE LASH::LASH ) -endif() - if ( MACOSX_FRAMEWORK ) install ( TARGETS fluidsynth libfluidsynth EXPORT FluidSynthTargets diff --git a/src/bindings/fluid_lash.c b/src/bindings/fluid_lash.c deleted file mode 100644 index 652ccb268..000000000 --- a/src/bindings/fluid_lash.c +++ /dev/null @@ -1,170 +0,0 @@ -/* FluidSynth - A Software Synthesizer - * - * Copyright (C) 2003 Peter Hanappe and others. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA - */ -#include "fluid_lash.h" - -#ifdef HAVE_LASH - -static void fluid_lash_save(fluid_synth_t *synth); -static void fluid_lash_load(fluid_synth_t *synth, const char *filename); -static void *fluid_lash_run(void *data); - -/* - * lash client - this symbol needs to be in the library else - * all clients would need a fluid_lash_client symbol. - */ -lash_client_t *fluid_lash_client; - -static pthread_t fluid_lash_thread; - - -fluid_lash_args_t * -fluid_lash_extract_args(int *pargc, char ***pargv) -{ - return lash_extract_args(pargc, pargv); -} - -int -fluid_lash_connect(fluid_lash_args_t *args) -{ - fluid_lash_client = lash_init(args, PACKAGE, LASH_Config_Data_Set | LASH_Terminal, LASH_PROTOCOL(2, 0)); - return fluid_lash_client && lash_enabled(fluid_lash_client); -} - -void -fluid_lash_create_thread(fluid_synth_t *synth) -{ - pthread_create(&fluid_lash_thread, NULL, fluid_lash_run, synth); -} - -static void -fluid_lash_save(fluid_synth_t *synth) -{ - int i; - int sfcount; - fluid_sfont_t *sfont; - lash_config_t *config; - char num[32]; - - sfcount = fluid_synth_sfcount(synth); - - config = lash_config_new(); - lash_config_set_key(config, "soundfont count"); - lash_config_set_value_int(config, sfcount); - lash_send_config(fluid_lash_client, config); - - for(i = sfcount - 1; i >= 0; i--) - { - sfont = fluid_synth_get_sfont(synth, i); - config = lash_config_new(); - - sprintf(num, "%d", i); - - lash_config_set_key(config, num); - lash_config_set_value_string(config, sfont->get_name(sfont)); - - lash_send_config(fluid_lash_client, config); - } -} - -static void -fluid_lash_load(fluid_synth_t *synth, const char *filename) -{ - fluid_synth_sfload(synth, filename, 1); -} - -static void * -fluid_lash_run(void *data) -{ - lash_event_t *event; - lash_config_t *config; - fluid_synth_t *synth; - int done = 0; - int err; - int pending_restores = 0; - - synth = (fluid_synth_t *) data; - - while(!done) - { - while((event = lash_get_event(fluid_lash_client))) - { - switch(lash_event_get_type(event)) - { - case LASH_Save_Data_Set: - fluid_lash_save(synth); - lash_send_event(fluid_lash_client, event); - break; - - case LASH_Restore_Data_Set: - lash_event_destroy(event); - break; - - case LASH_Quit: - err = kill(getpid(), SIGQUIT); - - if(err) - { - fprintf(stderr, "%s: error sending signal: %s", __FUNCTION__, strerror(errno)); - } - - lash_event_destroy(event); - done = 1; - break; - - case LASH_Server_Lost: - lash_event_destroy(event); - done = 1; - break; - - default: - fprintf(stderr, "Received unknown LASH event of type %d\n", lash_event_get_type(event)); - lash_event_destroy(event); - break; - } - } - - while((config = lash_get_config(fluid_lash_client))) - { - if(FLUID_STRCMP(lash_config_get_key(config), "soundfont count") == 0) - { - pending_restores = lash_config_get_value_int(config); - } - else - { - fluid_lash_load(synth, lash_config_get_value_string(config)); - pending_restores--; - } - - lash_config_destroy(config); - - if(!pending_restores) - { - event = lash_event_new_with_type(LASH_Restore_Data_Set); - lash_send_event(fluid_lash_client, event); - } - } - - usleep(10000); - } - - return NULL; -} - -#endif /* #if HAVE_LASH #else */ diff --git a/src/bindings/fluid_lash.h b/src/bindings/fluid_lash.h deleted file mode 100644 index 787683906..000000000 --- a/src/bindings/fluid_lash.h +++ /dev/null @@ -1,41 +0,0 @@ -/* FluidSynth - A Software Synthesizer - * - * Copyright (C) 2003 Peter Hanappe and others. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA - */ -#ifndef _FLUID_LASH_H -#define _FLUID_LASH_H - -#include "config.h" - -#ifdef HAVE_LASH - -#include "fluid_synth.h" - -#include -extern lash_client_t *fluid_lash_client; -#define fluid_lash_args_t lash_args_t -#define fluid_lash_alsa_client_id lash_alsa_client_id -#define fluid_lash_jack_client_name lash_jack_client_name - - -FLUIDSYNTH_API fluid_lash_args_t *fluid_lash_extract_args(int *pargc, char ***pargv); -FLUIDSYNTH_API int fluid_lash_connect(fluid_lash_args_t *args); -FLUIDSYNTH_API void fluid_lash_create_thread(fluid_synth_t *synth); - -#endif /* defined(HAVE_LASH) */ -#endif /* _FLUID_LASH_H */ diff --git a/src/config.cmake b/src/config.cmake index 436add7f2..94324e815 100644 --- a/src/config.cmake +++ b/src/config.cmake @@ -43,9 +43,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_IO_H @HAVE_IO_H@ -/* whether or not we are supporting lash */ -#cmakedefine HAVE_LASH @HAVE_LASH@ - /* Define if systemd support is enabled */ #cmakedefine SYSTEMD_SUPPORT @SYSTEMD_SUPPORT@ diff --git a/src/drivers/fluid_alsa.c b/src/drivers/fluid_alsa.c index 98ae8f2c0..52d051fcd 100644 --- a/src/drivers/fluid_alsa.c +++ b/src/drivers/fluid_alsa.c @@ -37,8 +37,6 @@ #include #include -#include "fluid_lash.h" - #define FLUID_ALSA_DEFAULT_MIDI_DEVICE "default" #define FLUID_ALSA_DEFAULT_SEQ_DEVICE "default" @@ -1241,19 +1239,6 @@ new_fluid_alsa_seq_driver(fluid_settings_t *settings, fluid_alsa_seq_autoconnect(dev); } - /* tell the lash server our client id */ -#ifdef HAVE_LASH - { - int enable_lash = 0; - fluid_settings_getint(settings, "lash.enable", &enable_lash); - - if(enable_lash) - { - fluid_lash_alsa_client_id(fluid_lash_client, snd_seq_client_id(dev->seq_handle)); - } - } -#endif /* HAVE_LASH */ - fluid_atomic_int_set(&dev->should_quit, 0); /* create the MIDI thread */ diff --git a/src/drivers/fluid_jack.c b/src/drivers/fluid_jack.c index 2b0084804..6ee2a4f7d 100644 --- a/src/drivers/fluid_jack.c +++ b/src/drivers/fluid_jack.c @@ -38,8 +38,6 @@ #include #include -#include "fluid_lash.h" - typedef struct _fluid_jack_audio_driver_t fluid_jack_audio_driver_t; typedef struct _fluid_jack_midi_driver_t fluid_jack_midi_driver_t; @@ -265,19 +263,6 @@ new_fluid_jack_client(fluid_settings_t *settings, int isaudio, void *driver) goto error_recovery; } - /* tell the lash server our client name */ -#ifdef HAVE_LASH - { - int enable_lash = 0; - fluid_settings_getint(settings, "lash.enable", &enable_lash); - - if(enable_lash) - { - fluid_lash_jack_client_name(fluid_lash_client, name); - } - } -#endif /* HAVE_LASH */ - client_ref->server = server; /* !! takes over allocation */ server = NULL; /* Set to NULL so it doesn't get freed below */ diff --git a/src/fluidsynth.c b/src/fluidsynth.c index 81de1a8d8..11c917dfe 100644 --- a/src/fluidsynth.c +++ b/src/fluidsynth.c @@ -29,8 +29,6 @@ #define GETOPT_SUPPORT 1 #endif -#include "fluid_lash.h" - #ifdef SYSTEMD_SUPPORT #include #endif @@ -392,13 +390,6 @@ int main(int argc, char **argv) int dump = 0; int fast_render = 0; static const char optchars[] = "a:C:c:dE:f:F:G:g:hijK:L:lm:nO:o:p:QqR:r:sT:Vvz:"; -#ifdef HAVE_LASH - int connect_lash = 1; - int enabled_lash = 0; /* set to TRUE if lash gets enabled */ - fluid_lash_args_t *lash_args; - - lash_args = fluid_lash_extract_args(&argc, &argv); -#endif #if SDL2_SUPPORT // Tell SDL that it shouldn't intercept signals, otherwise SIGINT and SIGTERM won't quit fluidsynth @@ -653,9 +644,7 @@ int main(int argc, char **argv) break; case 'l': /* disable LASH */ -#ifdef HAVE_LASH - connect_lash = 0; -#endif + // lash support removed in 2.4.0, NOOP break; case 'm': @@ -853,17 +842,6 @@ int main(int argc, char **argv) SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS); #endif -#ifdef HAVE_LASH - - /* connect to the lash server */ - if(connect_lash) - { - enabled_lash = fluid_lash_connect(lash_args); - fluid_settings_setint(settings, "lash.enable", enabled_lash ? 1 : 0); - } - -#endif - /* The 'groups' setting is relevant for LADSPA operation and channel mapping * in rvoice_mixer. * If not given, set number groups to number of audio channels, because @@ -1095,15 +1073,6 @@ int main(int argc, char **argv) #endif } -#endif - -#ifdef HAVE_LASH - - if(enabled_lash) - { - fluid_lash_create_thread(synth); - } - #endif /* fast rendering audio file, if requested */ @@ -1284,10 +1253,6 @@ print_help(fluid_settings_t *settings) " Attempt to connect the jack outputs to the physical ports\n"); printf(" -K, --midi-channels=[num]\n" " The number of midi channels [default = 16]\n"); -#ifdef HAVE_LASH - printf(" -l, --disable-lash\n" - " Don't connect to LASH server\n"); -#endif printf(" -L, --audio-channels=[num]\n" " The number of stereo audio channels [default = 1]\n"); printf(" -m, --midi-driver=[label]\n" From 619fc5c3380513146cd05e17decf8d747b02bba4 Mon Sep 17 00:00:00 2001 From: derselbst Date: Tue, 26 Mar 2024 18:52:36 +0100 Subject: [PATCH 11/20] Add FLUID_HOST_COMPILER cmake variable Fixes #1301 --- src/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 808b8b8f8..181b8ae5a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -548,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}/" From db86c36bca6a14d661f23adf913abf52708dff73 Mon Sep 17 00:00:00 2001 From: Tom M Date: Tue, 26 Mar 2024 19:01:54 +0100 Subject: [PATCH 12/20] Remove vcpkg CI badge from README --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index aabba6a90..a5ec166a5 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,7 @@ | **Linux** (Packaging) | [![build result](https://build.opensuse.org/projects/home:derselbst:anmp/packages/fluidsynth/badge.svg?type=default)](https://build.opensuse.org/package/show/home:derselbst:anmp/fluidsynth) | **Alpine** (musl) | [![Fluidsynth Alpine](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status%2FFluidSynth.fluidsynth.alpine?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=12&branchName=alpine) | | **FreeBSD** | [![Build Status](https://api.cirrus-ci.com/github/FluidSynth/fluidsynth.svg?branch=master)](https://cirrus-ci.com/github/FluidSynth/fluidsynth) | -| **Windows** (CI) | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.Win?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=3&branchName=master) | -| **Windows** (vcpkg) | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.vcpkg?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=6&branchName=master) | +| **Windows** | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.Win?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=3&branchName=master) | | **MacOSX** | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.macOS?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=5&branchName=master) | | **Android** | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.Android?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=4&branchName=master) | From e104532a0011793d1c7204d3035f2ac189c0ce78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20L=C3=B3pez-Cabanillas?= Date: Sat, 20 Apr 2024 21:38:15 +0200 Subject: [PATCH 13/20] add a new windows workflow based on msys2 (#1316) --- .github/workflows/windows.yml | 75 +++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 000000000..c225a5e86 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,75 @@ +name: Fluidsynth Windows + +on: + pull_request: + push: + paths-ignore: + - '.azure/**' + - '.circleci/**' + - '.github/workflows/sonarcloud.yml' + - '.cirrus.yml' + - 'README.md' + +env: + BUILD_TYPE: RelWithDebInfo + INSTALL_LOCATION: fluidsynth_install + +jobs: + build: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + include: + - { icon: 'âŦ›', sys: mingw32 } + - { icon: 'đŸŸĻ', sys: mingw64 } + - { icon: '🟨', sys: ucrt64 } + - { icon: '🟧', sys: clang64 } + name: 🚧${{ matrix.icon }} ${{ matrix.sys }} + defaults: + run: + shell: msys2 {0} + + steps: + - uses: actions/checkout@v4 + + - name: '${{ matrix.icon }} Setup MSYS2' + uses: msys2/setup-msys2@v2 + with: + release: false + msystem: ${{matrix.sys}} + install: >- + make + libreadline + pacboy: >- + toolchain:p + cmake:p + ninja:p + glib2:p + libsndfile:p + + - name: '${{ matrix.icon }} Configure CMake' + run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_LOCATION}} + + - name: '${{ matrix.icon }} Build' + run: cmake --build build --config ${{env.BUILD_TYPE}} + + #- name: '${{ matrix.icon }} Test' + # run: cmake --build build --target check + + - name: '${{ matrix.icon }} Demo' + run: cmake --build build --target demo + + - name: '${{ matrix.icon }} Install' + run: cmake --install build && ls -la $INSTALL_LOCATION + + - name: '${{ matrix.icon }} Create Archive' + run: tar cvf ${{env.INSTALL_LOCATION}}.tar ${{env.INSTALL_LOCATION}} + + - name: '${{ matrix.icon }} Upload Artifacts' + uses: actions/upload-artifact@v4 + with: + name: ${{env.INSTALL_LOCATION}}-${{matrix.sys}} + path: ${{env.INSTALL_LOCATION}}.tar + retention-days: 90 + overwrite: true From f78a9db2971c2ce1a1f29514c52325f390dce8c7 Mon Sep 17 00:00:00 2001 From: Tom M Date: Sat, 20 Apr 2024 21:59:58 +0200 Subject: [PATCH 14/20] Minor fixups for MSYS2 CI (#1317) --- .github/workflows/windows.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c225a5e86..84a051237 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -54,8 +54,8 @@ jobs: - name: '${{ matrix.icon }} Build' run: cmake --build build --config ${{env.BUILD_TYPE}} - #- name: '${{ matrix.icon }} Test' - # run: cmake --build build --target check + - name: '${{ matrix.icon }} Test' + run: cmake --build build --target check - name: '${{ matrix.icon }} Demo' run: cmake --build build --target demo @@ -63,13 +63,10 @@ jobs: - name: '${{ matrix.icon }} Install' run: cmake --install build && ls -la $INSTALL_LOCATION - - name: '${{ matrix.icon }} Create Archive' - run: tar cvf ${{env.INSTALL_LOCATION}}.tar ${{env.INSTALL_LOCATION}} - - name: '${{ matrix.icon }} Upload Artifacts' uses: actions/upload-artifact@v4 with: name: ${{env.INSTALL_LOCATION}}-${{matrix.sys}} - path: ${{env.INSTALL_LOCATION}}.tar - retention-days: 90 + path: ${{env.INSTALL_LOCATION}} + retention-days: 14 overwrite: true From abdd0985160673443f1170c04985c5c9f880e995 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 22 Apr 2024 00:30:21 +0200 Subject: [PATCH 15/20] Keep GitHub Actions up to date with GitHub's Dependabot Fixes the 16 software supply chain safety warnings at the bottom right of https://github.com/FluidSynth/fluidsynth/actions/runs/8767406884 * [Keeping your actions up to date with Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot) * [Configuration options for the dependabot.yml file - package-ecosystem](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem) --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..be006de9a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# Keep GitHub Actions up to date with GitHub's Dependabot... +# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot +# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + groups: + github-actions: + patterns: + - "*" # Group all Actions updates into a single larger pull request + schedule: + interval: weekly From 7a4f8c7242e4f2a4cdc3114b1c7c7f26f2832e28 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 16:52:49 +0000 Subject: [PATCH 16/20] Bump the github-actions group with 2 updates Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action). Updates `actions/checkout` from 3 to 4 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) Updates `github/codeql-action` from 2 to 3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/api_doc_build.yml | 2 +- .github/workflows/codeql-analysis.yml | 8 ++++---- .github/workflows/linux.yml | 2 +- .github/workflows/sonarcloud.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/api_doc_build.yml b/.github/workflows/api_doc_build.yml index 40aabc6d9..5bafa38f3 100644 --- a/.github/workflows/api_doc_build.yml +++ b/.github/workflows/api_doc_build.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4939b2b43..b7566752f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,11 +39,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -57,7 +57,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -71,4 +71,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index efd02e33f..0977c7a59 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -53,7 +53,7 @@ jobs: # clang11 is covered by openSUSE Leap 15.3 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Add apt-get repositories run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index b2ae8868d..e73a02158 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -24,7 +24,7 @@ jobs: sonarcloud: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Disabling shallow clone is recommended for improving relevancy of reporting fetch-depth: 0 From af8de7b345093b2961f40004e8d8220136713b14 Mon Sep 17 00:00:00 2001 From: 7dog123 Date: Mon, 6 May 2024 18:49:09 -0500 Subject: [PATCH 17/20] Sloppy port to PS2 --- CMakeLists.txt | 104 +++++++++++++++++++++++++----------- src/CMakeLists.txt | 1 + src/utils/fluid_sys.c | 71 +++++++++++++++++++++++- src/utils/fluidsynth_priv.h | 4 ++ 4 files changed, 149 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b002e47a..192ca7058 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,32 +74,62 @@ option ( enable-portaudio "compile PortAudio support" off ) option ( enable-profiling "profile the dsp code" off ) option ( enable-trap-on-fpe "enable SIGFPE trap on Floating Point Exceptions" off ) option ( enable-ubsan "compile and link against UBSan (for debugging fluidsynth internals)" off ) - # Options enabled by default -option ( enable-aufile "compile support for sound file output" on ) -option ( BUILD_SHARED_LIBS "Build a shared object or DLL" on ) -option ( enable-dbus "compile DBUS support (if it is available)" on ) -option ( enable-ipv6 "enable IPv6 support at the cost of disabling IPv4" on ) -option ( enable-jack "compile JACK support (if it is available)" on ) +if ( PS2 ) + option ( enable-aufile "compile support for sound file output" off ) + option ( BUILD_SHARED_LIBS "Build a shared object or DLL" off ) + option ( enable-dbus "compile DBUS support (if it is available)" off ) + option ( enable-ipv6 "enable IPv6 support at the cost of disabling IPv4" off ) + option ( enable-jack "compile JACK support (if it is available)" off ) +else () + option ( enable-aufile "compile support for sound file output" on ) + option ( BUILD_SHARED_LIBS "Build a shared object or DLL" on ) + option ( enable-dbus "compile DBUS support (if it is available)" on ) + option ( enable-ipv6 "enable IPv6 support at the cost of disabling IPv4" on ) + option ( enable-jack "compile JACK support (if it is available)" on ) +endif() option ( enable-ladspa "enable LADSPA effect units" off ) -option ( enable-libinstpatch "use libinstpatch (if available) to load DLS and GIG files" on ) -option ( enable-libsndfile "compile libsndfile support (if it is available)" on ) -option ( enable-midishare "compile MidiShare support (if it is available)" on ) + +if ( PS2 ) + option ( enable-libinstpatch "use libinstpatch (if available) to load DLS and GIG files" off ) + option ( enable-libsndfile "compile libsndfile support (if it is available)" off ) + option ( enable-midishare "compile MidiShare support (if it is available)" off ) +else () + option ( enable-libinstpatch "use libinstpatch (if available) to load DLS and GIG files" on ) + option ( enable-libsndfile "compile libsndfile support (if it is available)" on ) + option ( enable-midishare "compile MidiShare support (if it is available)" on ) +endif() + option ( enable-opensles "compile OpenSLES support (if it is available)" off ) option ( enable-oboe "compile Oboe support (requires OpenSLES and/or AAudio)" off ) -option ( enable-network "enable network support (requires BSD sockets)" on ) -option ( enable-oss "compile OSS support (if it is available)" on ) -option ( enable-dsound "compile DirectSound support (if it is available)" on ) -option ( enable-wasapi "compile Windows WASAPI support (if it is available)" on ) -option ( enable-waveout "compile Windows WaveOut support (if it is available)" on ) -option ( enable-winmidi "compile Windows MIDI support (if it is available)" on ) -option ( enable-sdl2 "compile SDL2 audio support (if it is available)" on ) -option ( enable-pulseaudio "compile PulseAudio support (if it is available)" on ) -option ( enable-pipewire "compile PipeWire support (if it is available)" on ) -option ( enable-readline "compile readline lib line editing (if it is available)" on ) -option ( enable-threads "enable multi-threading support (such as parallel voice synthesis)" on ) -option ( enable-openmp "enable OpenMP support (parallelization of soundfont decoding, vectorization of voice mixing, etc.)" on ) +if ( PS2 ) + option ( enable-network "enable network support (requires BSD sockets)" off ) + option ( enable-oss "compile OSS support (if it is available)" off ) + option ( enable-dsound "compile DirectSound support (if it is available)" off ) + option ( enable-wasapi "compile Windows WASAPI support (if it is available)" off ) + option ( enable-waveout "compile Windows WaveOut support (if it is available)" off ) + option ( enable-winmidi "compile Windows MIDI support (if it is available)" off ) + option ( enable-sdl2 "compile SDL2 audio support (if it is available)" off ) + option ( enable-pulseaudio "compile PulseAudio support (if it is available)" off ) + option ( enable-pipewire "compile PipeWire support (if it is available)" off ) + option ( enable-readline "compile readline lib line editing (if it is available)" off ) + option ( enable-threads "enable multi-threading support (such as parallel voice synthesis)" off ) + option ( enable-openmp "enable OpenMP support (parallelization of soundfont decoding, vectorization of voice mixing, etc.)" off ) +else() + option ( enable-network "enable network support (requires BSD sockets)" on ) + option ( enable-oss "compile OSS support (if it is available)" on ) + option ( enable-dsound "compile DirectSound support (if it is available)" on ) + option ( enable-wasapi "compile Windows WASAPI support (if it is available)" on ) + option ( enable-waveout "compile Windows WaveOut support (if it is available)" on ) + option ( enable-winmidi "compile Windows MIDI support (if it is available)" on ) + option ( enable-sdl2 "compile SDL2 audio support (if it is available)" on ) + option ( enable-pulseaudio "compile PulseAudio support (if it is available)" on ) + option ( enable-pipewire "compile PipeWire support (if it is available)" on ) + option ( enable-readline "compile readline lib line editing (if it is available)" on ) + option ( enable-threads "enable multi-threading support (such as parallel voice synthesis)" on ) + option ( enable-openmp "enable OpenMP support (parallelization of soundfont decoding, vectorization of voice mixing, etc.)" on ) +endif() # Platform specific options if ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" ) option ( enable-lash "compile LASH support (if it is available)" on ) @@ -122,10 +152,18 @@ if ( CMAKE_SYSTEM MATCHES "OS2" ) endif ( CMAKE_SYSTEM MATCHES "OS2" ) # the default C standard to use for all targets -set(CMAKE_C_STANDARD 90) +if ( PS2 ) + set(CMAKE_C_STANDARD 99) +else () + set(CMAKE_C_STANDARD 90) +endif () # the default C++ standard to use for all targets -set(CMAKE_CXX_STANDARD 98) +if ( PS2 ) + set(CMAKE_CXX_STANDARD 11) +else () + set(CMAKE_CXX_STANDARD 98) +endif () # whether to use gnu extensions set(CMAKE_C_EXTENSIONS ON) @@ -213,13 +251,7 @@ if ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_C endif ( HAVE_INCOMPATIBLE_POINTER_TYPES ) set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -Wpointer-arith -Wcast-qual -Wno-unused-parameter" ) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") - set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) - set(CMAKE_C_STANDARD 11) - set(CMAKE_C_STANDARD_REQUIRED ON) - set(CMAKE_C_EXTENSIONS ON) + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lpthread" ) # prepend to build type specific flags, to allow users to override set ( CMAKE_C_FLAGS_DEBUG "-g ${CMAKE_C_FLAGS_DEBUG}" ) @@ -360,6 +392,10 @@ if ( WIN32 ) endif ( MINGW ) endif ( WIN32 ) +if ( PS2 ) + set ( LIBFLUID_CPPFLAGS "-DFLUIDSYNTH_NOT_A_DLL -DFLUID_MUTEX_INIT" ) +endif () + # Check for threads and math find_package ( Threads REQUIRED ) @@ -370,6 +406,14 @@ endif ( HAS_LIBM ) set ( LIBFLUID_LIBS ${MATH_LIBRARY} Threads::Threads ) +unset ( PS2DEV_LIBS CACHE) +if ( PS2 ) + set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L$ENV{PS2SDK}/iop/lib") + set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -Wwrite-strings -Wcast-align -Wimplicit-int -Wsequence-point -fsigned-char") + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -Wwrite-strings -Wcast-align -Wsequence-point -fsigned-char") + set ( PS2DEV_LIBS "${PS2DEV_LIBS};cdvd;kernel;debug;mc;c;audsrv;gskit" ) +endif () + # IBM OS/2 unset ( DART_SUPPORT CACHE ) unset ( DART_LIBS CACHE ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c8d5ab3c2..e7257b6b4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -358,6 +358,7 @@ target_link_libraries ( libfluidsynth-OBJ PUBLIC ${COREMIDI_LIBS} ${WINDOWS_LIBS} ${LIBFLUID_LIBS} + ${PS2DEV_LIBS} ) if ( TARGET OpenMP::OpenMP_C AND HAVE_OPENMP ) diff --git a/src/utils/fluid_sys.c b/src/utils/fluid_sys.c index e1c0214c5..94d7d6216 100644 --- a/src/utils/fluid_sys.c +++ b/src/utils/fluid_sys.c @@ -30,10 +30,79 @@ #include "fluid_rtkit.h" #endif -#if HAVE_PTHREAD_H && !defined(_WIN32) +#if HAVE_PTHREAD_H && !defined(_WIN32) defined(PS2) // Do not include pthread on windows. It includes winsock.h, which collides with ws2tcpip.h from fluid_sys.h // It isn't need on Windows anyway. #include + +static pthread_mutex_t g_atomic_lock = PTHREAD_MUTEX_INITIALIZER; + +int pthread_atomic_int_get(const volatile int *atomic) +{ + int value; + + pthread_mutex_lock (&g_atomic_lock); + value = *atomic; + pthread_mutex_unlock (&g_atomic_lock); + + return value; +} + +void pthread_atomic_int_inc(volatile int *atomic) +{ + pthread_mutex_lock (&g_atomic_lock); + (*atomic)++; + pthread_mutex_unlock (&g_atomic_lock); +} + +void pthread_atomic_int_set(volatile int *atomic, + int value) +{ + pthread_mutex_lock (&g_atomic_lock); + *atomic = value; + pthread_mutex_unlock (&g_atomic_lock); +} + +bool pthread_atomic_int_dec_and_test (volatile int *atomic) +{ + bool is_zero; + + pthread_mutex_lock (&g_atomic_lock); + is_zero = --(*atomic) == 0; + pthread_mutex_unlock (&g_atomic_lock); + + return is_zero; +} + +bool pthread_atomic_int_compare_and_exchange(volatile int *atomic, + int oldval, + int newval) +{ + bool success; + + pthread_mutex_lock (&g_atomic_lock); + + if ((success = (*atomic == oldval))) + *atomic = newval; + + pthread_mutex_unlock (&g_atomic_lock); + + return success; +} + +int pthread_atomic_int_add(volatile int *atomic, + int val) +{ + int oldval; + + pthread_mutex_lock (&g_atomic_lock); + oldval = *atomic; + *atomic = oldval + val; + pthread_mutex_unlock (&g_atomic_lock); + + return oldval; +} + #endif /* WIN32 HACK - Flag used to differentiate between a file descriptor and a socket. diff --git a/src/utils/fluidsynth_priv.h b/src/utils/fluidsynth_priv.h index ca908bbd0..71e647fea 100644 --- a/src/utils/fluidsynth_priv.h +++ b/src/utils/fluidsynth_priv.h @@ -48,6 +48,10 @@ #include #endif +#ifdef PS2 +#include +#endif + #include #include #include From d2100a29a46db0028bc184c6902677a24dd76c11 Mon Sep 17 00:00:00 2001 From: 7dog123 Date: Mon, 6 May 2024 19:00:02 -0500 Subject: [PATCH 18/20] Since the PS2SDK doesn't have atomic libaries use global mutex from pthread patched from VolcanoMobile@cc72153 --- src/utils/fluid_sys.c | 3 +-- src/utils/fluid_sys.h | 25 +++++++++++++++++++++++++ src/utils/fluidsynth_priv.h | 7 ++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/utils/fluid_sys.c b/src/utils/fluid_sys.c index 94d7d6216..c1bb6d877 100644 --- a/src/utils/fluid_sys.c +++ b/src/utils/fluid_sys.c @@ -30,7 +30,7 @@ #include "fluid_rtkit.h" #endif -#if HAVE_PTHREAD_H && !defined(_WIN32) defined(PS2) +#if HAVE_PTHREAD_H && !defined(_WIN32) || defined(PS2) // Do not include pthread on windows. It includes winsock.h, which collides with ws2tcpip.h from fluid_sys.h // It isn't need on Windows anyway. #include @@ -102,7 +102,6 @@ int pthread_atomic_int_add(volatile int *atomic, return oldval; } - #endif /* WIN32 HACK - Flag used to differentiate between a file descriptor and a socket. diff --git a/src/utils/fluid_sys.h b/src/utils/fluid_sys.h index c73905e9e..622620dff 100644 --- a/src/utils/fluid_sys.h +++ b/src/utils/fluid_sys.h @@ -328,6 +328,29 @@ typedef _private fluid_private_t; /* Atomic operations */ +#if HAVE_PTHREAD_H + +#include + +int pthread_atomic_int_get(const volatile int *atomic); +void pthread_atomic_int_inc(volatile int *atomic); +void pthread_atomic_int_set(volatile int *atomic, int value); +bool pthread_atomic_int_dec_and_test (volatile int *atomic); +bool pthread_atomic_int_compare_and_exchange(volatile int *atomic, int oldval, int newval); +int pthread_atomic_int_add(volatile int *atomic, int val); + +#define fluid_atomic_int_inc(_pi) pthread_atomic_int_inc(_pi) +#define fluid_atomic_int_get(_pi) pthread_atomic_int_get(_pi) +#define fluid_atomic_int_set(_pi, _val) pthread_atomic_int_set(_pi, _val) +#define fluid_atomic_int_dec_and_test(_pi) pthread_atomic_int_dec_and_test(_pi) +#define fluid_atomic_int_compare_and_exchange(_pi, _old, _new) \ + pthread_atomic_int_compare_and_exchange(_pi, _old, _new) +#define fluid_atomic_int_add(_pi, _add) \ + pthread_atomic_int_add(_pi, _add) +#define fluid_atomic_int_exchange_and_add(_pi, _add) \ + pthread_atomic_int_add(_pi, _add) + +#else #define fluid_atomic_int_inc(_pi) atomic_fetch_add(_pi, 1) #define fluid_atomic_int_get(_pi) atomic_load(_pi) #define fluid_atomic_int_set(_pi, _val) atomic_store(_pi, _val) @@ -344,6 +367,8 @@ typedef _private fluid_private_t; #define fluid_atomic_pointer_compare_and_exchange(_pp, _old, _new) \ atomic_compare_exchange_weak(_pp, _old, _new) +#endif + static FLUID_INLINE void fluid_atomic_float_set(fluid_atomic_float_t *fptr, float val) { diff --git a/src/utils/fluidsynth_priv.h b/src/utils/fluidsynth_priv.h index 71e647fea..0307b9b19 100644 --- a/src/utils/fluidsynth_priv.h +++ b/src/utils/fluidsynth_priv.h @@ -84,10 +84,15 @@ typedef double fluid_real_t; /** Atomic types */ +#if defined(PS2) +typedef int fluid_atomic_int_t; +typedef unsigned int fluid_atomic_uint_t; +typedef float fluid_atomic_float_t; +#else typedef _Atomic int fluid_atomic_int_t; typedef _Atomic unsigned int fluid_atomic_uint_t; typedef _Atomic float fluid_atomic_float_t; - +#endif /*************************************************************** From 9c7249224689b42c23f6f8710152ce7f2dea9321 Mon Sep 17 00:00:00 2001 From: 7dog123 Date: Fri, 26 Jul 2024 15:28:24 -0500 Subject: [PATCH 19/20] Update fluidsynth_priv.h --- src/utils/fluidsynth_priv.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/fluidsynth_priv.h b/src/utils/fluidsynth_priv.h index 67e97abbd..8086e798f 100644 --- a/src/utils/fluidsynth_priv.h +++ b/src/utils/fluidsynth_priv.h @@ -49,6 +49,10 @@ #include #endif +#if PS2 +#include +#endif + #include "fluidsynth.h" #ifdef __cplusplus From 0e14d793b9e15199fd289690c328517c2bb253dc Mon Sep 17 00:00:00 2001 From: Wolfywolfy Date: Wed, 28 Aug 2024 08:58:57 -0300 Subject: [PATCH 20/20] Remove messy PS2 code. --- CMakeLists.txt | 82 ++++++++++--------------------------- src/CMakeLists.txt | 1 - src/utils/fluid_sys.c | 2 +- src/utils/fluid_sys.h | 2 +- src/utils/fluidsynth_priv.h | 7 ++-- 5 files changed, 27 insertions(+), 67 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b5a248bc..367f7361b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,61 +75,33 @@ option ( enable-profiling "profile the dsp code" off ) option ( enable-trap-on-fpe "enable SIGFPE trap on Floating Point Exceptions" off ) option ( enable-ubsan "compile and link against UBSan (for debugging fluidsynth internals)" off ) # Options enabled by default -if ( PS2 ) - option ( enable-aufile "compile support for sound file output" off ) - option ( BUILD_SHARED_LIBS "Build a shared object or DLL" off ) - option ( enable-dbus "compile DBUS support (if it is available)" off ) - option ( enable-ipv6 "enable IPv6 support at the cost of disabling IPv4" off ) - option ( enable-jack "compile JACK support (if it is available)" off ) -else () - option ( enable-aufile "compile support for sound file output" on ) - option ( BUILD_SHARED_LIBS "Build a shared object or DLL" on ) - option ( enable-dbus "compile DBUS support (if it is available)" on ) - option ( enable-ipv6 "enable IPv6 support at the cost of disabling IPv4" on ) - option ( enable-jack "compile JACK support (if it is available)" on ) -endif() +option ( enable-aufile "compile support for sound file output" on ) +option ( BUILD_SHARED_LIBS "Build a shared object or DLL" on ) +option ( enable-dbus "compile DBUS support (if it is available)" on ) +option ( enable-ipv6 "enable IPv6 support at the cost of disabling IPv4" on ) +option ( enable-jack "compile JACK support (if it is available)" on ) option ( enable-ladspa "enable LADSPA effect units" off ) +option ( enable-libinstpatch "use libinstpatch (if available) to load DLS and GIG files" on ) +option ( enable-libsndfile "compile libsndfile support (if it is available)" on ) +option ( enable-midishare "compile MidiShare support (if it is available)" on ) -if ( PS2 ) - option ( enable-libinstpatch "use libinstpatch (if available) to load DLS and GIG files" off ) - option ( enable-libsndfile "compile libsndfile support (if it is available)" off ) - option ( enable-midishare "compile MidiShare support (if it is available)" off ) -else () - option ( enable-libinstpatch "use libinstpatch (if available) to load DLS and GIG files" on ) - option ( enable-libsndfile "compile libsndfile support (if it is available)" on ) - option ( enable-midishare "compile MidiShare support (if it is available)" on ) -endif() option ( enable-opensles "compile OpenSLES support (if it is available)" off ) option ( enable-oboe "compile Oboe support (requires OpenSLES and/or AAudio)" off ) -if ( PS2 ) - option ( enable-network "enable network support (requires BSD sockets)" off ) - option ( enable-oss "compile OSS support (if it is available)" off ) - option ( enable-dsound "compile DirectSound support (if it is available)" off ) - option ( enable-wasapi "compile Windows WASAPI support (if it is available)" off ) - option ( enable-waveout "compile Windows WaveOut support (if it is available)" off ) - option ( enable-winmidi "compile Windows MIDI support (if it is available)" off ) - option ( enable-sdl2 "compile SDL2 audio support (if it is available)" off ) - option ( enable-pulseaudio "compile PulseAudio support (if it is available)" off ) - option ( enable-pipewire "compile PipeWire support (if it is available)" off ) - option ( enable-readline "compile readline lib line editing (if it is available)" off ) - option ( enable-threads "enable multi-threading support (such as parallel voice synthesis)" off ) - option ( enable-openmp "enable OpenMP support (parallelization of soundfont decoding, vectorization of voice mixing, etc.)" off ) -else() - option ( enable-network "enable network support (requires BSD sockets)" on ) - option ( enable-oss "compile OSS support (if it is available)" on ) - option ( enable-dsound "compile DirectSound support (if it is available)" on ) - option ( enable-wasapi "compile Windows WASAPI support (if it is available)" on ) - option ( enable-waveout "compile Windows WaveOut support (if it is available)" on ) - option ( enable-winmidi "compile Windows MIDI support (if it is available)" on ) - option ( enable-sdl2 "compile SDL2 audio support (if it is available)" on ) - option ( enable-pulseaudio "compile PulseAudio support (if it is available)" on ) - option ( enable-pipewire "compile PipeWire support (if it is available)" on ) - option ( enable-readline "compile readline lib line editing (if it is available)" on ) - option ( enable-threads "enable multi-threading support (such as parallel voice synthesis)" on ) - option ( enable-openmp "enable OpenMP support (parallelization of soundfont decoding, vectorization of voice mixing, etc.)" on ) -endif() +option ( enable-network "enable network support (requires BSD sockets)" on ) +option ( enable-oss "compile OSS support (if it is available)" on ) +option ( enable-dsound "compile DirectSound support (if it is available)" on ) +option ( enable-wasapi "compile Windows WASAPI support (if it is available)" on ) +option ( enable-waveout "compile Windows WaveOut support (if it is available)" on ) +option ( enable-winmidi "compile Windows MIDI support (if it is available)" on ) +option ( enable-sdl2 "compile SDL2 audio support (if it is available)" on ) +option ( enable-pulseaudio "compile PulseAudio support (if it is available)" on ) +option ( enable-pipewire "compile PipeWire support (if it is available)" on ) +option ( enable-readline "compile readline lib line editing (if it is available)" on ) +option ( enable-threads "enable multi-threading support (such as parallel voice synthesis)" on ) +option ( enable-openmp "enable OpenMP support (parallelization of soundfont decoding, vectorization of voice mixing, etc.)" on ) + # Platform specific options if ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" ) option ( enable-alsa "compile ALSA support (if it is available)" on ) @@ -391,10 +363,6 @@ if ( WIN32 ) endif ( MINGW ) endif ( WIN32 ) -if ( PS2 ) - set ( LIBFLUID_CPPFLAGS "-DFLUIDSYNTH_NOT_A_DLL -DFLUID_MUTEX_INIT" ) -endif () - # Check for threads and math find_package ( Threads REQUIRED ) @@ -405,14 +373,6 @@ endif ( HAS_LIBM ) set ( LIBFLUID_LIBS ${MATH_LIBRARY} Threads::Threads ) -unset ( PS2DEV_LIBS CACHE) -if ( PS2 ) - set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L$ENV{PS2SDK}/iop/lib") - set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -Wwrite-strings -Wcast-align -Wimplicit-int -Wsequence-point -fsigned-char") - set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -Wwrite-strings -Wcast-align -Wsequence-point -fsigned-char") - set ( PS2DEV_LIBS "${PS2DEV_LIBS};cdvd;kernel;debug;mc;c;audsrv;gskit" ) -endif () - # IBM OS/2 unset ( DART_SUPPORT CACHE ) unset ( DART_LIBS CACHE ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cfd1d8210..07d59c4ae 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -353,7 +353,6 @@ target_link_libraries ( libfluidsynth-OBJ PUBLIC ${COREMIDI_LIBS} ${WINDOWS_LIBS} ${LIBFLUID_LIBS} - ${PS2DEV_LIBS} ) if ( TARGET OpenMP::OpenMP_C AND HAVE_OPENMP ) diff --git a/src/utils/fluid_sys.c b/src/utils/fluid_sys.c index c1bb6d877..7a957dc95 100644 --- a/src/utils/fluid_sys.c +++ b/src/utils/fluid_sys.c @@ -30,7 +30,7 @@ #include "fluid_rtkit.h" #endif -#if HAVE_PTHREAD_H && !defined(_WIN32) || defined(PS2) +#if HAVE_PTHREAD_H && !defined(_WIN32) // Do not include pthread on windows. It includes winsock.h, which collides with ws2tcpip.h from fluid_sys.h // It isn't need on Windows anyway. #include diff --git a/src/utils/fluid_sys.h b/src/utils/fluid_sys.h index 622620dff..e67571617 100644 --- a/src/utils/fluid_sys.h +++ b/src/utils/fluid_sys.h @@ -344,7 +344,7 @@ int pthread_atomic_int_add(volatile int *atomic, int val); #define fluid_atomic_int_set(_pi, _val) pthread_atomic_int_set(_pi, _val) #define fluid_atomic_int_dec_and_test(_pi) pthread_atomic_int_dec_and_test(_pi) #define fluid_atomic_int_compare_and_exchange(_pi, _old, _new) \ - pthread_atomic_int_compare_and_exchange(_pi, _old, _new) + pthread_atomic_int_compare_and_exchange(_pi, (int)_old, _new) #define fluid_atomic_int_add(_pi, _add) \ pthread_atomic_int_add(_pi, _add) #define fluid_atomic_int_exchange_and_add(_pi, _add) \ diff --git a/src/utils/fluidsynth_priv.h b/src/utils/fluidsynth_priv.h index 769eb646f..8578ce3d0 100644 --- a/src/utils/fluidsynth_priv.h +++ b/src/utils/fluidsynth_priv.h @@ -48,9 +48,10 @@ #include #endif -#if PS2 -#include -#endif +#include +#include +#include +#include "fluid_threading.h" #include "fluidsynth.h"