processBlock() buffer contents when DAW isn't playing?

I've found myself with a mysterious bug on my hands. Whenever I stop playback in my DAW (Logic 9), I instantly get all kinds of nasty buffer noise (as in, noise that has an audible pitch of frequency buffer_size/sample_rate). Sometimes this noise decays to zero (sounds like a Karplus-Strong string), other times it is constant, and other times it seems to grow exponentially. My effect is stateful and has a tail, in much the same way a reverb does.

My best theory of what's going on is that Logic sees that I have stopped playback and thinks that it no longer needs to do anything with the buffer that is being delivered to the processBlock() callback, so it doesn't even zero it out (this seems broken if it is the case). Therefore, I get the effect tail that I produced in the previous callback as input, and the way I process on it determines whether this feedback is stable or not.

First off, have others encountered this? Is this crazy?

Are there any guarantees on the buffer that we get from processBlock() when audio is stopped?

Is this behavior consistent across DAWs?

Do DAWs fade out before they tell the plugin that they have stopped?


EDIT: It is perhaps relevant that I am getting the audio by sidechaining (which I am doing entirely within logic, I didn't do anything to indicate that in the Jucer). I just saw and will update this further if it mentions similar issues.

I haven't used logic, but on my setup (ProTools) the contents of the buffer are all times the same, no matter if the DAW plays or is stopped, because I might monitor the sound. I would look inside your code first, do you process anything differently in your code if the DAW is playing or stopped?

For the tail you are producing, did you implement virtual double AudioProcessor::getTailLengthSeconds ( ) const? see

Good luck...

Yes. I can confirm that this is either a JUCE or a Logic bug. Currently investigating on how to fix this...

First off, have others encountered this? Is this crazy?

Yep, also encountered this:

MIDI-controlled effects in Logic haven't been working in the JUCE versions of the past two months.

Try JUCE commit e0bd51f26c6204154eef55285a08a40223d08f8e or sooner - I believe it should work there.

Yes, I am implementing that. I gave it a very conservative 1.0 second, though I don't expect tails of more than a few hundred ms.

Thanks for the replies. I'll sit tight and try the old commit. 

FYI Fabian,  I am getting the buffer noise when the side chain is not set to "None" as well.

@yairadix: Thanks for the link, I was having lots of trouble finding relevant issues in the forums save the sticky post about problems when no sidechain is selected. I'll let you know if I have further issues. 

The commit you posted didn't work, but going back one or two more to d9403b67855e61b362600162d81efa6b12bb84ac did. I still have a little bit of crackle surrounding start and stop of playback, but that could definitely be my own fault.

Nope. It's sending me a discontinuity as soon as I hit stop. The buffer goes to zero immediately.

One week later, any news about that? Is that a logic or juce bug? has it been fixed? 

I believe this bug is now fixed on the latest tip. It's a bit random so I'm not 100% certain. Please test.

It doesn't seem to be fixed (completely, at least). I am at the tip. I don't get the horrible feedback, but it is still sending me a discontinuity at the end of the buffer.

Sorry for the delayed reply. The forums aren't sending me emails when someone replies to me for some reason. I'll see if I can enable that.

I'll have a look.

The forums aren't sending me emails when someone replies to me for some reason. I'll see if I can enable that.

Good luck with that, nobody has figured out how to do that yet :( in 2016 it's pretty surprising to have a forum that doesn't support this.

But, if you happen to find how to enable that, please let us know!

...especially strange as there is a page "subscriptions" and with several settings, on how you want to get your notifications...

So it's not that the forum wouldn't support it, it seems more like somebody forgot to activate the sendmail...

...again the webteam to blame becomes boring... *sigh*