git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4392 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.8
| @@ -232,7 +232,7 @@ bool JackThreadedDriver::Init() | |||||
| jack_log("JackThreadedDriver::Init IsRealTime"); | jack_log("JackThreadedDriver::Init IsRealTime"); | ||||
| // Will do "something" on OSX only... | // Will do "something" on OSX only... | ||||
| GetEngineControl()->fPeriod = GetEngineControl()->fConstraint = GetEngineControl()->fPeriodUsecs * 1000; | GetEngineControl()->fPeriod = GetEngineControl()->fConstraint = GetEngineControl()->fPeriodUsecs * 1000; | ||||
| GetEngineControl()->fComputation = JackMachThread::ComputationMicroSec(GetEngineControl()->fBufferSize) * 1000; | |||||
| GetEngineControl()->fComputation = ComputationMicroSec(GetEngineControl()->fBufferSize) * 1000; | |||||
| fThread.SetParams(GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint); | fThread.SetParams(GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint); | ||||
| if (fThread.AcquireSelfRealTime(GetEngineControl()->fServerPriority) < 0) { | if (fThread.AcquireSelfRealTime(GetEngineControl()->fServerPriority) < 0) { | ||||
| jack_error("AcquireSelfRealTime error"); | jack_error("AcquireSelfRealTime error"); | ||||
| @@ -110,6 +110,18 @@ class SERVER_EXPORT JackThreadedDriver : public JackDriverClientInterface, publi | |||||
| virtual bool Execute(); | virtual bool Execute(); | ||||
| virtual bool Init(); | virtual bool Init(); | ||||
| // For OSX only | |||||
| int ComputationMicroSec(int buffer_size) | |||||
| { | |||||
| if (buffer_size < 128) { | |||||
| return 500; | |||||
| } else if (buffer_size < 256) { | |||||
| return 300; | |||||
| } else { | |||||
| return 100; | |||||
| } | |||||
| } | |||||
| }; | }; | ||||
| } // end of namespace | } // end of namespace | ||||
| @@ -47,7 +47,7 @@ bool JackWaitThreadedDriver::Execute() | |||||
| jack_log("JackWaitThreadedDriver::Init IsRealTime"); | jack_log("JackWaitThreadedDriver::Init IsRealTime"); | ||||
| // Will do "something" on OSX only... | // Will do "something" on OSX only... | ||||
| GetEngineControl()->fPeriod = GetEngineControl()->fConstraint = GetEngineControl()->fPeriodUsecs * 1000; | GetEngineControl()->fPeriod = GetEngineControl()->fConstraint = GetEngineControl()->fPeriodUsecs * 1000; | ||||
| GetEngineControl()->fComputation = JackMachThread::ComputationMicroSec(GetEngineControl()->fBufferSize) * 1000; | |||||
| GetEngineControl()->fComputation = ComputationMicroSec(GetEngineControl()->fBufferSize) * 1000; | |||||
| fThread.SetParams(GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint); | fThread.SetParams(GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint); | ||||
| if (fThread.AcquireSelfRealTime(GetEngineControl()->fServerPriority) < 0) { | if (fThread.AcquireSelfRealTime(GetEngineControl()->fServerPriority) < 0) { | ||||
| jack_error("AcquireSelfRealTime error"); | jack_error("AcquireSelfRealTime error"); | ||||
| @@ -134,17 +134,6 @@ class SERVER_EXPORT JackMachThread : public JackPosixThread | |||||
| } | } | ||||
| static int DropRealTimeImp(jack_native_thread_t thread); | static int DropRealTimeImp(jack_native_thread_t thread); | ||||
| static int ComputationMicroSec(int buffer_size) | |||||
| { | |||||
| if (buffer_size < 128) { | |||||
| return 500; | |||||
| } else if (buffer_size < 256) { | |||||
| return 300; | |||||
| } else { | |||||
| return 100; | |||||
| } | |||||
| } | |||||
| }; | }; | ||||
| } // end of namespace | } // end of namespace | ||||