FFT slow on rpi4

Hello
I’m tryng to build my own first lv2 plugin for zynthian in order to let it run in headless mode.
I started coding it in Juce, but it dors not manage control ports, thus is not simple to let it communicate with zynthian GUI. One more noticeable thing thing is that plugin .so file is about 60MB, including the default Juce GUI for debugging purposes.

Then I started coding it in C without Juce.
Since my plugin performs an FFT, some thiny logic and an iFFT, I used fftw3.
Whenever I try to get my 1024 FFT plans in the instantiate or activate function with ESTIMATE flag it hangs one CPU to 100% for a long time. But the FFT size is the same as the Juce one.

Since the Juce plugin has not this issue it’s clear to me that I’m missing something, it’s the second time I compute an FFT the first was in Juce, but I don’t understand what’s wrong.

Do you have any hints on it?
Have I to use another approach for FFT, e.g. a different FFT library, code one function by myself, install some linux optimization package, …?
Is there a LV2 example plugin that I could look at to learn?
Or should I compute the plans offline and save them, in order to barely load them in the plugin?

Thank you

Sergio

Hi @idranoels !

fftw3 library is fast enough in Pi4, so it shouldn’t have performance issues. Check you compiler optimization options.

In the other hand, you could try to use:

that is a kind of JUCE-port framework developed by falktx and allows to compile JUCE plugins as LV2 with control ports.

Also, if you are going to program LV2, you should consider the LVTK framework:

Regards,

1 Like

Thanks for all the precious suggestions.
I’ll check It ASAP.

Finally I succedesse in getting It working.
I still didn’t use any framework, but I’m planning to study the UI framework for the next release

CPU usage Is about 5%, I don’t know if it’s high for this kind of FX, but it’s at least acceptable for my purpose.
DLL size is about 20KB, a considerabile saving from JUCE release of 4.4MB.

Now I’m going to complete my HW, so I can perform all final test.

Thany you all again

Sergio

4 Likes

These are fantastic news, @idranoels . I hope to test your plugin very soon, when you are ready to share. BTW, what kind of FX are you developing?

Thanks!

1 Like

Some simple spectral processing, limit or regain each bin.
The result can lead to some funny audio deformations (sometimes seems like the song has been played under the Sea) tò some stronger unrecognizable deformations (e.g. the song retains just percussive events with noise appearance)
I didn’t know what I should expect from It until I did It, but I find It nice in some specific situations.

1 Like

Try categorising that one @jofemodo :smile:

1 Like

Nice! I will be waiting for testing it :wink:

Regards,

Probably post of the month if we were crazy enough to operate such a charade…

As i told, i will restrict myself from categorizing audio FXs, as my knowledge is very limited. Anyway, it seems clear to me that this effect should have a very big “WET” control :rofl: :rofl:

Cheeers!

2 Likes

Wierd shit

1 Like