spotify / pedalboard

🎛 🔊 A Python library for audio.
https://spotify.github.io/pedalboard
GNU General Public License v3.0
5.15k stars 260 forks source link

Unable to load VST3 when running through CircleCI #281

Closed czerpa-antdev closed 8 months ago

czerpa-antdev commented 9 months ago

Overview

Pre-requisite

Code:

Type "help", "copyright", "credits" or "license" for more information.
>>> from pedalboard import load_plugin
>>> vst = load_plugin("/Library/Audio/Plug-Ins/VST3/cool_plugin.vst3")

Using "~/Library/Audio/Plug-Ins/VST3/cool_plugin.vst3" also failed to load. Yes, I copied the plug-in before attempting.

Error:

  File "<stdin>", line 1, in <module>
  File "/Users/distiller/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pedalboard/_pedalboard.py", line 781, in load_plugin
    raise ImportError(
ImportError: Failed to load plugin as VST3Plugin or AudioUnitPlugin. Errors were:
    VST3Plugin: Unable to load plugin /Library/Audio/Plug-Ins/VST3/Auto-Tune Pro.vst3: unsupported plugin format or load failure.
    AudioUnitPlugin: Unable to load plugin /Library/Audio/Plug-Ins/VST3/Auto-Tune Pro.vst3: unsupported plugin format or load failure. macOS requires plugin files to be moved to /Library/Audio/Plug-Ins/Components/ or ~/Library/Audio/Plug-Ins/Components/ before loading.

What I have tried so far:

  1. Running in my local Mac Machine (M3 chip), I am able to successfully run the code without problems.
  2. Tried in different version of python3:
    • 3.8
    • 3.9
    • 3.10
    • 3.11
    • Issue reproducible in all.
  3. Setup CircleCI to run with another Mac Machine we physically own as a server.
    • We are able to load the plugin, no problems.

Interesting Debugging Observations

  1. When running from the terminal in a machine where issue is NOT reproducible, I noticed that from pedalboard import load_plugin call took longer to load (about 5 to 10 seconds)
    • I believe Pedalboard in the background is generating some cached python files for loading VST3.
    • Namely: VST3Plugin.py
    • This is generated off pedalboard_native.cpython-311-darwin.so
    • When running in my local Mac Machine in Pycharm I can easily find this file
    • ~/Library/Caches/JetBrains/PyCharmCE2023.2/python_stubs/486492554/pedalboard_native/VST3Plugin.py
    • Any ideas how to find it when using Terminal??
      1. Using pdb module for debugging in the terminal. I am noticing the failure occurs as soon as the VST3Plugin class gets initiated
    • # This should be line 765 thru 770 in <path_to_project>/venv/lib/python3.11/site-packages/pedalboard/_pedalboard.py
      return plugin_class(  # type: ignore
               path_to_plugin_file=path_to_plugin_file,  # type: ignore
               parameter_values=parameter_values,  # type: ignore
               plugin_name=plugin_name,  # type: ignore
               initialization_timeout=initialization_timeout,  # type: ignore
           )  # type: ignore 
    • Any ideas what that could mean? My hypothesis is a based on above cached files but I am not sure how to validate that.

Thanks in advance for the support

czerpa-antdev commented 8 months ago

closing issue, turns out desired VST3 plugin is unable to run in a virtual machine by design as it enforces the license on the machine but it's missing. Not pedalboard related.