summaryrefslogtreecommitdiffstats
path: root/meta-multimedia/recipes-multimedia
diff options
context:
space:
mode:
authorAndreas Müller <schnitzeltony@gmail.com>2019-01-16 22:41:54 +0100
committerKhem Raj <raj.khem@gmail.com>2019-01-16 16:33:11 -0800
commit950331a6f53cb25af81e1537cc14591eb3d8e20b (patch)
tree6adf2649be5902f083c6e3c0bbd7aebba6ebbbb4 /meta-multimedia/recipes-multimedia
parenta368821c96bc041a8d7f7dab7d4a653d59729d0e (diff)
downloadmeta-openembedded-950331a6f53cb25af81e1537cc14591eb3d8e20b.tar.gz
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. Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-multimedia/recipes-multimedia')
-rw-r--r--meta-multimedia/recipes-multimedia/fluidsynth/files/0001-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch76
-rw-r--r--meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth-native_git.bb10
-rw-r--r--meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth.inc12
-rw-r--r--meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0001-Do-not-build-gentables-helper-we-have-to-use-native-.patch37
-rw-r--r--meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0002-fluid_synth_nwrite_float-Allow-zero-pointer-for-left.patch178
-rw-r--r--meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0003-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch304
-rw-r--r--meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.11.bb24
-rw-r--r--meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_git.bb22
8 files changed, 563 insertions, 100 deletions
diff --git a/meta-multimedia/recipes-multimedia/fluidsynth/files/0001-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch b/meta-multimedia/recipes-multimedia/fluidsynth/files/0001-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch
deleted file mode 100644
index 0e1846e31..000000000
--- a/meta-multimedia/recipes-multimedia/fluidsynth/files/0001-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch
+++ /dev/null
@@ -1,76 +0,0 @@
1From 2de7e128fbdf528716b500cf27ed9a4358c931c9 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Fri, 24 Nov 2017 00:05:35 +0100
4Subject: [PATCH 2/2] Use ARM-NEON accelaration for float-multithreaded setups
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Upstream-Status: Pending
10
11Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
12---
13 src/rvoice/fluid_rvoice_mixer.c | 26 ++++++++++++++++++++++++++
14 1 file changed, 26 insertions(+)
15
16diff --git a/src/rvoice/fluid_rvoice_mixer.c b/src/rvoice/fluid_rvoice_mixer.c
17index 9616518..dbf8057 100644
18--- a/src/rvoice/fluid_rvoice_mixer.c
19+++ b/src/rvoice/fluid_rvoice_mixer.c
20@@ -27,6 +27,10 @@
21 #include "fluid_ladspa.h"
22 #include "fluid_synth.h"
23
24+#if defined(__ARM_NEON__)
25+#include "arm_neon.h"
26+#endif
27+
28
29 #define ENABLE_MIXER_THREADS 1
30
31@@ -794,20 +798,42 @@ fluid_mixer_buffers_mix(fluid_mixer_buffers_t* dest, fluid_mixer_buffers_t* src)
32 if (minbuf > src->buf_count)
33 minbuf = src->buf_count;
34 for (i=0; i < minbuf; i++) {
35+#if defined(__ARM_NEON__) && defined(WITH_FLOAT)
36+ for (j=0; j < scount; j+=4) {
37+ float32x4_t vleft = vld1q_f32(&dest->left_buf[i][j]);
38+ float32x4_t vright = vld1q_f32(&dest->right_buf[i][j]);
39+ vleft = vaddq_f32(vleft, vld1q_f32(&src->left_buf[i][j]));
40+ vright = vaddq_f32(vright, vld1q_f32(&src->right_buf[i][j]));
41+ vst1q_f32(&dest->left_buf[i][j], vleft);
42+ vst1q_f32(&dest->right_buf[i][j], vright);
43+ }
44+#else
45 for (j=0; j < scount; j++) {
46 dest->left_buf[i][j] += src->left_buf[i][j];
47 dest->right_buf[i][j] += src->right_buf[i][j];
48 }
49+#endif
50 }
51
52 minbuf = dest->fx_buf_count;
53 if (minbuf > src->fx_buf_count)
54 minbuf = src->fx_buf_count;
55 for (i=0; i < minbuf; i++) {
56+#if defined(__ARM_NEON__) && defined(WITH_FLOAT)
57+ for (j=0; j < scount; j+=4) {
58+ float32x4_t vleft = vld1q_f32(&dest->fx_left_buf[i][j]);
59+ float32x4_t vright = vld1q_f32(&dest->fx_right_buf[i][j]);
60+ vleft = vaddq_f32(vleft, vld1q_f32(&src->fx_left_buf[i][j]));
61+ vright = vaddq_f32(vright, vld1q_f32(&src->fx_right_buf[i][j]));
62+ vst1q_f32(&dest->fx_left_buf[i][j], vleft);
63+ vst1q_f32(&dest->fx_right_buf[i][j], vright);
64+ }
65+#else
66 for (j=0; j < scount; j++) {
67 dest->fx_left_buf[i][j] += src->fx_left_buf[i][j];
68 dest->fx_right_buf[i][j] += src->fx_right_buf[i][j];
69 }
70+#endif
71 }
72 }
73
74--
752.9.5
76
diff --git a/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth-native_git.bb b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth-native_git.bb
new file mode 100644
index 000000000..a95c4c42a
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth-native_git.bb
@@ -0,0 +1,10 @@
1require ${BPN}.inc
2
3inherit native
4
5OECMAKE_SOURCEPATH = "${S}/src/gentables"
6
7do_install() {
8 install -d ${D}/${bindir}
9 install -m 755 ${B}/make_tables.exe ${D}/${bindir}/
10}
diff --git a/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth.inc b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth.inc
new file mode 100644
index 000000000..df431b62c
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth.inc
@@ -0,0 +1,12 @@
1SUMMARY = "Fluidsynth is a software synthesizer"
2HOMEPAGE = "http://www.fluidsynth.org/"
3SECTION = "libs/multimedia"
4LICENSE = "LGPL-2.1"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=fc178bcd425090939a8b634d1d6a9594"
6
7SRC_URI = "git://github.com/FluidSynth/fluidsynth.git"
8SRCREV = "1bae9b2fe1a958f54f4910c802a79673e0df9850"
9S = "${WORKDIR}/git"
10PV = "2.0.3"
11
12inherit cmake pkgconfig lib_package
diff --git a/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0001-Do-not-build-gentables-helper-we-have-to-use-native-.patch b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0001-Do-not-build-gentables-helper-we-have-to-use-native-.patch
new file mode 100644
index 000000000..44612275c
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0001-Do-not-build-gentables-helper-we-have-to-use-native-.patch
@@ -0,0 +1,37 @@
1From 81ea820b155e887b13ea5986c3407cf93b2737f6 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Wed, 2 Jan 2019 18:42:46 +0100
4Subject: [PATCH] Do not build gentables helper - we have to use native variant
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Upstream-Status: Inappropriate [embedded specific]
10
11Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
12---
13 src/CMakeLists.txt | 11 -----------
14 1 file changed, 11 deletions(-)
15
16diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
17index a0ba53d1..1c626717 100644
18--- a/src/CMakeLists.txt
19+++ b/src/CMakeLists.txt
20@@ -359,14 +359,3 @@ else ( MACOSX_FRAMEWORK )
21 )
22 install ( FILES ${public_main_HEADER} DESTINATION ${INCLUDE_INSTALL_DIR} )
23 endif ( MACOSX_FRAMEWORK )
24-
25-# ******* Auto Generated Lookup Tables ******
26-
27-include(ExternalProject)
28-ExternalProject_Add(gentables
29- DOWNLOAD_COMMAND ""
30- SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables
31- BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables
32- INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/"
33-)
34-add_dependencies(libfluidsynth-OBJ gentables)
35--
362.14.5
37
diff --git a/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0002-fluid_synth_nwrite_float-Allow-zero-pointer-for-left.patch b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0002-fluid_synth_nwrite_float-Allow-zero-pointer-for-left.patch
new file mode 100644
index 000000000..94daa951c
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0002-fluid_synth_nwrite_float-Allow-zero-pointer-for-left.patch
@@ -0,0 +1,178 @@
1From 300977537b6056bdbbba9df9100fa6e891ca1f44 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Mon, 17 Dec 2018 14:08:45 +0100
4Subject: [PATCH 2/2] fluid_synth_nwrite_float: Allow zero pointer for
5 left/right and zero pointer in arrays
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10With this modification a client can define exactly what it wants to get into
11buffers to avoid useless copying of data. On weak machines this leads to measurable
12performance wins.
13
14Upstream-Status: Submitted [1]
15
16[1] https://github.com/FluidSynth/fluidsynth/pull/490
17
18Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
19---
20 src/synth/fluid_synth.c | 69 ++++++++++++++++++++++++++++++++++---------------
21 1 file changed, 48 insertions(+), 21 deletions(-)
22
23diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c
24index 0df620d3..379f8216 100644
25--- a/src/synth/fluid_synth.c
26+++ b/src/synth/fluid_synth.c
27@@ -3306,10 +3306,10 @@ fluid_synth_program_reset(fluid_synth_t *synth)
28 * Synthesize a block of floating point audio to separate audio buffers (multichannel rendering). First effect channel used by reverb, second for chorus.
29 * @param synth FluidSynth instance
30 * @param len Count of audio frames to synthesize
31- * @param left Array of float buffers to store left channel of planar audio (as many as \c synth.audio-channels buffers, each of \c len in size)
32- * @param right Array of float buffers to store right channel of planar audio (size: dito)
33- * @param fx_left Since 1.1.7: If not \c NULL, array of float buffers to store left effect channels (as many as \c synth.effects-channels buffers, each of \c len in size)
34- * @param fx_right Since 1.1.7: If not \c NULL, array of float buffers to store right effect channels (size: dito)
35+ * @param left Array of float buffers to store left channel of planar audio (as many as \c synth.audio-channels buffers, each of \c len in size). Since 2.0.3: NULL allowed / NULL allowed for array entry
36+ * @param right Array of float buffers to store right channel of planar audio (size: dito). Since 2.0.3: NULL allowed / NULL allowed for array entry
37+ * @param fx_left Since 1.1.7: If not \c NULL, array of float buffers to store left effect channels (as many as \c synth.effects-channels buffers, each of \c len in size). Since 2.0.3: NULL allowed for array entry
38+ * @param fx_right Since 1.1.7: If not \c NULL, array of float buffers to store right effect channels (size: dito). Since 2.0.3: NULL allowed for array entry
39 * @return #FLUID_OK on success, #FLUID_FAILED otherwise
40 *
41 * @note Should only be called from synthesis thread.
42@@ -3386,15 +3386,27 @@ fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
43 for(i = 0; i < synth->audio_channels; i++)
44 {
45 #ifdef WITH_FLOAT
46- FLUID_MEMCPY(left[i], &left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + synth->cur], bytes);
47- FLUID_MEMCPY(right[i], &right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + synth->cur], bytes);
48+ if(left != NULL && left[i] != NULL)
49+ {
50+ FLUID_MEMCPY(left[i], &left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + synth->cur], bytes);
51+ }
52+ if(right != NULL && right[i] != NULL)
53+ {
54+ FLUID_MEMCPY(right[i], &right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + synth->cur], bytes);
55+ }
56 #else //WITH_FLOAT
57 int j;
58
59 for(j = 0; j < num; j++)
60 {
61- left[i][j] = (float) left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + j + synth->cur];
62- right[i][j] = (float) right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + j + synth->cur];
63+ if(left != NULL && left[i] != NULL)
64+ {
65+ left[i][j] = (float) left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + j + synth->cur];
66+ }
67+ if(right != NULL && right[i] != NULL)
68+ {
69+ right[i][j] = (float) right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + j + synth->cur];
70+ }
71 }
72
73 #endif //WITH_FLOAT
74@@ -3404,12 +3416,12 @@ fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
75 {
76 #ifdef WITH_FLOAT
77
78- if(fx_left != NULL)
79+ if(fx_left != NULL && fx_left[i] != NULL)
80 {
81 FLUID_MEMCPY(fx_left[i], &fx_left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + synth->cur], bytes);
82 }
83
84- if(fx_right != NULL)
85+ if(fx_right != NULL && fx_right[i] != NULL)
86 {
87 FLUID_MEMCPY(fx_right[i], &fx_right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + synth->cur], bytes);
88 }
89@@ -3417,7 +3429,7 @@ fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
90 #else //WITH_FLOAT
91 int j;
92
93- if(fx_left != NULL)
94+ if(fx_left != NULL && fx_left[i] != NULL)
95 {
96 for(j = 0; j < num; j++)
97 {
98@@ -3425,7 +3437,7 @@ fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
99 }
100 }
101
102- if(fx_right != NULL)
103+ if(fx_right != NULL && fx_right[i] != NULL)
104 {
105 for(j = 0; j < num; j++)
106 {
107@@ -3456,15 +3468,30 @@ fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
108 for(i = 0; i < synth->audio_channels; i++)
109 {
110 #ifdef WITH_FLOAT
111- FLUID_MEMCPY(left[i] + count, &left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT], bytes);
112- FLUID_MEMCPY(right[i] + count, &right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT], bytes);
113+ if(left != NULL && left[i] != NULL)
114+ {
115+ FLUID_MEMCPY(left[i] + count, &left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT], bytes);
116+ }
117+ if(right != NULL && right[i] != NULL)
118+ {
119+ FLUID_MEMCPY(right[i] + count, &right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT], bytes);
120+ }
121 #else //WITH_FLOAT
122 int j;
123
124- for(j = 0; j < num; j++)
125+ if(left != NULL && left[i] != NULL)
126+ {
127+ for(j = 0; j < num; j++)
128+ {
129+ left[i][j + count] = (float) left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + j];
130+ }
131+ }
132+ if(right != NULL && right[i] != NULL)
133 {
134- left[i][j + count] = (float) left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + j];
135- right[i][j + count] = (float) right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + j];
136+ for(j = 0; j < num; j++)
137+ {
138+ right[i][j + count] = (float) right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + j];
139+ }
140 }
141
142 #endif //WITH_FLOAT
143@@ -3474,12 +3501,12 @@ fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
144 {
145 #ifdef WITH_FLOAT
146
147- if(fx_left != NULL)
148+ if(fx_left != NULL && fx_left[i] != NULL)
149 {
150 FLUID_MEMCPY(fx_left[i] + count, &fx_left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT], bytes);
151 }
152
153- if(fx_right != NULL)
154+ if(fx_right != NULL && fx_right[i] != NULL)
155 {
156 FLUID_MEMCPY(fx_right[i] + count, &fx_right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT], bytes);
157 }
158@@ -3487,7 +3514,7 @@ fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
159 #else //WITH_FLOAT
160 int j;
161
162- if(fx_left != NULL)
163+ if(fx_left != NULL && fx_left[i] != NULL)
164 {
165 for(j = 0; j < num; j++)
166 {
167@@ -3495,7 +3522,7 @@ fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
168 }
169 }
170
171- if(fx_right != NULL)
172+ if(fx_right != NULL && fx_right[i] != NULL)
173 {
174 for(j = 0; j < num; j++)
175 {
176--
1772.14.5
178
diff --git a/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0003-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0003-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch
new file mode 100644
index 000000000..ead099545
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth/0003-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch
@@ -0,0 +1,304 @@
1From 947f79f97a5fa6547d99bff282606026632e010b Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Sat, 13 Oct 2018 23:01:11 +0200
4Subject: [PATCH] Use ARM-NEON accelaration for float-multithreaded setups
5
6Profiling shows a considerable performance win. See estimated number of voices:
7They increase from ~471 to ~513 which makes a ~9% win:
8
9*******************************************************************************
10WITHOUT ARM NEON:
11*******************************************************************************
12
13morona@raspberrypi3:~$ fluidsynth -o synth.cpu-cores=4 -o synth.chorus.active=0 -o synth.reverb.active=0 /usr/share/sf2/fluidr3gm.sf2
14> prof_set_print 1
15> prof_set_notes 10
16> prof_start 3 10000
17Generating 10 notes, generated voices:20
18Number of measures(n_prof):3, duration of one mesure(dur):10000ms
19
20Profiling time(mm:ss): Total=0:30 Remainder=0:30, press <ENTER> to cancel
21 ------------------------------------------------------------------------------
22 Duration(microsecond) and cpu loads(%) (sr: 48000 Hz, sp: 20.83 microsecond)
23 ------------------------------------------------------------------------------
24 Code under profiling |Voices| Duration (microsecond) | Load(%)
25 | nbr| min| avg| max|
26 ---------------------------|------|--------------------------------|----------
27 synth_write_* ------------>| 20| 112.00| 118.96| 206.00| 4.461
28 synth_one_block ---------->| 20| 109.00| 116.44| 196.00| 4.367
29 synth_one_block:clear ---->| 20| 1.00| 1.67| 18.00| 0.063
30 synth_one_block:one voice->| 1| 11.00| 12.36| 58.00| 0.463
31 synth_one_block:all voices>| 20| 107.00| 113.47| 187.00| 4.255
32 synth_one_block:reverb --->| no profiling available
33 synth_one_block:chorus --->| no profiling available
34 voice:note --------------->| no profiling available
35 voice:release ------------>| no profiling available
36 ------------------------------------------------------------------------------
37 Cpu loads(%) (sr: 48000 Hz, sp: 20.83 microsecond) and maximum voices
38 ------------------------------------------------------------------------------
39 nVoices| total(%)|voices(%)| reverb(%)|chorus(%)| voice(%)|estimated maxVoices
40 -------|---------|---------|----------|---------|---------|-------------------
41 20| 4.461| 4.461| 0.000| 0.000| 0.213| 470
42
43Profiling time(mm:ss): Total=0:30 Remainder=0:20, press <ENTER> to cancel
44 ------------------------------------------------------------------------------
45 Duration(microsecond) and cpu loads(%) (sr: 48000 Hz, sp: 20.83 microsecond)
46 ------------------------------------------------------------------------------
47 Code under profiling |Voices| Duration (microsecond) | Load(%)
48 | nbr| min| avg| max|
49 ---------------------------|------|--------------------------------|----------
50 synth_write_* ------------>| 20| 112.00| 118.42| 216.00| 4.441
51 synth_one_block ---------->| 20| 109.00| 115.91| 205.00| 4.347
52 synth_one_block:clear ---->| 20| 1.00| 1.65| 18.00| 0.062
53 synth_one_block:one voice->| 1| 11.00| 12.30| 58.00| 0.461
54 synth_one_block:all voices>| 20| 107.00| 112.98| 197.00| 4.237
55 synth_one_block:reverb --->| no profiling available
56 synth_one_block:chorus --->| no profiling available
57 voice:note --------------->| no profiling available
58 voice:release ------------>| no profiling available
59 ------------------------------------------------------------------------------
60 Cpu loads(%) (sr: 48000 Hz, sp: 20.83 microsecond) and maximum voices
61 ------------------------------------------------------------------------------
62 nVoices| total(%)|voices(%)| reverb(%)|chorus(%)| voice(%)|estimated maxVoices
63 -------|---------|---------|----------|---------|---------|-------------------
64 20| 4.441| 4.441| 0.000| 0.000| 0.212| 472
65
66Profiling time(mm:ss): Total=0:30 Remainder=0:10, press <ENTER> to cancel
67 ------------------------------------------------------------------------------
68 Duration(microsecond) and cpu loads(%) (sr: 48000 Hz, sp: 20.83 microsecond)
69 ------------------------------------------------------------------------------
70 Code under profiling |Voices| Duration (microsecond) | Load(%)
71 | nbr| min| avg| max|
72 ---------------------------|------|--------------------------------|----------
73 synth_write_* ------------>| 20| 112.00| 118.64| 244.00| 4.449
74 synth_one_block ---------->| 20| 109.00| 116.12| 234.00| 4.355
75 synth_one_block:clear ---->| 20| 1.00| 1.67| 37.00| 0.062
76 synth_one_block:one voice->| 1| 11.00| 12.31| 63.00| 0.462
77 synth_one_block:all voices>| 20| 107.00| 113.18| 214.00| 4.244
78 synth_one_block:reverb --->| no profiling available
79 synth_one_block:chorus --->| no profiling available
80 voice:note --------------->| no profiling available
81 voice:release ------------>| no profiling available
82 ------------------------------------------------------------------------------
83 Cpu loads(%) (sr: 48000 Hz, sp: 20.83 microsecond) and maximum voices
84 ------------------------------------------------------------------------------
85 nVoices| total(%)|voices(%)| reverb(%)|chorus(%)| voice(%)|estimated maxVoices
86 -------|---------|---------|----------|---------|---------|-------------------
87 20| 4.449| 4.449| 0.000| 0.000| 0.212| 471
88Stopping 20 voices...voices stopped.
89> quit
90cheers!
91JackTemporaryException : now quits...
92Jack main caught signal 2
93fluid_profiling_print
94fluidsynth: Estimated times: min/avg/max (micro seconds)
95fluidsynth: synth_write_* ------------>: 112.000/118.636/244.000
96fluidsynth: synth_one_block ---------->: 109.000/116.124/234.000
97fluidsynth: synth_one_block:clear ---->: 1.000/1.665/37.000
98fluidsynth: synth_one_block:one voice->: 11.000/12.309/63.000
99fluidsynth: synth_one_block:all voices>: 107.000/113.180/214.000
100
101*******************************************************************************
102WITH ARM NEON:
103*******************************************************************************
104
105morona@raspberrypi3:~$ fluidsynth -o synth.cpu-cores=4 -o synth.chorus.active=0 -o synth.reverb.active=0 /usr/share/sf2/fluidr3gm.sf2
106> prof_set_print 1
107> prof_set_notes 10
108> prof_start 3 10000
109Generating 10 notes, generated voices:20
110Number of measures(n_prof):3, duration of one mesure(dur):10000ms
111
112Profiling time(mm:ss): Total=0:30 Remainder=0:30, press <ENTER> to cancel
113 ------------------------------------------------------------------------------
114 Duration(microsecond) and cpu loads(%) (sr: 48000 Hz, sp: 20.83 microsecond)
115 ------------------------------------------------------------------------------
116 Code under profiling |Voices| Duration (microsecond) | Load(%)
117 | nbr| min| avg| max|
118 ---------------------------|------|--------------------------------|----------
119 synth_write_* ------------>| 20| 102.00| 109.21| 213.00| 4.095
120 synth_one_block ---------->| 20| 99.00| 106.68| 201.00| 4.001
121 synth_one_block:clear ---->| 20| 1.00| 1.64| 18.00| 0.062
122 synth_one_block:one voice->| 1| 11.00| 12.30| 54.00| 0.461
123 synth_one_block:all voices>| 20| 97.00| 103.71| 188.00| 3.889
124 synth_one_block:reverb --->| no profiling available
125 synth_one_block:chorus --->| no profiling available
126 voice:note --------------->| no profiling available
127 voice:release ------------>| no profiling available
128 ------------------------------------------------------------------------------
129 Cpu loads(%) (sr: 48000 Hz, sp: 20.83 microsecond) and maximum voices
130 ------------------------------------------------------------------------------
131 nVoices| total(%)|voices(%)| reverb(%)|chorus(%)| voice(%)|estimated maxVoices
132 -------|---------|---------|----------|---------|---------|-------------------
133 20| 4.095| 4.095| 0.000| 0.000| 0.194| 514
134
135Profiling time(mm:ss): Total=0:30 Remainder=0:20, press <ENTER> to cancel
136 ------------------------------------------------------------------------------
137 Duration(microsecond) and cpu loads(%) (sr: 48000 Hz, sp: 20.83 microsecond)
138 ------------------------------------------------------------------------------
139 Code under profiling |Voices| Duration (microsecond) | Load(%)
140 | nbr| min| avg| max|
141 ---------------------------|------|--------------------------------|----------
142 synth_write_* ------------>| 20| 102.00| 109.46| 278.00| 4.105
143 synth_one_block ---------->| 20| 99.00| 106.91| 265.00| 4.009
144 synth_one_block:clear ---->| 20| 1.00| 1.67| 22.00| 0.062
145 synth_one_block:one voice->| 1| 11.00| 12.30| 54.00| 0.461
146 synth_one_block:all voices>| 20| 97.00| 103.94| 251.00| 3.898
147 synth_one_block:reverb --->| no profiling available
148 synth_one_block:chorus --->| no profiling available
149 voice:note --------------->| no profiling available
150 voice:release ------------>| no profiling available
151 ------------------------------------------------------------------------------
152 Cpu loads(%) (sr: 48000 Hz, sp: 20.83 microsecond) and maximum voices
153 ------------------------------------------------------------------------------
154 nVoices| total(%)|voices(%)| reverb(%)|chorus(%)| voice(%)|estimated maxVoices
155 -------|---------|---------|----------|---------|---------|-------------------
156 20| 4.105| 4.105| 0.000| 0.000| 0.195| 513
157
158Profiling time(mm:ss): Total=0:30 Remainder=0:10, press <ENTER> to cancel
159 ------------------------------------------------------------------------------
160 Duration(microsecond) and cpu loads(%) (sr: 48000 Hz, sp: 20.83 microsecond)
161 ------------------------------------------------------------------------------
162 Code under profiling |Voices| Duration (microsecond) | Load(%)
163 | nbr| min| avg| max|
164 ---------------------------|------|--------------------------------|----------
165 synth_write_* ------------>| 20| 102.00| 109.22| 278.00| 4.096
166 synth_one_block ---------->| 20| 99.00| 106.65| 265.00| 3.999
167 synth_one_block:clear ---->| 20| 1.00| 1.67| 22.00| 0.062
168 synth_one_block:one voice->| 1| 11.00| 12.31| 57.00| 0.462
169 synth_one_block:all voices>| 20| 97.00| 103.68| 251.00| 3.888
170 synth_one_block:reverb --->| no profiling available
171 synth_one_block:chorus --->| no profiling available
172 voice:note --------------->| no profiling available
173 voice:release ------------>| no profiling available
174 ------------------------------------------------------------------------------
175 Cpu loads(%) (sr: 48000 Hz, sp: 20.83 microsecond) and maximum voices
176 ------------------------------------------------------------------------------
177 nVoices| total(%)|voices(%)| reverb(%)|chorus(%)| voice(%)|estimated maxVoices
178 -------|---------|---------|----------|---------|---------|-------------------
179 20| 4.096| 4.096| 0.000| 0.000| 0.194| 514
180Stopping 20 voices...voices stopped.
181> quit
182cheers!
183JackTemporaryException : now quits...
184Jack main caught signal 2
185fluid_profiling_print
186fluidsynth: Estimated times: min/avg/max (micro seconds)
187fluidsynth: synth_write_* ------------>: 102.000/109.216/278.000
188fluidsynth: synth_one_block ---------->: 99.000/106.649/265.000
189fluidsynth: synth_one_block:clear ---->: 1.000/1.666/22.000
190fluidsynth: synth_one_block:one voice->: 11.000/12.307/57.000
191fluidsynth: synth_one_block:all voices>: 97.000/103.681/251.000
192
193Upstream-Status: Inappropriate [embedded-specific]
194
195---
196 src/rvoice/fluid_rvoice_mixer.c | 55 ++++++++++++++++++++++++++++++++-
197 1 file changed, 54 insertions(+), 1 deletion(-)
198
199diff --git a/src/rvoice/fluid_rvoice_mixer.c b/src/rvoice/fluid_rvoice_mixer.c
200index af0ef75d..07a357c7 100644
201--- a/src/rvoice/fluid_rvoice_mixer.c
202+++ b/src/rvoice/fluid_rvoice_mixer.c
203@@ -27,6 +27,9 @@
204 #include "fluid_ladspa.h"
205 #include "fluid_synth.h"
206
207+#if defined(__ARM_NEON__)
208+#include "arm_neon.h"
209+#endif
210
211 // If less than x voices, the thread overhead is larger than the gain,
212 // so don't activate the thread(s).
213@@ -1053,9 +1056,15 @@ fluid_mixer_buffers_mix(fluid_mixer_buffers_t *dst, fluid_mixer_buffers_t *src,
214 int i, j;
215 int scount = current_blockcount * FLUID_BUFSIZE;
216 int minbuf;
217+#if defined(__ARM_NEON__) && defined(WITH_FLOAT)
218+ fluid_real_t *FLUID_RESTRICT base_src_left;
219+ fluid_real_t *FLUID_RESTRICT base_src_right;
220+ fluid_real_t *FLUID_RESTRICT base_dst_left;
221+ fluid_real_t *FLUID_RESTRICT base_dst_right;
222+#else
223 fluid_real_t *FLUID_RESTRICT base_src;
224 fluid_real_t *FLUID_RESTRICT base_dst;
225-
226+#endif
227 minbuf = dst->buf_count;
228
229 if(minbuf > src->buf_count)
230@@ -1063,6 +1072,27 @@ fluid_mixer_buffers_mix(fluid_mixer_buffers_t *dst, fluid_mixer_buffers_t *src,
231 minbuf = src->buf_count;
232 }
233
234+#if defined(__ARM_NEON__) && defined(WITH_FLOAT)
235+ base_src_left = fluid_align_ptr(src->left_buf, FLUID_DEFAULT_ALIGNMENT);
236+ base_dst_left = fluid_align_ptr(dst->left_buf, FLUID_DEFAULT_ALIGNMENT);
237+ base_src_right = fluid_align_ptr(src->right_buf, FLUID_DEFAULT_ALIGNMENT);
238+ base_dst_right = fluid_align_ptr(dst->right_buf, FLUID_DEFAULT_ALIGNMENT);
239+
240+ for(i = 0; i < minbuf; i++)
241+ {
242+ for(j = 0; j < scount; j+=4)
243+ {
244+ int dsp_i = i * FLUID_MIXER_MAX_BUFFERS_DEFAULT * FLUID_BUFSIZE + j;
245+
246+ float32x4_t vleft = vld1q_f32(&base_dst_left[dsp_i]);
247+ float32x4_t vright = vld1q_f32(&base_dst_right[dsp_i]);
248+ vleft = vaddq_f32(vleft, vld1q_f32(&base_src_left[dsp_i]));
249+ vright = vaddq_f32(vright, vld1q_f32(&base_src_right[dsp_i]));
250+ vst1q_f32(&base_dst_left[dsp_i], vleft);
251+ vst1q_f32(&base_dst_right[dsp_i], vright);
252+ }
253+ }
254+#else
255 base_src = fluid_align_ptr(src->left_buf, FLUID_DEFAULT_ALIGNMENT);
256 base_dst = fluid_align_ptr(dst->left_buf, FLUID_DEFAULT_ALIGNMENT);
257
258@@ -1090,6 +1120,7 @@ fluid_mixer_buffers_mix(fluid_mixer_buffers_t *dst, fluid_mixer_buffers_t *src,
259 base_dst[dsp_i] += base_src[dsp_i];
260 }
261 }
262+#endif
263
264 minbuf = dst->fx_buf_count;
265
266@@ -1098,6 +1129,27 @@ fluid_mixer_buffers_mix(fluid_mixer_buffers_t *dst, fluid_mixer_buffers_t *src,
267 minbuf = src->fx_buf_count;
268 }
269
270+#if defined(__ARM_NEON__) && defined(WITH_FLOAT)
271+ base_src_left = fluid_align_ptr(src->fx_left_buf, FLUID_DEFAULT_ALIGNMENT);
272+ base_dst_left = fluid_align_ptr(dst->fx_left_buf, FLUID_DEFAULT_ALIGNMENT);
273+ base_src_right = fluid_align_ptr(src->fx_right_buf, FLUID_DEFAULT_ALIGNMENT);
274+ base_dst_right = fluid_align_ptr(dst->fx_right_buf, FLUID_DEFAULT_ALIGNMENT);
275+
276+ for(i = 0; i < minbuf; i++)
277+ {
278+ for(j = 0; j < scount; j+=4)
279+ {
280+ int dsp_i = i * FLUID_MIXER_MAX_BUFFERS_DEFAULT * FLUID_BUFSIZE + j;
281+
282+ float32x4_t vleft = vld1q_f32(&base_dst_left[dsp_i]);
283+ float32x4_t vright = vld1q_f32(&base_dst_right[dsp_i]);
284+ vleft = vaddq_f32(vleft, vld1q_f32(&base_src_left[dsp_i]));
285+ vright = vaddq_f32(vright, vld1q_f32(&base_src_right[dsp_i]));
286+ vst1q_f32(&base_dst_left[dsp_i], vleft);
287+ vst1q_f32(&base_dst_right[dsp_i], vright);
288+ }
289+ }
290+#else
291 base_src = fluid_align_ptr(src->fx_left_buf, FLUID_DEFAULT_ALIGNMENT);
292 base_dst = fluid_align_ptr(dst->fx_left_buf, FLUID_DEFAULT_ALIGNMENT);
293
294@@ -1125,6 +1177,7 @@ fluid_mixer_buffers_mix(fluid_mixer_buffers_t *dst, fluid_mixer_buffers_t *src,
295 base_dst[dsp_i] += base_src[dsp_i];
296 }
297 }
298+#endif
299 }
300
301
302--
3032.20.1
304
diff --git a/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.11.bb b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.11.bb
deleted file mode 100644
index 4df310275..000000000
--- a/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.11.bb
+++ /dev/null
@@ -1,24 +0,0 @@
1SUMMARY = "Fluidsynth is a software synthesizer"
2HOMEPAGE = "http://www.fluidsynth.org/"
3SECTION = "libs/multimedia"
4LICENSE = "LGPL-2.1"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=fc178bcd425090939a8b634d1d6a9594"
6
7DEPENDS = "alsa-lib ncurses glib-2.0"
8
9SRC_URI = " \
10 git://github.com/FluidSynth/fluidsynth.git;branch=1.1.x \
11 file://0001-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch \
12"
13SRCREV = "f65c6ba25fb2c7e37c89fc6a4afc5aa645e208c2"
14S = "${WORKDIR}/git"
15
16inherit cmake pkgconfig lib_package
17
18EXTRA_OECMAKE = "-Denable-floats=ON -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}"
19
20PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)}"
21PACKAGECONFIG[sndfile] = "-Denable-libsndfile-support=ON,-Denable-libsndfile-support=OFF,libsndfile1"
22PACKAGECONFIG[jack] = "-Denable-jack-support=ON,-Denable-jack-support=OFF,jack"
23PACKAGECONFIG[pulseaudio] = "-Denable-pulseaudio=ON,-Denable-pulseaudio=OFF,pulseaudio"
24PACKAGECONFIG[portaudio] = "-Denable-portaudio=ON,-Denable-portaudio=OFF,portaudio-v19"
diff --git a/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_git.bb b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_git.bb
new file mode 100644
index 000000000..4f600a218
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_git.bb
@@ -0,0 +1,22 @@
1require ${BPN}.inc
2
3DEPENDS = "${BPN}-native alsa-lib ncurses glib-2.0"
4
5SRC_URI += " \
6 file://0001-Do-not-build-gentables-helper-we-have-to-use-native-.patch \
7 file://0002-fluid_synth_nwrite_float-Allow-zero-pointer-for-left.patch \
8 file://0003-Use-ARM-NEON-accelaration-for-float-multithreaded-se.patch \
9"
10
11EXTRA_OECMAKE = "-Denable-floats=ON -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}"
12
13do_configure_append() {
14 make_tables.exe ${B}/
15}
16
17PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)}"
18PACKAGECONFIG[sndfile] = "-Denable-libsndfile=ON,-Denable-libsndfile=OFF,libsndfile1"
19PACKAGECONFIG[jack] = "-Denable-jack=ON,-Denable-jack=OFF,jack"
20PACKAGECONFIG[pulseaudio] = "-Denable-pulseaudio=ON,-Denable-pulseaudio=OFF,pulseaudio"
21PACKAGECONFIG[portaudio] = "-Denable-portaudio=ON,-Denable-portaudio=OFF,portaudio-v19"
22PACKAGECONFIG[profiling] = "-Denable-profiling=ON,-Denable-profiling=OFF"