Browse Source

Improve generated gnuplot files for adapting code.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3365 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.2
sletz 17 years ago
parent
commit
bf1723b98a
7 changed files with 63 additions and 9 deletions
  1. +5
    -1
      ChangeLog
  2. +52
    -1
      common/JackAudioAdapterInterface.cpp
  3. +2
    -2
      common/JackAudioAdapterInterface.h
  4. +1
    -1
      linux/alsa/JackAlsaAdapter.cpp
  5. +1
    -1
      macosx/coreaudio/JackCoreAudioAdapter.cpp
  6. +1
    -2
      solaris/oss/JackOSSAdapter.cpp
  7. +1
    -1
      windows/portaudio/JackPortAudioAdapter.cpp

+ 5
- 1
ChangeLog View File

@@ -23,9 +23,13 @@ Michael Voigt
Jackdmp changes log
---------------------------

2009-02-27 Stephane Letz <letz@grame.fr>
* Improve generated gnuplot files for adapting code.

2009-02-25 Stephane Letz <letz@grame.fr>
* Major cleanup in adapter code.
* Major cleanup in adapter code.
2009-02-25 Stephane Letz <letz@grame.fr>


+ 52
- 1
common/JackAudioAdapterInterface.cpp View File

@@ -38,7 +38,7 @@ namespace Jack
fTable[pos].pos2 = pos2;
}

void MeasureTable::Save()
void MeasureTable::Save(unsigned int fHostBufferSize, unsigned int fHostSampleRate, unsigned int fAdaptedSampleRate, unsigned int fAdaptedBufferSize)
{
char buffer[1024];
FILE* file = fopen("JackAudioAdapter.log", "w");
@@ -55,6 +55,22 @@ namespace Jack

// Adapter timing 1
file = fopen("AdapterTiming1.plot", "w");
fprintf(file, "set multiplot\n");
fprintf(file, "set grid\n");
fprintf(file, "set title \"Audio adapter timing: host [rate = %.1f kHz buffer = %d frames] adapter [rate = %.1f kHz buffer = %d frames] \"\n"
,float(fHostSampleRate)/1000.f, fHostBufferSize, float(fAdaptedSampleRate)/1000.f, fAdaptedBufferSize);
fprintf(file, "set xlabel \"audio cycles\"\n");
fprintf(file, "set ylabel \"frames\"\n");
fprintf(file, "plot ");
sprintf(buffer, "\"JackAudioAdapter.log\" using 2 title \"Consumer interrupt period\" with lines,");
fprintf(file, buffer);
sprintf(buffer, "\"JackAudioAdapter.log\" using 3 title \"Producer interrupt period\" with lines");
fprintf(file, buffer);
fprintf(file, "\n unset multiplot\n");
fprintf(file, "set output 'AdapterTiming1.pdf\n");
fprintf(file, "set terminal pdf\n");
fprintf(file, "set multiplot\n");
fprintf(file, "set grid\n");
fprintf(file, "set title \"Audio adapter timing\"\n");
@@ -65,10 +81,27 @@ namespace Jack
fprintf(file, buffer);
sprintf(buffer, "\"JackAudioAdapter.log\" using 3 title \"Producer interrupt period\" with lines");
fprintf(file, buffer);
fclose(file);

// Adapter timing 2
file = fopen("AdapterTiming2.plot", "w");
fprintf(file, "set multiplot\n");
fprintf(file, "set grid\n");
fprintf(file, "set title \"Audio adapter timing: host [rate = %.1f kHz buffer = %d frames] adapter [rate = %.1f kHz buffer = %d frames] \"\n"
,float(fHostSampleRate)/1000.f, fHostBufferSize, float(fAdaptedSampleRate)/1000.f, fAdaptedBufferSize);
fprintf(file, "set xlabel \"audio cycles\"\n");
fprintf(file, "set ylabel \"resampling ratio\"\n");
fprintf(file, "plot ");
sprintf(buffer, "\"JackAudioAdapter.log\" using 4 title \"Ratio 1\" with lines,");
fprintf(file, buffer);
sprintf(buffer, "\"JackAudioAdapter.log\" using 5 title \"Ratio 2\" with lines");
fprintf(file, buffer);
fprintf(file, "\n unset multiplot\n");
fprintf(file, "set output 'AdapterTiming2.pdf\n");
fprintf(file, "set terminal pdf\n");
fprintf(file, "set multiplot\n");
fprintf(file, "set grid\n");
fprintf(file, "set title \"Audio adapter timing\"\n");
@@ -79,10 +112,27 @@ namespace Jack
fprintf(file, buffer);
sprintf(buffer, "\"JackAudioAdapter.log\" using 5 title \"Ratio 2\" with lines");
fprintf(file, buffer);
fclose(file);

// Adapter timing 3
file = fopen("AdapterTiming3.plot", "w");
fprintf(file, "set multiplot\n");
fprintf(file, "set grid\n");
fprintf(file, "set title \"Audio adapter timing: host [rate = %.1f kHz buffer = %d frames] adapter [rate = %.1f kHz buffer = %d frames] \"\n"
,float(fHostSampleRate)/1000.f, fHostBufferSize, float(fAdaptedSampleRate)/1000.f, fAdaptedBufferSize);
fprintf(file, "set xlabel \"audio cycles\"\n");
fprintf(file, "set ylabel \"frames\"\n");
fprintf(file, "plot ");
sprintf(buffer, "\"JackAudioAdapter.log\" using 6 title \"Frames position in consumer ringbuffer\" with lines,");
fprintf(file, buffer);
sprintf(buffer, "\"JackAudioAdapter.log\" using 7 title \"Frames position in producer ringbuffer\" with lines");
fprintf(file, buffer);
fprintf(file, "\n unset multiplot\n");
fprintf(file, "set output 'AdapterTiming3.pdf\n");
fprintf(file, "set terminal pdf\n");
fprintf(file, "set multiplot\n");
fprintf(file, "set grid\n");
fprintf(file, "set title \"Audio adapter timing\"\n");
@@ -93,6 +143,7 @@ namespace Jack
fprintf(file, buffer);
sprintf(buffer, "\"JackAudioAdapter.log\" using 7 title \"Frames position in producer ringbuffer\" with lines");
fprintf(file, buffer);
fclose(file);
}



+ 2
- 2
common/JackAudioAdapterInterface.h View File

@@ -51,8 +51,8 @@ namespace Jack
MeasureTable() :fCount ( 0 )
{}

void Write ( int time1, int time2, float r1, float r2, int pos1, int pos2 );
void Save();
void Write(int time1, int time2, float r1, float r2, int pos1, int pos2);
void Save(unsigned int fHostBufferSize, unsigned int fHostSampleRate, unsigned int fAdaptedSampleRate, unsigned int fAdaptedBufferSize);

};



+ 1
- 1
linux/alsa/JackAlsaAdapter.cpp View File

@@ -111,7 +111,7 @@ namespace Jack
int JackAlsaAdapter::Close()
{
#ifdef JACK_MONITOR
fTable.Save();
fTable.Save(fHostBufferSize, fHostSampleRate, fAdaptedSampleRate, fAdaptedBufferSize);
#endif
switch ( fThread.GetStatus() )
{


+ 1
- 1
macosx/coreaudio/JackCoreAudioAdapter.cpp View File

@@ -948,7 +948,7 @@ int JackCoreAudioAdapter::Open()
int JackCoreAudioAdapter::Close()
{
#ifdef JACK_MONITOR
fTable.Save();
fTable.Save(fHostBufferSize, fHostSampleRate, fAdaptedSampleRate, fAdaptedBufferSize);
#endif
AudioOutputUnitStop(fAUHAL);
DisposeBuffers();


+ 1
- 2
solaris/oss/JackOSSAdapter.cpp View File

@@ -507,9 +507,8 @@ error:
int JackOSSAdapter::Close()
{
#ifdef JACK_MONITOR
fTable.Save();
fTable.Save(fHostBufferSize, fHostSampleRate, fAdaptedSampleRate, fAdaptedBufferSize);
#endif

fThread.Stop();
CloseAux();
return 0;


+ 1
- 1
windows/portaudio/JackPortAudioAdapter.cpp View File

@@ -178,7 +178,7 @@ namespace Jack
int JackPortAudioAdapter::Close()
{
#ifdef JACK_MONITOR
fTable.Save();
fTable.Save(fHostBufferSize, fHostSampleRate, fAdaptedSampleRate, fAdaptedBufferSize);
#endif
jack_log ( "JackPortAudioAdapter::Close" );
Pa_StopStream ( fStream );


Loading…
Cancel
Save