From nobody Sun Sep 15 11:18:26 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X65Bq0rVPz5WBqJ; Sun, 15 Sep 2024 11:18:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X65Bq0C4Jz57cs; Sun, 15 Sep 2024 11:18:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726399107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DEntcoCng359ow6zpmP1i4lm91gAUVicfQLZDfW7RVc=; b=NIW7ryXBvLQ5QzKns9ClvHqnlnhibeH01f+ZJcrX8mQ+gCIv7v9oo8zH+a5LeCowgwsO0+ kZwg/ltq7HfMwXXTP1rmCoGIpD5HB0VZmn5aLw1G68qFAiFmxY4lY33v43IbmfFe9gXvHX I0KjXnSxE5mVbPTtSTngloyJFX+I/9osXNO6GNDFSy8tpVZNGMrN0xnaV6auqgqKydqbdm JRNdOxJx+QKBVoLlGKabtqTAW/coIDkmm16icM1Nk+DeUQpZvWKgmEZRsPis/xODZEzDvA 3gsgBaPSMU/9NmP+J03ZcVoyLD03Y6uZfPxLRCUbJQ2kVRRrKi+yUKCXDOHsHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726399107; a=rsa-sha256; cv=none; b=J22yOr2YCIGWDsgVXq5udidmA3NJCgbqug/DPtFhVoV1s00bCC8uGjy/yoYvPiXkA3iwMA yiMu2ydkay6baSgSRksv6/bhiF1uyT7ggeqX8q60SMVhaRRGFG3nhCCNMcjvhu93bfrTCt NCvZqujEaTydaf+kYIpycQ2/THYbbVQn1W7uenUcthV+J9+yKN4w3tUPTGQ6SMXNWJUuZt nQ509IBpYoS49VTaSG+/Lh7bcDLRaeZCITzxhx5AIZ1//FS1cNEHgDVU66GvtzJV2BUzxW pGBALkWz9zsGnajVRZYCiwzpZegEEj/lu3pKOQP1wg5mpPBjMjw88YHTVscb8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726399107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DEntcoCng359ow6zpmP1i4lm91gAUVicfQLZDfW7RVc=; b=fKnteMxmG+WKI5Mx7/PQvc5wbEP0CQk18LgRM1RAmMiC14PV291U7Zs+3b/qvDFs1VkuvT c3V921i7+JaD/cBLyJ+x+b7eLHt2wvAWYjihY0XfsvvP3FVdP9VvAhSjdxdVNuktGDfvrC p6PnH8J1YKYKSRIlFvPGEVY6PldMkPIchuUAqezQ4olNX7oteeadSGKEsAjTa3JeClKa/A AG+MHDKD3SVrEMcGkEVlRf0/b5XXbwJlyorTB/IGCLfN6mte/kcpAGTdd/SyP6iKlKziMX JwivhpCTh1ZItuhb6hjarFPGjCUfOnvogYqYutOfOiH80Fqyf1Htd7euBu7C5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X65Bp6bsdz17dH; Sun, 15 Sep 2024 11:18:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48FBIQ79057974; Sun, 15 Sep 2024 11:18:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48FBIQPw057971; Sun, 15 Sep 2024 11:18:26 GMT (envelope-from git) Date: Sun, 15 Sep 2024 11:18:26 GMT Message-Id: <202409151118.48FBIQPw057971@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Daniel Engberg Subject: git: c4d5a141aa97 - main - audio/fluidsynth: Update to 2.3.6 and drop sndio support List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: diizzy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4d5a141aa97606257a723511ce34aa039f492eb Auto-Submitted: auto-generated The branch main has been updated by diizzy: URL: https://cgit.FreeBSD.org/ports/commit/?id=c4d5a141aa97606257a723511ce34aa039f492eb commit c4d5a141aa97606257a723511ce34aa039f492eb Author: Daniel Engberg AuthorDate: 2024-09-15 11:09:33 +0000 Commit: Daniel Engberg CommitDate: 2024-09-15 11:09:37 +0000 audio/fluidsynth: Update to 2.3.6 and drop sndio support Drop sndio patches as maintaining our "custom fork/set of patches" will cause bitrot further down the road PR: 281184 --- audio/fluidsynth/Makefile | 43 +- audio/fluidsynth/distinfo | 6 +- audio/fluidsynth/files/fluid_sndio.c | 521 --------------------- audio/fluidsynth/files/patch-CMakeLists.txt | 22 - .../files/patch-cmake__admin_report.cmake | 15 - audio/fluidsynth/files/patch-src_CMakeLists.txt | 33 -- audio/fluidsynth/files/patch-src_config.cmake | 12 - .../files/patch-src_drivers_fluid__adriver.c | 19 - .../files/patch-src_drivers_fluid__adriver.h | 17 - .../files/patch-src_drivers_fluid__mdriver.c | 18 - .../files/patch-src_drivers_fluid__mdriver.h | 18 - audio/fluidsynth/pkg-plist | 2 +- 12 files changed, 31 insertions(+), 695 deletions(-) diff --git a/audio/fluidsynth/Makefile b/audio/fluidsynth/Makefile index a26ce2874532..c8635d6af705 100644 --- a/audio/fluidsynth/Makefile +++ b/audio/fluidsynth/Makefile @@ -1,6 +1,6 @@ PORTNAME= fluidsynth DISTVERSIONPREFIX= v -DISTVERSION= 2.3.4 +DISTVERSION= 2.3.6 CATEGORIES= audio MAINTAINER= multimedia@FreeBSD.org @@ -10,28 +10,39 @@ WWW= https://www.fluidsynth.org/ LICENSE= LGPL21 LICENSE_FILE= ${WRKSRC}/LICENSE -USES= cmake cpe gnome pkgconfig +USES= cmake cpe gnome pathfix pkgconfig USE_GITHUB= yes GH_ACCOUNT= FluidSynth USE_GNOME= glib20 USE_LDCONFIG= yes -# would require unreleased libinstpatch >= 1.1.0 -CMAKE_OFF= enable-libinstpatch enable-midishare LDFLAGS+= -lpthread +# would require unreleased libinstpatch >= 1.1.0 +CMAKE_OFF= CMAKE_DISABLE_FIND_PACKAGE_Doxygen \ + enable-dsound \ + enable-libinstpatch \ + enable-midishare \ + enable-waveout \ + enable-winmidi + OPTIONS_DEFINE= ALSA DBUS JACK LADSPA LASH PIPEWIRE PORTAUDIO \ - PULSEAUDIO READLINE SDL SNDFILE SNDIO + PULSEAUDIO READLINE SDL SNDFILE OPTIONS_DEFAULT= JACK READLINE -JACK_LIB_DEPENDS= libjack.so:audio/jack -JACK_CMAKE_BOOL= enable-jack +SNDFILE_DESC= Support for SF3 files via libsndfile ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib ALSA_CMAKE_BOOL= enable-alsa +ALSA_CMAKE_OFF= -DCMAKE_DISABLE_FIND_PACKAGE_ALSA:BOOL=True DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus DBUS_CMAKE_BOOL= enable-dbus +DBUS_CMAKE_OFF= -DCMAKE_DISABLE_FIND_PACKAGE_DBus1:BOOL=True + +JACK_LIB_DEPENDS= libjack.so:audio/jack +JACK_CMAKE_BOOL= enable-jack +JACK_CMAKE_OFF= -DCMAKE_DISABLE_FIND_PACKAGE_Jack:BOOL=True LADSPA_BUILD_DEPENDS= ${LOCALBASE}/include/ladspa.h:audio/ladspa LADSPA_RUN_DEPENDS= ${LOCALBASE}/include/ladspa.h:audio/ladspa @@ -40,30 +51,30 @@ LADSPA_CMAKE_BOOL= enable-ladspa LASH_LIB_DEPENDS= liblash.so:audio/lash LASH_CMAKE_BOOL= enable-lash +LASH_CMAKE_OFF= -DCMAKE_DISABLE_FIND_PACKAGE_LASH:BOOL=True PIPEWIRE_LIB_DEPENDS= libpipewire-0.3.so:multimedia/pipewire PIPEWIRE_CMAKE_BOOL= enable-pipewire +PIPEWIRE_CMAKE_OFF= -DCMAKE_DISABLE_FIND_PACKAGE_PipeWire:BOOL=True PORTAUDIO_LIB_DEPENDS= libportaudio.so:audio/portaudio PORTAUDIO_CMAKE_BOOL= enable-portaudio +PORTAUDIO_CMAKE_OFF= -DCMAKE_DISABLE_FIND_PACKAGE_PortAudio:BOOL=True PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PULSEAUDIO_CMAKE_BOOL= enable-pulseaudio +PULSEAUDIO_CMAKE_OFF= -DCMAKE_DISABLE_FIND_PACKAGE_PulseAudio:BOOL=True READLINE_USES= readline READLINE_CMAKE_BOOL= enable-readline +READLINE_CMAKE_OFF= -DCMAKE_DISABLE_FIND_PACKAGE_Readline:BOOL=True -SDL_USES= sdl -SDL_USE= SDL=sdl2 -SDL_CMAKE_BOOL= enable-sdl2 +SDL_USES= sdl +SDL_USE= SDL=sdl2 +SDL_CMAKE_BOOL= enable-sdl2 +SDL_CMAKE_OFF= -DCMAKE_DISABLE_FIND_PACKAGE_SDL2:BOOL=True SNDFILE_LIB_DEPENDS= libsndfile.so:audio/libsndfile SNDFILE_CMAKE_BOOL= enable-libsndfile -SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio -SNDIO_CMAKE_BOOL= enable-sndio - -post-patch: - ${CP} ${FILESDIR}/fluid_sndio.c ${WRKSRC}/src/drivers/ - .include diff --git a/audio/fluidsynth/distinfo b/audio/fluidsynth/distinfo index 938e58999337..dc6bd5c0de06 100644 --- a/audio/fluidsynth/distinfo +++ b/audio/fluidsynth/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1696027938 -SHA256 (FluidSynth-fluidsynth-v2.3.4_GH0.tar.gz) = 1529ef5bc3b9ef3adc2a7964505912f7305103e269e50cc0316f500b22053ac9 -SIZE (FluidSynth-fluidsynth-v2.3.4_GH0.tar.gz) = 1775291 +TIMESTAMP = 1725183622 +SHA256 (FluidSynth-fluidsynth-v2.3.6_GH0.tar.gz) = 3340d73286b28fe6e5150fbe12648d4640e86c64c228878b572773bd08cac531 +SIZE (FluidSynth-fluidsynth-v2.3.6_GH0.tar.gz) = 1776510 diff --git a/audio/fluidsynth/files/fluid_sndio.c b/audio/fluidsynth/files/fluid_sndio.c deleted file mode 100644 index bf496955b615..000000000000 --- a/audio/fluidsynth/files/fluid_sndio.c +++ /dev/null @@ -1,521 +0,0 @@ -/* sndio backend for FluidSynth - A Software Synthesizer - * - * Copyright (c) 2008 Jacob Meuser - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - - -/* fluid_sndio.c - * - * Driver for the sndio audio access library - */ - -#include "fluid_synth.h" -#include "fluid_adriver.h" -#include "fluid_midi.h" -#include "fluid_mdriver.h" -#include "fluid_settings.h" - -#if SNDIO_SUPPORT - -#include - -#include -#include -#include -#include - - -/** fluid_sndio_audio_driver_t - * - * This structure should not be accessed directly. Use audio port - * functions instead. - */ -typedef struct { - fluid_audio_driver_t driver; - fluid_synth_t* synth; - fluid_audio_callback_t read; - void* buffer; - pthread_t thread; - int cont; - struct sio_hdl *hdl; - struct sio_par par; - int buffer_size; - int buffer_byte_size; - fluid_audio_func_t callback; - void* data; - float* buffers[2]; -} fluid_sndio_audio_driver_t; - -typedef struct { - fluid_midi_driver_t driver; - struct mio_hdl *hdl; - pthread_t thread; - int status; - fluid_midi_parser_t *parser; -} fluid_sndio_midi_driver_t; - -//void delete_fluid_sndio_audio_driver(fluid_audio_driver_t* p); - -/* local utilities */ -static void* fluid_sndio_audio_run(void* d); -static void* fluid_sndio_audio_run2(void* d); - - -void -fluid_sndio_audio_driver_settings(fluid_settings_t* settings) -{ - fluid_settings_register_str(settings, "audio.sndio.device", "default", 0); -} - -/* - * new_fluid_sndio_audio_driver - */ -fluid_audio_driver_t* -new_fluid_sndio_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth) -{ - fluid_sndio_audio_driver_t* dev = NULL; - double sample_rate; - int periods, period_size; - char* devname; - pthread_attr_t attr; - int err; - - dev = FLUID_NEW(fluid_sndio_audio_driver_t); - if (dev == NULL) { - FLUID_LOG(FLUID_ERR, "Out of memory"); - return NULL; - } - FLUID_MEMSET(dev, 0, sizeof(fluid_sndio_audio_driver_t)); - - fluid_settings_getint(settings, "audio.periods", &periods); - fluid_settings_getint(settings, "audio.period-size", &period_size); - fluid_settings_getnum(settings, "synth.sample-rate", &sample_rate); - - dev->hdl = NULL; - dev->synth = synth; - dev->callback = NULL; - dev->data = NULL; - dev->cont = 1; - - if (!fluid_settings_dupstr(settings, "audio.sndio.device", &devname)) { - devname = NULL; - } - - dev->hdl = sio_open(devname, SIO_PLAY, 0); - if (dev->hdl == NULL) { - FLUID_LOG(FLUID_ERR, "sndio could not be opened for writing"); - goto error_recovery; - } - - sio_initpar(&dev->par); - - if (fluid_settings_str_equal(settings, "audio.sample-format", "16bits")) { - dev->par.bits = 16; - dev->par.le = SIO_LE_NATIVE; - dev->read = fluid_synth_write_s16; - } else { - FLUID_LOG(FLUID_ERR, "Unknown sample format"); - goto error_recovery; - } - - dev->par.appbufsz = period_size * periods; - dev->par.round = period_size; - - dev->par.pchan = 2; - dev->par.rate = sample_rate; - - if (!sio_setpar(dev->hdl, &dev->par)) { - FLUID_LOG(FLUID_ERR, "Couldn't set sndio audio parameters"); - goto error_recovery; - } - - if (!sio_getpar(dev->hdl, &dev->par)) { - FLUID_LOG(FLUID_ERR, "Couldn't get sndio audio parameters"); - goto error_recovery; - } else if (dev->par.pchan != 2 || dev->par.rate != sample_rate || - dev->par.bits != 16) { - FLUID_LOG(FLUID_ERR, "Couldn't set sndio audio parameters as desired"); - goto error_recovery; - } - - dev->buffer_size = dev->par.round; - dev->buffer_byte_size = dev->par.round * dev->par.bps * dev->par.pchan; - - dev->buffer = FLUID_MALLOC(dev->buffer_byte_size); - if (dev->buffer == NULL) { - FLUID_LOG(FLUID_ERR, "Out of memory"); - goto error_recovery; - } - - if (!sio_start(dev->hdl)) { - FLUID_LOG(FLUID_ERR, "Couldn't start sndio"); - goto error_recovery; - } - - if (pthread_attr_init(&attr)) { - FLUID_LOG(FLUID_ERR, "Couldn't initialize audio thread attributes"); - goto error_recovery; - } - - err = pthread_create(&dev->thread, &attr, fluid_sndio_audio_run, (void*) dev); - if (err) { - FLUID_LOG(FLUID_ERR, "Couldn't create audio thread"); - goto error_recovery; - } - - return (fluid_audio_driver_t*) dev; - -error_recovery: - delete_fluid_sndio_audio_driver((fluid_audio_driver_t*) dev); - return NULL; -} - -fluid_audio_driver_t* -new_fluid_sndio_audio_driver2(fluid_settings_t* settings, fluid_audio_func_t func, void* data) -{ - fluid_sndio_audio_driver_t* dev = NULL; - double sample_rate; - int periods, period_size; - char* devname; - pthread_attr_t attr; - int err; - - dev = FLUID_NEW(fluid_sndio_audio_driver_t); - if (dev == NULL) { - FLUID_LOG(FLUID_ERR, "Out of memory"); - return NULL; - } - FLUID_MEMSET(dev, 0, sizeof(fluid_sndio_audio_driver_t)); - - fluid_settings_getint(settings, "audio.periods", &periods); - fluid_settings_getint(settings, "audio.period-size", &period_size); - fluid_settings_getnum(settings, "synth.sample-rate", &sample_rate); - - dev->hdl = NULL; - dev->synth = NULL; - dev->read = NULL; - dev->callback = func; - dev->data = data; - dev->cont = 1; - - if (!fluid_settings_dupstr(settings, "audio.sndio.device", &devname)) { - devname = NULL; - } - - dev->hdl = sio_open(devname, SIO_PLAY, 0); - if (dev->hdl == NULL) { - FLUID_LOG(FLUID_ERR, "sndio could not be opened for writing"); - goto error_recovery; - } - - sio_initpar(&dev->par); - - dev->par.appbufsz = period_size * periods; - dev->par.round = period_size; - - dev->par.bits = 16; - dev->par.le = SIO_LE_NATIVE; - dev->par.pchan = 2; - dev->par.rate = sample_rate; - - if (!sio_setpar(dev->hdl, &dev->par)){ - FLUID_LOG(FLUID_ERR, "Can't configure sndio parameters"); - goto error_recovery; - } - - if (!sio_getpar(dev->hdl, &dev->par)) { - FLUID_LOG(FLUID_ERR, "Couldn't get sndio audio parameters"); - goto error_recovery; - } else if (dev->par.pchan != 2 || dev->par.rate != sample_rate || - dev->par.bits != 16) { - FLUID_LOG(FLUID_ERR, "Couldn't set sndio audio parameters as desired"); - goto error_recovery; - } - - dev->buffer_size = dev->par.round; - dev->buffer_byte_size = dev->par.round * dev->par.bps * dev->par.pchan; - - /* allocate the buffers. FIXME!!! don't use interleaved samples */ - dev->buffer = FLUID_MALLOC(dev->buffer_byte_size); - if (dev->buffer == NULL) { - FLUID_LOG(FLUID_ERR, "Out of memory"); - goto error_recovery; - } - dev->buffers[0] = FLUID_ARRAY(float, dev->buffer_size); - dev->buffers[1] = FLUID_ARRAY(float, dev->buffer_size); - if ((dev->buffer == NULL) || (dev->buffers[0] == NULL) || (dev->buffers[1] == NULL)) { - FLUID_LOG(FLUID_ERR, "Out of memory"); - goto error_recovery; - } - - if (!sio_start(dev->hdl)) { - FLUID_LOG(FLUID_ERR, "Couldn't start sndio"); - goto error_recovery; - } - - if (pthread_attr_init(&attr)) { - FLUID_LOG(FLUID_ERR, "Couldn't initialize audio thread attributes"); - goto error_recovery; - } - - err = pthread_create(&dev->thread, &attr, fluid_sndio_audio_run2, (void*) dev); - if (err) { - FLUID_LOG(FLUID_ERR, "Couldn't create audio2 thread"); - goto error_recovery; - } - - return (fluid_audio_driver_t*) dev; - -error_recovery: - delete_fluid_sndio_audio_driver((fluid_audio_driver_t*) dev); - return NULL; -} - -/* - * delete_fluid_sndio_audio_driver - */ -void -delete_fluid_sndio_audio_driver(fluid_audio_driver_t* p) -{ - fluid_sndio_audio_driver_t* dev = (fluid_sndio_audio_driver_t*) p; - - if (dev == NULL) { - return; - } - dev->cont = 0; - if (dev->thread) { - if (pthread_join(dev->thread, NULL)) { - FLUID_LOG(FLUID_ERR, "Failed to join the audio thread"); - return; - } - } - if (dev->hdl) { - sio_close(dev->hdl); - } - if (dev->buffer != NULL) { - FLUID_FREE(dev->buffer); - } - FLUID_FREE(dev); - return; -} - -/* - * fluid_sndio_audio_run - */ -void* -fluid_sndio_audio_run(void* d) -{ - fluid_sndio_audio_driver_t* dev = (fluid_sndio_audio_driver_t*) d; - fluid_synth_t* synth = dev->synth; - void* buffer = dev->buffer; - int len = dev->buffer_size; - - /* it's as simple as that: */ - while (dev->cont) - { - dev->read (synth, len, buffer, 0, 2, buffer, 1, 2); - sio_write (dev->hdl, buffer, dev->buffer_byte_size); - } - - FLUID_LOG(FLUID_DBG, "Audio thread finished"); - - pthread_exit(NULL); - - return 0; /* not reached */ -} - - -/* - * fluid_sndio_audio_run - */ -void* -fluid_sndio_audio_run2(void* d) -{ - fluid_sndio_audio_driver_t* dev = (fluid_sndio_audio_driver_t*) d; - short* buffer = (short*) dev->buffer; - float* left = dev->buffers[0]; - float* right = dev->buffers[1]; - int buffer_size = dev->buffer_size; - int dither_index = 0; - - FLUID_LOG(FLUID_DBG, "Audio thread running"); - - /* it's as simple as that: */ - while (dev->cont) - { - (*dev->callback)(dev->data, buffer_size, 0, NULL, 2, dev->buffers); - - fluid_synth_dither_s16 (&dither_index, buffer_size, left, right, - buffer, 0, 2, buffer, 1, 2); - - sio_write (dev->hdl, buffer, dev->buffer_byte_size); - } - - FLUID_LOG(FLUID_DBG, "Audio thread finished"); - - pthread_exit(NULL); - - return 0; /* not reached */ -} - -void fluid_sndio_midi_driver_settings(fluid_settings_t* settings) -{ - fluid_settings_register_str(settings, "midi.sndio.device", "default", 0); -} - -void -delete_fluid_sndio_midi_driver(fluid_midi_driver_t *addr) -{ - int err; - fluid_sndio_midi_driver_t *dev = (fluid_sndio_midi_driver_t *)addr; - - if (dev == NULL) { - return; - } - dev->status = FLUID_MIDI_DONE; - - /* cancel the thread and wait for it before cleaning up */ - if (dev->thread) { - err = pthread_cancel(dev->thread); - if (err) { - FLUID_LOG(FLUID_ERR, "Failed to cancel the midi thread"); - return; - } - if (pthread_join(dev->thread, NULL)) { - FLUID_LOG(FLUID_ERR, "Failed to join the midi thread"); - return; - } - } - if (dev->hdl != NULL) { - mio_close(dev->hdl); - } - if (dev->parser != NULL) { - delete_fluid_midi_parser(dev->parser); - } - FLUID_FREE(dev); - return; -} - -void * -fluid_sndio_midi_run(void *addr) -{ - int n, i; - fluid_midi_event_t* evt; - fluid_sndio_midi_driver_t *dev = (fluid_sndio_midi_driver_t *)addr; -#define MIDI_BUFLEN (3125 / 10) - unsigned char buffer[MIDI_BUFLEN]; - - /* make sure the other threads can cancel this thread any time */ - if (pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL)) { - FLUID_LOG(FLUID_ERR, "Failed to set the cancel state of the midi thread"); - pthread_exit(NULL); - } - if (pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL)) { - FLUID_LOG(FLUID_ERR, "Failed to set the cancel state of the midi thread"); - pthread_exit(NULL); - } - - /* go into a loop until someone tells us to stop */ - dev->status = FLUID_MIDI_LISTENING; - - while (dev->status == FLUID_MIDI_LISTENING) { - - /* read new data */ - n = mio_read(dev->hdl, buffer, MIDI_BUFLEN); - if (n == 0 && mio_eof(dev->hdl)) { - FLUID_LOG(FLUID_ERR, "Failed to read the midi input"); - dev->status = FLUID_MIDI_DONE; - } - - /* let the parser convert the data into events */ - for (i = 0; i < n; i++) { - evt = fluid_midi_parser_parse(dev->parser, buffer[i]); - if (evt != NULL) { - /* send the event to the next link in the chain */ - (*dev->driver.handler)(dev->driver.data, evt); - } - } - } - pthread_exit(NULL); -} - -int -fluid_sndio_midi_driver_status(fluid_midi_driver_t *addr) -{ - fluid_sndio_midi_driver_t *dev = (fluid_sndio_midi_driver_t *)addr; - return dev->status; -} - - -fluid_midi_driver_t * -new_fluid_sndio_midi_driver(fluid_settings_t *settings, - handle_midi_event_func_t handler, void *data) -{ - int err; - fluid_sndio_midi_driver_t *dev; - char *device; - - /* not much use doing anything */ - if (handler == NULL) { - FLUID_LOG(FLUID_ERR, "Invalid argument"); - return NULL; - } - - /* allocate the device */ - dev = FLUID_NEW(fluid_sndio_midi_driver_t); - if (dev == NULL) { - FLUID_LOG(FLUID_ERR, "Out of memory"); - return NULL; - } - FLUID_MEMSET(dev, 0, sizeof(fluid_sndio_midi_driver_t)); - dev->hdl = NULL; - - dev->driver.handler = handler; - dev->driver.data = data; - - /* allocate one event to store the input data */ - dev->parser = new_fluid_midi_parser(); - if (dev->parser == NULL) { - FLUID_LOG(FLUID_ERR, "Out of memory"); - goto error_recovery; - } - - /* get the device name. if none is specified, use the default device. */ - if (!fluid_settings_dupstr(settings, "midi.sndio.device", &device)) { - device = NULL; - } - - /* open the default hardware device. only use midi in. */ - dev->hdl = mio_open(device, MIO_IN, 0); - if (dev->hdl == NULL) { - FLUID_LOG(FLUID_ERR, "Couldn't open sndio midi device"); - goto error_recovery; - } - - dev->status = FLUID_MIDI_READY; - - err = pthread_create(&dev->thread, NULL, fluid_sndio_midi_run, (void *)dev); - if (err) { - FLUID_LOG(FLUID_PANIC, "Couldn't create the midi thread."); - goto error_recovery; - } - return (fluid_midi_driver_t *) dev; - - error_recovery: - delete_fluid_sndio_midi_driver((fluid_midi_driver_t *)dev); - return NULL; -} - -#endif /*#if SNDIO_SUPPORT */ diff --git a/audio/fluidsynth/files/patch-CMakeLists.txt b/audio/fluidsynth/files/patch-CMakeLists.txt deleted file mode 100644 index f9c26aca644e..000000000000 --- a/audio/fluidsynth/files/patch-CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ ---- CMakeLists.txt.orig 2022-12-28 11:43:59 UTC -+++ CMakeLists.txt -@@ -90,6 +90,7 @@ option ( enable-winmidi "compile Windows MIDI support - 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-sndio "compile Sndio 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 ) -@@ -530,6 +531,11 @@ if ( enable-pulseaudio ) - else ( enable-pulseaudio ) - unset_pkg_config ( PULSE ) - endif ( enable-pulseaudio ) -+ -+unset ( SNDIO_SUPPORT CACHE ) -+if ( enable-sndio ) -+ set ( SNDIO_SUPPORT 1 ) -+endif ( enable-sndio ) - - unset ( ALSA_SUPPORT CACHE ) - if ( enable-alsa ) diff --git a/audio/fluidsynth/files/patch-cmake__admin_report.cmake b/audio/fluidsynth/files/patch-cmake__admin_report.cmake deleted file mode 100644 index 86069ab49ec6..000000000000 --- a/audio/fluidsynth/files/patch-cmake__admin_report.cmake +++ /dev/null @@ -1,15 +0,0 @@ ---- cmake_admin/report.cmake.orig 2012-08-16 04:01:13 UTC -+++ cmake_admin/report.cmake -@@ -25,6 +25,12 @@ else ( PULSE_SUPPORT ) - message ( "PulseAudio: no" ) - endif ( PULSE_SUPPORT ) - -+if ( SNDIO_SUPPORT ) -+ message ( "Sndio: yes" ) -+else ( SNDIO_SUPPORT ) -+ message ( "Sndio: no" ) -+endif ( SNDIO_SUPPORT ) -+ - if ( JACK_SUPPORT ) - message ( "JACK: yes" ) - else ( JACK_SUPPORT ) diff --git a/audio/fluidsynth/files/patch-src_CMakeLists.txt b/audio/fluidsynth/files/patch-src_CMakeLists.txt deleted file mode 100644 index 86b7a19d9a72..000000000000 --- a/audio/fluidsynth/files/patch-src_CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ ---- src/CMakeLists.txt.orig 2023-04-02 15:54:17 UTC -+++ src/CMakeLists.txt -@@ -25,6 +25,11 @@ if ( PULSE_SUPPORT ) - set ( fluid_pulse_SOURCES drivers/fluid_pulse.c ) - endif ( PULSE_SUPPORT ) - -+if ( SNDIO_SUPPORT ) -+ set ( fluid_sndio_SOURCES drivers/fluid_sndio.c ) -+ set ( SNDIO_LIBRARIES sndio ) -+endif ( SNDIO_SUPPORT ) -+ - if ( ALSA_SUPPORT ) - set ( fluid_alsa_SOURCES drivers/fluid_alsa.c ) - endif ( ALSA_SUPPORT ) -@@ -244,6 +249,7 @@ add_library ( libfluidsynth-OBJ OBJECT - ${fluid_oss_SOURCES} - ${fluid_portaudio_SOURCES} - ${fluid_pulse_SOURCES} -+ ${fluid_sndio_SOURCES} - ${fluid_dsound_SOURCES} - ${fluid_wasapi_SOURCES} - ${fluid_waveout_SOURCES} -@@ -362,6 +368,10 @@ endif() - if ( PULSE_SUPPORT ) - target_include_directories( libfluidsynth-OBJ PRIVATE ${PULSEAUDIO_INCLUDE_DIRS} ) - target_link_libraries ( libfluidsynth-OBJ PUBLIC ${PULSEAUDIO_LIBRARIES} ) -+endif() -+ -+if ( SNDIO_SUPPORT) -+ target_link_libraries ( libfluidsynth-OBJ PUBLIC ${SNDIO_LIBRARIES} ) - endif() - - if ( TARGET ALSA::ALSA AND ALSA_SUPPORT ) diff --git a/audio/fluidsynth/files/patch-src_config.cmake b/audio/fluidsynth/files/patch-src_config.cmake deleted file mode 100644 index 26562972109d..000000000000 --- a/audio/fluidsynth/files/patch-src_config.cmake +++ /dev/null @@ -1,12 +0,0 @@ ---- src/config.cmake.orig 2018-12-30 11:42:00 UTC -+++ src/config.cmake -@@ -199,6 +199,9 @@ - /* Define to enable Windows MIDI driver */ - #cmakedefine WINMIDI_SUPPORT @WINMIDI_SUPPORT@ - -+/* Define to enable Sndio driver */ -+#cmakedefine SNDIO_SUPPORT @SNDIO_SUPPORT@ -+ - /* Define to 1 if you have the ANSI C header files. */ - #cmakedefine STDC_HEADERS @STDC_HEADERS@ - diff --git a/audio/fluidsynth/files/patch-src_drivers_fluid__adriver.c b/audio/fluidsynth/files/patch-src_drivers_fluid__adriver.c deleted file mode 100644 index 4cdfebb982ba..000000000000 --- a/audio/fluidsynth/files/patch-src_drivers_fluid__adriver.c +++ /dev/null @@ -1,19 +0,0 @@ ---- src/drivers/fluid_adriver.c.orig 2021-09-11 16:26:35 UTC -+++ src/drivers/fluid_adriver.c -@@ -40,6 +40,16 @@ struct _fluid_audriver_definition_t - /* Available audio drivers, listed in order of preference */ - static const fluid_audriver_definition_t fluid_audio_drivers[] = - { -+#if SNDIO_SUPPORT -+ { -+ "sndio", -+ new_fluid_sndio_audio_driver, -+ new_fluid_sndio_audio_driver2, -+ delete_fluid_sndio_audio_driver, -+ fluid_sndio_audio_driver_settings -+ }, -+#endif -+ - #if ALSA_SUPPORT - { - "alsa", diff --git a/audio/fluidsynth/files/patch-src_drivers_fluid__adriver.h b/audio/fluidsynth/files/patch-src_drivers_fluid__adriver.h deleted file mode 100644 index 5c5bf4310db5..000000000000 --- a/audio/fluidsynth/files/patch-src_drivers_fluid__adriver.h +++ /dev/null @@ -1,17 +0,0 @@ ---- src/drivers/fluid_adriver.h.orig 2019-02-03 07:07:02 UTC -+++ src/drivers/fluid_adriver.h -@@ -90,6 +90,14 @@ fluid_audio_driver_t *new_fluid_portaudio_driver(fluid - void delete_fluid_portaudio_driver(fluid_audio_driver_t *p); - #endif - -+#if SNDIO_SUPPORT -+fluid_audio_driver_t *new_fluid_sndio_audio_driver(fluid_settings_t *settings, fluid_synth_t *synth); -+fluid_audio_driver_t *new_fluid_sndio_audio_driver2(fluid_settings_t *settings, -+ fluid_audio_func_t func, void *data); -+void delete_fluid_sndio_audio_driver(fluid_audio_driver_t *p); -+void fluid_sndio_audio_driver_settings(fluid_settings_t *settings); -+#endif -+ - #if JACK_SUPPORT - fluid_audio_driver_t *new_fluid_jack_audio_driver(fluid_settings_t *settings, fluid_synth_t *synth); - fluid_audio_driver_t *new_fluid_jack_audio_driver2(fluid_settings_t *settings, diff --git a/audio/fluidsynth/files/patch-src_drivers_fluid__mdriver.c b/audio/fluidsynth/files/patch-src_drivers_fluid__mdriver.c deleted file mode 100644 index 6bd2e6d3b635..000000000000 --- a/audio/fluidsynth/files/patch-src_drivers_fluid__mdriver.c +++ /dev/null @@ -1,18 +0,0 @@ -$OpenBSD: patch-src_drivers_fluid_mdriver_c,v 1.1 2013/03/29 12:37:43 sthen Exp $ ---- src/drivers/fluid_mdriver.c.orig 2018-12-30 11:42:00 UTC -+++ src/drivers/fluid_mdriver.c -@@ -52,6 +52,14 @@ static const fluid_mdriver_definition_t fluid_midi_dri - fluid_alsa_rawmidi_driver_settings - }, - #endif -+#if SNDIO_SUPPORT -+ { -+ "sndio", -+ new_fluid_sndio_midi_driver, -+ delete_fluid_sndio_midi_driver, -+ fluid_sndio_midi_driver_settings -+ }, -+#endif - #if JACK_SUPPORT - { - "jack", diff --git a/audio/fluidsynth/files/patch-src_drivers_fluid__mdriver.h b/audio/fluidsynth/files/patch-src_drivers_fluid__mdriver.h deleted file mode 100644 index ebba65ff907a..000000000000 --- a/audio/fluidsynth/files/patch-src_drivers_fluid__mdriver.h +++ /dev/null @@ -1,18 +0,0 @@ ---- src/drivers/fluid_mdriver.h.orig 2019-02-03 07:13:59 UTC -+++ src/drivers/fluid_mdriver.h -@@ -53,6 +53,15 @@ void delete_fluid_alsa_seq_driver(fluid_midi_driver_t - void fluid_alsa_seq_driver_settings(fluid_settings_t *settings); - #endif - -+/* SNDIO */ -+#if SNDIO_SUPPORT -+void fluid_sndio_midi_driver_settings(fluid_settings_t *settings); -+fluid_midi_driver_t *new_fluid_sndio_midi_driver(fluid_settings_t *settings, -+ handle_midi_event_func_t handler, -+ void *data); -+void delete_fluid_sndio_midi_driver(fluid_midi_driver_t *p); -+#endif -+ - /* JACK */ - #if JACK_SUPPORT - void fluid_jack_midi_driver_settings(fluid_settings_t *settings); diff --git a/audio/fluidsynth/pkg-plist b/audio/fluidsynth/pkg-plist index d9de8e4a93d3..0bb5c97276f4 100644 --- a/audio/fluidsynth/pkg-plist +++ b/audio/fluidsynth/pkg-plist @@ -23,6 +23,6 @@ lib/cmake/fluidsynth/FluidSynthTargets-%%CMAKE_BUILD_TYPE%%.cmake lib/cmake/fluidsynth/FluidSynthTargets.cmake lib/libfluidsynth.so lib/libfluidsynth.so.3 -lib/libfluidsynth.so.3.2.2 +lib/libfluidsynth.so.3.2.4 libdata/pkgconfig/fluidsynth.pc share/man/man1/fluidsynth.1.gz