DISTRHO starting out question

Ive cloned the DISTRHO repo and successfully compiled the MidiThrough and Metronome examples, but the Parameters and SendNote examples give this same error on make:

Compiling SendNoteExamplePlugin.cpp
Compiling SendNoteExampleUI.cpp
Compiling DistrhoPluginMain.cpp (JACK)
In file included from ../../distrho/src/../../dgl/src/WindowPrivateData.hpp:24,
                 from ../../distrho/src/DistrhoUIPrivateData.hpp:31,
                 from ../../distrho/src/DistrhoUIInternal.hpp:20,
                 from ../../distrho/src/DistrhoPluginJACK.cpp:24,
                 from ../../distrho/DistrhoPluginMain.cpp:24:
../../distrho/src/../../dgl/src/pugl.hpp:42:10: fatal error: pugl-upstream/include/pugl/pugl.h: No such file or directory
   42 | #include "pugl-upstream/include/pugl/pugl.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [../../Makefile.plugins.mk:442: ../../build/d_sendNote/DistrhoPluginMain_JACK.cpp.o] Error 1

I have found this: Missing entry method in VST2 plugin,about DISTRHO/Cardinal - Coder Social but not sure if its relevant to my simple problem. All I want to do is produce lv2 plugins rather than vsts if that would help

p.s. am using Ubuntu 20.04.5 LTS (Focal Fossa)

1 Like

you must run

git submodule init
git submodule update

before make.

3 Likes

Everytime you see a .gitmodules file on a repo, it is because submodules are in use.
I prefer to use this which is a one liner:

git submodule update --init --recursive
5 Likes

thanks @brummer & @falkTX - working now!

3 Likes

@falkTX
In my projects I use a little target to automate this step. Works like a charm.

check-and-reinit-submodules :
	@if git submodule status 2>/dev/null | grep -E -q '^[-]|^[+]' ; then \
		echo "INFO: Need to reinitialize git submodules"$; \
		git submodule update --init; \
		echo "Done"; \
	else echo "Submodule up to date"; \
	fi
2 Likes

Thanks for the answers so far. Having compiled the various example plugins - I was hoping that I could just copy them on to the moddwarf and they would run, but clearly not. I found somewhere else in the forums about a make modwarf command, but when I tried that, it seemed like there were a number of environment variables that had to be set -

make AR=/home/me/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-gcc-ar CC=/home/me/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-gcc CPP=/home/me/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-cpp CXX=/home/me/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-g++ LD=/home/me/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-ld PKG_CONFIG=/home/me/mod-workdir/moddwarf/host/usr/bin/pkg-config STRIP=/home/me/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-strip CFLAGS="-I/home/me/mod-workdir/moddwarf/staging/usr/include " CPPFLAGS= CXXFLAGS="-I/home/me/mod-workdir/moddwarf/staging/usr/include " LDFLAGS="-L/home/me/mod-workdir/moddwarf/staging/usr/lib " EXE_WRAPPER="qemu-aarch64-static -L /home/me/mod-workdir/moddwarf/target" NOOPT=true

I do have the mod-plugin-builder cloned - but in the above diagnostics what does mod-workdir refer to? And how do I tell the system where it is?

1 Like

~/mod-workdir is the default build and install target directory from mod-plugin-builder.
you are supposed to “bootstrap” the toolchain on the mod-plugin-builder first, then “make moddwarf” will work, it just uses the default dirs from mod-plugin-builder

2 Likes

I highly recommend reading through the github page of MPB

And if possible use the docker image of cbix or build one yourself.

At least that is what I used to build the neural-modeler-plugin.

2 Likes

Thanks again - got here - got here in the sense that in ~/mod-workdir/moddwarf/plugins/ I did manage to generate a folder called d_midiThrough.lv2 which comes from the
DPF/examples/MidiThrough/ code

The documentation says:

If everything goes well, you will have the final plugin bundle in ~/mod-workdir/<platform>/plugins

I do, but its not really a bundle, its just a single .so file called d_midiThrough_dsp.so inside a folder called d_midiThrough.lv2

