<div dir="ltr">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).<div><br></div><div>cheers,</div><div>Rich</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 5, 2015 at 2:29 PM, Joel Matthys <span dir="ltr"><<a href="mailto:jwmatthys@gmail.com" target="_blank">jwmatthys@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello all. I'm working on a project with libpd & JUCE. I'm trying to include a couple of externals.<br>
<br>
Following directions from here: <a href="https://github.com/danomatika/ofxPd#adding-pure-data-external-libraries-to-ofxpd" rel="noreferrer" target="_blank">https://github.com/danomatika/ofxPd#adding-pure-data-external-libraries-to-ofxpd</a><br>
<br>
I included the source files in my JUCE project, #included them in my audio renderer code, initialize portaudio and libpd:<br>
<br>
libpd_init_audio(2, 2, this->getSampleRate()); //two channel in, two channel out<br>
bob_tilde_setup();<br>
<br>
This compiles fine, and if the external is non-audio, everything works. But for externals with DSP, I get a segfault:<br>
<br>
Program received signal SIGSEGV, Segmentation fault.<br>
0x000000000041b2d7 in bob_dsp (x=0xf40660, sp=0xf3f610) at ../../Source/bob~.c:237<br>
237            sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n);<br>
(gdb) bt<br>
#0  0x000000000041b2d7 in bob_dsp (x=0xf40660, sp=0xf3f610) at ../../Source/bob~.c:237<br>
#1  0x00007ffff649dae1 in ugen_doit () from /usr/local/lib/libpdcpp.so<br>
#2  0x00007ffff649dc3e in ugen_doit () from /usr/local/lib/libpdcpp.so<br>
#3  0x00007ffff649e4a1 in ugen_done_graph () from /usr/local/lib/libpdcpp.so<br>
#4  0x00007ffff64a6427 in canvas_dodsp () from /usr/local/lib/libpdcpp.so<br>
#5  0x00007ffff64a7aef in canvas_resume_dsp () from /usr/local/lib/libpdcpp.so<br>
#6  0x00007ffff64dfb39 in glob_evalfile () from /usr/local/lib/libpdcpp.so<br>
<br>
offending line is:<br>
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);<br>
<br>
Any help is appreciated!<br>
Joel<br>
<br>
_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></div><br></div>