You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a single-threaded Processing sketch, where we are dealing with a lot of simultaneous playbacks, number of which is capped to an integer variable. After the queue is overfilled, ugens are being unpatched and sound removed from the queue.
However, sometimes (still mysterious), when trying to run pan.unpatch(out);, ArrayOutOfBoundsException is thrown by AudioOutput's Summer object. It tries to access one position beyond the end of an array (that we assume could've changed WHILE the loop was running).
We looked through our code and couldn't pinpoint the source of the problem (ArrayList that's throwing exception belongs to AudioOutput.Summer) - we don't even use ArrayLists. Thus, I am not really sure whether it's a bug or just us overloading Minim, we thought you'd like to know this anyway.
As a suggestion: maybe make Summer's m_ugens array synchronized or save the array's size explicitly, such that no modifications to it are allowed in such way (during unpatching).
Stack trace:
java.lang.RuntimeException: java.lang.IndexOutOfBoundsException: Index: 11, Size: 11
< ... >
Caused by: java.lang.IndexOutOfBoundsException: Index: 11, Size: 11
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411) <- ArrayList = Summer.m_ugens
at ddf.minim.ugens.Summer.removeInput(Unknown Source) <- (!!!)
at ddf.minim.UGen.unpatch(Unknown Source)
at ddf.minim.UGen.unpatch(Unknown Source)
at main$Sonify$Chain.dispose(main.java:662)
at main$Sonify.updateSamples(main.java:779)
at main$Sonify.play(main.java:794)
at main.draw(main.java:217)
Our code is available here: http://github.com/dmitryfd/Zond
The problematic part is in Sonify.pde:44 (we put try/catch around it).
Thanks a lot!
The text was updated successfully, but these errors were encountered:
Hi, I added synchronization on the ugens list inside Summer and I think this will fix the error you are seeing. Would you be so kind as to grab the lastest minim.jar from here and replace the version you are running against in your Processing setup:
We have a single-threaded Processing sketch, where we are dealing with a lot of simultaneous playbacks, number of which is capped to an integer variable. After the queue is overfilled, ugens are being unpatched and sound removed from the queue.
However, sometimes (still mysterious), when trying to run
pan.unpatch(out);
, ArrayOutOfBoundsException is thrown by AudioOutput's Summer object. It tries to access one position beyond the end of an array (that we assume could've changed WHILE the loop was running).We looked through our code and couldn't pinpoint the source of the problem (ArrayList that's throwing exception belongs to AudioOutput.Summer) - we don't even use ArrayLists. Thus, I am not really sure whether it's a bug or just us overloading Minim, we thought you'd like to know this anyway.
As a suggestion: maybe make Summer's m_ugens array synchronized or save the array's size explicitly, such that no modifications to it are allowed in such way (during unpatching).
Stack trace:
Our code is available here:
http://github.com/dmitryfd/Zond
The problematic part is in Sonify.pde:44 (we put try/catch around it).
Thanks a lot!
The text was updated successfully, but these errors were encountered: