Using Pd-0.42.5-extended.app, Pd-0.43-3.app, and Pd-0.43.4-extended-20121101
on OSX 10.6x and 10.7x,
vbap 1.0.3.2 crashes when sent longer "define_loudspeakers" messages
the PD console displays: vbap: Loudspeaker setup configured! pd: getbytes() failed -- out of memory vbap: Configure loudspeakers first!
and the program crashes.
(It appears to be failing in the "vbap_matrix" method. But, perhaps, the data sent to that message is already bad).
Following HCS's suggestion,
I tried doubling both MAX_LS_AMOUNT as well as MAX_LS_SETS. Now the program does not crash, vbap fails each time: when sent the define_loudspeakers, the PD console displays:
"vbap loudspeaker-matrices: param 475 is not a float." (from vbap_matrix method)
Things I have noticed:
--The above param number in the error message will be different each time pd is relaunched and a new attempt is made.
--increasing MAX_LS_AMOUNT and MAX_LS_SETS 10 times introduces intermittency: Some times the same error message above will be displayed, sometimes it the define_loudspeakers message will succeed, and VBAP will function correctly.
-- occasionally, a different error message in the pd console will result:
"Dimension can be only 2 or 3" (from vbap_matrix method)
--And of course, the problem does not manifest when smaller configurations are used (i.e. shorter define_loudspeakers messages).
I wrestled with the problem for a long time without getting any further. Maybe you, or someone out there, will have some greater insight into this problem. Any assistance or additional suggestions would be greatly appreciated, since the problem above comes with the latest pd-extended.
Below is the the vbap message that provokes the problem:
define_loudspeakers 3 0 90 -7.5 55 52.5 55 112.5 55 172.5
55 -127.5 55 -67.5 55 7.5 20 37.5 20 67.5 20 97.5 20 127.5 20 157.5
20 -172.5 20 -142.5 20 -112.5 20 -82.5 20 -52.5 20 -22.5 20 7.5 -15
37.5 -15 67.5 -15 97.5 -15 127.5 -15 157.5 -15 -172.5 -15 -142.5 -15
-112.5 -15 -82.5 -15 -52.5 -15 -22.5 -15
Anonymous
I used svn-bisect to find the commit that introduced this issue:
http://pure-data.svn.sourceforge.net/viewvc/pure-data?view=revision&revision=15871
I'm going to email the author of that patch to see if he's got any insight.
patch to illustrate the issue
This bug is still there, at least in pd-extended 0.43.4
Any chance to have this fixed?
Or is there a version I can compile with this plugin working?
Thanks in advance
d
Hello List,
I think I found the problem.
the end of the speaker setup process vbap_bang is called
because of the following macro is defined in vbap.h
define sendLoudspeakerMatrices(x,list_length, at) \
vbap_matrix(x, gensym("loudspeaker-matrices"),list_length, at); \
vbap_bang(x)
in the vbap_bang()
t_float final_gs = (t_float ) getbytes(x->x_ls_amount * sizeof(t_float));
is called. however, the value of x->x_ls_amount * sizeof(t_float) is NEGATIVE. if you send a long list of “define_loudspeakers” message.
I have tested it with Zack’s speaker setup.
The value of x->x_ls_amount is 1063141355 and the size of t_float is 4
1063141355 * 4 = 4252565420
4252565420 > LONG_MAX
this causes the problem and two questions raise here.
1: Why do we need such a huge amount of memory for VBAP?
4252565420 byte = 4252565 kbyte = 4252 mb = 4G !??
2: The dynamic allocation and release of memory is executed in vbap_bang function. this function is called probably very frequently. Is this safe and efficient design to do dynamic allocation in this function?
Chikashi
Last edit: Chikashi Miyama 2015-05-08
hmm, unable to reproduce this with the values you gave.
which svn commit are you using?
could you post the patch that crashes?
hcs's
vbap64-test.pdworks fine for me with rev.17464 (which is the same as rev.17332)I use Pd-extended 0.43.4 and attached patch for testing.
on MacOS 10.10 it often crashes but not always.
The following error message I get always.
vbap loudspeaker-matrices: param 11048 is not a float
pd: getbytes() failed -- out of memory
vbap: Configure loudspeakers first!
Sorry. I just downloaded the newest revision with Zack's correction. It works fine now.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
could someone please tell me where can I can get "hcs's vbap64-test.pd with rev.17464"? I still have this bug and can't get more than 16 speakers to work with vbap.
vbap64-test.pdis a file attached to the post of Hans Christoph Steiner (aka hcs) in this thread."with rev.17464" is a specific revision of the vbap external (the current one), as found in the SVN repository.
Diff:
closing this ticket as it has apparently been fixed.