StackOverFlow on PortAudioStreamMBS

I’ve been using Xojo for a few weeks (2019 r1.1) and I only have a problem when I run the application on Linux (Debian Jessie, Buster on X86 and ARM (Pi4))
In Windows 10 everything works fine.
I use the plugin MBS Audio and I want to read the audio level on the inputs of the sound card.
With the example provided by MBS: InputLevelWindow, when I click on the button “Input Test With Level Events” I have the error StackOverFlow on Callback
I have the same error with my app … normal I use the same functions …
Can you help me ?

A StackOverflow in a callback is usually a sign for a callback on a background thread. This is not officially supported and you have to restrict yourself to some basic operations and not create Xojo objects or access Instance properties. First of all you have to use

#Pragma BackgroundTasks False #Pragma StackOverflowChecking False
in your callback method.

But Christian handles this stuff for you and you probably should set PortAudioStreamMBS.UseSafeThreading = True on Linux.

Thank you,
It seems to work on Pi4.
I can not do “frmMain.txtSN.Text = str (sum)” in my callback ?
“sum” being the sum of the values ??of a frame.

If the callback is performed on a thread (even a Xojo thread), no. If it runs on a background thread, you could address class properties, so add a shared property to your window where you can put the value in and have a window timer read that value and display it periodically.
If it is performed on a normal thread, you can also use instance properties, or use a Xojo.core.timer.Calllater call with a variable or any other callback method that does not try to address the GUI from within the thread.

But you are using Christian’s plugins anyway. He added ThreadSafeSet methods to most (or all?) of Xojo GUI controls. Otherwise if you try so, you will most probably encounter a ThreadAccessingGUI exception.