Is that what is expected?

However, the next step (publishing to the moddwarf) i dont quite understand. The documentation says:

To push the build plugin onto a MOD Device, run:
./build <platform> <plugin-package>-publish

I presume that means the script build from mod-plugin-builder/ - however my mind couldnt compute how I reference the just built package (in mod-workdir) from that script - is it just the name of the folder created (i.e d_midiThrough.lv2) - I tried that it didnt work.

So I tried the other method (from inside the ~/mod-workdir/moddwarf/plugins folder)

tar cz d_midiThrough.lv2 | base64 | curl -F ‘package=@-’ http://192.168.51.1/sdk/install; echo

but that just returned:
{“removed”: [], “ok”: false, “error”: “No plugins found in bundle”, “installed”: []}

Clearly I am not understanding something - if there any mistakes above if they could be pointed out that would be great.

But I think my mental model of the system is not right maybe. My model so far is something like this

a) mod-plugin-builder is a set of tools to generate the installable plugins from the code
b) mod-workdir is where mpb puts and produces what is coded
c) DISTRHO is a simpler way of creating the plugins and its make scripts seem to understand the mod-plugin-builder well enough that if you run the command make moddwarf - you will manage to get something put into your mod-workdir
But that’s not enough - something else needs to be done to get whatever’s been produced to be accepted by the dwarf

Anyway, if anyone can help, I’d be very grateful!

1 Like

You only need the mod-plugin-builder for its bootstrap, leave the rest to DPF, including building and pushing to MOD.
After the bootstrap process, you should only bother with mod-plugin-builder if you want to have your plugin on the plugin store or build the available plugins.

For local builds, again assuming bootstrap process has been run once, and you have latest DPF too (important as I just fixed a thing while testing this right now), just do:

# build the plugin
make moddwarf

# push to MOD over USB
make modpush

The step regarding importing the “local.env” from mod-plugin-builder is not needed here either.
It is really just “make moddwarf && make modpush”, DPF does the hard part all behind the scenes.

Later on I will have the same setup for cmake-based projects, but for now this only works if using makefiles.

2 Likes

Thanks again - I tried this, but I get this error (the same one when attempting to do it manually)

$ make moddwarf && make modpush
make AR=/home/me/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-gcc-ar CC=/home/me/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-gcc CPP=/home/me/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-cpp CXX=/home/me/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-g++ LD=/home/me/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-ld PKG_CONFIG=/home/me/mod-workdir/moddwarf/host/usr/bin/pkg-config STRIP=/home/me/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-strip CFLAGS="-I/home/me/mod-workdir/moddwarf/staging/usr/include " CPPFLAGS= CXXFLAGS="-I/home/me/mod-workdir/moddwarf/staging/usr/include " LDFLAGS="-L/home/me/mod-workdir/moddwarf/staging/usr/lib " EXE_WRAPPER="qemu-aarch64-static -L /home/me/mod-workdir/moddwarf/target" NOOPT=true
make[1]: Entering directory '/media/me/ld/l/dev/DPF/examples/Metronome'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/me/ld/l/dev/DPF/examples/Metronome'
tar -C bin -cz  | base64 | curl -F 'package=@-' http://192.168.51.1/sdk/install && echo
tar: Cowardly refusing to create an empty archive
Try 'tar --help' or 'tar --usage' for more information.
{"installed": [], "ok": false, "error": "No plugins found in bundle", "removed": []}

Just one thing - (might be relevant might not) - I originally cloned the mod-plugin-builder in July, but didnt do anything with it till this last week. I therefore did a git pull and then a bootstrap moddwarf again. Could that have messed anything up? Oh, and just to be clear - bootstrap moddwarf should be done once - or should it be done every session that you might want to build things?

1 Like

bootstrap is only needed once, ever.
there should be no need to re-run for dwarf, nothing on its toolchain changed in the last couple of months.

not sure what is going on for you, the bin directory ends up empty?
if you tweaked the makefiles I am afraid you messed up the build

try with GitHub - DISTRHO/Nekobi: DISTRHO Nekobi as-is instead of DPF itself (and its examples). note cloning needs --recursive for submodules.

1 Like

Thanks for your patience. Here is the full sequence of commands from clone to make modpush

stiv@stiv-V:~$ git clone https://github.com/DISTRHO/Nekobi.git
Cloning into 'Nekobi'...
remote: Enumerating objects: 610, done.
remote: Counting objects: 100% (46/46), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 610 (delta 16), reused 33 (delta 11), pack-reused 564
Receiving objects: 100% (610/610), 1.20 MiB | 1.43 MiB/s, done.
Resolving deltas: 100% (289/289), done.
stiv@stiv-V:~$ cd Nekobi
stiv@stiv-V:~/Nekobi$ git submodule update --init --recursive
Submodule 'dpf' (https://github.com/DISTRHO/DPF) registered for path 'dpf'
Cloning into '/home/stiv/Nekobi/dpf'...
Submodule path 'dpf': checked out '061f6c4e6444f961b5d601f6dbe60e1e04748094'
Submodule 'dgl/src/pugl-upstream' (https://github.com/DISTRHO/pugl.git) registered for path 'dpf/dgl/src/pugl-upstream'
Cloning into '/home/stiv/Nekobi/dpf/dgl/src/pugl-upstream'...
Submodule path 'dpf/dgl/src/pugl-upstream': checked out '3e03459a5a0b0f118b04e9e0b0a32f42ccd04a5c'
stiv@stiv-V:~/Nekobi$ ls
dpf  LICENSE  Makefile  plugins  README.md
stiv@stiv-V:~/Nekobi$ cd plugins
stiv@stiv-V:~/Nekobi/plugins$ ls
Nekobi
stiv@stiv-V:~/Nekobi/plugins$ cd Nekobi
stiv@stiv-V:~/Nekobi/plugins/Nekobi$ ls
artwork                   DistrhoPluginNekobi.cpp  Makefile
DistrhoArtworkNekobi.cpp  DistrhoPluginNekobi.hpp  nekobee-src
DistrhoArtworkNekobi.hpp  DistrhoUINekobi.cpp      NekoWidget.hpp
DistrhoPluginInfo.h       DistrhoUINekobi.hpp      Screenshot.png
stiv@stiv-V:~/Nekobi/plugins/Nekobi$ make moddwarf
make AR=/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-gcc-ar CC=/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-gcc CPP=/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-cpp CXX=/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-g++ LD=/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-ld PKG_CONFIG=/home/stiv/mod-workdir/moddwarf/host/usr/bin/pkg-config STRIP=/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-strip CFLAGS="-I/home/stiv/mod-workdir/moddwarf/staging/usr/include " CPPFLAGS= CXXFLAGS="-I/home/stiv/mod-workdir/moddwarf/staging/usr/include " LDFLAGS="-L/home/stiv/mod-workdir/moddwarf/staging/usr/lib " EXE_WRAPPER="qemu-aarch64-static -L /home/stiv/mod-workdir/moddwarf/target" HAVE_CAIRO=false HAVE_OPENGL=false MOD_BUILD=true NOOPT=true
make[1]: Entering directory '/home/stiv/Nekobi/plugins/Nekobi'
Compiling DistrhoPluginNekobi.cpp
Compiling DistrhoPluginMain.cpp (JACK)
Creating JACK standalone for Nekobi
Compiling DistrhoPluginMain.cpp (DSSI)
Creating DSSI plugin library for Nekobi
Compiling DistrhoPluginMain.cpp (LV2)
Creating LV2 plugin library for Nekobi
Compiling DistrhoPluginMain.cpp (VST2)
Creating VST2 plugin for Nekobi
Compiling DistrhoPluginMain.cpp (VST3)
In file included from ../../dpf/distrho/DistrhoPluginMain.cpp:33:0:
../../dpf/distrho/src/DistrhoPluginVST3.cpp: In member function 'v3_result DISTRHO::PluginVst3::process(v3_process_data*)':
../../dpf/distrho/src/DistrhoPluginVST3.cpp:1551:55: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
                     if (canAppendMoreEvents && rindex >= kVst3InternalParameterMidiCC_start && rindex <= kVst3InternalParameterMidiCC_end)
                                                ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Creating VST3 plugin for Nekobi
Compiling DistrhoPluginMain.cpp (CLAP)
Creating CLAP plugin for Nekobi
make[1]: Leaving directory '/home/stiv/Nekobi/plugins/Nekobi'
stiv@stiv-V:~/Nekobi/plugins/Nekobi$ make modpush
tar -C bin -cz  | base64 | curl -F 'package=@-' http://192.168.51.1/sdk/install && echo
tar: Cowardly refusing to create an empty archive
Try 'tar --help' or 'tar --usage' for more information.
{"installed": [], "ok": false, "error": "No plugins found in bundle", "removed": []}
1 Like

The output is not empty, but its just a single .so file

stiv@stiv-V:~/Nekobi/bin/Nekobi.lv2$ ls
Nekobi_dsp.so

1 Like

yeah you are doing a “cd” step too much. you run “make” on the root of the project folder, not in the plugins/Nekobi subfolder.
do that and it should work

1 Like

Thanks again. Nearly there! Am getting different error now

/home/stiv/Nekobi/dpf/utils/generate-ttl.sh: line 37: qemu-aarch64-static: command not found

Full listing below

make moddwarf
make AR=/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-gcc-ar CC=/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-gcc CPP=/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-cpp CXX=/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-g++ LD=/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-ld PKG_CONFIG=/home/stiv/mod-workdir/moddwarf/host/usr/bin/pkg-config STRIP=/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-strip CFLAGS="-I/home/stiv/mod-workdir/moddwarf/staging/usr/include " CPPFLAGS= CXXFLAGS="-I/home/stiv/mod-workdir/moddwarf/staging/usr/include " LDFLAGS="-L/home/stiv/mod-workdir/moddwarf/staging/usr/lib " EXE_WRAPPER="qemu-aarch64-static -L /home/stiv/mod-workdir/moddwarf/target" HAVE_CAIRO=false HAVE_OPENGL=false MOD_BUILD=true NOOPT=true
make[1]: Entering directory '/home/stiv/Nekobi'
make all -C plugins/Nekobi
make[2]: Entering directory '/home/stiv/Nekobi/plugins/Nekobi'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/stiv/Nekobi/plugins/Nekobi'
make -C dpf/utils/lv2-ttl-generator
make[2]: Entering directory '/home/stiv/Nekobi/dpf/utils/lv2-ttl-generator'
/home/stiv/mod-workdir/moddwarf/host/usr/bin/aarch64-mod-linux-gnu-gcc lv2_ttl_generator.c -Wall -Wextra -pipe -MD -MP -fno-gnu-unique -fPIC -DPIC -DNDEBUG -O2 -ffast-math -fdata-sections -ffunction-sections -fvisibility=hidden -std=gnu99 -I/home/stiv/mod-workdir/moddwarf/staging/usr/include  -o ../lv2_ttl_generator -fdata-sections -ffunction-sections -Wl,-O1,--as-needed,--gc-sections -Wl,--strip-all -L/home/stiv/mod-workdir/moddwarf/staging/usr/lib  -Wl,--no-undefined -ldl
make[2]: Leaving directory '/home/stiv/Nekobi/dpf/utils/lv2-ttl-generator'
/home/stiv/Nekobi/dpf/utils/generate-ttl.sh: line 37: qemu-aarch64-static: command not found
make[1]: *** [Makefile:23: gen] Error 127
make[1]: Leaving directory '/home/stiv/Nekobi'
make: *** [dpf/Makefile.base.mk:734: moddwarf] Error 2
1 Like

yeah you need to install the tool/package that has qemu-aarch64-static.
on ubuntu and debian this is called “qemu-user-static”

this is needed in order to run the plugin binary directly, to generate the lv2 ttl data.

2 Likes

YAY!!!

Thanks so much for your help

7 Likes