JUCE demo plugin outputs only left channel


#1

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

 


#2

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.


#3

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


#4

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


#5

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


#6

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...


#7

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