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

[BUG] Unable to load plugin when using .component files #155

Open
malekinho8 opened this issue Apr 2, 2023 · 9 comments
Open

[BUG] Unable to load plugin when using .component files #155

malekinho8 opened this issue Apr 2, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@malekinho8
Copy link
Contributor

Issue Description

When running test_plugins.py, the function test_stereo_plugin_effect fails when the plugin_path is a .component file, but it works correctly for VST and VST3 files. The function fails at the line:

effect = engine.make_plugin_processor("effect", plugin_path)

from the function test_stereo_plugin_effect(), producing the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
RuntimeError: Unable to load plugin.

Steps to Reproduce

  1. Run test_plugins.py with pytest with a set of plugins including .component files.
  2. Observe the failure of the test_stereo_plugin_effect function for .component files.

Expected behavior

The test function should work for .component files, similar to how it works for VST and VST3 files.

Additional Context

Here is the test_stereo_plugin_effect function:

@pytest.mark.parametrize("plugin_path", ALL_PLUGIN_EFFECTS)
def test_stereo_plugin_effect(plugin_path):

    DURATION = 5.

    plugin_basename = splitext(basename(plugin_path))[0]

    engine = daw.RenderEngine(SAMPLE_RATE, BUFFER_SIZE)

    data = load_audio_file(ASSETS / "575854__yellowtree__d-b-funk-loop.wav", DURATION+.1)

    playback_processor = engine.make_playback_processor("playback", data)

    effect = engine.make_plugin_processor("effect", plugin_path)

    assert(effect.get_num_input_channels() == PLUGIN_INPUT_CHANNELS[plugin_basename])
    assert(effect.get_num_output_channels() == PLUGIN_OUTPUT_CHANNELS[plugin_basename])

    graph = [
        (playback_processor, []),
        (effect, ["playback"])
    ]

    engine.load_graph(graph)

    plugin_basename = splitext(basename(plugin_path))[0]

    render(engine, file_path=OUTPUT / f'test_plugin_effect_{plugin_basename}.wav', duration=DURATION)

    audio = engine.get_audio()
    assert(np.mean(np.abs(audio)) > .05)
    

Any thoughts or advice on how to resolve this issue would be much appreciated!

@DBraun
Copy link
Owner

DBraun commented Apr 2, 2023

Which plugin? Also, can you do otool -L path/to/plugin.component and see whether the architecture (x86_64 or arm64) is correct for your macOS?

@malekinho8
Copy link
Contributor Author

malekinho8 commented Apr 2, 2023

Hey David,

Thanks for the prompt response. I ran this command:

otool -L DimensionExpander.component/Contents/MacOS/DimensionExpander 

in my plugins folder, and I got this output:

DimensionExpander.component/Contents/MacOS/DimensionExpander (architecture x86_64):
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
	/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 164.0.0)
	/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
	/System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI (compatibility version 1.0.0, current version 69.0.0)
	/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1770.255.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2022.20.117)
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 54.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1463.2.1)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1122.11.0)
	/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO (compatibility version 1.0.0, current version 1.0.0)
DimensionExpander.component/Contents/MacOS/DimensionExpander (architecture arm64):
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
	/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 164.0.0)
	/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
	/System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI (compatibility version 1.0.0, current version 69.0.0)
	/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1770.255.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2022.20.117)
	/System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync (compatibility version 1.0.0, current version 4.7.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1463.2.1)
	/System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage (compatibility version 1.0.1, current version 5.0.0)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1122.11.0)
	/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO (compatibility version 1.0.0, current version 1.0.0)

It seems to be showing that the DimensionExpander.component plugin has been compiled for both x86_64 and arm64 architectures... I ran the same code for the .vst file and got this output:

DimensionExpander.vst/Contents/MacOS/DimensionExpander (architecture x86_64):
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
	/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 164.0.0)
	/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
	/System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI (compatibility version 1.0.0, current version 69.0.0)
	/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1770.255.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2022.20.117)
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 54.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1463.2.1)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1122.11.0)
	/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO (compatibility version 1.0.0, current version 1.0.0)
DimensionExpander.vst/Contents/MacOS/DimensionExpander (architecture arm64):
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
	/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 164.0.0)
	/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
	/System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI (compatibility version 1.0.0, current version 69.0.0)
	/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1770.255.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2022.20.117)
	/System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync (compatibility version 1.0.0, current version 4.7.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1463.2.1)
	/System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage (compatibility version 1.0.1, current version 5.0.0)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1122.11.0)
	/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO (compatibility version 1.0.0, current version 1.0.0)

