git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2730 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.90
| @@ -21,6 +21,10 @@ Romain Moret | |||
| Jackdmp changes log | |||
| --------------------------- | |||
| 2008-07-14 Stephane Letz <letz@grame.fr> | |||
| * Fix server client OSX special notification mechanism, CoreAudio driver compilation back for 10.4. | |||
| 2008-07-18 Stephane Letz <letz@grame.fr> | |||
| * Correct audioadapter when a sample rate value different from jack server one is chosen. | |||
| @@ -54,7 +54,7 @@ void MeasureTable::Save() | |||
| fprintf(file, "set grid\n"); | |||
| fprintf(file, "set title \"Audio adapter timing\"\n"); | |||
| fprintf(file, "set xlabel \"audio cycles\"\n"); | |||
| fprintf(file, "set ylabel \"usec\"\n"); | |||
| fprintf(file, "set ylabel \"frames\"\n"); | |||
| fprintf(file, "plot "); | |||
| sprintf(buffer, "\"JackAudioAdapter.log\" using 2 title \"Consumer time\" with lines,"); | |||
| fprintf(file, buffer); | |||
| @@ -68,7 +68,6 @@ void MeasureTable::Save() | |||
| fprintf(file, "set grid\n"); | |||
| fprintf(file, "set title \"Audio adapter timing\"\n"); | |||
| fprintf(file, "set xlabel \"audio cycles\"\n"); | |||
| fprintf(file, "set ylabel \"usec\"\n"); | |||
| fprintf(file, "plot "); | |||
| sprintf(buffer, "\"JackAudioAdapter.log\" using 4 title \"Ratio 1\" with lines,"); | |||
| fprintf(file, buffer); | |||
| @@ -82,7 +81,7 @@ void MeasureTable::Save() | |||
| fprintf(file, "set grid\n"); | |||
| fprintf(file, "set title \"Audio adapter timing\"\n"); | |||
| fprintf(file, "set xlabel \"audio cycles\"\n"); | |||
| fprintf(file, "set ylabel \"usec\"\n"); | |||
| fprintf(file, "set ylabel \"frames\"\n"); | |||
| fprintf(file, "plot "); | |||
| sprintf(buffer, "\"JackAudioAdapter.log\" using 6 title \"Position in consumer ringbuffer\" with lines,"); | |||
| fprintf(file, buffer); | |||
| @@ -27,6 +27,7 @@ JackLibSampleRateResampler::JackLibSampleRateResampler() | |||
| { | |||
| int error; | |||
| fResampler = src_new(SRC_LINEAR, 1, &error); | |||
| //fResampler = src_new(SRC_SINC_BEST_QUALITY, 1, &error); | |||
| if (error != 0) | |||
| jack_error("JackLibSampleRateResampler::JackLibSampleRateResampler err = %s", src_strerror(error)); | |||
| } | |||
| @@ -75,8 +76,8 @@ unsigned int JackLibSampleRateResampler::ReadResample(float* buffer, unsigned in | |||
| written_frames += src_data.output_frames_gen; | |||
| if ((src_data.input_frames_used == 0 || src_data.output_frames_gen == 0) && j == 0) { | |||
| jack_error("Output : j = %d input_frames_used = %ld output_frames_gen = %ld", j, src_data.input_frames_used, src_data.output_frames_gen); | |||
| return 0; | |||
| jack_log("Output : j = %d input_frames_used = %ld output_frames_gen = %ld frames1 = %lu frames2 = %lu" | |||
| , j, src_data.input_frames_used, src_data.output_frames_gen, ring_buffer_data[0].len, ring_buffer_data[1].len); | |||
| } | |||
| jack_log("Output : j = %d input_frames_used = %ld output_frames_gen = %ld", j, src_data.input_frames_used, src_data.output_frames_gen); | |||
| @@ -125,8 +126,8 @@ unsigned int JackLibSampleRateResampler::WriteResample(float* buffer, unsigned i | |||
| read_frames += src_data.input_frames_used; | |||
| if ((src_data.input_frames_used == 0 || src_data.output_frames_gen == 0) && j == 0) { | |||
| jack_error("Input : j = %d input_frames_used = %ld output_frames_gen = %ld", j, src_data.input_frames_used, src_data.output_frames_gen); | |||
| return 0; | |||
| jack_log("Input : j = %d input_frames_used = %ld output_frames_gen = %ld frames1 = %lu frames2 = %lu" | |||
| , j, src_data.input_frames_used, src_data.output_frames_gen, ring_buffer_data[0].len, ring_buffer_data[1].len); | |||
| } | |||
| jack_log("Input : j = %d input_frames_used = %ld output_frames_gen = %ld", j, src_data.input_frames_used, src_data.output_frames_gen); | |||
| @@ -41,7 +41,7 @@ are "hard-coded" in the source. A much better approach would be to use the contr | |||
| - get available drivers and their possible parameters, then prepare to parse them. | |||
| */ | |||
| #ifdef __APPLE_ | |||
| #ifdef __APPLE__ | |||
| #include <CoreFoundation/CFNotificationCenter.h> | |||
| static void notify_server_start(const char* server_name) | |||
| @@ -201,11 +201,16 @@ OSStatus JackCoreAudioDriver::MeasureCallback(AudioDeviceID inDevice, | |||
| { | |||
| JackCoreAudioDriver* driver = (JackCoreAudioDriver*)inClientData; | |||
| AudioDeviceStop(driver->fDeviceID, MeasureCallback); | |||
| /* | |||
| #ifdef MAC_OS_X_VERSION_10_5 | |||
| AudioDeviceDestroyIOProcID(driver->fDeviceID, driver->fMesureCallbackID); | |||
| #else | |||
| AudioDeviceRemoveIOProc(driver->fDeviceID, MeasureCallback); | |||
| #endif | |||
| */ | |||
| AudioDeviceRemoveIOProc(driver->fDeviceID, MeasureCallback); | |||
| jack_log("JackCoreAudioDriver::MeasureCallback called"); | |||
| JackMachThread::GetParams(&driver->fEngineControl->fPeriod, &driver->fEngineControl->fComputation, &driver->fEngineControl->fConstraint); | |||
| // Setup threadded based log function | |||
| @@ -858,11 +863,15 @@ int JackCoreAudioDriver::AddListeners() | |||
| void JackCoreAudioDriver::RemoveListeners() | |||
| { | |||
| /* | |||
| #ifdef MAC_OS_X_VERSION_10_5 | |||
| AudioDeviceDestroyIOProcID(fDeviceID, fMesureCallbackID); | |||
| #else | |||
| AudioDeviceRemoveIOProc(fDeviceID, MeasureCallback); | |||
| #endif | |||
| */ | |||
| AudioDeviceRemoveIOProc(fDeviceID, MeasureCallback); | |||
| AudioDeviceRemovePropertyListener(fDeviceID, 0, true, kAudioDeviceProcessorOverload, DeviceNotificationCallback); | |||
| AudioDeviceRemovePropertyListener(fDeviceID, 0, true, kAudioHardwarePropertyDevices, DeviceNotificationCallback); | |||
| AudioDeviceRemovePropertyListener(fDeviceID, 0, true, kAudioDevicePropertyNominalSampleRate, DeviceNotificationCallback); | |||
| @@ -1062,11 +1071,15 @@ int JackCoreAudioDriver::Start() | |||
| { | |||
| jack_log("JackCoreAudioDriver::Start"); | |||
| JackAudioDriver::Start(); | |||
| /* | |||
| #ifdef MAC_OS_X_VERSION_10_5 | |||
| OSStatus err = AudioDeviceCreateIOProcID(fDeviceID, MeasureCallback, this, &fMesureCallbackID); | |||
| #else | |||
| OSStatus err = AudioDeviceAddIOProc(fDeviceID, MeasureCallback, this); | |||
| #endif | |||
| */ | |||
| OSStatus err = AudioDeviceAddIOProc(fDeviceID, MeasureCallback, this); | |||
| if (err != noErr) | |||
| return -1; | |||
| @@ -1087,11 +1100,15 @@ int JackCoreAudioDriver::Stop() | |||
| { | |||
| jack_log("JackCoreAudioDriver::Stop"); | |||
| AudioDeviceStop(fDeviceID, MeasureCallback); | |||
| /* | |||
| #ifdef MAC_OS_X_VERSION_10_5 | |||
| AudioDeviceDestroyIOProcID(fDeviceID, fMesureCallbackID); | |||
| #else | |||
| AudioDeviceRemoveIOProc(fDeviceID, MeasureCallback); | |||
| #endif | |||
| */ | |||
| AudioDeviceRemoveIOProc(fDeviceID, MeasureCallback); | |||
| return (AudioOutputUnitStop(fAUHAL) == noErr) ? 0 : -1; | |||
| } | |||
| @@ -72,10 +72,12 @@ class JackCoreAudioDriver : public JackAudioDriver | |||
| bool fMonitor; | |||
| float fIOUsage; | |||
| /* | |||
| #ifdef MAC_OS_X_VERSION_10_5 | |||
| AudioDeviceIOProcID fMesureCallbackID; | |||
| #endif | |||
| */ | |||
| static OSStatus Render(void *inRefCon, | |||
| AudioUnitRenderActionFlags *ioActionFlags, | |||