Do you have a lock to protect the patch load? If not then pd audio might try to run the dsp loop before the graph is completely constructed (unless you're also loading the patch from the audio thread, which you probably don't want to do).
cheers, Rich
On Wed, Aug 5, 2015 at 2:29 PM, Joel Matthys jwmatthys@gmail.com wrote:
Hello all. I'm working on a project with libpd & JUCE. I'm trying to include a couple of externals.
Following directions from here: https://github.com/danomatika/ofxPd#adding-pure-data-external-libraries-to-o...
I included the source files in my JUCE project, #included them in my audio renderer code, initialize portaudio and libpd:
libpd_init_audio(2, 2, this->getSampleRate()); //two channel in, two channel out bob_tilde_setup();
This compiles fine, and if the external is non-audio, everything works. But for externals with DSP, I get a segfault:
Program received signal SIGSEGV, Segmentation fault. 0x000000000041b2d7 in bob_dsp (x=0xf40660, sp=0xf3f610) at ../../Source/bob~.c:237 237 sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n); (gdb) bt #0 0x000000000041b2d7 in bob_dsp (x=0xf40660, sp=0xf3f610) at ../../Source/bob~.c:237 #1 0x00007ffff649dae1 in ugen_doit () from /usr/local/lib/libpdcpp.so #2 0x00007ffff649dc3e in ugen_doit () from /usr/local/lib/libpdcpp.so #3 0x00007ffff649e4a1 in ugen_done_graph () from /usr/local/lib/libpdcpp.so #4 0x00007ffff64a6427 in canvas_dodsp () from /usr/local/lib/libpdcpp.so #5 0x00007ffff64a7aef in canvas_resume_dsp () from /usr/local/lib/libpdcpp.so #6 0x00007ffff64dfb39 in glob_evalfile () from /usr/local/lib/libpdcpp.so
offending line is: dsp_add(bob_perform, 6, x, sp[0]->s_vec, sp[1]->s_vec,sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n);
Any help is appreciated! Joel
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list