-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] "Real time safety" and inter-thread communication in Tonic. #270
Comments
Tonic doesn't use any protection mechanism for the inter-thread On Sat, Nov 21, 2015 at 8:27 PM, Rafael Vega [email protected]
Morgan Packard |
I know this is an old thread but I also have trouble calling If there are any examples on best usage of the Tonic api + real-time gui I would appreciate it. |
What are the exceptions?
On Sat, Sep 16, 2017 at 3:23 PM Aaron Azhari ***@***.***> wrote:
I know this is an old thread but I have trouble calling synth.setOutputGen
from another thread.
I'm using imgui (a famous GUI library) and change a generator value upon
moving a slider around, which is a very practical purpose of using
TonicAudio and that gives me exceptions in all places. I do see that there
is a MutexLock / Unlock within setOutputGen but that doesn't seem to help
at all.
If there are any examples on best usage of the Tonic api + real-time gui I
would appreciate it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#270 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA9pZcUpKsI3AE6AFV_h63y07JD8eJI-ks5sjCA8gaJpZM4GnB24>
.
--
===============
Morgan Packard
phone: (720) 891-0122
|
There are so many. Mostly read access violations. Running the software multiple times you will see them in different locations. Simply put, Tonic internally seem to race its own stuff. Since the only call from outside that I make is synth.setOutputGen. Here are some of them but these are mostly coincidental. Exception Screenshots |
Most of the literature I've read on real-time programming for audio shows that there should be some sort of lock-free data structure (usually a ring buffer) to pass control messages from the GUI to the audio thread and another one to pass audio samples from the audio thread to the GUI (if one needs to draw the audio wave in the GUI, for example). This is to prevent audio glitches and concurrency issues.
I can see that functions like synth.setParameter() are used, but, I can't figure out if this functions implement some sort of inter-thread communication similar to the one I described or if they use mutexes or something similar instead.
Can someone please explain how the communication between GUI and audio threads work in Tonic and/or the example apps? If a lock-free data structure scheme is not used, why?
The text was updated successfully, but these errors were encountered: