pd-lua icon indicating copy to clipboard operation
pd-lua copied to clipboard

Pd crashes with multichannel input to pdlua object from subpatch with clone (under certain circumstances)

Open ben-wes opened this issue 1 year ago • 2 comments

maybe you people here might have an immediate idea on what's going on there:

i was working with a multichannel pdlua object and at some point, it seemed to receive weird signals when they originated from a [clone -do ...] (-do is for distributing cloned signals to separate channels on output) ... but only if the clone was subpatched. i then tried to make some simplified tests and even achieved crashes here.

attaching a test patch with 2 clones and 2 subpatched clones. if you connect one after the other exclusively to the lua object (that just outputs all incoming samples once whenever dsp is activated), you might see that Pd crashes for one of the subpatches.

crash.zip

this is not an issue in plugdata (at least, everything seemed to be working fine for me there). now i'm not sure if there's some pointer issue in my pdlua multichannel implementation or if Pd (0.55-1 on M2 mac) does funny things when a multichannel clone output goes through the outlet of a subpatch. i'm lost ... help! ;)

ben-wes avatar Oct 17 '24 13:10 ben-wes

quickly noting that sig->s_nchans is just reporting 1 channel in the perform function for the same signal where the dsp function reported 16 right before. something seems to get overwritten here.

ben-wes avatar Oct 17 '24 15:10 ben-wes

see PR - fixed, but certainly needs review. it adds a sig_info struct to the object struct which is used to forward the vector pointers and channel counts to the perform function. works well for me. but the memory management might need adjustment (if that whole approach itself seems right).

ben-wes avatar Oct 17 '24 19:10 ben-wes