From 801541e04d3c15591ca1f3f088e465892f53fc8b Mon Sep 17 00:00:00 2001 From: sletz Date: Mon, 26 Oct 2009 19:25:09 +0000 Subject: [PATCH] Internal aggregate devices can be used only after 10.5.4 systems, otherwise use public one. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3676 0c269be4-1314-0410-8aa9-9f06e86f4224 --- macosx/coreaudio/JackCoreAudioDriver.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/macosx/coreaudio/JackCoreAudioDriver.cpp b/macosx/coreaudio/JackCoreAudioDriver.cpp index 55268edf..d5ba8f85 100644 --- a/macosx/coreaudio/JackCoreAudioDriver.cpp +++ b/macosx/coreaudio/JackCoreAudioDriver.cpp @@ -484,9 +484,21 @@ OSStatus JackCoreAudioDriver::CreateAggregateDevice(AudioDeviceID captureDeviceI CFDictionaryAddValue(aggDeviceDict, CFSTR(kAudioAggregateDeviceUIDKey), AggregateDeviceUIDRef); // add a "private aggregate key" to the dictionary + int value = 1; CFNumberRef AggregateDeviceNumberRef = CFNumberCreate(NULL, kCFNumberIntType, &value); - CFDictionaryAddValue(aggDeviceDict, CFSTR(kAudioAggregateDeviceIsPrivateKey), AggregateDeviceNumberRef); + + SInt32 major; + SInt32 minor; + SInt32 bugfix; + Gestalt(gestaltSystemVersionMajor, &major); + Gestalt(gestaltSystemVersionMinor, &minor); + Gestalt(gestaltSystemVersionBugFix, &bugfix); + + // Starting with 10.5.4 systems, the AD can be internal... (better) + if (major == 10 && minor >= 5 && bugfix >= 4) { + CFDictionaryAddValue(aggDeviceDict, CFSTR(kAudioAggregateDeviceIsPrivateKey), AggregateDeviceNumberRef); + } //------------------------------------------------- // Create a CFMutableArray for our sub-device list @@ -1132,7 +1144,7 @@ int JackCoreAudioDriver::Open(jack_nframes_t buffer_size, Gestalt(gestaltSystemVersionMinor, &minor); // Starting with 10.6 systems, the HAL notification thread is created internally - if (major == 10 && minor >=6) { + if (major == 10 && minor >= 6) { CFRunLoopRef theRunLoop = NULL; AudioObjectPropertyAddress theAddress = { kAudioHardwarePropertyRunLoop, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; OSStatus theError = AudioObjectSetPropertyData (kAudioObjectSystemObject, &theAddress, 0, NULL, sizeof(CFRunLoopRef), &theRunLoop);