Hi DSP Concepts,
I was developing a custom module, and wrote the _module.m script like this:
PT_AudioIn1=new_pin_type(12, 32, 48000, 'float', 0);
PT_AudioIn2=new_pin_type(1, 32, 48000, 'float', 0);
PT_AudioIn3=new_pin_type(1, 32, 48000, 'float', 0);
PT_AudioOut1=new_pin_type(2, 32, 48000, 'float', 0);
PT_AudioOut2=new_pin_type(12, 32, 48000, 'float', 0);
add_pin(M, 'input', 'AudioIn1', 'AudioIn1', PT_AudioIn1);
add_pin(M, 'input', 'AudioIn2', 'AudioIn2', PT_AudioIn2);
add_pin(M, 'input', 'AudioIn3', 'AudioIn3', PT_AudioIn3);
add_pin(M, 'output', 'AudioOut1', 'AudioOut1', PT_AudioOut1);
add_pin(M, 'output', 'AudioOut2', 'AudioOut2', PT_AudioOut2);
And after I created a layout and connected the custom module, the number of channels of the output pins are different from the declaration:
As shown in the screenshots, the AudioOut1 is shown as 12 channels and AudioOut2 is shown as 1 channel. However in the TestInOutChannels_module.m script, AudioOut1 is declared 2 channels and AudioOut2 is declared 12 channels.
Could you please help me find out where the problem is?
I have attached my whole testing project in this post.
Thanks.
7:41pm
Hi Jessie, just letting you know I've started to look into this.
Gary
8:32pm
Hi Jessie, please see the modified MATLAB module script. I added an empty prebuild function and declared the pointer to it. It looks like this works now.
Thanks,
Gary
10:48pm
Hi Gary,
Thanks. It works now. Could you please explain why the empty prebuild function is necessary?
Thanks,
Jessie
11:40am
Hi Jessie,
Please check the entry in the following table for the "preBuildFunc" function. While it states that prebuild is optional, note that if you leave it out, the output pin properties are simply copied from the input pins. This is what was happening in your case.
https://tinyurl.com/237rfxv8
Thanks,
Gary