Menu

#1012 vbap 1.0.3.2 fails when sent longer "define_loudspeakers" me

v0.39.2
closed-fixed
nobody
externals (234)
5
2017-08-06
2013-01-08
Anonymous
No

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

Discussion

  • Hans-Christoph Steiner

    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.

     
  • Hans-Christoph Steiner

    patch to illustrate the issue

     
  • Anonymous

    Anonymous - 2014-04-08

    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

     
  • Chikashi Miyama

    Chikashi Miyama - 2015-05-08

    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.

    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

    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
  • IOhannes m zmölnig

    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.pd works fine for me with rev.17464 (which is the same as rev.17332)

     
  • Chikashi Miyama

    Chikashi Miyama - 2015-05-08

    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!

     
  • Chikashi Miyama

    Chikashi Miyama - 2015-05-08

    Sorry. I just downloaded the newest revision with Zack's correction. It works fine now.

     
  • Anonymous

    Anonymous - 2017-07-31

    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.

     
    • IOhannes m zmölnig

      vbap64-test.pd is 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.

       
  • IOhannes m zmölnig

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
    
     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,
    
    • status: open --> closed-fixed
    • Group: --> v0.39.2
     
  • IOhannes m zmölnig

    closing this ticket as it has apparently been fixed.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB