Browse Source

Fix netmaster timing monitoring

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2721 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
moret 17 years ago
parent
commit
1d427a83a7
4 changed files with 20 additions and 10 deletions
  1. +8
    -4
      common/JackNetDriver.cpp
  2. +2
    -1
      common/JackNetDriver.h
  3. +8
    -4
      common/JackNetManager.cpp
  4. +2
    -1
      common/JackNetManager.h

+ 8
- 4
common/JackNetDriver.cpp View File

@@ -33,8 +33,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
namespace Jack
{
#ifdef JACK_MONITOR
uint JackNetDriver::fMeasureCnt = 512;
uint JackNetDriver::fMeasureCnt = 50;
uint JackNetDriver::fMeasurePoints = 5;
uint JackNetDriver::fMonitorPlotOptionsCnt = 2;
std::string JackNetDriver::fMonitorPlotOptions[] =
{
std::string ( "set xlabel \"audio cycles\"" ),
@@ -65,9 +66,11 @@ namespace Jack

//monitor
#ifdef JACK_MONITOR
fMonitor = new NetMonitor<jack_time_t> ( JackNetDriver::fMeasureCnt, JackNetDriver::fMeasurePoints );
fMeasure = new jack_time_t[JackNetDriver::fMeasurePoints];
std::string plot_file_name = std::string ( fParams.fName );
fMonitor.SetPlotFile ( plot_file_name, JackNetDriver::fMonitorPlotOptions, 2, JackNetDriver::fMonitorFieldNames, 5 );
fMonitor->SetPlotFile ( plot_file_name, JackNetDriver::fMonitorPlotOptions, JackNetDriver::fMonitorPlotOptionsCnt,
JackNetDriver::fMonitorFieldNames, JackNetDriver::fMeasurePoints );
#endif
}

@@ -86,6 +89,7 @@ namespace Jack
delete[] fMidiPlaybackPortList;
#ifdef JACK_MONITOR
delete[] fMeasure;
delete fMonitor;
#endif
}

@@ -109,7 +113,7 @@ namespace Jack
int JackNetDriver::Close()
{
std::string filename = string ( fParams.fName );
fMonitor.Save ( filename );
fMonitor->Save ( filename );
return JackDriver::Close();
}
#endif
@@ -639,7 +643,7 @@ namespace Jack

#ifdef JACK_MONITOR
fMeasure[4] = GetMicroSeconds() - fUsecCycleStart;
fMonitor.Write ( fMeasure );
fMonitor->Write ( fMeasure );
#endif

return 0;


+ 2
- 1
common/JackNetDriver.h View File

@@ -64,10 +64,11 @@ namespace Jack
#ifdef JACK_MONITOR
static uint fMeasureCnt;
static uint fMeasurePoints;
static uint fMonitorPlotOptionsCnt;
static std::string fMonitorPlotOptions[];
static std::string fMonitorFieldNames[];
jack_time_t* fMeasure;
NetMonitor<jack_time_t> fMonitor;
NetMonitor<jack_time_t>* fMonitor;
jack_time_t fUsecCycleStart;
#endif



+ 8
- 4
common/JackNetManager.cpp View File

@@ -28,8 +28,9 @@ namespace Jack
{
//JackNetMaster******************************************************************************************************
#ifdef JACK_MONITOR
uint JackNetMaster::fMeasureCnt = 512;
uint JackNetMaster::fMeasureCnt = 50;
uint JackNetMaster::fMeasurePoints = 5;
uint JackNetMaster::fMonitorPlotOptionsCnt = 2;
std::string JackNetMaster::fMonitorPlotOptions[] =
{
std::string ( "set xlabel \"audio cycles\"" ),
@@ -118,9 +119,11 @@ namespace Jack

//monitor
#ifdef JACK_MONITOR
fMonitor = new NetMonitor<jack_nframes_t> ( JackNetMaster::fMeasureCnt, JackNetMaster::fMeasurePoints );
fMeasure = new jack_nframes_t[JackNetMaster::fMeasurePoints];
std::string plot_file_name = std::string ( fParams.fName );
fMonitor.SetPlotFile ( plot_file_name, fMonitorPlotOptions, 2, fMonitorFieldNames, 5 );
fMonitor->SetPlotFile ( plot_file_name, JackNetMaster::fMonitorPlotOptions, JackNetMaster::fMonitorPlotOptionsCnt,
JackNetMaster::fMonitorFieldNames, JackNetMaster::fMeasurePoints );
#endif
}

@@ -146,8 +149,9 @@ namespace Jack
delete[] fRxBuffer;
#ifdef JACK_MONITOR
std::string filename = string ( fParams.fName );
fMonitor.Save ( filename );
fMonitor->Save ( filename );
delete[] fMeasure;
delete fMonitor;
#endif
}

@@ -521,7 +525,7 @@ fail:

#ifdef JACK_MONITOR
fMeasure[4] = jack_frames_since_cycle_start( fJackClient );
fMonitor.Write ( fMeasure );
fMonitor->Write ( fMeasure );
#endif
return 0;
}


+ 2
- 1
common/JackNetManager.h View File

@@ -82,10 +82,11 @@ namespace Jack
#ifdef JACK_MONITOR
static uint fMeasureCnt;
static uint fMeasurePoints;
static uint fMonitorPlotOptionsCnt;
static std::string fMonitorPlotOptions[];
static std::string fMonitorFieldNames[];
jack_nframes_t* fMeasure;
NetMonitor<jack_nframes_t> fMonitor;
NetMonitor<jack_nframes_t>* fMonitor;
#endif

bool Init();


Loading…
Cancel
Save