-
Notifications
You must be signed in to change notification settings - Fork 17
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
Confirm demoplugin works in Windows/Linux #45
Comments
Can confirm that this compiles on Windows, but the plugin is not detectable by VST hosts. As a sidenote, I'm also not seeing any
AFAIK a VST2.x plugin requires a VSTPluginMain or equivalent exported symbol. Am I missing something here? |
You are absolutely right @lsegal! As you already discovered in your PR, this entry point exists in include/plugin.c and for Darwin architecture it's exported automatically. I guess that for DLL it behaves differently. |
Tried this, too. But plugin crashes in different hosts. Tried Unify x64 and Renoise x64, it just freeze. VSTPluginMain export is there, so it must be something else.
I used:
|
Thanks for looking into this @ryrun ! Can you clarify one thing - do those hosts crash when they scan plugins or when you try to instantiate plug-in instance? |
@dudk When i try to instantiate plug-in instance. Renoise and Unify simply freeze, need to force close it. Crash was the wrong term, sorry :) Can also test it in FL and Bitwig, if needed. |
Thanks for clarification @ryrun. It would be great if you can check there as well. I can see this behaviour with Renoise on Mac, but only when the second plugin instance is created. That is - the first instance opens fine and works as expected, but when I create the second instance of the very same plugin - Renoise hangs up. Seems like it's the same problem. |
Thanks for checking it! That's an interesting find. Unique ID and versions are defined in In the current implementation those members are not set to any value. I'm not sure if that can cause such issue because many vst2 plugin manuals don't provide those values either. EDIT: read your edit, that's an even better catch. Is that happening with time or immediately? |
Immediately. VSTHost seems to be good for quick testing. Loaded the plugin 3 times, always different informations about: @dudk I played around abit with your code. It seems malloc is one issue. It allocates memory, but doesn't zero it and its needed to be zero as far as i can see. I've changed all mem allocations to calloc and i can finally load the plugin in Renoise. But it will also freeze, when i create a second instance. So this seems to be another problem. |
I tend to think that it's due to vendor string. I'll do a PoC to confirm that. |
@dudk It seems malloc is an issue, too. I've edited my post, again sorry :D. Maybe not a good idea, so you will miss this. |
No worries @ryrun 😉 yes, I tend to think that I allocate CPlugin struct wrongfully - it should be 'malloc(sizeof *p)'. I tested this, but it still crashes on the second instance. To conclude next steps for debugging it:
Seems pretty interesting now👀 |
It still crashes Renoise and FL, when i remove the plugin. But loading seems to be fine now. Was able to playing around with the demo plugin, trying sidechain input. |
@dudk Does Renoise also crash on you when you remove the last instance of the plugin? It also happens in FLStudio. Unfortunately there is no information about the crash in the logs. |
@ryrun no, it works fine on Mac. Probably some mach-o bundle magic that handles resource management differently. I assume that it crashes because plugin currently doesn't handle |
@dudk I tried to debug this crash with gdb and i got this. Not sure how we can fix this:
Edit: Did some research. Maybe i'm wrong, but it seems that unloading a go c-shared dll causing this crash. Its a known problem: golang/go#11100 Edit2: Maybe this could be a workaround: https://blogs.msmvps.com/vandooren/2006/10/09/preventing-a-dll-from-being-unloaded-by-the-app-that-uses-it/ was mentioned here: golang/go#32497 (comment) |
Now it comes to my mind - I saw the issue you've mentioned before. It's a pretty interesting workaround. It definitely comes with some price - go runtime would be always running if you. But on another hand, host won't crush 🤷♂️ seems like a fair trade off, but needs to be explicitly documented once there. If you want to play around with it - look into vst_windows.go |
@dudk Found a cleaner solution.
See https://stackoverflow.com/a/14436845 I think this would be a better solution for this issue. |
@dudk I created a pull request. Not sure if this code is "clean enough". :) With this last fix, all crashes are fixed for me. I can load multiple instance of the demo plugin, remove them one by one. And when the last one was removed, no crash. Gain parameter is working fine. Tested this plugin in Renoise 3.3 and FLStudio 20.8 on a Windows 10 64bit machine. |
plugGetParamDisplay is currently not working, returns an empty string. In VSTHost it shows no values. |
@ryrun I think that's because I didn't set any value to I've created #54 to track it. |
Confirmed demoplugin works on Linux (recognised and functional in Carla host) |
It seems that the following command is enough to produce working plugin for Windows/Linux:
Confirmation is required.
The text was updated successfully, but these errors were encountered: