Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux support #222

Closed
wants to merge 32 commits into from
Closed

Linux support #222

wants to merge 32 commits into from

Conversation

tomjnixon
Copy link
Member

@tomjnixon tomjnixon commented Nov 10, 2022

This should be ready to merge; there are a couple of things still to look at, but these can be turned into issues as it still works:

  • crash in nng expire thread while scanning (probably just takes too long in debug)

  • warnings from cmake install phase, and .vst3 files should be directories containing shared objects, rather than shared objects

  • commits prefixed with linux: are only required for linux support

  • commits prefixed with ci: are improvements to the github actions script (kept here to avoid merge pains)

  • other commits are general fixes or upgrades that i made along the way

Notes:

  • I started trying to build this with JUCE v7, but it looks like this is a bit stricter with VST audio bus formats (specifically that plugins can't have discrete channels by default), and seems to have a tricky bug where you end up with missing channels if you disable assertions.
  • I've built this with JUCE assertions enabled in debug, and gone through and commented assertions that this triggers. This way you still get most of the checks and can see where JUCE thinks we're doing things wrong. Perhaps this would be a better strategy in general?

@tomjnixon
Copy link
Member Author

For reference, I've been building with:

cmake -B build/ -G Ninja -DEAR_PLUGINS_UNIT_TESTS=OFF -DBUILD_TESTING=OFF -DSMTG_CREATE_PLUGIN_LINK=0 -DCMAKE_BUILD_TYPE=Debug
ninja -C build install

@marclava
Copy link

I just tried compilation on my Ubuntu 20.04.

[536/1021] Building CXX object ear-production-suite-plugins/lib/CMakeFiles/ear-plugin-base.dir/src/store_metadata.cpp.o FAILED: ear-production-suite-plugins/lib/CMakeFiles/ear-plugin-base.dir/src/store_metadata.cpp.o /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_UUID_FORCE_AUTO_LINK -DEPS_ENABLE_LOGGING -DJUCE_DISABLE_ASSERTIONS -DNNG_HAVE_BUS0 -DNNG_HAVE_PAIR0 -DNNG_HAVE_PAIR1 -DNNG_HAVE_PUB0 -DNNG_HAVE_PULL0 -DNNG_HAVE_PUSH0 -DNNG_HAVE_REP0 -DNNG_HAVE_REQ0 -DNNG_HAVE_RESPONDENT0 -DNNG_HAVE_SUB0 -DNNG_HAVE_SURVEYOR0 -DNNG_STATIC_LIB -DNNG_TRANSPORT_INPROC -DNNG_TRANSPORT_IPC -DNNG_TRANSPORT_TCP -DSPDLOG_COMPILED_LIB -DVISR_CORE_STATIC_LIBRARY=1 -DVISR_EFL_STATIC_LIBRARY=1 -DVISR_OBJECTMODEL_STATIC_LIBRARY=1 -DVISR_PANNING_STATIC_LIBRARY=1 -DVISR_PML_STATIC_LIBRARY=1 -DVISR_RBBL_STATIC_LIBRARY=1 -DVISR_RCL_STATIC_LIBRARY=1 -DVISR_RRL_STATIC_LIBRARY=1 -I/home/marc/git/ear-production-suite/ear-production-suite-plugins/lib/include -I/home/marc/git/ear-production-suite/build/ear-production-suite-plugins -I/home/marc/git/ear-production-suite/build/ear-production-suite-plugins/lib -I/home/marc/git/ear-production-suite/shared -I/home/marc/git/ear-production-suite/submodules/bear/visr_bear/submodules/libear/include -I/home/marc/git/ear-production-suite/build/submodules/bear/visr_bear/submodules/libear -I/home/marc/git/ear-production-suite/submodules/bear/visr_bear/include -I/home/marc/git/ear-production-suite/build/submodules/bear/visr_bear/include -I/home/marc/git/ear-production-suite/submodules/visr/src -I/home/marc/git/ear-production-suite/submodules/libbw64/include -I/home/marc/git/ear-production-suite/build/submodules/libbw64 -I/home/marc/git/ear-production-suite/submodules/libadm/include -I/home/marc/git/ear-production-suite/build/submodules/libadm -isystem /home/marc/git/ear-production-suite/submodules/bear/visr_bear/submodules/libear/submodules/eigen -g -fPIC -std=c++17 -MD -MT ear-production-suite-plugins/lib/CMakeFiles/ear-plugin-base.dir/src/store_metadata.cpp.o -MF ear-production-suite-plugins/lib/CMakeFiles/ear-plugin-base.dir/src/store_metadata.cpp.o.d -o ear-production-suite-plugins/lib/CMakeFiles/ear-plugin-base.dir/src/store_metadata.cpp.o -c /home/marc/git/ear-production-suite/ear-production-suite-plugins/lib/src/store_metadata.cpp /home/marc/git/ear-production-suite/ear-production-suite-plugins/lib/src/store_metadata.cpp: In member function ‘void ear::plugin::Metadata::removeProgramme(const ProgrammeInternalId&)’: /home/marc/git/ear-production-suite/ear-production-suite-plugins/lib/src/store_metadata.cpp:113:37: error: ‘class google::protobuf::RepeatedPtrField<ear::plugin::proto::Programme>’ has no member named ‘at’ 113 | newSelectedId = programmes->at(newSelectedIndex).programme_internal_id(); | ^

@tomjnixon
Copy link
Member Author

I just tried compilation on my Ubuntu 20.04.

Thanks, but yeah, as mentioned on the other thread it will probably require using vcpkg -- ubuntu 20.04 ships protobuf 3.6.1.3, while vcpkg provides 3.18.0. I'll try to put together some instructions for this next week.

@firthm01
Copy link
Collaborator

binaural rendering is glitchy (possibly just too slow in debug?)

I think that's probably the case - certainly true when I do the same in Windows

@tomjnixon tomjnixon force-pushed the linux_support branch 4 times, most recently from fa94b52 to e3d9df7 Compare November 14, 2022 23:50
on linux, this depends on other static initialisers having been ran
(specifically the "text" constant in the XML parser), and they may end
up running in the wrong order

(the main change is in fonts.hpp; the rest is search/replace)
this was checked in the monitoring plugin, but not the scene plugin
this issues warnings about missing plist files, but works

according to the VST3 specs the .vst3 should actually be a directory
structure containing the library, but this works for now
this matches what the official JUCE cmake scripts do

without this, all plugins end up sharing one message thread, which might
be fine one some platforms, but on linux the VST wrapper assumes that
there is a message thread for each plugin, and this ultimately causes
callOnMessageThread callbacks to not get called unless the plugin window
is open

(specifically, it does something like using the run state of the
messaging thread to decide whether to register with the VST event loop
-- it's quite complicated and unclear)

note that plugins are dlopened with RTLD_LOCAL, which you might think
would stop this kind of sharing, but no -- the message thread is created
with SharedResourcePointer, which is a template class and so the static
variable lives in an inline function, which gets marked as "unique
global", which still get merged

it might be sensible to add this to the reaper_adm plugin and other
libraries we use -- they mostly use static initialisation for caching so
aren't affected by this, but it could cause issues when mixing plugins
of different versions for debugging, for example
the user VST path does not end with "/VST3", so merge that into the
prefix

perhaps it would be better to make the full install dir somewhere
centrally so that the VST3 part could be left out of the prefix on other
platforms?
for some reason the POSITION_INDEPENDENT_CODE target property doesn't
get propagated to the tests, which then fail to link

really everything in this project should be built with PIC, and this is
an easier way to get that
addPoint can cause the underlying vector to be reallocated, which
invalidates references to it
abs can refer to the C integer version, causing inaccuracy

testing on Linux picked this up, so the float version was probably
getting used production builds
- use VCPKG_DEFAULT_BINARY_CACHE instead of VCPKG_BINARY_SOURCES -- this
  should have the same effect, but is simpler

- use the same timestamp mechanism as ccache for saving the cache

  this means that the cache will always be saved, and so will keep up to
  date even if a change on the runner invalidates it

- don't invalidate the cache when something changes in vcpkg, as it can
  work that out itself

- add a script to prune the vcpkg cache to a set size (500MB) -- this is
  required when using timestamps as otherwise the cache will keep
  growing
@tomjnixon tomjnixon marked this pull request as ready for review November 17, 2022 10:59
@firthm01 firthm01 mentioned this pull request Dec 29, 2022
17 tasks
@firthm01
Copy link
Collaborator

Merged in to v1.0 PR

@firthm01 firthm01 closed this Feb 21, 2023
firthm01 added a commit that referenced this pull request Mar 23, 2023
Build and test cross-platform Installer
Support for ADM "Importance" parameter
Fix bug in render dialog when using language packs (Closes #215)
Include Experimental Linux build (Closes  #222)
Silence unused monitoring output channels (prevents pass-through of object audio) (Closes #224)
Fix alignment of monitoring meters (Closes #206)
Fix blank audioProgrammeLanguage on export (Closes #213)
Export uses 2076-2 structures (omitting AudioTrackFormat and AudioStreamFormat)
Build fixes; Build failing on Xcode 14 (Closes #220), Build fails on MacOS 12 due to vcpkg unable to find python (Closes #221)
Include additional project templates
Fix unintended downmix issue (Closes #228)
Fix plugin crash on other DAWs (Closes #232)
Support plugin renaming (Closes #240)
Fix parameters not updating in response to other parameter changes after JUCE upgrade
Fix blank Scene when importing ADM with no high-level metadata (Closes #242)
Various optimisations (reducing lock lengths, only running metering calcs when needed)
Bus-width compatibility fixes.
Fix for some render dialog controls re-enabling.
Fix for updated text in render dialog in recent versions of REAPER.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants