Thanks Stefan.
I ruled out these cache problems by removing the caches, and using the AU Manager as you proposed. Further, I started to use auval -v for debugging, to avoid Logic altogether. However, I'm happy to report that the cause of the problem was CoreAudio SDK 1.4.3. I moved to CoreAudio SDK 1.4.4, rebuilt my AU, and voila! I'm being called for the kAudioUnitProperty_SupportedChannelLayoutTags and kAudioUnitProperty_AudioChannelLayout properties. Next,
1. I subclassed AUInputElement and AUOutputElement, and overridden the empty implementations of AUElement to GetChannelLayoutTags() and GetAudioChannelLayout().
2. I then overridden the AUBase original CreateElement() with my version that creates my subclassed Input/Output elements. instead of the original AUInputElement and AUOutputElement.
Subclassing AUInputElement I stumbled upon a problem in the SDK internal documentation: look at this excerpt from AUIOElement.cpp
// As the AudioChannelLayout can be a variable length structure (though in most cases it won't be!!!)
// the AU should return the address of the current ACM in use (in outMapPtr) AND if it is writable
// The size of the ACM is returned by the method
// If the AU doesn't require an AudioChannelLayout, then just return 0.
UInt32 AUIOElement::GetAudioChannelLayout (AudioChannelLayout *outMapPtr, Boolean &outWritable) {
return 0;
}
It took me some time to understand that the words "// the AU should return the address of the current ACM in use (in outMapPtr)" are misleading.
I have to COPY BACK THE CONTENTS of my AudioChannelLayout, and not merely the Address of my internal AudioChannelLayout structure. Is this a known Typo of the SDK or am I missing something?
My current implementation looks like this:
UInt32 CWSAUInputElement::GetAudioChannelLayout (AudioChannelLayout *outMapPtr, Boolean &outWritable)
{
outWritable = false;
size_t layoutSize = CAAudioChannelLayout::CalculateByteSize(mACL->mNumberChannelDescriptions);
if (outMapPtr!= NULL)
memcpy(outMapPtr, mACL, layoutSize);
return layoutSize;
}
This seems to work (auval approves my AU and reports my single AudioChannelLayoutTag) as long as I'm using a simple predefined layout tag (e.g. kAudioChannelLayoutTag_MPEG_5_1_A)
But If I try to use kAudioChannelLayoutTag_UseChannelDescriptions and fill the ChannelDescriptions array, I'm getting an error from auval that says "outWritable" must be true in order to use channel descriptions.
Can anyone here explain to me why?
As far as I understand, I'm only REPORTING to CoreAudio what are MY SUPPORTED LAYOUTS (giving out read-only data), and then I should expect to get any input/output buffers with the channels sorted in this order. Am I wrong?
1. In what circumstances I need to return outWritable=true; ?
2. In what circumstances I need to implement SetAudioChannelLayout() ?
I'll appreciate any hint
On 03/09/2008, at 16:50, Stefan Gretscher wrote:
This sounds like you're running into Logic's property caching for
Audio Units. Use the AU Manager to rescan your AU so Logic re-reads
these property from your AU, or increment your AU's version number
which will trigger an update as well. Also note that you'll need to
use Logic Pro for doing surround work, Logic Express doesn't support
surround.
-Stefan