It looks like you’re using the C++ wrapper for libpd. Did you build it with thread support and/or are you using the queued layer?
There are actually 3 threads here:
* main application thread * audio thread * Open GL thread
libpd will obviously be utilized by the audio thread where you run the libpd process function. If you are *not* using a mutex or the queued layer, you may have resource issues between the audio thread and the other threads.
-------- Dan Wilcox @danomatika https://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/
On Feb 17, 2016, at 4:00 AM, pd-dev-request@lists.iem.at wrote:
From: 0222445 <Luis.Valdivia@stud.sbg.ac.at mailto:Luis.Valdivia@stud.sbg.ac.at> Subject: [PD-dev] Fwd: Synchronizing OpenGL with libpd (with RtAudio or Port Audio) Date: February 16, 2016 at 9:00:30 PM MST To: pd-dev@lists.iem.at mailto:pd-dev@lists.iem.at
I have to synchonize a Metronome (wrote with libpd) and OpenGL graphics. I'd like to move some objects parallel with the metronome clicks. The language is C++, the Gui is made with WxWidgets, Threads with Poco, audio with RtAudio. The metronome works, OpenGL graphics too, I have only a problem with the synchronisation. I'm running both things with a Thread, but it actually doesn't works, the metronome run and the graphic is done after the metronome stops (and not parallel). i become the CGLError 10004 from OpenGL during the execution of the thread (if CLGError is = 0 the draw is going to be done). The object is moved when the thread is completed.