JUCE demo plugin outputs only left channel

In Logic X, JUCE's Demo plugin and other plugins I tested, when used on Stereo tracks, zero the right channel.

Git bisect tells that the offending commit is 32e34bc8087d117df19847c372a50b875a556eb0 - before that it worked, however the feedback bug that it fixes exists before it.

Cheers, Yair


This happens when placing the plugin as the first insert on a Stereo channel with a Mono recording in the track.

The input buffer obtained from GetInput (0) has input->mIOBuffer.mPtrs->mBuffers[0] == input->mIOBuffer.mPtrs->mBuffers[1]! Pointing to the same mData.

The plugin then similarily operates on a buffer where the left and right channels are the same buffer, so one of its channels will override the other..

After copying the left channel, there's the "zeromem (buffer, sizeof(float) * nFrames);" line (not sure why). This cleared the so called left channel but the right channel too because they are the same buffer and we later get zero samples in the right channel.

Looks like AU can give the same pointer for different input channels if they are identical and I guess one shouldn't use these buffers for their in-place processing.

After debugging and reviewing the code I believe I have a proper fix. I tested it and it seems to work fine here, for both this problem and the previous feedback problem which commit 32e34bc was trying to fix.

See commits 24fb776..c1b2a70 at SR's brance https://github.com/soundradix/JUCE/commits/master

Cheers, Yair

Thanks a lot! This should also solve my issue here: http://www.juce.com/forum/topic/mono/stereo-issue-logic/logicx

These look like some great patches. I'll review them and add them to JUCE.

Do you think these changes will be added over the next few days? Just trying to decide whether or not to use the Yairadix fork in the meantime...

Yes they will definitely be added in the next couple of days.