Browse Source

In JackCoreAudioDriver::Start, wait for the audio driver to effectively start (use the MeasureCallback).

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3681 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/v1.9.4
sletz 16 years ago
parent
commit
d9def1e48c
3 changed files with 26 additions and 3 deletions
  1. +4
    -0
      ChangeLog
  2. +20
    -3
      macosx/coreaudio/JackCoreAudioDriver.cpp
  3. +2
    -0
      macosx/coreaudio/JackCoreAudioDriver.h

+ 4
- 0
ChangeLog View File

@@ -25,6 +25,10 @@ Paul Davis
Jackdmp changes log
---------------------------

2009-10-29 Stephane Letz <letz@grame.fr>
* In JackCoreAudioDriver::Start, wait for the audio driver to effectively start (use the MeasureCallback).

2009-10-28 Stephane Letz <letz@grame.fr>
* In JackCoreAudioDriver, force the SR value to the wanted one *before* creating aggregate device (otherwise creation will fail).


+ 20
- 3
macosx/coreaudio/JackCoreAudioDriver.cpp View File

@@ -227,6 +227,9 @@ OSStatus JackCoreAudioDriver::MeasureCallback(AudioDeviceID inDevice,
driver->fEngineControl->fComputation = driver->fEngineControl->fPeriod * driver->fComputationGrain;
}
// Signal waiting start function...
driver->fState = true;
// Setup threadded based log function
set_threaded_log_function();
return noErr;
@@ -824,7 +827,7 @@ int JackCoreAudioDriver::SetupSampleRateAux(AudioDeviceID inDevice, jack_nframes

// Waiting for SR change notification
int count = 0;
while (!fState && count++ < 100) {
while (!fState && count++ < WAIT_COUNTER) {
usleep(100000);
jack_log("Wait count = %d", count);
}
@@ -1376,8 +1379,22 @@ int JackCoreAudioDriver::Start()
printError(err);
return -1;
}

return 0;
// Waiting for Measure callback to be called ( = driver has started)
fState = false;
int count = 0;
while (!fState && count++ < WAIT_COUNTER) {
usleep(100000);
jack_log("JackCoreAudioDriver::Start wait count = %d", count);
}
if (count < WAIT_COUNTER) {
jack_info("CoreAudio driver is running...");
return 0;
} else {
jack_error("CoreAudio driver cannot start...");
return -1;
}
}

int JackCoreAudioDriver::Stop()


+ 2
- 0
macosx/coreaudio/JackCoreAudioDriver.h View File

@@ -36,6 +36,8 @@ typedef UInt8 CAAudioHardwareDeviceSectionID;
#define kAudioDeviceSectionOutput ((CAAudioHardwareDeviceSectionID)0x00)
#define kAudioDeviceSectionGlobal ((CAAudioHardwareDeviceSectionID)0x00)
#define kAudioDeviceSectionWildcard ((CAAudioHardwareDeviceSectionID)0xFF)
#define WAIT_COUNTER 60

/*!
\brief The CoreAudio driver.


Loading…
Cancel
Save