Closed m3m0ry closed 4 years ago
I'm not very sure about the VST3 issue, but my hunch about the LV2 issue you are having is that it is a mismatch between the architecture of your dplug-build
and the plugin you are trying to build. It's possible that by default your dplug-build
got built as x86. I would try rebuilding it with dub -a x86_64 -b debug --compiler ldc2
.
I have no idea what the dplug-build
actually does. I am completely new to dplug
.
LV2 issue was, that i used dmd
and not ldc2
.
Just the flag --compiler ldc2
solves the issue. I don't understand why though.
VST3 issue is unchanged.
Well I'm glad to hear that it fixed atleast part of your problem! @p0nce will likely know more about what the issue your having with VST3 is.
dplug-build
is necessary for basically every format except VST
. In a nutshell, it wraps dub
to build your plugin and generates other needed files depending on the format and operating system.
In the case of LV2 it creates the .lv2 folder to put your binary in and then loads the binary to generate the manifest file for it. It also has flags to automatically create installers on Windows and MacOS. I'm not sure what it does differently for VST3 format since I havent worked on that format at all.
To test if your VST3 issue is dplug-build specific or if it is a compiler issue, you can build just the binary using dub -a x86_64 -b debug -c VST3 --compiler ldc2
. To use the plugin in Reaper on linux then you just need to rename the binary to have a .vst3
file extension.
It seems to be a compiler (or any other issue then dplub-build
). The command dub -a x86_64 -b debug -c VST3 --compiler ldc2
reproduces my error above.
And if enabeling VST2
in the dub.json
i get:
Invalid source/import path: /home/hrom/git/d/Dplug/$VST2_SDK/pluginterfaces/vst2.x
Invalid variable: VST2_SDK
However i am happy to have LV2. Since i am completely new, do you have any tips for me? What software on Linux uses LV2? I am looking towards Qtractor or Ardour.
Hello @m3m0ry,
The issue with VST3 looks like a LDC 1.20 bug. LDC shouldn't crash under any condition. You can use a former version of LDC. This bug will be tricky to isolate but at one point we'll have to do it. You may open a bug on the LDC bugtracker but it won't be fine-grained enough in the current state. If you use eg: LDC 1.17(recommended) to 1.19 it should work.
You can't build VST2 plug-in without a VST2 SDK, those SDKs are made increasingly rare on the internet and the official source is Steinberg. Anyone that get the right from Steinberg to have a VST2 SDK would then set the VST2_SDK
env variable to the corresponding directory.
LV2 can be loaded by Ardour, Mixbus, Carla, Qtractor, and LMMS.
LV2 issue was, that i used dmd and not ldc2.
Mmmm, this shouldn't crash like this anyway. This is a Dplug bug.
Mmmm, this shouldn't crash like this anyway. This is a Dplug bug.
Seems like a problem in sharedlib.d
, i guess line 166.
I have run it with debugSharedLibs
and it tries to load:
loading dynlib 'builds/Linux-64b-LV2/WittyAudioCLIPIt.so'
This library is present.
I don't really understand, why loading is different under dmd
and ldc
.
Perhaps there is a hidden requirement that dplug-build
should be built with the same compiler that the compiler used to build the plug-in?
It would be interesting to test DMD + DMD / DMD + LDC / LDC + DMD and LDC + LDC to see the combinations that work in LV2.
@m3m0ry I don't manage to reproduce your dplug:vst3 problem (see #451 ) Please install LDC using https://github.com/ldc-developers/ldc/releases have you used another method?
For the dplug-build LV2 problem, here are the steps to reproduce the crash:
dplug-build
ensues
No such problem on Windows, possibly it is ABI?Stack trace is showing:
(lldb) bt
* thread #1, name = 'dplug-build', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
* frame #0: 0x0000555555777703 dplug-build`_D2rt8monitor_13ensureMonitorFNbC6ObjectZPOSQBqQBq7Monitor + 159
frame #1: 0x0000555555777601 dplug-build`_d_monitorenter + 25
frame #2: 0x00007ffff67f2266 WittyAudioCLIPIt.so`_D4core6thread6Thread__T10getAllImplS_DQBlQBjQBf7opApplyFMDFKCQCiQCgQCcZiZ6resizeFNbNiKAQBbmZvZQCtFNiZQp + 54
frame #3: 0x00007ffff67f2186 WittyAudioCLIPIt.so`_D4core6thread6Thread7opApplyFMDFKCQBhQBfQBbZiZi + 22
frame #4: 0x000055555579fc7f dplug-build`_D2rt5minfo__T17runModuleFuncsRevSQBgQBg11ModuleGroup8runDtorsMFZ9__lambda1ZQCkMFAxPyS6object10ModuleInfoZv + 87
frame #5: 0x000055555579f799 dplug-build`_D2rt5minfo11ModuleGroup8runDtorsMFZv + 33
frame #6: 0x000055555579fa31 dplug-build`_D2rt5minfo13rt_moduleDtorUZ14__foreachbody1MFKSQBu19sections_elf_shared3DSOZi + 29
frame #7: 0x0000555555777c06 dplug-build`_D2rt19sections_elf_shared3DSO14opApplyReverseFMDFKSQByQByQBgZiZi + 74
frame #8: 0x000055555579fa11 dplug-build`rt_moduleDtor + 21
frame #9: 0x000055555579cd62 dplug-build`rt_term + 70
frame #10: 0x0000555555771e86 dplug-build`_D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv + 202
frame #11: 0x0000555555771d6d dplug-build`_D2rt6dmain212_d_run_main2UAAamPUQgZiZ7tryExecMFMDFZvZv + 33
frame #12: 0x0000555555771cd6 dplug-build`_d_run_main2 + 558
frame #13: 0x0000555555771a92 dplug-build`_d_run_main + 190
frame #14: 0x00005555556b4c72 dplug-build`main(argc=5, argv=0x00007fffffffdee8) at entrypoint.d:34
frame #15: 0x00007ffff6e24b97 libc.so.6`__libc_start_main(main=(dplug-build`main at entrypoint.d:32), argc=5, argv=0x00007fffffffdee8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffded8) at libc-start.c:310
frame #16: 0x00005555556ac1ca dplug-build`_start + 42
(lldb)
dplug-build tries to run the module destructors of the plug-in, which doesn't work because the runtime isn't enabled... I don't really get what happens there.
A working work-around is to always build dplug-build
with LDC (and not DMD) on Windows.
With DMD and LDC both at 2.070 FE, the crash becomes (DMD hosting LDC plug-in):
Aborting from src/rt/sections_elf_shared.d(480) DSO being unregistered isn't current last one.Aborted (core dumped)
With DMD hosting DMD plug-in, the crash can be work-arounded with RTLD_LAZY
, don't know why
It's complicated...
dplug-build
with DMD will now complain that for LV2 hosting you need to build it with LDC.
I am trying to build the examples. I am using the
dplug-build
. There seems to be two different issues.dplug:vst3
, no matter what the-c
argument is. I am getting the following output:=> Bundling plug-in CLIP It from Witty Audio, archs 64-bit configurations: ["LV2"], build type debug, compiler ldc2
** Building configuration LV2 with ldc2, 64-bit arch... $ dub build --build=debug --arch=x86_64 --compiler=ldc2 --config=LV2 Performing "debug" build using ldc2 for x86_64. dplug:core 9.1.10: building configuration "library"... dplug:carbon 9.1.10: building configuration "library"... dplug:client 9.1.10: building configuration "library"... dplug:cocoa 9.1.10: building configuration "library"... dplug:au 9.1.10: building configuration "library"... intel-intrinsics 1.2.2: building configuration "library"... pfft 1.0.6: building configuration "library"... dplug:dsp 9.1.10: building configuration "library"... gfm:math 8.0.3: building configuration "library"... dplug:graphics 9.1.10: building configuration "library"... dplug:x11 9.1.10: building configuration "library"... dplug:window 9.1.10: building configuration "library"... dplug:gui 9.1.10: building configuration "library"... dplug:flat-widgets 9.1.10: building configuration "library"... dplug:lv2 9.1.10: building configuration "library"... dplug:vst 9.1.10: building configuration "library"... dplug:vst3 9.1.10: building configuration "library"... ldc2: /build/ldc-jszirN/ldc-1.20.0/gen/classes.cpp:430: llvm::Value DtoVirtualFunctionPointer(DValue, FuncDeclaration, const char*): Assertion `fdecl->vtblIndex > 0 || (fdecl->vtblIndex == 0 && fdecl->linkage == LINKcpp)' failed. /usr/lib/x86_64-linux-gnu/libLLVM-9.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1f)[0x7f2fe2d54bdf] /usr/lib/x86_64-linux-gnu/libLLVM-9.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0x22)[0x7f2fe2d52fc2] /usr/lib/x86_64-linux-gnu/libLLVM-9.so.1(+0xb7dfe1)[0x7f2fe2d54fe1] /lib/x86_64-linux-gnu/libpthread.so.0(+0x13520)[0x7f2fe219c520] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x141)[0x7f2fe1cd5f61] /lib/x86_64-linux-gnu/libc.so.6(abort+0x121)[0x7f2fe1cc1535] /lib/x86_64-linux-gnu/libc.so.6(+0x2540f)[0x7f2fe1cc140f] /lib/x86_64-linux-gnu/libc.so.6(+0x32b92)[0x7f2fe1cceb92] ldc2(_Z25DtoVirtualFunctionPointerP6DValueP15FuncDeclarationPKc+0x256)[0x564b451c1cd6] ldc2(+0x6ff93a)[0x564b4516893a] ldc2(_Z6toElemP10Expression+0x7a)[0x564b4516019a] ldc2(+0x700d25)[0x564b45169d25] ldc2(+0x700f6f)[0x564b45169f6f] ldc2(_Z6toElemP10Expression+0x7a)[0x564b4516019a] ldc2(+0x701b3e)[0x564b4516ab3e] ldc2(_Z10toElemDtorP10Expression+0x7a)[0x564b4516044a] ldc2(+0x6eb436)[0x564b45154436] ldc2(+0x6e3091)[0x564b4514c091] ldc2(+0x6e2f4a)[0x564b4514bf4a] ldc2(+0x6eb683)[0x564b45154683] ldc2(+0x6e3091)[0x564b4514c091] ldc2(+0x6e2f4a)[0x564b4514bf4a] ldc2(+0x6eb683)[0x564b45154683] ldc2(+0x6e2f4a)[0x564b4514bf4a] ldc2(+0x6e4693)[0x564b4514d693] ldc2(+0x6e3091)[0x564b4514c091] ldc2(+0x6e2f4a)[0x564b4514bf4a] ldc2(+0x6e3091)[0x564b4514c091] ldc2(+0x6e3091)[0x564b4514c091] ldc2(_Z14Statement_toIRP9StatementP7IRState+0x2d)[0x564b4514b8fd] ldc2(_Z17DtoDefineFunctionP15FuncDeclarationb+0xc35)[0x564b4510bb55] ldc2(+0x694890)[0x564b450fd890] ldc2(+0x694890)[0x564b450fd890] ldc2(+0x694890)[0x564b450fd890] ldc2(+0x694890)[0x564b450fd890] ldc2(+0x696350)[0x564b450ff350] ldc2(_Z19Declaration_codegenP7Dsymbol+0x34)[0x564b450fd174] ldc2(_Z13codegenModuleP7IRStateP6Module+0x11e)[0x564b4511ffde] ldc2(_ZN3ldc13CodeGenerator4emitEP6Module+0x95)[0x564b451dfc75] ldc2(_Z14codegenModulesR5ArrayIP6ModuleE+0x17f)[0x564b451af89f] ldc2(_Z13marsmainBodyR5ParamR5ArrayIPKcES5+0x18db)[0x564b44f86c0b] ldc2(_Z7cppmainv+0x1692)[0x564b451b1d12] ldc2(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv+0x50)[0x564b45312b90] ldc2(_d_run_main2+0x18f)[0x564b4531299f] ldc2(_d_run_main+0x8e)[0x564b453127fe] ldc2(main+0x24e)[0x564b44e9261e] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb)[0x7f2fe1cc2bbb] ldc2(_start+0x2a)[0x564b44e9490a] Aborted ldc2 failed with exit code 134. error: Command 'dub build --build=debug --arch=x86_64 --compiler=ldc2 --config=LV2' returned 2
info: Missing "licensePath" in plugin.json (eg: "license.txt") info: Missing "iconPath-windows" in plugin.json (eg: "gfx/myIcon.ico") info: Missing "iconPath-osx" in plugin.json (eg: "gfx/myIcon.png")
=> Bundling plug-in CLIP It from Witty Audio, archs 64-bit configurations: ["LV2"], build type debug, compiler ldc2
*** Building configuration LV2 with ldc2, 64-bit arch... $ dub build --build=debug --arch=x86_64 --compiler=ldc2 --config=LV2 Performing "debug" build using ldc2 for x86_64. dplug:core 9.1.10: target for configuration "library" is up to date. dplug:carbon 9.1.10: target for configuration "library" is up to date. dplug:client 9.1.10: target for configuration "library" is up to date. dplug:cocoa 9.1.10: target for configuration "library" is up to date. dplug:au 9.1.10: target for configuration "library" is up to date. intel-intrinsics 1.2.2: target for configuration "library" is up to date. pfft 1.0.6: target for configuration "library" is up to date. dplug:dsp 9.1.10: target for configuration "library" is up to date. gfm:math 8.0.3: target for configuration "library" is up to date. dplug:graphics 9.1.10: target for configuration "library" is up to date. dplug:x11 9.1.10: target for configuration "library" is up to date. dplug:window 9.1.10: target for configuration "library" is up to date. dplug:gui 9.1.10: target for configuration "library" is up to date. dplug:flat-widgets 9.1.10: target for configuration "library" is up to date. dplug:lv2 9.1.10: target for configuration "library" is up to date. dplug:vst 9.1.10: target for configuration "library" is up to date. clipit ~master: building configuration "LV2"... Linking... To force a rebuild of up-to-date targets, run again with --force. => Build OK, binary size = 11.2 mb, available in ./builds/Linux-64b-LV2
*** Extract LV2 manifest from binary... core.exception.AssertError@../../core/dplug/core/sharedlib.d(39): Couldn't open the shared library.
??:? _d_assert_msg [0x5590b9543aee] ../../core/dplug/core/sharedlib.d:39 nothrow @nogc void dplug.core.sharedlib.SharedLib.load(immutable(char)[]) [0x5590b95385b2] source/main.d:541 void main.main(immutable(char)[][]).buildAndPackage(immutable(char)[], plugin.Arch[], immutable(char)[]).extractLV2ManifestFromBinary(immutable(char)[], immutable(char)[], bool, immutable(char)[]) [0x5590b94810cf] source/main.d:687 void main.main(immutable(char)[][]).buildAndPackage(immutable(char)[], plugin.Arch[], immutable(char)[]) [0x5590b94808b8] source/main.d:945 _Dmain [0x5590b947fecc]
Registered Targets: aarch64 - AArch64 (little endian) aarch64_32 - AArch64 (little endian ILP32) aarch64_be - AArch64 (big endian) amdgcn - AMD GCN GPUs arm - ARM arm64 - ARM64 (little endian) arm64_32 - ARM64 (little endian ILP32) armeb - ARM (big endian) avr - Atmel AVR Microcontroller bpf - BPF (host endian) bpfeb - BPF (big endian) bpfel - BPF (little endian) hexagon - Hexagon lanai - Lanai mips - MIPS (32-bit big endian) mips64 - MIPS (64-bit big endian) mips64el - MIPS (64-bit little endian) mipsel - MIPS (32-bit little endian) msp430 - MSP430 [experimental] nvptx - NVIDIA PTX 32-bit nvptx64 - NVIDIA PTX 64-bit ppc32 - PowerPC 32 ppc64 - PowerPC 64 ppc64le - PowerPC 64 LE r600 - AMD GPUs HD2XXX-HD6XXX riscv32 - 32-bit RISC-V riscv64 - 64-bit RISC-V sparc - Sparc sparcel - Sparc LE sparcv9 - Sparc V9 systemz - SystemZ thumb - Thumb thumbeb - Thumb (big endian) wasm32 - WebAssembly 32-bit wasm64 - WebAssembly 64-bit x86 - 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64 xcore - XCore