FFT Analyser Path - Need help drawing the magnitude to height
-
@ustk Precisely what I am using, it's been super helpful and I really appreciate Christoph's work on this! Unfortunatley it's a really strange issue. Generally (90% of cases) the plugin runs completley fine, and there really is nothing super complex about it. However for about 10% of users there is some serious lag and even crashes their DAW and I can't put my finger on whats causing this (I haven't been able to recreate the issue). So I am trying to minimize the imapct of any UI/Script callbacks and paint routines
-
@HISEnberg Maybe you could just try with the stock createPath to see if it's stable and if the issue is about UI drawing / message thread
Is your interface script deferred?
Long ago I had a lot of crashes doing that kind of things. It's now stable and I reckon I added extra security here and there.
Also when working with a buffer, I tend to create a copy to work with instead of the original. Afraid that another thread want access at the same time (I don't always know if the writeLock is set, so...)
-
@ustk Ah great tips thank you!
My OG script is using the createPath method. It performs well (generally better than the HISE stock display with the floatingTile).
The interface script deferred, does that just mean the Synth.deferCallbacks(true), or are you referring to the specific script?
Interesting suggestion about copying the buffers. I would have thought there was more overhead this way but I could see how this is more safe for threading.
-
@HISEnberg said in FFT Analyser Path - Need help drawing the magnitude to height:
does that just mean the Synth.deferCallbacks(true), or are you referring to the specific script?
Interface script should always be deferred. Included scripts are just part of interface so they inherit from it.
Scripts that are dealing with midi/audio shouldn't be deferred -
@HISEnberg said in FFT Analyser Path - Need help drawing the magnitude to height:
@ustk Precisely what I am using, it's been super helpful and I really appreciate Christoph's work on this! Unfortunatley it's a really strange issue. Generally (90% of cases) the plugin runs completley fine, and there really is nothing super complex about it. However for about 10% of users there is some serious lag and even crashes their DAW and I can't put my finger on whats causing this (I haven't been able to recreate the issue). So I am trying to minimize the imapct of any UI/Script callbacks and paint routines
I am running into this same issue with my new Plugin update. It generally works well but for some Windows users it would lag to the point it would not be possible to use.
I've tested with the few users with the issue to get the FFT performance up to speed with no luck so far!
@HISEnberg make sure to use IPP or FFTW3 on windows, this should boost the performance significantly. However it did not seemed to help here.
I tested to have
no IPP -> Performs BAD
IPP -> Performans BAD
FFTW3 -> Performans BAD
Synth deferred callbacks -> no changeThis only happens to around 10% of Windows Users tho. MacOS and Linux is completly fine.
-
I am using a quite complex graphics but MacOS and even my cheap Windows system are working quite nicely.
Not sure how to get the FFT performance up for these couple of Windows users and actually what is happening on their system. They use Win 11 Ableton 12. I also of that bug and the crashing of the DAW.
@Christoph-Hart maybe you can help here or share some insights.
-
H HISEnberg has marked this topic as unsolved
-
@oskarsh Ah very interesting you are coming across this issue as well!
Ya I am finding that the IPP is boosting performance but isn't solving the issue for these handful of users. It's frustrating since 10% is too many user reports to ignore (maybe 5% would have been acceptable).
I had the same exact experience as you. I booted up a 12 year old laptop that runs on Windows 8 (I thought it was dead) and ran my plugin without any problems. I also had another user who has nearly the exact same Windows setup as me (Lenovo Ideapad Slim7, Ryzen 7, AMD Radeon Graphics Card) reporting this issue.
Maybe you will have better luck with this. I created a profiling script which records 1-5 seconds of the user interacting with the plugin. Afterwards it will just dump the snippet onto the users desktop. You can import the profiling session and get a snapshot of how the plugin is performing on the users system (time it takes for paint routines, processing on the different threads, control callbacks, etc.) No one sent me the file back but you could possibly ask one of your users to try this and get some insight into what aspect of the FFT is causing the plugin to choke.
Christoph has actually already given me some advice here about what to do. The one thing I haven't tried which might solve this is setting your FFT script to a background task. I am still wrapping my head around how threading works in HISE (and audio plugins more generally), but I could see how an FFT which is communicating between the audio thread and the UI/Scripting threads could be unsafe if the pointers on the JUCE end aren't setup correctly. I think this is something that the Synth.deferCallbacks should be addressing but possibly not in this particular case.
So if anyone has a snippet on how to use the background task API and can share I would really appreciate it!
-
@HISEnberg Perhaps something like this:
HiseSnippet 1642.3ocuX0saaaCElxNJowKcnEXWLrqD5UtCot1yoosXXHt1ItKXMIFwYAcXnHiVh1hvRjZRT0wan.CX2zWgd01qQuYuA6p8BrGg9FrcHorsjkSyhQWLRaLO+wuygmyGYamPtMIJhGhLJcx3.BxXCytiYB2VtXJCs+tHiO0rc6SNaDU31DaObPHOl4bBNZHp43.bTDwAYXT7oRqMVeEj5y61oI1CyrIyDgPmxo1jmQ8ohYR6z3anddswNjSn9ordqF6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WNB6G3QNFf+lV8731C6R+IR9gy.M5ZJsnrsKlAMwQKyL7p+mKX0d+mWZ1yAGfEgTX.xDpA56LakfNYMnfbTVutpbsrkoKg4nV7OvmDk0lVv.k0lnLEKvgDwHd3P0IUx2QFqIOV1vLRUjOq+40P.qMejb1mlz.CGNJYc3diCb4LpsTj1hIH8I9.8rXBbgmJdBl5I636FGAbTNGw5BFqdepQwSgSWUfWyDt2oBjHENj6.pVsM1FJrikz+xQIIsGz2RBqXOs+MCVyz.odnZF0xnN4Is5BGfZeEiF7fVihonA0cuxUvrYA8FsezoRsvMmnSks.x7QESo4ESfr1TdjMbgmjJ.kKGBIURodQPNk5qBjkpfF+ymPtO27y7Rj4Eygb9jVi8ftaG3o1J2mztzAGBfRn8e0oqfypCnrjpvLpqCvmOmra0nqfDHG.SSC2cHYjttjVprzspjDkfxEkcI8wwdhb6H58CosZjCRu9ulGR+9adyayCoF+p+eti9U5sCI+XLzsNdNb8KCWLt.4WBtd2N4KUUuhkpMT3x5X4TIJW7WbA6c6ft5mg.HthmgOEXBu1gDvzcgPZMyNt3nbXBgVx9pODXZU0qWlAo3+329r6+h2dwkoTLLlx2YkkZ4llXF1abDohTUdZEsKWS7Ix.eo7IoSn0LU+aWylRaX5KesuVS9LZhOWRNUHSNkgPy35nySGfknySB2lb9Per5V5k5Y6WKuovGaGxOyV+LIYc8FJIP6DScPst4Ax0V0Pub9r0m5POy1Nanx43WrrNVeYcbqk0wGrrNt8x53CWVGezk6n7+urmDK395m9ACDc1SOOarGCCupUMNh9W.KKnpjB
Here it is only the path generation that is handled in the bg, not the painting. But I reckon the painting already happens in the bg as it is not in sync with the message thread (I might be wrong though...)
Don't forget to handle the BG status and/or shouldAbort cases if needed
-
-
@HISEnberg Yes I do, but some very simple/small ones in a plugin and some much more complex in a standalone. None of them relying on a background task that having been said.
But in the standalone FFT analyser I remember fighting against a lot of instabilities so I used some flags here and there. I don't remember exactly, but probably flags preventing a repaint until the new FFT path is sure to be ready (because it wasn't a simple path, it took a lot of cycles to generate...)