trummerschlunk / master_me

automatic mastering plugin for live streaming, podcasts and internet radio.
GNU General Public License v3.0
520 stars 22 forks source link

AzuraCast Integration: Issues and Best Practices? #107

Closed BusterNeece closed 1 year ago

BusterNeece commented 1 year ago

Hello! I'm the creator and lead dev for AzuraCast, a free and open-source self-hosted web radio suite.

Several of our users have brought up master_me, and we're working right now to fast-track its incorporation into our software.

Since we use Liquidsoap under the hood, we have several possible avenues for incorporation into the backend. The simplest appears to be LADSPA, and we've run faust2ladspa as part of our build process, which you can see here: https://github.com/AzuraCast/AzuraCast/blob/5bd89a9a4a6a2828cae43a16ee3c068762fdc2aa/Dockerfile#L30-L50

Unfortunately, this seems to cause a critical fault within Liquidsoap when it detects and tries to load the file. It just loops this error over and over:

INFO: Loading Sdl_ttf, Target = linux
INFO: Loading Sdl_image, Target = linux
INFO: Loading Sdl_ttf, Target = linux
INFO: Loading Sdl_image, Target = linux

I'm not sure if this is the result of a missing dependency in our production step. Maybe y'all can point me toward a possible cause on this one.

We could alternatively look into using LV2 plugins, which Liquidsoap would also support with some extra work on our part, but I'm not currently sure how to build master_me as a LV2 plugin with no UI. I'm also not sure how we'd point Liquidsoap at the easy presets (which we'd likely be using for a majority of our users). I would appreciate any guidance on that process.

magnetophon commented 1 year ago

Unfortunately, this seems to cause a critical fault within Liquidsoap when it detects and tries to load the file. It just loops this error over and over:

What do you mean by "tries to load the file"? IOW: which part of your code triggers this error?

Speaking of dependencies: to compile the LADSPA, you only need faust, no need for faustpp or python, those are for compiling the full plugin with gui. Not sure about build-essential and ladspa-sdk, but I would expect the faust pkg to pull those in.

To compile an LV2 without a GUI, you can run faust2lv2 master_me.dsp. There are tons of other formats you can compile to, if any of those work better for your purposes: https://github.com/grame-cncm/faust#faust2-scripts-and-programs

I can't help with your other questions, but maybe @sletz can.

BusterNeece commented 1 year ago

What do you mean by "tries to load the file"? IOW: which part of your code triggers this error?

I mean the presence of the plugin in /usr/lib/ladspa triggers this error in Liquidsoap. It's likely that they iterate through all of the plugins listed in that directory in order to create relevant functions for them inside LS, even if those plugins aren't used in a particular script; I've reached out to them to see if they know what's causing that particular error.

To compile an LV2 without a GUI, you can run faust2lv2 master_me.dsp. There are tons of other formats you can compile to, if any of those work better for your purposes: https://github.com/grame-cncm/faust#faust2-scripts-and-programs

Gotcha, thank you. That does cover the main plugin, though I see a bunch of additional plugins scattered throughout the repo, like master_me_easy_presets, which I think might save me some trouble in implementing said easy presets into my application.

Forgive me, but I don't know the terminology for LV2 very well. I'm not sure if these other things are separate plugins, or if they're all rolled into the same plugin and I'd be able to call the easy presets either way.

magnetophon commented 1 year ago

There is a similar error in this issue: https://github.com/savonet/liquidsoap/issues/2775 Maybe you can run liquidsoap with the --verbose flag to get more info? In any case it seems to be a liquidsoap issue. Did you try to run the plugin somewhere else, for example in a DAW?

The easy presets are not a separate plugin, there is only one plugin in this repo. I think you are referring to https://github.com/trummerschlunk/master_me/commit/d8aab2395f209cee396e74ba0efb6e3b40455800 That seems to be a way to set parameter values, but it only applies to the GUI version (is that correct, @falkTX?)

BusterNeece commented 1 year ago

I'm referring to the presets here: https://github.com/trummerschlunk/master_me/tree/master/plugin/master_me-easy-presets.lv2

I can just set these values manually, but it would be nice to somehow reference these presets when calling the LV2 plugin.

falkTX commented 1 year ago

That preset lv2 bundle is already in the correct format, you just need a host that supports loading LV2 presets. Most of them do.

falkTX commented 1 year ago

Regarding this ticket, I can easily add a LADSPA build that follows the same structure as the others (via DPF). I didnt do this before because I thought no one would need it

falkTX commented 1 year ago

LADSPA build is enabled in https://github.com/trummerschlunk/master_me/commit/f6f098ef281028ae7ba6962c056fc2c626fbe63f Will be part of next release tomorrow

BusterNeece commented 1 year ago

@falkTX Excellent, thank you! I'm working with Liquidsoap to get our build of it to support LV2 out of the box, at which point we can just use that directly, but it would be very handy for now to have LADSPA available.

BusterNeece commented 1 year ago

Update: we've shipped it!

It turns out that indeed, the version built per your CI process worked with much fewer issues than our own attempts at running faust2ladspa. We're continuing to work with Liquidsoap so that we'll have native LV2 support, at which point we'll bump over to using the LV2 version instead, but our users are well-served already and can choose from the master_me presets directly from our web UI. :)

sletz commented 1 year ago

Great ! announced on Faust Discord: https://discord.gg/SvZwCNmnNj