Browse Source

More robust dynamic port management in JACK/CoreMidi bridge.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4604 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.8
sletz 13 years ago
parent
commit
496146f6b5
7 changed files with 24 additions and 6 deletions
  1. +4
    -0
      ChangeLog
  2. +8
    -4
      common/JackDriver.cpp
  3. +1
    -0
      linux/alsarawmidi/JackALSARawMidiDriver.cpp
  4. +4
    -0
      macosx/coremidi/JackCoreMidiDriver.cpp
  5. +3
    -1
      posix/JackPosixThread.h
  6. +2
    -1
      windows/portaudio/JackPortAudioDriver.cpp
  7. +2
    -0
      windows/winmme/JackWinMMEDriver.cpp

+ 4
- 0
ChangeLog View File

@@ -36,6 +36,10 @@ John Emmas
Jackdmp changes log
---------------------------

2011-11-25 Stephane Letz <letz@grame.fr>

* More robust dynamic port management in JACK/CoreMidi bridge.

2011-11-24 Stephane Letz <letz@grame.fr>

* Dynamic port management in JACK/CoreMidi bridge.


+ 8
- 4
common/JackDriver.cpp View File

@@ -317,8 +317,10 @@ int JackDriver::ProcessReadSlaves()
list<JackDriverInterface*>::const_iterator it;
for (it = fSlaveList.begin(); it != fSlaveList.end(); it++) {
JackDriverInterface* slave = *it;
if (slave->ProcessRead() < 0) {
res = -1;
if (slave->IsRunning()) {
if (slave->ProcessRead() < 0) {
res = -1;
}
}
}
return res;
@@ -330,8 +332,10 @@ int JackDriver::ProcessWriteSlaves()
list<JackDriverInterface*>::const_iterator it;
for (it = fSlaveList.begin(); it != fSlaveList.end(); it++) {
JackDriverInterface* slave = *it;
if (slave->ProcessWrite() < 0) {
res = -1;
if (slave->IsRunning()) {
if (slave->ProcessWrite() < 0) {
res = -1;
}
}
}
return res;


+ 1
- 0
linux/alsarawmidi/JackALSARawMidiDriver.cpp View File

@@ -567,6 +567,7 @@ int
JackALSARawMidiDriver::Stop()
{
jack_info("JackALSARawMidiDriver::Stop - stopping 'alsarawmidi' driver.");
JackMidiDriver::Stop();

if (fds[1] != -1) {
close(fds[1]);


+ 4
- 0
macosx/coremidi/JackCoreMidiDriver.cpp View File

@@ -489,6 +489,8 @@ JackCoreMidiDriver::HandleNotification(const MIDINotification *message)
case kMIDIMsgSetupChanged:
SaveConnections();
Stop();
// Wait at least one cycle...
JackSleep(int(fEngineControl->fPeriodUsecs * 2.f));
Detach();
CloseAux();
OpenAux();
@@ -655,6 +657,8 @@ JackCoreMidiDriver::Stop()
{
int result = 0;

JackMidiDriver::Stop();

jack_info("JackCoreMidiDriver::Stop - disabling physical input ports.");

for (int i = 0; i < num_physical_inputs; i++) {


+ 3
- 1
posix/JackPosixThread.h View File

@@ -72,7 +72,9 @@ class SERVER_EXPORT JackPosixThread : public detail::JackThreadInterface

static int AcquireRealTimeImp(jack_native_thread_t thread, int priority);
static int AcquireRealTimeImp(jack_native_thread_t thread, int priority, UInt64 period, UInt64 computation, UInt64 constraint)
{ return JackPosixThread::AcquireRealTimeImp(thread, priority); }
{
return JackPosixThread::AcquireRealTimeImp(thread, priority);
}
static int DropRealTimeImp(jack_native_thread_t thread);
static int StartImp(jack_native_thread_t* thread, int priority, int realtime, void*(*start_routine)(void*), void* arg);
static int StopImp(jack_native_thread_t thread);


+ 2
- 1
windows/portaudio/JackPortAudioDriver.cpp View File

@@ -24,6 +24,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "JackGraphManager.h"
#include "JackError.h"
#include "JackTime.h"
#include "JackTools.h"
#include "JackCompilerDeps.h"
#include <iostream>
#include <assert.h>
@@ -220,7 +221,7 @@ int JackPortAudioDriver::Open(jack_nframes_t buffer_size,

#ifdef __APPLE__
fEngineControl->fPeriod = fEngineControl->fPeriodUsecs * 1000;
fEngineControl->fComputation = 500 * 1000;
fEngineControl->fComputation = JackTools::ComputationMicroSec(fEngineControl->fBufferSize) * 1000;
fEngineControl->fConstraint = fEngineControl->fPeriodUsecs * 1000;
#endif



+ 2
- 0
windows/winmme/JackWinMMEDriver.cpp View File

@@ -327,6 +327,8 @@ JackWinMMEDriver::Stop()
{
int result = 0;

JackMidiDriver::Stop();

jack_info("JackWinMMEDriver::Stop - disabling input ports.");

for (int i = 0; i < fCaptureChannels; i++) {


Loading…
Cancel
Save