<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:medium;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:medium;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:medium;"><div><div><div><div>As to "compiling but not working", I had issues in the past where some alloca() in [fiddle~] were failing on the BeagleBone Black (that is, Linux, but embedded), so it was failing at runtime with no meaningful error other than "segmentation fault". </div></div><br class="ydpe90a78e8Apple-interchange-newline"></div></div><div><br></div><hr></div></div><div id="ydp849a8254yahoo_quoted_0023102637" class="ydp849a8254yahoo_quoted"><div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;"><div>On Tuesday, 4 July 2017, 15:03:28 BST, Alexandre Torres Porres <porres@gmail.com> wrote:</div><div><br></div><div><br></div><div><div id="ydp849a8254yiv9840803782"><div><div dir="ltr">Awesome, thanks! My coding skills and experience is so poor that this makes sense :) <br clear="none"><br clear="none">But just so we're 100% clear, even if it compiles and works for mac, linux and windows, we can still have problems for android like compiling but not working?<div><br clear="none"></div><div>cheers</div></div><div class="ydp849a8254yiv9840803782gmail_extra"><br clear="none"><div class="ydp849a8254yiv9840803782yqt1558721721" id="ydp849a8254yiv9840803782yqtfd93626"><div class="ydp849a8254yiv9840803782gmail_quote">2017-07-04 5:16 GMT-03:00 IOhannes m zmoelnig <span dir="ltr"><<a shape="rect" href="mailto:zmoelnig@iem.at" rel="nofollow" target="_blank">zmoelnig@iem.at</a>></span>:<br clear="none"><blockquote class="ydp849a8254yiv9840803782gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><span class="ydp849a8254yiv9840803782">On 2017-07-04 03:49, Alexandre Torres Porres wrote:<br clear="none">
> howdy, I've been testing libpd for android and some externals. I've managed<br clear="none">
> to use pd's extra objects as well as a few objects from cyclone and also<br clear="none">
> from another library of my own - but some externals will fail, they compile<br clear="none">
> and create and everything, I just do not hear any sound! And they're pretty<br clear="none">
> simple so I can't see any reason why they fail, here's one I couldn't run,<br clear="none">
> for instance: <a shape="rect" href="https://github.com/porres/pd-else/blob/master/classes/gbman~.c" rel="nofollow" target="_blank">https://github.com/porres/pd- else/blob/master/classes/ gbman~.c</a><br clear="none">
<br clear="none">
</span>i don't see any obvious problem, but some generic remarks:<br clear="none">
<br clear="none">
- use `t_sample` for all signals.<br clear="none">
don't use different types for input and output signals.<br clear="none">
use types consistently and try to not convert between them too often<br clear="none">
(even if t_float and t_sample are practically the same on *your* system<br clear="none">
right now).<br clear="none">
<br clear="none">
- data sent to perform routine:<br clear="none">
you are passing in x, some signal-vectors and the vector length.<br clear="none">
you are storing the samplerate as a member of x. why don't you pass it<br clear="none">
directly? or rather: why do you pass in sp[0]->s_n directly, but<br clear="none">
sp[0]->s_sr via "x".<br clear="none">
you are also passing in a member of x (x_val), why don't you just<br clear="none">
dereference `x` in the perform routine to get that value? apart from<br clear="none">
that, what is this value there for in the first place? you seem to do an<br clear="none">
awful lot of referencing/passing around/dereferencing just to never<br clear="none">
actually use that value.<br clear="none">
<br clear="none">
<br clear="none">
- you are mixing variable declarations and code (L118). this is valid<br clear="none">
C99 code, but not ANSI compatible.<br clear="none">
since/if it doesn't really improve the readability of your code, i'd<br clear="none">
stick to ANSI and declare my variables only at the beginning of a code<br clear="none">
block.<br clear="none">
<span class="ydp849a8254yiv9840803782"><br clear="none">
> What should I know or be careful about building external objects for<br clear="none">
> android? How can I get more information about my problem?<br clear="none">
<br clear="none">
</span>often such problems come from uninitialized variables.<br clear="none">
<br clear="none">
i don't know anything about libpd, but sys_getsr() in the constructor<br clear="none">
looks fishy. it might well poison the hz (x_freq; hmm, is that used<br clear="none">
anywhere?) and x_phase values.<br clear="none">
<br clear="none">
run your program through debuggers:<br clear="none">
- valgrind is very easy to use, and it often detects use of<br clear="none">
uninitialized variables.<br clear="none">
learn to use it: <a shape="rect" href="https://www.google.at/search?q=valgrind+tutorial" rel="nofollow" target="_blank">https://www.google.at/search? q=valgrind+tutorial</a><br clear="none">
<br clear="none">
- if this doesn't give you plenty of hints<br clear="none">
gdb is a very powerful debugger, you should probably learn to use it:<br clear="none">
<a shape="rect" href="https://www.google.at/search?q=gdb+tutorial" rel="nofollow" target="_blank">https://www.google.at/search? q=gdb+tutorial</a><br clear="none">
<br clear="none">
- there's also the printf debugger, which might be easier to use in some<br clear="none">
specific contexts:<br clear="none">
<a shape="rect" href="https://stackoverflow.com/questions/189562" rel="nofollow" target="_blank">https://stackoverflow.com/ questions/189562</a><br clear="none">
<br clear="none">
<br clear="none">______________________________ _________________<br clear="none">
<a shape="rect" href="mailto:Pd-list@lists.iem.at" rel="nofollow" target="_blank">Pd-list@lists.iem.at</a> mailing list<br clear="none">
UNSUBSCRIBE and account-management -> <a shape="rect" href="https://lists.puredata.info/listinfo/pd-list" rel="nofollow" target="_blank">https://lists.puredata.info/ listinfo/pd-list</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div></div><div class="ydp849a8254yqt1558721721" id="ydp849a8254yqtfd15294">_______________________________________________<br clear="none"><a shape="rect" href="mailto:Pd-list@lists.iem.at" rel="nofollow" target="_blank">Pd-list@lists.iem.at</a> mailing list<br clear="none">UNSUBSCRIBE and account-management -> <a shape="rect" href="https://lists.puredata.info/listinfo/pd-list" rel="nofollow" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br clear="none"></div></div></div></div></div></body></html>