Is there a way to disable audio port output processing for specific ports? #160
-
Hi! I've been writing a few simple, host implementations and thought it'd be fun to do something more complex such as a graph/node style connection between plugins. If I understand the docs the process audio outputs and inputs map audio buffers 1:1 with the number of ports the plugin has. Ideally there would be a member in process, perhaps Also it seems the documentation in process.h has a typo for audio inputs/outputs, it refers to Thanks for taking time to read through all of this! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 13 replies
-
Why would you skip an input or an output the host asks for? I’m not sure I understand the goal If a plugin wants it can ask the host to rescan its ports if topology changes using the audio ports host extension. And if a host wishes to advertise multiple topologies to a host we have the audio ports config extension also, but I am not sure if any host or plugin implements that today. But I also know that surge and clap saw demo will both crash or fail if you don’t give them the buffers you ask for thank you for spotting that typo thoigh! You know now the names those apis had in clap 0.06 :) we should fix that up for sure though (or if you want to feel free to send a pr against the next branch fixing it ) |
Beta Was this translation helpful? Give feedback.
-
Yes, the point is that the host queries and the plugin (in extreme) says I'll do 8 output ports with each 16 channels and I don't really need that as a host, I'm only connecting you to a 1 port input with 2 channels. Nevermind the connection bit, that's of course handled by the higher level API. I think the host should dictate what ports and how many channels need rendering, but with the current api and documentation it suggests the plugin is free to render as many ports and channels as it wants and if the receiver isn't game it still has to provide buffers for all those ports and channels those frames are just wasted. I'll try to join the discord at some point because I am unable to describe this more clearly in text. Thanks for your time baconpaul, much appreciated! Edit: and it's absolutely possible that I have just misunderstood how these things work entirely. :P |
Beta Was this translation helpful? Give feedback.
-
Here's the question again, if a plugin has 4 output ports and 6 channels on each port, but my host only wants one port and 2 channels, how can I convince the plugin to not render/process those other ports and channels that are not needed/requested? The documentation and examples don't support this scenario, the plugin simply assumes that you have the buffers to cover all the ports and channels, whether you want them or not. I mean, it's easy to filter, by why render frames for the ports and channels that aren't used for the actual output? |
Beta Was this translation helpful? Give feedback.
-
With the current API and reference implementation the host must handle whatever the plugin says it's doing. If the plugin has 4 ports with 6 channels each and the host is a single port mono output, allocating buffers and rendering all the frames for 4 ports with 6 channels each gives nothing to the host which only wants 1 port with a single channel. All those other frames are thrown away. Paul, talk to you tomorrow it's getting late here. Hopefully we can chat in a less constricted environment than github. There's a discord or something right? In any case I wish you a good evening (or whatever your TZ is hehe). Laters! |
Beta Was this translation helpful? Give feedback.
-
Oh, I thought the clap community had some official channels aside from github already. I'm not good with the community communication sites, I have slack because of work, but generally stick to github and gitlab and even those I dont handle well XD. I get what you're saying, but it would be easy for the plugin writers to adhere to the rule that you only generate what the hosts asks for and I think that would be the cleanest aproach. If you have written a 6 channel plugin it is quite easy to only make it render the first channel. Same with ports, it's easy to skip ports. It's such an easy branching/condition statement that it should probably be mandatory for plugins to be able to render less channels than their maximum capability and only on selected ports. IMHO! I'm pretty new to audio so I'm not even sure if this is is an issue. It seems like an edge case at least, but it comes up when you write the buffer allocation code etc. Why do I need a larger buffer than the actual host output? Is what I asked myself (and also the thrown away frames good for nothing in this scenario). The host may mix the superflous channels, but rendering unused ports is still an issue. |
Beta Was this translation helpful? Give feedback.
Oh, I thought the clap community had some official channels aside from github already. I'm not good with the community communication sites, I have slack because of work, but generally stick to github and gitlab and even those I dont handle well XD.
I get what you're saying, but it would be easy for the plugin writers to adhere to the rule that you only generate what the hosts asks for and I think that would be the cleanest aproach. If you have written a 6 channel plugin it is quite easy to only make it render the first channel. Same with ports, it's easy to skip ports. It's such an easy branching/condition statement that it should probably be mandatory for plugins to be able to render les…