swh / lv2 Goto Github PK
View Code? Open in Web Editor NEWSWH Plugins in LV2 format
Home Page: http://plugin.org.uk/
License: GNU General Public License v3.0
SWH Plugins in LV2 format
Home Page: http://plugin.org.uk/
License: GNU General Public License v3.0
After building the latest snapshot, I get undefined symbols. See:
https://gist.github.com/135612/c06b3bca480b0f46fadad14377b2675b3ab290e6
This patch resolves this issue:
http://gist.github.com/135618/d7f133882dc8ae6e67f0118549320e59c3cb2987
(It is a pain to add attachments to bug reports here. Is there an easier way?)
A second patch I made corrects permissions (and timestamps) of the installed files.
http://github.com/oget/lv2/commit/8dacda442dd10b5269288aee034d4956926dd4de
I'd be happy if you merge this too.
Many of the routines in the plugins allocate memory in the activate()
method that is freed in the cleanup()
method. If the activate()
method is never called (say, because the plugin was instantiated, but never used), then the program that loaded the plugin will crash.
For example, in 'plugins/allpass-swh.lv2/plugin.xml', the activate() method allocates memory:
plugin_data->buffer = calloc(size, sizeof(float));
... which isn't cleaned up until cleanup()
is called:
free(plugin_data->buffer);
Note that this strategy also causes the plugins to leak memory, as a plugin could be activated and deactivated multiple times before cleanup()
is called.
One of the following should occur:
1.) The memory should be allocated when the instance is first created.
2.) The memory should be freed in the deactivate()
method.
3.) The cleanup()
method should check to make sure that memory was actually allocated before freeing that memory.
(1) and (2) are ideal.
I have swh-lv2-1.0.16 in gentoo, and use global make options -j3 -l1.8.
Reported to them as https://bugs.gentoo.org/show_bug.cgi?id=687924
Initially I thought it is failure to handle multiple jobs, but then made experiments with fresh git trunk, and found that only some -j -l values fail.
In particular, -j3 -l1.8
, -j3 -l3
and -j10 -l2
.
However, simple -jN
(with any N) and -j3 -l5
are ok.
When I tried to install releases, I made two attempts. First time it failed missing gverb/gverbdsp.o, and second time - at util/iir.o. But when I experimented with git trunk, only util/iir.o was missed all times.
I originally filed this bug to zynjacku:
https://gna.org/bugs/?13688
The problem was, loading some of the lv2-swh plugins via zynjacku resulted in segmentation faults, while the plugins work fine with lv2_jack_host (from slv2) or ardour.
I have been asked to file this bug here. I went through all the plugins one-by-one, and meanwhile I noticed that some of them crash with even lv2_jack_host (which I misreported before). What is not listed in the below list works fine.
Note that, this test is made against the latest trunk snapshot + the patch I submitted in
http://github.com/swh/lv2/issues#issue/1
(otherwise more plugins will fail due to missing symbols)
Allpass delay line, cubic spline interpolation:
crashes with both lv2_jack_host, zynjacku
[Switching to Thread 0x7fffed4bb910 (LWP 27663)]
0x00007fffec3a0d14 in runAllpass_c (instance=0x1967a20, sample_count=)
at plugins/allpass-swh.lv2/plugin.c:637
637 float read = cube_interp (frac,
[Switching to Thread 0x7fffed4bb910 (LWP 28763)]
0x00007fffec3a2433 in runAllpass_l (instance=0x196a050, sample_count=)
at plugins/allpass-swh.lv2/plugin.c:429
429 float r1 = buffer[read_phase & buffer_mask];
runAllpass_n (instance=0x1968710, sample_count=1024) at plugins/allpass-swh.lv2/plugin.c:192
192 float read = *(readptr++);
[Switching to Thread 0x7fffed4bb910 (LWP 2471)]
runBodeShifterCV (instance=0x173af90, sample_count=)
at plugins/bode_shifter_cv-swh.lv2/plugin.c:205
205 buffer_write(mixout[pos], (dout[pos] - uout[pos]) * mixc + uout[pos]);
[Switching to Thread 0x7fffed4bb910 (LWP 4036)]
0x00007fffec19ecb4 in runComb_c (instance=0x19692b0, sample_count=)
at plugins/comb-swh.lv2/plugin.c:633
633 float read = cube_interp (frac,
[Switching to Thread 0x7fffed4bb910 (LWP 6545)]
runComb_l (instance=0x1968050, sample_count=)
at plugins/comb-swh.lv2/plugin.c:425
425 float r1 = buffer[read_phase & buffer_mask];
[Switching to Thread 0x7fffed4bb910 (LWP 8806)]
runComb_n (instance=0x1966bf0, sample_count=)
at plugins/comb-swh.lv2/plugin.c:189
189 float read = *(readptr++);
[Switching to Thread 0x7fffed4bb910 (LWP 10143)]
runXfade (instance=0x1a428d0, sample_count=)
at plugins/xfade-swh.lv2/plugin.c:83
83 buffer_write(outputL[pos], inputLA[pos] * coefA + inputLB[pos] * coefB);
[Switching to Thread 0x7fffed4bb910 (LWP 9841)]
runXfade4 (instance=0x196a000, sample_count=)
at plugins/xfade-swh.lv2/plugin.c:194
194 buffer_write(outputLB[pos], inputLB[pos] * coefB);
[Switching to Thread 0x7fffed4bb910 (LWP 10800)]
calc_2polebandpass (iirf=0x736e6967756c702d, gt=0x736170646e61622f,
fc=0.112575002, bw=0.225050002, sample_rate=44100) at util/iir.c:102
102 if ( (gt->fc==fc) && (gt->bw==bw) )
[Switching to Thread 0x7fffed4bb910 (LWP 13459)]
chebyshev (iirf=0x0, gt=0x0, n=2, mode=1, fc=2.55158739e-06, pr=0.5) at util/iir.c:213
213 if ( (gt->fc==fc) && (gt->np==n) && (gt->ppr=pr) )
[Switching to Thread 0x7fffed4bb910 (LWP 16152)]
butterworth_stage (sample_rate=, r=, f=, mode=, gt=)
at util/iir.h:130
130 gt->coeff[0][0] = a1;
[Switching to Thread 0x7fffed4bb910 (LWP 18643)]
chebyshev (iirf=0x736170686769682f, gt=0x7875007269695f73, n=2, mode=1, fc=2.55272107e-06,
pr=0.5) at util/iir.c:213
213 if ( (gt->fc==fc) && (gt->np==n) && (gt->ppr=pr) )
[Switching to Thread 0x7fffed4bb910 (LWP 22139)]
0x00007fffdc5c3903 in runRevdelay (instance=0x1b4cbe0, sample_count=1024)
at plugins/revdelay-swh.lv2/plugin.c:167
167 read = (wet * buffer[read_phase]) + (dry * insamp);
[Switching to Thread 0x7fffed4bb910 (LWP 25952)]
runSc3 (instance=0x16c6710, sample_count=)
at plugins/sc3-swh.lv2/plugin.c:175
175 + chain_bal * sidechain[pos];
runDelay_c (instance=0x1747d60, sample_count=)
at plugins/delay-swh.lv2/plugin.c:520
520 float read = cube_interp (frac,
[Switching to Thread 0x7fffed4bb910 (LWP 30899)]
0x00007fffec3a1cfe in runDelay_l (instance=0x1968000, sample_count=)
at plugins/delay-swh.lv2/plugin.c:338
338 read = LIN_INTERP (frac,
[Switching to Thread 0x7fffed4bb910 (LWP 32669)]
runDelay_n (instance=0x1969510, sample_count=)
at plugins/delay-swh.lv2/plugin.c:155
155 float read = *(readptr++);
[Switching to Thread 0x7fffed4bb910 (LWP 1423)]
runSurroundEncoder (instance=, sample_count=)
at plugins/surround_encoder-swh.lv2/plugin.c:158
158 delay[dptr] = s[pos];
Please tag a stable release.
This would make it easier to package the plugins.
Some package management systems (e.g. homebrew) do not accept packages with no tagged versions.
==28903== Invalid free() / delete / delete[] / realloc()
==28903== at 0x4C2AEAB: free (vg_replace_malloc.c:530)
==28903== by 0x4A03F8DC: ??? (in /usr/lib/lv2/revdelay-swh.lv2/plugin-linux.so)
==28903== by 0xE912082: lilv_instance_free (in /usr/lib/liblilv-0.so.0.22.0)
==28903== by 0x6972404: ARDOUR::LV2Plugin::cleanup() (lv2_plugin.cc:1927)
==28903== by 0x696C210: ARDOUR::LV2Plugin::~LV2Plugin() (lv2_plugin.cc:721)
==28903== by 0x696C563: ARDOUR::LV2Plugin::~LV2Plugin() (lv2_plugin.cc:752)
==28903== Conditional jump or move depends on uninitialised value(s)
==28903== at 0x4C2AE61: free (vg_replace_malloc.c:530)
==28903== by 0x4A03F8DC: ??? (in /usr/lib/lv2/revdelay-swh.lv2/plugin-linux.so)
==28903== by 0xE912082: lilv_instance_free (in /usr/lib/liblilv-0.so.0.22.0)
==28903== by 0x6972404: ARDOUR::LV2Plugin::cleanup() (lv2_plugin.cc:1927)
==28903== by 0x696C210: ARDOUR::LV2Plugin::~LV2Plugin() (lv2_plugin.cc:721)
==28903== by 0x696C563: ARDOUR::LV2Plugin::~LV2Plugin() (lv2_plugin.cc:752)
Sorry no debug-build, but this really smells like some uninitialized pointer variable.
If needed I can do with a debug build, but really just calloc
allocate the instance or memset
will solve this.
lowpass_iir-swh.lv2 has a similar issue (no crash), valgrind reports
==28903== Conditional jump or move depends on uninitialised value(s)
==28903== at 0xF5352EF: __sin_avx (in /lib/x86_64-linux-gnu/libm-2.21.so)
==28903== by 0xF4F01DA: sincos (in /lib/x86_64-linux-gnu/libm-2.21.so)
==28903== by 0x50884EE5: chebyshev_stage (in /usr/lib/lv2/lowpass_iir-swh.lv2/plugin-linux.so)
==28903== by 0x508856C9: chebyshev (in /usr/lib/lv2/lowpass_iir-swh.lv2/plugin-linux.so)
==28903== by 0x69688EF: lilv_instance_activate (lilv.h:1648)
Example from the generated GLAME Butterworth Lowpass ttl:
:port [
a :InputPort, :ControlPort ;
:name "Cutoff Frequency (Hz)" ;
:index 0 ;
:symbol "cutoff" ;
:minimum 0.0001 ;
:maximum 0.45 ;
:default 0.112575 ;
:portProperty pprops:logarithmic ;
:portProperty :sampleRate ;
] ;
Here, sampleRate
tells us that minimum
and maximum
shall be multiplied with the processing sample rate, i.e. minimum
and maximum
in range [0,1]
makes sense. However, default
will not be multiplied, so the default value must be in range [minimum*sampleRate, maximum*sampleRate]
.
Thanks for @PhysSong who posted a comment about it, and to @drobilla for confirming that this default value is not valid.
Hi,
I know of your plugins via the Ardour program. Thanks for the great work!
I’m running into some issues though. I asked on IRC #ardour-osx , and they said there are some known issues with the plugins under os x.
This is what I encountered thus far:
When trying to load Multiband EQ Ardour consistently crashes:
https://gist.github.com/raw/757211/079bc782aff25f4a46216513d555fd88ed026ff5/ardour-crash.log
SC4 doesn’t affect it’s input when loaded by itself, adding a bypassed instance of SC1 changes this, like:
http://ardour.org/node/2176
I was wondering if you could look into this.
thanks, Eric
I like the "Artificial latency" plugin to eliminate latencies that were introduced during recording (multiple microphones on a drum kit, for example).
However, it would be more intuitive (to me) to
a) set the delay that I want to apply and not the delay the signal has
b) also be able to set negative values
and c) set the delay in samples because it can be measured much more accurate.
I did a quick experiment and came up with this trivial plugin. It has all the properties mentioned above and I tested it in Ardour3.
Would you be willing to include such a plug-in in your collection? I'd be happy to create a corresponding pull request if you like.
The sidechain inputs should have a lv2:portProperty lv2:isSideChain;
port property.
Currently they're only in a custom group pg:inGroup swh:sc3-sidechain ;
and "swh:sc3-sidechain" is not meaningful to a host.
expected (here sc3-swh.lv2/plugin.ttl).
:port [
a :InputPort, :AudioPort ;
:name "Sidechain" ;
:index 7 ;
:symbol "sidechain" ;
:portProperty :isSideChain;
pg:inGroup swh:sc3-sidechain ;
pg:role pg:centerChannel ;
] ;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.