diff --git a/common/JackNetDriver.cpp b/common/JackNetDriver.cpp index f25f51b2..545eecdf 100644 --- a/common/JackNetDriver.cpp +++ b/common/JackNetDriver.cpp @@ -361,10 +361,8 @@ namespace Jack void JackNetDriver::SaveConnections() { + JackDriver::SaveConnections(); const char** connections; - fConnections.clear(); - - JackTimedDriver::SaveConnections(); for (int i = 0; i < fParams.fSendMidiChannels; ++i) { if (fCapturePortList[i] && (connections = fGraphManager->GetConnections(fMidiCapturePortList[i])) != 0) { diff --git a/macosx/coreaudio/JackCoreAudioDriver.cpp b/macosx/coreaudio/JackCoreAudioDriver.cpp index 5999493f..6939b68e 100644 --- a/macosx/coreaudio/JackCoreAudioDriver.cpp +++ b/macosx/coreaudio/JackCoreAudioDriver.cpp @@ -400,73 +400,30 @@ OSStatus JackCoreAudioDriver::BSNotificationCallback(AudioDeviceID inDevice, return noErr; } +// A better implementation would possibly try to recover in case of hardware device change (see HALLAB HLFilePlayerWindowControllerAudioDevicePropertyListenerProc code) OSStatus JackCoreAudioDriver::AudioHardwareNotificationCallback(AudioHardwarePropertyID inPropertyID, void* inClientData) { JackCoreAudioDriver* driver = (JackCoreAudioDriver*)inClientData; switch (inPropertyID) { - case kAudioHardwarePropertyDevices: { - jack_log("JackCoreAudioDriver::AudioHardwareNotificationCallback kAudioHardwarePropertyDevices"); - DisplayDeviceNames(); - - AudioDeviceID captureID, playbackID; - - jack_log("JackCoreAudioDriver::AudioHardwareNotificationCallback %s %d %s %d", - driver->fCaptureUID, CheckAvailableDeviceName(driver->fCaptureUID, &captureID), - driver->fPlaybackUID, CheckAvailableDeviceName(driver->fPlaybackUID, &playbackID)); - jack_log("JackCoreAudioDriver::AudioHardwareNotificationCallback %d %d", driver->fDeviceID, CheckAvailableDevice(driver->fDeviceID)); - driver->CloseAUHAL(); - - if (CheckAvailableDevice(driver->fDeviceID) || - (CheckAvailableDeviceName(driver->fCaptureUID, &captureID) && CheckAvailableDeviceName(driver->fPlaybackUID, &playbackID))) { - - vector parsed_chan_in_list; - vector parsed_chan_out_list; - - if (driver->OpenAUHAL(true, true, 2, 2, 2, 2, - parsed_chan_in_list, - parsed_chan_out_list, - driver->fEngineControl->fBufferSize, - driver->fEngineControl->fSampleRate) < 0) { - jack_log("JackCoreAudioDriver::OpenAUHAL fails"); - return -1; - } - - // Waiting for Render callback to be called (= driver has started) - driver->fState = false; - int count = 0; + case kAudioHardwarePropertyDevices: { + jack_log("JackCoreAudioDriver::AudioHardwareNotificationCallback kAudioHardwarePropertyDevices"); + DisplayDeviceNames(); + AudioDeviceID captureID, playbackID; + if (CheckAvailableDevice(driver->fDeviceID) || + (CheckAvailableDeviceName(driver->fCaptureUID, &captureID) + && CheckAvailableDeviceName(driver->fPlaybackUID, &playbackID))) { - OSStatus err = AudioOutputUnitStart(driver->fAUHAL); - if (err == noErr) { - - while (!driver->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; - } - - jack_error("CoreAudio driver cannot start..."); - return -1; - } - - } else { - driver->CloseAUHAL(); - } - - break; - } + } + break; + } } return noErr; } -// A better implementation would possibly try to recover in case of hardware device change (see HALLAB HLFilePlayerWindowControllerAudioDevicePropertyListenerProc code) OSStatus JackCoreAudioDriver::DeviceNotificationCallback(AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput,