Calling multiple functions with delay on a Knob's Callback
-
@resonant said in Calling multiple functions with delay on a Knob's Callback:
- Firstly run functOne()
- Then wait for 30 ms and run functTwo()
- Then wait for 50 ms and run functThree()
Just out of curiosity, why would you need this function workflow?
-
As you see in the snippet, on each knob I am using multiple functions and each function contains lots of
setAttribute
APIs. Also there are lots of knobs, so this means tons of setAttribute APIs.I've just discovered that the more setAttributes are assigned to the knobs/buttons, the more crashes happen while loading DAW Projects with multiple plugin instances.
These crashes happen on Windows and it's a memory corruption error. Because while the DAW project is loading, all of the parameters are trying to load the setAttribute functions and this causes a bottleneck that causes the crash.
I think delaying these functions will prevent crashes because the functions aren't being loaded simultaneously.
Or this might be a bug, I am not sure. But these crashes are happening with multiple plugin instances, on Windows and while loading the DAW project.
-
@resonant So if this work around succeeds it's a good alternative, but it might also mean we're lacking of a possible Hise optimisation so this bottleneck doesn't happen... @Christoph-Hart?
-
Yes I agree. If you manage to make a minimal example that recreates this I can take a look. This shouldn‘t be a reason to hack around with timers.
-
I've pushed an experimental build flag that might help with the issue. Please pull HISE and export your plugin with the
HI_DONT_SEND_ATTRIBUTE_UPDATES
flag set in your Extradefinitions. This should deactivate the internal messaging and hopefully fix the crash. Let me know if that helped. -
@Christoph-Hart Thank you for the update.
Unfortunately, this update is not a solution for the crash. The plugin seems a little bit relaxed but the crash still happens.
I sent you a minimal project of this FX plugin privately.
We tried this crash problem on different users and different computers. My advice to replicate the problem there is if possible, on Windows in
Cubase 9/10/11
orStudio One 5/6
create 3 individual DAW projects (Using this FX plugin on the channels of a real song project will give a much more realistic result):- 3 plugins
- 8 plugins
- 20 plugins
Some computers crash at 3 plugins, some at 20.
I also discovered that, if I insert only a ShapeFX module at the begining of the project (no setAttribute or parameter usage for this module), it reduces the crash because the loading time increases and this prevent crash. But the plugin seems still unstable.
I think the real cause of the crash is all of the parameter settings, UI elements...etc. are being called simultaneously at the same time on DAW project loadings. A little bit delayed calls can solve this issue.
-
@resonant So the issue doesn't happen in a single plugin instance but when multiple are used?
-
@d-healey said in Calling multiple functions with delay on a Knob's Callback:
@resonant So the issue doesn't happen in a single plugin instance but when multiple are used?
Yes exactly.
-
@resonant Are you doing realtime stuff in the UI thread?
-
@Christoph-Hart Any progress for this issue?
-
No, I need to test this. Can you give me a list of all host / OS combinations. I know Cubase is very critical when it comes to UI CPU pressure but I can‘t est on Cubase at the moment.
-
@Christoph-Hart I understand. We've tested on 11 different Windows 10 machines.
- 8 crashes are coming from Cubase version 9 or 10 or 11 unfortunately.
- 2 crashes from Studio One 5 and 6.
- 1 crash from Reaper 6.
For other DAWs and macOS, no known crashes for now. But I can definitely say that, if the plugin works in Cubase, it will work on everywhere.
For the NFR License, as a Developer you can write to Steinberg and ask from them, they are giving NFR Licenses to the Developers for free. If you get version 11, you can rest assured because you will reproduce the issue in there.
-
@resonant yeah I wrote them for an NFR but never heard back, then I stopped caring.
-
@Christoph-Hart Have you used up your free trial?
-
@Christoph-Hart said in Calling multiple functions with delay on a Knob's Callback:
@resonant yeah I wrote them for an NFR but never heard back, then I stopped caring.
They have changed their NFR License section lately. The new system is very cool and easy to use/update, their response is now quick. Maybe giving a one more shot would be useful.
-
@orange is there a form we can fill out or specific email to contact? Or just their info@ one?
-
@DanH Just using the website support ticket system worked here.
-
Still no luck :/
If there is no fix for this for now, what can we do as an alternative shortcut hack?
-
@resonant based on the snippet from @Christoph-Hart , this will make sure all functions will be executed, and in the right order, even if you touch the knob.
You say you have a lot of knobs and functions to be executed, so maybe this is not an alternative for your project but anyway, here's my go for it...
HiseSnippet 1989.3oc2YEzaabbEdWIsIZYpSsCRZSuMPnnfxQldWRI6DXTPZKIlJDKKJQV6Vf.XOZ4PwAd4LLyNqbTb8sBzCEEEE8Tt0+AsGaQOT+CHG5k1yAEEEH8TO1So8MytK2YEonnURbjCuHMu48dy27du48dyrsD7.RTDWXY614ngDK6ukS6iXx9q2GSYVasgk8kbDwLTMTuXVfjxYQV25ng3nHRWKa64eWEa1tKXo+8epeKbHlEPxIYYcWNMfba5.p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ly3C6yYzBN58HPVfCNfTH9YhaH3x83fGlS40arGIjfiLNh88abanWHrvH20ypsv+Y9KiLQ+0a5j.WjJG.5E2KxM+2nuH2re5CRAd91K9ccfTwUQZWI5qGe4yi55OOViA3.A+9AIuvk5P+hZJv9lo+RvtNaqFiF8zVNNdU7rF.kKtePfJd8JP0mIKS0yfL0NCxr5YPl0NCxbsyfLW+LHyaOUYTUpuYrjOHIlGHzZS8SLZaa7B.V+ev4RidQ
-
@ulrik Thank you for the suggestion.
Maybe there are other methods instead of delaying functions to prevent multi instance crash.