diff -Nru fluidsynth-2.3.3/.azure/azure-pipelines-mac.yml fluidsynth-2.3.4/.azure/azure-pipelines-mac.yml --- fluidsynth-2.3.3/.azure/azure-pipelines-mac.yml 2023-06-14 12:42:03.000000000 +0000 +++ fluidsynth-2.3.4/.azure/azure-pipelines-mac.yml 2023-09-24 16:59:36.000000000 +0000 @@ -113,6 +113,16 @@ echo $? displayName: 'Consume from pkg-config' condition: and(succeeded(), contains(variables.CMakeFlags, 'Denable-framework=0')) + # regression test for #1266 + - script: | + set -e + rm -rf build + mkdir build && cd build + export PKG_CONFIG_PATH="$(brew --prefix libffi)/lib/pkgconfig" + cmake -G Xcode -Denable-sdl2=0 -Denable-readline=0 -Denable-dbus=0 .. + xcodebuild + displayName: 'Test CMake XCode Generator' + condition: and(succeeded(), not(contains(variables.CMakeFlags, 'Denable-framework=0'))) - job: macOS_ports diff -Nru fluidsynth-2.3.3/.azure/azure-pipelines-vcpkg.yml fluidsynth-2.3.4/.azure/azure-pipelines-vcpkg.yml --- fluidsynth-2.3.3/.azure/azure-pipelines-vcpkg.yml 2023-06-14 12:42:03.000000000 +0000 +++ fluidsynth-2.3.4/.azure/azure-pipelines-vcpkg.yml 2023-09-24 16:59:36.000000000 +0000 @@ -34,7 +34,7 @@ toolset: 'v142' generator: 'Visual Studio 16 2019' configuration: 'RelWithDebInfo' - VCPKG_REVISION: 'acc3bcf76b84ae5041c86ab55fe138ae7b8255c7' + VCPKG_REVISION: 'fc59c2a30a99536e8fb6e085c228e9f724dd87d0' jobs: - job: vcpkg diff -Nru fluidsynth-2.3.3/.cirrus.yml fluidsynth-2.3.4/.cirrus.yml --- fluidsynth-2.3.3/.cirrus.yml 2023-06-14 12:42:03.000000000 +0000 +++ fluidsynth-2.3.4/.cirrus.yml 2023-09-24 16:59:36.000000000 +0000 @@ -4,7 +4,7 @@ freebsd_instance: matrix: image_family: freebsd-13-2 - image_family: freebsd-13-1 + 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 -Nru fluidsynth-2.3.3/.github/workflows/sonarcloud.yml fluidsynth-2.3.4/.github/workflows/sonarcloud.yml --- fluidsynth-2.3.3/.github/workflows/sonarcloud.yml 2023-06-14 12:42:03.000000000 +0000 +++ fluidsynth-2.3.4/.github/workflows/sonarcloud.yml 2023-09-24 16:59:36.000000000 +0000 @@ -17,6 +17,7 @@ # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) # Use Debug build for better code coverage results BUILD_TYPE: Debug + BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed name: SonarCloud Workflow jobs: @@ -60,20 +61,23 @@ shell: bash working-directory: ${{github.workspace}}/build run: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Werror=dev -Denable-portaudio=1 -Denable-ladspa=1 -Denable-coverage=1 -DNO_GUI=1 $GITHUB_WORKSPACE + + - name: Install sonar-scanner and build-wrapper + uses: SonarSource/sonarcloud-github-c-cpp@v2 - name: Build working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | - ./build-wrapper-linux-x86-64 --out-dir bw-output make + build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make - name: Test working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. run: | - ./build-wrapper-linux-x86-64 --out-dir bw-output make coverage + build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make coverage # sonar-scanner does not like utf8 filenames - name: Prepare for Sonar @@ -85,19 +89,11 @@ ls -la ${{ github.workspace }}/build ls -la ${{ github.workspace }}/build/coverage -# The official sonarsource/sonarcloud-github-action@v1.5 action does not work properly. -# It keeps complaining that the build-wrapper.json cannot be found. -# Hence, use a third party action to download and add sonar-scanner to PATH and then run it manually. - - name: Setup sonarqube - uses: warchant/setup-sonar-scanner@v3 - - - name: Run sonarqube + - name: Run sonar-scanner env: - # to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: sonar-scanner - -Dsonar.login=${{ secrets.SONAR_TOKEN }} - -Dsonar.cfamily.build-wrapper-output=${{ github.workspace }}/build/bw-output - -Dsonar.coverageReportPaths=build/coverage/sonarqube.report - -Dsonar.verbose=false - -Dsonar.host.url=https://sonarcloud.io/ + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + sonar-scanner \ + -Dsonar.cfamily.build-wrapper-output="${{github.workspace}}/build/${{ env.BUILD_WRAPPER_OUT_DIR }}" \ + -Dsonar.coverageReportPaths=${{github.workspace}}/build/coverage/sonarqube.report diff -Nru fluidsynth-2.3.3/CMakeLists.txt fluidsynth-2.3.4/CMakeLists.txt --- fluidsynth-2.3.3/CMakeLists.txt 2023-06-14 12:42:03.000000000 +0000 +++ fluidsynth-2.3.4/CMakeLists.txt 2023-09-24 16:59:36.000000000 +0000 @@ -47,7 +47,7 @@ # FluidSynth package version set ( FLUIDSYNTH_VERSION_MAJOR 2 ) set ( FLUIDSYNTH_VERSION_MINOR 3 ) -set ( FLUIDSYNTH_VERSION_MICRO 3 ) +set ( FLUIDSYNTH_VERSION_MICRO 4 ) set ( VERSION "${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}" ) set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" ) @@ -62,7 +62,7 @@ # 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 1 ) +set ( LIB_VERSION_REVISION 2 ) set ( LIB_VERSION_INFO "${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" ) @@ -392,8 +392,7 @@ unset ( MACOSX_FRAMEWORK CACHE ) if ( CMAKE_SYSTEM MATCHES "Darwin" ) set ( DARWIN 1 ) - set ( CMAKE_INSTALL_NAME_DIR - ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} ) + set ( CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_FULL_LIBDIR} ) if ( enable-coreaudio ) check_include_file ( CoreAudio/AudioHardware.h COREAUDIO_FOUND ) if ( COREAUDIO_FOUND ) @@ -548,7 +547,7 @@ unset ( PULSE_SUPPORT CACHE ) if ( enable-pulseaudio ) - find_package ( PulseAudio ${PULSEAUDIO_MINIMUM_VERSION} QUIET ) + find_package ( PulseAudio ${PULSEAUDIO_MINIMUM_VERSION} ) # Upstream config does not search for pulse-simple find_library ( PULSEAUDIO_SIMPLE_LIBRARY NAMES "pulse-simple" ) if ( PULSEAUDIO_FOUND AND PULSEAUDIO_SIMPLE_LIBRARY ) diff -Nru fluidsynth-2.3.3/cmake_admin/FindJack.cmake fluidsynth-2.3.4/cmake_admin/FindJack.cmake --- fluidsynth-2.3.3/cmake_admin/FindJack.cmake 2023-06-14 12:42:03.000000000 +0000 +++ fluidsynth-2.3.4/cmake_admin/FindJack.cmake 2023-09-24 16:59:36.000000000 +0000 @@ -9,7 +9,7 @@ This module provides the following imported targets, if found: -``Jack::libJack`` +``Jack::Jack`` The Jack library Result Variables @@ -35,7 +35,7 @@ find_library( Jack_LIBRARY NAMES "jack" - HINTS "${PC_JACK_LIBDIR}") + HINTS "${PC_JACK_LIBDIR}" "${PC_JACK_LIBRARY_DIRS}") # Handle transitive dependencies if(PC_JACK_FOUND) diff -Nru fluidsynth-2.3.3/debian/changelog fluidsynth-2.3.4/debian/changelog --- fluidsynth-2.3.3/debian/changelog 2023-09-23 16:35:10.000000000 +0000 +++ fluidsynth-2.3.4/debian/changelog 2023-11-30 19:59:00.000000000 +0000 @@ -1,16 +1,17 @@ -fluidsynth (2.3.3-2.1~20.04.sav1) focal; urgency=medium - - * d/control: Set to libpipewire-0.3-dev [!i386] BD/PD (no i386 PipeWire) - - -- Rob Savoury Sat, 23 Sep 2023 09:35:10 -0700 - -fluidsynth (2.3.3-2.1~20.04.sav0) focal; urgency=medium +fluidsynth (2.3.4-1~20.04.sav0) focal; urgency=medium * Backport to Focal * Revert "Prefer libjack-dev over libjack-jackd2-dev" * debian/control: Set debhelper-compat (= 12) BD + - Set to libpipewire-0.3-dev [!i386] BD/PD (not on LP i386 whitelist) + + -- Rob Savoury Thu, 30 Nov 2023 11:59:00 -0800 + +fluidsynth (2.3.4-1) unstable; urgency=medium + + * New upstream version 2.3.4 - -- Rob Savoury Sat, 23 Sep 2023 09:07:54 -0700 + -- Dennis Braun Wed, 27 Sep 2023 20:01:10 +0200 fluidsynth (2.3.3-2.1) unstable; urgency=medium diff -Nru fluidsynth-2.3.3/doc/fluidsynth-v20-devdoc.txt fluidsynth-2.3.4/doc/fluidsynth-v20-devdoc.txt --- fluidsynth-2.3.3/doc/fluidsynth-v20-devdoc.txt 2023-06-14 12:42:03.000000000 +0000 +++ fluidsynth-2.3.4/doc/fluidsynth-v20-devdoc.txt 2023-09-24 16:59:36.000000000 +0000 @@ -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.3 -\date 2023-06-14 +\version Revision 2.3.4 +\date 2023-09-24 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 -Nru fluidsynth-2.3.3/sonar-project.properties fluidsynth-2.3.4/sonar-project.properties --- fluidsynth-2.3.3/sonar-project.properties 2023-06-14 12:42:03.000000000 +0000 +++ fluidsynth-2.3.4/sonar-project.properties 2023-09-24 16:59:36.000000000 +0000 @@ -1,8 +1,7 @@ sonar.projectKey=FluidSynth_fluidsynth sonar.organization=fluidsynth -sonar.cfamily.threads=4 -sonar.cfamily.cache.enabled=false +sonar.cfamily.threads=2 # This is the name and version displayed in the SonarCloud UI. diff -Nru fluidsynth-2.3.3/src/CMakeLists.txt fluidsynth-2.3.4/src/CMakeLists.txt --- fluidsynth-2.3.3/src/CMakeLists.txt 2023-06-14 12:42:03.000000000 +0000 +++ fluidsynth-2.3.4/src/CMakeLists.txt 2023-09-24 16:59:36.000000000 +0000 @@ -205,7 +205,7 @@ ${FluidSynth_BINARY_DIR}/include/fluidsynth.h ) -configure_file ( ${FluidSynth_SOURCE_DIR}/include/fluidsynth/version.h.in +configure_file ( ${FluidSynth_SOURCE_DIR}/include/fluidsynth/version.h.in ${FluidSynth_BINARY_DIR}/include/fluidsynth/version.h ) configure_file ( ${FluidSynth_SOURCE_DIR}/include/fluidsynth.cmake ${public_main_HEADER} ) @@ -275,6 +275,14 @@ PROPERTIES COMPILE_FLAGS ${LIBFLUID_CPPFLAGS} ) endif ( LIBFLUID_CPPFLAGS ) +# The CMake Xcode generator fails to build the framework unless it references +# a source file. Create an empty one in the build directory to use for this +# purpose. +if ( MACOSX_FRAMEWORK ) + set ( MACOSX_FRAMEWORK_SOURCE_HACK ${CMAKE_BINARY_DIR}/empty_file_for_linking_issue.cpp ) + file ( TOUCH ${MACOSX_FRAMEWORK_SOURCE_HACK} ) +endif ( MACOSX_FRAMEWORK ) + # Note: by default this target creates a shared object (or dll). To build a # static library instead, set the option BUILD_SHARED_LIBS to FALSE. # Further note: The headers must be explicitly added here to have CMake install @@ -283,6 +291,7 @@ $ ${public_main_HEADER} ${public_HEADERS} + ${MACOSX_FRAMEWORK_SOURCE_HACK} ) if ( MACOSX_FRAMEWORK ) @@ -360,7 +369,8 @@ endif() if ( PULSE_SUPPORT ) - target_include_directories( libfluidsynth-OBJ PRIVATE ${PULSEAUDIO_INCLUDE_DIRS} ) + # need to include PULSEAUDIO_INCLUDE_DIR to make it compile with homebrew on Mac + target_include_directories( libfluidsynth-OBJ PRIVATE ${PULSEAUDIO_INCLUDE_DIRS} ${PULSEAUDIO_INCLUDE_DIR} ) target_link_libraries ( libfluidsynth-OBJ PUBLIC ${PULSEAUDIO_LIBRARIES} ) endif() diff -Nru fluidsynth-2.3.3/src/midi/fluid_midi.c fluidsynth-2.3.4/src/midi/fluid_midi.c --- fluidsynth-2.3.3/src/midi/fluid_midi.c 2023-06-14 12:42:03.000000000 +0000 +++ fluidsynth-2.3.4/src/midi/fluid_midi.c 2023-09-24 16:59:36.000000000 +0000 @@ -1641,6 +1641,23 @@ player->reset_synth_between_songs = value; } +static int check_for_on_notes(fluid_synth_t *synth) +{ + fluid_voice_t* v[1024]; + int i, res=FALSE; + fluid_synth_get_voicelist(synth, v, FLUID_N_ELEMENTS(v), -1); + for(i=0; iend_pedals_disabled) { + if(check_for_on_notes(synth)) + { + FLUID_LOG(FLUID_WARN, "End of the MIDI file reached, but not all notes have received a note off event! OFFing them now! Run with --verbose to spot pending voices."); + } + for(i = 0; i < synth->midi_channels; i++) { fluid_synth_cc(player->synth, i, SUSTAIN_SWITCH, 0); fluid_synth_cc(player->synth, i, SOSTENUTO_SWITCH, 0); + fluid_synth_cc(player->synth, i, ALL_NOTES_OFF, 0); } player->end_pedals_disabled = 1; @@ -2268,6 +2291,7 @@ if(!player->use_system_timer) { fluid_sample_timer_reset(player->synth, player->sample_timer); + player->cur_msec = 0; } /* If we're at the end of the playlist and there are no loops left, loop once */ diff -Nru fluidsynth-2.3.3/src/utils/fluid_sys.c fluidsynth-2.3.4/src/utils/fluid_sys.c --- fluidsynth-2.3.3/src/utils/fluid_sys.c 2023-06-14 12:42:03.000000000 +0000 +++ fluidsynth-2.3.4/src/utils/fluid_sys.c 2023-09-24 16:59:36.000000000 +0000 @@ -1606,12 +1606,12 @@ new_fluid_server_socket(int port, fluid_server_func_t func, void *data) { fluid_server_socket_t *server_socket; + struct sockaddr_in addr4; #ifdef IPV6_SUPPORT - struct sockaddr_in6 addr; -#else - struct sockaddr_in addr; + struct sockaddr_in6 addr6; #endif - + const struct sockaddr *addr; + size_t addr_size; fluid_socket_t sock; fluid_return_val_if_fail(func != NULL, NULL); @@ -1621,23 +1621,37 @@ return NULL; } + FLUID_MEMSET(&addr4, 0, sizeof(addr4)); + addr4.sin_family = AF_INET; + addr4.sin_port = htons((uint16_t)port); + addr4.sin_addr.s_addr = htonl(INADDR_ANY); + +#ifdef IPV6_SUPPORT + FLUID_MEMSET(&addr6, 0, sizeof(addr6)); + addr6.sin6_family = AF_INET6; + addr6.sin6_port = htons((uint16_t)port); + addr6.sin6_addr = in6addr_any; +#endif + #ifdef IPV6_SUPPORT sock = socket(AF_INET6, SOCK_STREAM, 0); + addr = (const struct sockaddr *) &addr6; + addr_size = sizeof(addr6); if(sock == INVALID_SOCKET) { - FLUID_LOG(FLUID_ERR, "Failed to create server socket: %d", fluid_socket_get_error()); - fluid_socket_cleanup(); - return NULL; + FLUID_LOG(FLUID_WARN, "Failed to create IPv6 server socket: %d (will try with IPv4)", fluid_socket_get_error()); + + sock = socket(AF_INET, SOCK_STREAM, 0); + addr = (const struct sockaddr *) &addr4; + addr_size = sizeof(addr4); } - FLUID_MEMSET(&addr, 0, sizeof(addr)); - addr.sin6_family = AF_INET6; - addr.sin6_port = htons((uint16_t)port); - addr.sin6_addr = in6addr_any; #else - sock = socket(AF_INET, SOCK_STREAM, 0); + addr = (const struct sockaddr *) &addr4; + addr_size = sizeof(addr4); +#endif if(sock == INVALID_SOCKET) { @@ -1646,13 +1660,7 @@ return NULL; } - FLUID_MEMSET(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons((uint16_t)port); - addr.sin_addr.s_addr = htonl(INADDR_ANY); -#endif - - if(bind(sock, (const struct sockaddr *) &addr, sizeof(addr)) == SOCKET_ERROR) + if(bind(sock, addr, addr_size) == SOCKET_ERROR) { FLUID_LOG(FLUID_ERR, "Failed to bind server socket: %d", fluid_socket_get_error()); fluid_socket_close(sock);