Hi there,
I've been playing around with libpd the last few months, trying to make a little app that does audio synthesis from some computer vision algorithms. The program is now complete.. The only thing is, it's a little cpu intensive and I'd like to make it more efficient.
Basically, what I'm trying to do now is incorporate the [pd~] object in pd-extra to take advantage of parallelism. I'm writing my code in C++ right now and compiling it on a Linux machine running Ubuntu Studio.
I set up my program and Makefile in a way similar to the pdtest_freeverb c++ example. After some wrangling, everything compiles fine. But when I try to run it,
Segmentation fault (core dumped)
Boo. At this point I try compiling pdtest_freeverb itself. It compiles fine (although I have to add a #include line in main.cpp for usleep). When I run it,
error: signal outlet connect to nonsignal inlet (ignored)
verbose(4): ... you might be able to track this down from the Find menu.
Segmentation fault (core dumped)
So then I try rebuilding libpd. I delete the old one with make clobber and then make with UTIL=true and EXTRA=true. Still no dice. I delete the whole libpd folder from my hard drive and then clone it again from github. I build libpd with a bunch of different combinations of options. I checkout a couple different versions of libpd and do the same. Nothing seems to work - still getting segfaults.
So, I am at a bit of a loss here. I don't know why these segfaults are happening. Any help would be ever so appreciated as I have been stuck on this for a while now.
Here is the output from gdb's backtrace full if that is helpful:
pdtest_freeverb:
#0 0x000055555557ad2c in freeverb_dsp (x=0x5555557d1820, sp=<optimized out>)
at src/externals/freeverb~.c:550
No locals.
#1 0x00007ffff7a966b3 in ugen_doit () from ../../../libs/libpd.so
No symbol table info available.
#2 0x00007ffff7a96bd3 in ugen_doit () from ../../../libs/libpd.so
No symbol table info available.
#3 0x00007ffff7a96bd3 in ugen_doit () from ../../../libs/libpd.so
No symbol table info available.
#4 0x00007ffff7a96bd3 in ugen_doit () from ../../../libs/libpd.so
No symbol table info available.
#5 0x00007ffff7a985ef in ugen_done_graph () from ../../../libs/libpd.so
No symbol table info available.
#6 0x00007ffff7aa5797 in canvas_dodsp () from ../../../libs/libpd.so
No symbol table info available.
#7 0x00007ffff7aa58cf in canvas_resume_dsp () from ../../../libs/libpd.so
No symbol table info available.
#8 0x00007ffff7aa6ad2 in glob_evalfile () from ../../../libs/libpd.so
No symbol table info available.
#9 0x00007ffff7b6d876 in libpd_openfile () from ../../../libs/libpd.so
No symbol table info available.
#10 0x000055555556e085 in pd::PdBase::openPatch (path="./pd", patch="test.pd",
this=0x555555783358 <lpd>) at ../../../cpp/PdBase.hpp:140
handle = <optimized out>
dollarZero = <optimized out>
handle = <optimized out>
dollarZero = <optimized out>
#11 initAudio () at src/main.cpp:55
bufferFrames = 128
patch = {_handle = 0x7fffffffdd50, _dollarZero = 6, _dollarZeroStr = "", _filename = "",
_path = ".\000\000\000\000\000\000\000hcyUUU\000\000\020\254M\367\377\177\000\000\000\275\271\270\254\335\\X\000\000\000\000\000\000\000\000`cyUUU\000\000`3xUUU\000\000\000\000\000\000\000\000\000\000@cyUUU\000\000P xUUU\000\000\000\000\000\000\000\000\000\000\070eVUUU\000\000\006\000\000\000\377\000\000\000\000\aN\367\377\177\000\000\200\aN\367\377\177\000\000\000\004N\367\377\177\000\000\300\002N\367\377\177\000\000\000\275\271\270\254\335\\X\000\000\000\000%\000\000\000(F\230\366\377\177\000\000\360\332UUUU\000\000\000\275\271\270\254\335\\X\004\000\000\000\000\000\000\000h\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000"...}
parameters = {deviceId = 6, nChannels = 0, firstChannel = 3099180288}
options = {flags = 4294958528, numberOfBuffers = 32767,
streamName = <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>, priority = -8728}
#12 0x000055555555af09 in main (argc=<optimized out>, argv=<optimized out>) at src/main.cpp:85
No locals.
Thanks again for any help!