(For reference, I am on an M1 Macbook Air)

@DBraun
Copy link
Owner

DBraun commented Apr 2, 2023

Looks correct. What’s the Python version, location, and whether it’s in a virtualenv? What’s your macOS version?

@malekinho8
Copy link
Contributor Author

The Python version is 3.10 installed in miniconda3/envs/gass/bin/python, I am using a virtual environment with the following packages:

Package            Version
------------------ ---------
appdirs            1.4.4
attrs              22.2.0
audioread          3.0.0
certifi            2022.12.7
cffi               1.15.1
charset-normalizer 3.0.1
contourpy          1.0.7
cycler             0.11.0
dawdreamer         0.6.15
decorator          5.1.1
exceptiongroup     1.1.0
fonttools          4.38.0
idna               3.4
iniconfig          2.0.0
joblib             1.2.0
kiwisolver         1.4.4
librosa            0.9.2
llvmlite           0.39.1
matplotlib         3.6.3
numba              0.56.4
numpy              1.23.5
packaging          23.0
pedalboard         0.6.9
Pillow             9.4.0
pip                22.3.1
pluggy             1.0.0
pooch              1.6.0
pycparser          2.21
pyparsing          3.0.9
pytest             7.2.1
python-dateutil    2.8.2
requests           2.28.2
resampy            0.4.2
scikit-learn       1.2.1
scipy              1.10.0
setuptools         65.6.3
six                1.16.0
sklearn            0.0.post1
soundfile          0.12.1
threadpoolctl      3.1.0
tomli              2.0.1
urllib3            1.26.14
wheel              0.37.1
xmltodict          0.13.0

and I am on MacOS Ventura 13.2.

@DBraun
Copy link
Owner

DBraun commented Apr 2, 2023

Virtual environments have been a little tricky in the past for DawDreamer but I haven’t tried in a while. And the Python version must be 64-bit, otherwise I don’t think you could even import dawdreamer. I’m not sure what the issue is then. Could you try without a virtualenv?

@malekinho8
Copy link
Contributor Author

Yeah, I just ran it in with my native Python setup located in usr/local/bin/python3 (Python version 3.10.6), and it is still giving the same behavior... VST's can be loaded fine but none of the .component files. I also confirmed that dawdreamer is still able to be imported in this base Python setup. Is there anything else I can try? Perhaps setting up an environment with Python 3.9?

@DBraun
Copy link
Owner

DBraun commented Apr 2, 2023

Sure. I would look for more component files to test too. And follow the otool -L test above to double check the architecture.

@DBraun DBraun self-assigned this Apr 2, 2023
@DBraun DBraun added the bug Something isn't working label Apr 2, 2023
@malekinho8
Copy link
Contributor Author

I just finished installing Python version 3.9 following the Developer Guide Instructions step by step, and I was able to successfully build DawDreamer using sh build_macos.sh, but I am still running into the same issue above (can load .vst but not .component plugins). I was hoping to make a contribution, but I am just at a complete loss at the moment as I cannot get all of the tests to work for some reason. Not sure if this helps, but here is some extra information I am seeing in the terminal when I am running the test_plugins.py with pytest for different plugin_path items:

Attempting to load VST: /Users/malek8/Documents/DawDreamer3.9/tests/plugins/DimensionExpander.vst
Creating VST instance: DimensionExpander
Initialising VST: DimensionExpander (1.0.0.5)
Attempting to load VST: /Users/malek8/Documents/DawDreamer3.9/tests/plugins/DimensionExpander.vst
Creating VST instance: DimensionExpander
Initialising VST: DimensionExpander (1.0.0.5)
error: attempt to map invalid URI `/Users/malek8/Documents/DawDreamer3.9/tests/plugins/RoughRider3.component'
error: attempt to map invalid URI `/Users/malek8/Documents/DawDreamer3.9/tests/plugins/TAL-NoiseMaker.component'

Thanks for your help thus far.

@DBraun
Copy link
Owner

DBraun commented Apr 2, 2023

I'm not sure yet how to fix it. I just tested the PyPI version on my M1 mac with macOS 13.2.1 and test_plugins.py passed. If .components are the only issue, let's not let it prevent any contribution you make. As long as the current automated tests work on the GitHub actions I'll be satisfied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants