git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1303 0c269be4-1314-0410-8aa9-9f06e86f4224tags/0.60
| @@ -1,6 +1,11 @@ | |||||
| --------------------------- | --------------------------- | ||||
| Jackdmp changes log | Jackdmp changes log | ||||
| --------------------------- | --------------------------- | ||||
| 2006-11-22 Stephane Letz <letz@grame.fr> | |||||
| * In synchronous mode, if the driver time out is reached, the server may get desynchronized (pending signal may arrive in later cycles), | |||||
| use a higher time out value use in driver, and warn the use of possible mis-behaviour in case of time out. | |||||
| 2006-11-08 Stephane Letz <letz@grame.fr> | 2006-11-08 Stephane Letz <letz@grame.fr> | ||||
| @@ -189,14 +189,20 @@ int JackAudioDriver::ProcessSync() | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| if (fIsMaster) { | |||||
| if (fIsMaster) { | |||||
| fEngine->Process(fLastWaitUst); // fLastWaitUst is set in the "low level" layer | fEngine->Process(fLastWaitUst); // fLastWaitUst is set in the "low level" layer | ||||
| fGraphManager->ResumeRefNum(fClientControl, fSynchroTable); | |||||
| ProcessSlaves(); | |||||
| if (fGraphManager->SuspendRefNum(fClientControl, fSynchroTable, fEngineControl->fTimeOutUsecs) < 0) | |||||
| jack_error("JackAudioDriver::ProcessSync SuspendRefNum error"); | |||||
| fGraphManager->ResumeRefNum(fClientControl, fSynchroTable); | |||||
| if (ProcessSlaves() < 0) | |||||
| jack_error("JackAudioDriver::ProcessSync ProcessSlaves error, engine may now behave abnormally!!"); | |||||
| if (fGraphManager->SuspendRefNum(fClientControl, fSynchroTable, fEngineControl->fTimeOutUsecs) < 0) | |||||
| jack_error("JackAudioDriver::ProcessSync SuspendRefNum error, engine may now behave abnormally!!"); | |||||
| if (Write() < 0) // Write output buffers for the current cycle | if (Write() < 0) // Write output buffers for the current cycle | ||||
| jack_error("Process: write error"); | |||||
| jack_error("Process: write error"); | |||||
| } else { | } else { | ||||
| fGraphManager->ResumeRefNum(fClientControl, fSynchroTable); | fGraphManager->ResumeRefNum(fClientControl, fSynchroTable); | ||||
| } | } | ||||
| @@ -19,7 +19,7 @@ | |||||
| #define PRINTDEBUG | #define PRINTDEBUG | ||||
| #define VERSION "0.59" | |||||
| #define VERSION "0.60" | |||||
| #define FORK_SERVER 1 | #define FORK_SERVER 1 | ||||
| @@ -132,8 +132,8 @@ int JackDriver::Open(jack_nframes_t nframes, | |||||
| strcpy(fPlaybackDriverName, playback_driver_name); | strcpy(fPlaybackDriverName, playback_driver_name); | ||||
| fEngineControl->fPeriodUsecs = (jack_time_t)floor((((float)nframes) / (float)samplerate) * 1000000.0f); | fEngineControl->fPeriodUsecs = (jack_time_t)floor((((float)nframes) / (float)samplerate) * 1000000.0f); | ||||
| if (fEngineControl->fTimeOutUsecs == 0) /* usecs; if zero, use 2 period size. */ | |||||
| fEngineControl->fTimeOutUsecs = (jack_time_t)(2.f * fEngineControl->fPeriodUsecs); | |||||
| if (fEngineControl->fTimeOutUsecs == 0) /* usecs; if zero, use 10 period size. */ | |||||
| fEngineControl->fTimeOutUsecs = (jack_time_t)(10.f * fEngineControl->fPeriodUsecs); | |||||
| fGraphManager->DirectConnect(fClientControl->fRefNum, fClientControl->fRefNum); // Connect driver to itself for sync | fGraphManager->DirectConnect(fClientControl->fRefNum, fClientControl->fRefNum); // Connect driver to itself for sync | ||||
| @@ -192,13 +192,16 @@ void JackDriverClient::RemoveSlave(JackDriverInterface* slave) | |||||
| fSlaveList.remove(slave); | fSlaveList.remove(slave); | ||||
| } | } | ||||
| void JackDriverClient::ProcessSlaves() | |||||
| { | |||||
| int JackDriverClient::ProcessSlaves() | |||||
| { | |||||
| int res = 0; | |||||
| list<JackDriverInterface*>::const_iterator it; | list<JackDriverInterface*>::const_iterator it; | ||||
| for (it = fSlaveList.begin(); it != fSlaveList.end(); it++) { | for (it = fSlaveList.begin(); it != fSlaveList.end(); it++) { | ||||
| JackDriverInterface* slave = *it; | JackDriverInterface* slave = *it; | ||||
| slave->Process(); | |||||
| } | |||||
| if ((res = slave->Process()) < 0) | |||||
| return res; | |||||
| } | |||||
| return res; | |||||
| } | } | ||||
| } // end of namespace | } // end of namespace | ||||
| @@ -78,7 +78,7 @@ class EXPORT JackDriverInterface | |||||
| virtual bool GetMaster() = 0; | virtual bool GetMaster() = 0; | ||||
| virtual void AddSlave(JackDriverInterface* slave) = 0; | virtual void AddSlave(JackDriverInterface* slave) = 0; | ||||
| virtual void RemoveSlave(JackDriverInterface* slave) = 0; | virtual void RemoveSlave(JackDriverInterface* slave) = 0; | ||||
| virtual void ProcessSlaves() = 0; | |||||
| virtual int ProcessSlaves() = 0; | |||||
| virtual bool IsRealTime() = 0; | virtual bool IsRealTime() = 0; | ||||
| @@ -112,7 +112,7 @@ class EXPORT JackDriverClient : public JackDriverClientInterface | |||||
| virtual bool GetMaster(); | virtual bool GetMaster(); | ||||
| virtual void AddSlave(JackDriverInterface* slave); | virtual void AddSlave(JackDriverInterface* slave); | ||||
| virtual void RemoveSlave(JackDriverInterface* slave); | virtual void RemoveSlave(JackDriverInterface* slave); | ||||
| virtual void ProcessSlaves(); | |||||
| virtual int ProcessSlaves(); | |||||
| }; | }; | ||||
| /*! | /*! | ||||
| @@ -37,8 +37,10 @@ int JackFreewheelDriver::Process() | |||||
| } else { | } else { | ||||
| fGraphManager->ResumeRefNum(fClientControl, fSynchroTable); // Signal all clients | fGraphManager->ResumeRefNum(fClientControl, fSynchroTable); // Signal all clients | ||||
| if (fEngineControl->fSyncMode) { | if (fEngineControl->fSyncMode) { | ||||
| if (fGraphManager->SuspendRefNum(fClientControl, fSynchroTable, fEngineControl->fTimeOutUsecs) < 0) | |||||
| jack_error("JackFreewheelDriver::ProcessSync SuspendRefNum error"); | |||||
| if (fGraphManager->SuspendRefNum(fClientControl, fSynchroTable, fEngineControl->fTimeOutUsecs) < 0) { | |||||
| jack_error("JackFreewheelDriver::ProcessSync SuspendRefNum error"); | |||||
| return -1; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| return 0; | return 0; | ||||
| @@ -117,9 +117,9 @@ class JackThreadedDriver : public JackDriverClientInterface, public JackRunnable | |||||
| { | { | ||||
| fDriver->RemoveSlave(slave); | fDriver->RemoveSlave(slave); | ||||
| } | } | ||||
| virtual void ProcessSlaves() | |||||
| virtual int ProcessSlaves() | |||||
| { | { | ||||
| fDriver->ProcessSlaves(); | |||||
| return fDriver->ProcessSlaves(); | |||||
| } | } | ||||
| virtual void PrintState() | virtual void PrintState() | ||||
| @@ -223,7 +223,7 @@ int JackPortAudioDriver::Render(const void* inputBuffer, void* outputBuffer, | |||||
| driver->fLastWaitUst = GetMicroSeconds(); // Take callback date here | driver->fLastWaitUst = GetMicroSeconds(); // Take callback date here | ||||
| driver->fInputBuffer = (float**)inputBuffer; | driver->fInputBuffer = (float**)inputBuffer; | ||||
| driver->fOutputBuffer = (float**)outputBuffer; | driver->fOutputBuffer = (float**)outputBuffer; | ||||
| return driver->Process(); | |||||
| return (driver->Process() == 0) ? paContinue : paAbort; | |||||
| } | } | ||||
| int JackPortAudioDriver::Read() | int JackPortAudioDriver::Read() | ||||