Bug? zero sized buffers passed into processBlock() for AU MIDI FX

Hi,

Since the update to JUCE 6.15 the audioBuffers passed into processBlock() always have zero samples. I’ve already tried updating to 6.16 but it’s the same.

This commit might be related: AU Client: Avoid AudioBuffer assertion when plugin has no audio chan… · juce-framework/JUCE@fc378aa · GitHub

I just did a quick test and changed this code to

if (! channels.empty())
    mutableBuffer.setDataToReferTo (channels.data(), (int) channels.size(), static_cast<int> (frames));
else
    mutableBuffer.setSize(0, frames, false, true, true);

and it appears to be working. @reuk are there any potential problems with doing this (other than the potential allocation) ? Or is this just plastering over another deeper issue ?

thanks!

I don’t completely understand the problem. Please could you provide the following:

  • What exactly is the problem? I guess the AudioBuffer has the wrong size - is the problem with the number of channels, or the length in samples, or both?
  • Have you tested on the develop branch, or only on master? There was a recent commit on develop (AU Client: Ensure processBlock receives AudioBuffer of correct size · juce-framework/JUCE@5b3aa7f · GitHub) that sounds like it could be related. Perhaps the issue is already fixed on develop.
  • If updating to develop didn’t help, what sort of plugin are you testing (MIDI FX, instrument, effect etc.)
  • What plugin format (I’m guessing AUv2, but it’d be good to make sure)
  • Are you testing in a specific host? If so, which version, and on what platform?
  • It might also be helpful to know about your implementation of isBusesLayoutSupported, and the bus configuration that you’re passing to your AudioProcessor’s constructor, if you’re doing anything custom in these places.

My apologies. My reply was a bit hasty.

  1. Yes. The AudioBuffer that gets passed into processBlock always has zero channels (which is expected) and zero samples (which is wrong)
  2. Just tested develop. works perfectly fine. This brings be to something that bugs me for quite a while: can we please (pretty please) get a stable branch that is more conservative in terms of features and only contains bug fixes like this one? I can’t just switch JUCE versions lightheartedly because usually something breaks in subtle and unexpected ways. I’m pretty sure that something else is broken now that I’m using develop. So I’m going to cherry pick the commit. But now I wonder which other fixes I’m missing out on.
  3. MIDI FX plug-in - I’m aware that this is hugely relevant - so apologies again for my hasty post.
  4. Yes, AUv2
  5. Logic 10.5.1 & 10.7.3 on macOS 12.2.1
  6. default implementation and the JucePlugin_IsMidiEffect makes it just return true.

Thanks for your time and for chiming in so quickly.

in most daws (all daws even i think) you receive 0 samples each time there has been silence on the track for a while. that is done to inform the plugin that it doesn’t need to keep on working at the moment. it’s actually very useful to have this, cause then you can still use processBlock for other things that even matter without audio input

Interesting.

But here in my situation, the DAW was playing back and the actually buffer size I obtained from variables on the call stack greater than zero. the patch that reuk referenced solved the issue.