|
10-24-2017, 06:28 AM
|
#1
|
Human being with feelings
Join Date: Aug 2017
Posts: 50
|
Runtime Library & Multithread
Hi,
I might will need to change the runtime library of base, lice and IPlug from "Multi-Threaded" to "Multi-Threaded DLL" for my VST3 plugin. Is it a bad idea ? It would allow me to secure a FIFO
|
|
|
10-24-2017, 07:26 AM
|
#2
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Somewhat bad idea, if you changed it to a "dll", the plugin will require that the end users have the exact needed runtime dlls installed on their machines. (And that tends to be somewhat of a pain to deal with.)
What do you mean by "secure a FIFO"?
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
|
|
|
10-24-2017, 07:47 AM
|
#3
|
Human being with feelings
Join Date: Aug 2017
Posts: 50
|
Quote:
Originally Posted by Xenakios
What do you mean by "secure a FIFO"?
|
As my algorithm needs 5*512 samples to start working, I made a First-In First-Out Queue which store those buffers at start. Problem was that somehow Daws are taking more buffers than I got for the output and everything crash. So I'm looking into multi-threading possibilities
|
|
|
10-24-2017, 07:54 AM
|
#4
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Quote:
Originally Posted by JonOsterman
As my algorithm needs 5*512 samples to start working, I made a First-In First-Out Queue which store those buffers at start. Problem was that somehow Daws are taking more buffers than I got for the output and everything crash. So I'm looking into multi-threading possibilities
|
At first thought, sounds like a horrible idea. You should probably simply output silent samples until you have enough data available for the host. If you can predict how long the initial silence lasts in samples, you could make your plugin report a latency amount for the host, so it can compensate for the delay.
Adding more threads just adds problems you have to deal with. Of course the runtime library itself doesn't make your code multithreaded, you will have to implement all that yourself. The non multithreaded runtime library options exists for some obscure legacy reasons, when you would know your code is going to be strictly single threaded, which doesn't even really work in a modern DAW/plugins context. So you must choose the multithreaded static or dll option anyway.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Last edited by Xenakios; 10-24-2017 at 08:06 AM.
|
|
|
10-24-2017, 08:03 AM
|
#5
|
Human being with feelings
Join Date: Aug 2017
Posts: 50
|
Quote:
Originally Posted by Xenakios
You should probably simply output silent samples until you have enough data available for the host
|
Yeah sorry that's what I do, I didn't mentioned it.
Quote:
Originally Posted by Xenakios
And in any case, didn't you notice how both the static runtime library and the dll runtime library say "multithreaded" on them? You should never be using the non-multithreaded runtime libraries in VST plugins anyway.
|
Ok, thing is that I don't know the difference beetween Multithreaded and Multithreaded DLL
|
|
|
10-24-2017, 08:09 AM
|
#6
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Quote:
Originally Posted by JonOsterman
Ok, thing is that I don't know the difference beetween Multithreaded and Multithreaded DLL
|
"Multithreaded" statically links the runtime library into your plugin, which is what you will most likely want, so that the user doesn't have to install extra stuff before they can use your plugin.
"Multithreaded DLL" links the runtime library dynamically and the user will likely have to install the runtime libraries on their machine before they can use your plugin.
Neither option makes your plugin multithreaded. That's all up for you to implement. But I would recommend you find some other way than adding threads...Why doesn't outputting silence until you have valid data work? Wouldn't you just get glitches in the audio and not crashes, if your code is working correctly? Maybe you will just have to buffer more samples initially?
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Last edited by Xenakios; 10-24-2017 at 08:16 AM.
|
|
|
10-25-2017, 01:46 AM
|
#7
|
Human being with feelings
Join Date: Aug 2017
Posts: 50
|
Quote:
Originally Posted by Xenakios
"Multithreaded" statically links the runtime library into your plugin, which is what you will most likely want, so that the user doesn't have to install extra stuff before they can use your plugin.
"Multithreaded DLL" links the runtime library dynamically and the user will likely have to install the runtime libraries on their machine before they can use your plugin.
Neither option makes your plugin multithreaded. That's all up for you to implement. But I would recommend you find some other way than adding threads...
|
I have 3 DLLs which I should integrate into the vst, I'll take a look on how to integrate them
Quote:
Originally Posted by Xenakios
Why doesn't outputting silence until you have valid data work? Wouldn't you just get glitches in the audio and not crashes, if your code is working correctly? Maybe you will just have to buffer more samples initially?
|
I reworked it and now I just use a queue waiting to have enough buffers before working, seems to be ok for the moment. Thanks
Last edited by JonOsterman; 10-25-2017 at 02:09 AM.
|
|
|
10-25-2017, 06:12 AM
|
#8
|
Human being with feelings
Join Date: Aug 2017
Posts: 50
|
Well I did not found where I can load the DLLs directly into my VST, instead of giving it to the DAWs in its directory. If anyone knows if it's possible ..
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 04:37 AM.
|