Skip to contentSkip to conversation

fluidsynth: upgrade 1.1.11 -> 2.0.3

PATCH New Andreas Müller 1 participant 2 messages Jan 16, 2019

lore
Share & tools
lore
#0 lore raw

cover fluidsynth: upgrade 1.1.11 -> 2.0.3

Although just a single patch it

* is a big enhancement for embedded devices when setting 'synth.dynamic-sample-loading' to 1 and working with large soundfonts:
* Load times are reduced extremly
* RAM memory consumption is reduced significantly which opens new possibilties
* was a long running and huge effort

Andreas Müller (1):
fluidsynth: upgrade 1.1.11 -> 2.0.3

 ...elaration-for-float-multithreaded-se.patch |  76 -----
 .../fluidsynth/fluidsynth-native_git.bb       |  10 +
 .../fluidsynth/fluidsynth.inc                 |  12 +
 ...tables-helper-we-have-to-use-native-.patch |  37 +++
 ...te_float-Allow-zero-pointer-for-left.patch | 178 ++++++++++
 ...elaration-for-float-multithreaded-se.patch | 304 ++++++++++++++++++
 .../fluidsynth/fluidsynth_1.1.11.bb           |  24 --
 .../fluidsynth/fluidsynth_git.bb              |  22 ++
 8 files changed, 563 insertions(+), 100 deletions(-)
 delete mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/files/0001-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch
 create mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth-native_git.bb
 create mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth.inc
 create mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0001-Do-not-build-gentables-helper-we-have-to-use-native-.patch
 create mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0002-fluid_synth_nwrite_float-Allow-zero-pointer-for-left.patch
 create mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0003-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch
 delete mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.11.bb
 create mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_git.bb
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 fluidsynth: upgrade 1.1.11 -> 2.0.3

* Fallout caused by API change should be fixed in all recipes depending fluidsynth. To make this happen I sent out patches to many projects during last autumn.
* Add PACKAGECONFIG for profiling (disabled by default).
* ARM-NEON-patch was reworked and profiling runs were performed with and without the patch. See patch description for profiling results.
* We need to split tool to generate parameter tables to native. Since target and native builds do not share much in common we don't use BBCALLSEXTEND
* Add patch which allows clients to reduce useless copies of buffers. Fluidsynth-DSSI (in meta-qt5-extra currently) is going to make use of this.

---
 ...elaration-for-float-multithreaded-se.patch |  76 -----
 .../fluidsynth/fluidsynth-native_git.bb       |  10 +
 .../fluidsynth/fluidsynth.inc                 |  12 +
 ...tables-helper-we-have-to-use-native-.patch |  37 +++
 ...te_float-Allow-zero-pointer-for-left.patch | 178 ++++++++++
 ...elaration-for-float-multithreaded-se.patch | 304 ++++++++++++++++++
 .../fluidsynth/fluidsynth_1.1.11.bb           |  24 --
 .../fluidsynth/fluidsynth_git.bb              |  22 ++
 8 files changed, 563 insertions(+), 100 deletions(-)
 delete mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/files/0001-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch
 create mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth-native_git.bb
 create mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth.inc
 create mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0001-Do-not-build-gentables-helper-we-have-to-use-native-.patch
 create mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0002-fluid_synth_nwrite_float-Allow-zero-pointer-for-left.patch
 create mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0003-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch
 delete mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.11.bb
 create mode 100644 meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_git.bb
meta-multimedia/recipes-multimedia/fluidsynth/files/0001-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch deleted +0 -76
deleted file mode 100644
index 0e1846e31..000000000
@@ -1,76 +0,0 @@
-From 2de7e128fbdf528716b500cf27ed9a4358c931c9 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20M=C3=BCller?= <[email protected]>
-Date: Fri, 24 Nov 2017 00:05:35 +0100
-Subject: [PATCH 2/2] Use ARM-NEON accelaration for float-multithreaded setups
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Upstream-Status: Pending
-
-Signed-off-by: Andreas Müller <[email protected]>
----
- src/rvoice/fluid_rvoice_mixer.c | 26 ++++++++++++++++++++++++++
- 1 file changed, 26 insertions(+)
-
-diff --git a/src/rvoice/fluid_rvoice_mixer.c b/src/rvoice/fluid_rvoice_mixer.c
-index 9616518..dbf8057 100644
---- a/src/rvoice/fluid_rvoice_mixer.c
-+++ b/src/rvoice/fluid_rvoice_mixer.c
-@@ -27,6 +27,10 @@
- #include "fluid_ladspa.h"
- #include "fluid_synth.h"
- 
-+#if defined(__ARM_NEON__)
-+#include "arm_neon.h"
-+#endif
-+
- 
- #define ENABLE_MIXER_THREADS 1
- 
-@@ -794,20 +798,42 @@ fluid_mixer_buffers_mix(fluid_mixer_buffers_t* dest, fluid_mixer_buffers_t* src)
-   if (minbuf > src->buf_count)
-     minbuf = src->buf_count;
-   for (i=0; i < minbuf; i++) {
-+#if defined(__ARM_NEON__) && defined(WITH_FLOAT)
-+    for (j=0; j < scount; j+=4) {
-+        float32x4_t vleft = vld1q_f32(&dest->left_buf[i][j]);
-+        float32x4_t vright = vld1q_f32(&dest->right_buf[i][j]);
-+        vleft = vaddq_f32(vleft, vld1q_f32(&src->left_buf[i][j]));
-+        vright = vaddq_f32(vright, vld1q_f32(&src->right_buf[i][j]));
-+        vst1q_f32(&dest->left_buf[i][j], vleft);
-+        vst1q_f32(&dest->right_buf[i][j], vright);
-+    }
-+#else
-     for (j=0; j < scount; j++) {
-       dest->left_buf[i][j] += src->left_buf[i][j];
-       dest->right_buf[i][j] += src->right_buf[i][j];
-     }
-+#endif
-   }
- 
-   minbuf = dest->fx_buf_count;
-   if (minbuf > src->fx_buf_count)
-     minbuf = src->fx_buf_count;
-   for (i=0; i < minbuf; i++) {
-+#if defined(__ARM_NEON__) && defined(WITH_FLOAT)
-+    for (j=0; j < scount; j+=4) {
-+        float32x4_t vleft = vld1q_f32(&dest->fx_left_buf[i][j]);
-+        float32x4_t vright = vld1q_f32(&dest->fx_right_buf[i][j]);
-+        vleft = vaddq_f32(vleft, vld1q_f32(&src->fx_left_buf[i][j]));
-+        vright = vaddq_f32(vright, vld1q_f32(&src->fx_right_buf[i][j]));
-+        vst1q_f32(&dest->fx_left_buf[i][j], vleft);
-+        vst1q_f32(&dest->fx_right_buf[i][j], vright);
-+    }
-+#else
-     for (j=0; j < scount; j++) {
-       dest->fx_left_buf[i][j] += src->fx_left_buf[i][j];
-       dest->fx_right_buf[i][j] += src->fx_right_buf[i][j];
-     }
-+#endif
-   }
- }
- 
--- 
-2.9.5
-
meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth-native_git.bb new file +10 -0
new file mode 100644
index 000000000..a95c4c42a
@@ -0,0 +1,10 @@
+require ${BPN}.inc
+
+inherit native
+
+OECMAKE_SOURCEPATH = "${S}/src/gentables"
+
+do_install() {
+    install -d ${D}/${bindir}
+    install -m 755 ${B}/make_tables.exe ${D}/${bindir}/
+}
meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth.inc new file +12 -0
new file mode 100644
index 000000000..df431b62c
@@ -0,0 +1,12 @@
+SUMMARY = "Fluidsynth is a software synthesizer"
+HOMEPAGE = "http://www.fluidsynth.org/"
+SECTION = "libs/multimedia"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fc178bcd425090939a8b634d1d6a9594"
+
+SRC_URI = "git://github.com/FluidSynth/fluidsynth.git"
+SRCREV = "1bae9b2fe1a958f54f4910c802a79673e0df9850"
+S = "${WORKDIR}/git"
+PV = "2.0.3"
+
+inherit cmake pkgconfig lib_package
meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0001-Do-not-build-gentables-helper-we-have-to-use-native-.patch new file +37 -0
new file mode 100644
index 000000000..44612275c
@@ -0,0 +1,37 @@
+From 81ea820b155e887b13ea5986c3407cf93b2737f6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <[email protected]>
+Date: Wed, 2 Jan 2019 18:42:46 +0100
+Subject: [PATCH] Do not build gentables helper - we have to use native variant
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Andreas Müller <[email protected]>
+---
+ src/CMakeLists.txt | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index a0ba53d1..1c626717 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -359,14 +359,3 @@ else ( MACOSX_FRAMEWORK )
+ )
+    install ( FILES ${public_main_HEADER} DESTINATION ${INCLUDE_INSTALL_DIR} )
+ endif ( MACOSX_FRAMEWORK )
+-
+-# ******* Auto Generated Lookup Tables ******
+-
+-include(ExternalProject)
+-ExternalProject_Add(gentables
+-    DOWNLOAD_COMMAND ""
+-    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables
+-    BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables
+-    INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/"
+-)
+-add_dependencies(libfluidsynth-OBJ gentables)
+-- 
+2.14.5
+
meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0002-fluid_synth_nwrite_float-Allow-zero-pointer-for-left.patch new file +178 -0

178 lines not on this page · raw message

meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0003-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch new file +304 -0

304 lines not on this page · raw message

meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.11.bb deleted +0 -24
deleted file mode 100644
index 4df310275..000000000
@@ -1,24 +0,0 @@
-SUMMARY = "Fluidsynth is a software synthesizer"
-HOMEPAGE = "http://www.fluidsynth.org/"
-SECTION = "libs/multimedia"
-LICENSE = "LGPL-2.1"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=fc178bcd425090939a8b634d1d6a9594"
-
-DEPENDS = "alsa-lib ncurses glib-2.0"
-
-SRC_URI = " \
-    git://github.com/FluidSynth/fluidsynth.git;branch=1.1.x \
-    file://0001-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch \
-"
-SRCREV = "f65c6ba25fb2c7e37c89fc6a4afc5aa645e208c2"
-S = "${WORKDIR}/git"
-
-inherit cmake pkgconfig lib_package
-
-EXTRA_OECMAKE = "-Denable-floats=ON -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}"
-
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)}"
-PACKAGECONFIG[sndfile] = "-Denable-libsndfile-support=ON,-Denable-libsndfile-support=OFF,libsndfile1"
-PACKAGECONFIG[jack] = "-Denable-jack-support=ON,-Denable-jack-support=OFF,jack"
-PACKAGECONFIG[pulseaudio] = "-Denable-pulseaudio=ON,-Denable-pulseaudio=OFF,pulseaudio"
-PACKAGECONFIG[portaudio] = "-Denable-portaudio=ON,-Denable-portaudio=OFF,portaudio-v19"
meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_git.bb new file +22 -0
new file mode 100644
index 000000000..4f600a218
@@ -0,0 +1,22 @@
+require ${BPN}.inc
+
+DEPENDS = "${BPN}-native alsa-lib ncurses glib-2.0"
+
+SRC_URI += " \
+    file://0001-Do-not-build-gentables-helper-we-have-to-use-native-.patch \
+    file://0002-fluid_synth_nwrite_float-Allow-zero-pointer-for-left.patch \
+    file://0003-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch \
+"
+
+EXTRA_OECMAKE = "-Denable-floats=ON -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}"
+
+do_configure_append() {
+    make_tables.exe ${B}/
+}
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)}"
+PACKAGECONFIG[sndfile] = "-Denable-libsndfile=ON,-Denable-libsndfile=OFF,libsndfile1"
+PACKAGECONFIG[jack] = "-Denable-jack=ON,-Denable-jack=OFF,jack"
+PACKAGECONFIG[pulseaudio] = "-Denable-pulseaudio=ON,-Denable-pulseaudio=OFF,pulseaudio"
+PACKAGECONFIG[portaudio] = "-Denable-portaudio=ON,-Denable-portaudio=OFF,portaudio-v19"
+PACKAGECONFIG[profiling] = "-Denable-profiling=ON,-Denable-profiling=OFF"
Signature · 1 line
2.20.1