Browse Source

Loopback driver working again.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2687 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
sletz 17 years ago
parent
commit
6dc1387fc5
20 changed files with 51 additions and 47 deletions
  1. +4
    -0
      ChangeLog
  2. +4
    -4
      common/JackAudioDriver.cpp
  3. +3
    -3
      common/JackAudioDriver.h
  4. +1
    -0
      common/JackChannel.h
  5. +3
    -3
      common/JackDriver.cpp
  6. +2
    -2
      common/JackDriver.h
  7. +2
    -2
      common/JackDummyDriver.cpp
  8. +2
    -2
      common/JackDummyDriver.h
  9. +2
    -2
      common/JackNetDriver.cpp
  10. +0
    -1
      common/JackServer.cpp
  11. +2
    -2
      common/JackThreadedDriver.cpp
  12. +1
    -1
      common/JackThreadedDriver.h
  13. +1
    -1
      common/Jackdmp.cpp
  14. +2
    -2
      linux/alsa/JackAlsaDriver.h
  15. +2
    -2
      macosx/JackCoreAudioAdapter.h
  16. +10
    -10
      macosx/JackCoreAudioDriver.cpp
  17. +3
    -3
      macosx/JackCoreAudioDriver.h
  18. +2
    -2
      macosx/Jackdmp.xcodeproj/project.pbxproj
  19. +3
    -3
      windows/JackPortAudioDriver.cpp
  20. +2
    -2
      windows/JackPortAudioDriver.h

+ 4
- 0
ChangeLog View File

@@ -21,6 +21,10 @@ Romain Moret
Jackdmp changes log
---------------------------

2008-07-12 Stephane Letz <letz@grame.fr>

* Loopback driver working again.

2008-07-08 Stephane Letz <letz@grame.fr>

* Add jack_get_descriptor in internal clients API.


+ 4
- 4
common/JackAudioDriver.cpp View File

@@ -68,10 +68,10 @@ int JackAudioDriver::SetSampleRate(jack_nframes_t sample_rate)
return 0;
}

int JackAudioDriver::Open(jack_nframes_t nframes,
int JackAudioDriver::Open(jack_nframes_t buffer_size,
jack_nframes_t samplerate,
int capturing,
int playing,
bool capturing,
bool playing,
int inchannels,
int outchannels,
bool monitor,
@@ -83,7 +83,7 @@ int JackAudioDriver::Open(jack_nframes_t nframes,
fCaptureChannels = inchannels;
fPlaybackChannels = outchannels;
fWithMonitorPorts = monitor;
return JackDriver::Open(nframes, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_name, playback_driver_name, capture_latency, playback_latency);
return JackDriver::Open(buffer_size, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_name, playback_driver_name, capture_latency, playback_latency);
}

int JackAudioDriver::Attach()


+ 3
- 3
common/JackAudioDriver.h View File

@@ -63,10 +63,10 @@ class EXPORT JackAudioDriver : public JackDriver
JackAudioDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table);
virtual ~JackAudioDriver();

virtual int Open(jack_nframes_t nframes,
virtual int Open(jack_nframes_t buffer_size,
jack_nframes_t samplerate,
int capturing,
int playing,
bool capturing,
bool playing,
int inchannels,
int outchannels,
bool monitor,


+ 1
- 0
common/JackChannel.h View File

@@ -124,6 +124,7 @@ class JackClientChannelInterface
{}
};

}

} // end of namespace


+ 3
- 3
common/JackDriver.cpp View File

@@ -86,7 +86,7 @@ int JackDriver::Open()
return 0;
}

int JackDriver::Open(jack_nframes_t nframes,
int JackDriver::Open(jack_nframes_t buffer_size,
jack_nframes_t samplerate,
bool capturing,
bool playing,
@@ -109,7 +109,7 @@ int JackDriver::Open(jack_nframes_t nframes,

fClientControl.fRefNum = refnum;
fClientControl.fActive = true;
fEngineControl->fBufferSize = nframes;
fEngineControl->fBufferSize = buffer_size;
fEngineControl->fSampleRate = samplerate;
fCaptureLatency = capture_latency;
fPlaybackLatency = playback_latency;
@@ -124,7 +124,7 @@ int JackDriver::Open(jack_nframes_t nframes,
if (!fEngineControl->fTimeOut)
fEngineControl->fTimeOutUsecs = jack_time_t(2.f * fEngineControl->fPeriodUsecs);

fGraphManager->SetBufferSize(nframes);
fGraphManager->SetBufferSize(buffer_size);
fGraphManager->DirectConnect(fClientControl.fRefNum, fClientControl.fRefNum); // Connect driver to itself for "sync" mode
SetupDriverSync(fClientControl.fRefNum, false);
return 0;


+ 2
- 2
common/JackDriver.h View File

@@ -50,7 +50,7 @@ class EXPORT JackDriverInterface
{}
virtual int Open() = 0;
virtual int Open(jack_nframes_t nframes,
virtual int Open(jack_nframes_t buffer_size,
jack_nframes_t samplerate,
bool capturing,
bool playing,
@@ -142,7 +142,7 @@ class EXPORT JackDriver : public JackDriverClientInterface
int ProcessSlaves();
virtual int Open();
virtual int Open(jack_nframes_t nframes,
virtual int Open(jack_nframes_t buffer_size,
jack_nframes_t samplerate,
bool capturing,
bool playing,


+ 2
- 2
common/JackDummyDriver.cpp View File

@@ -34,7 +34,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
namespace Jack
{

int JackDummyDriver::Open(jack_nframes_t nframes,
int JackDummyDriver::Open(jack_nframes_t buffer_size,
jack_nframes_t samplerate,
bool capturing,
bool playing,
@@ -46,7 +46,7 @@ int JackDummyDriver::Open(jack_nframes_t nframes,
jack_nframes_t capture_latency,
jack_nframes_t playback_latency)
{
int res = JackAudioDriver::Open(nframes,
int res = JackAudioDriver::Open(buffer_size,
samplerate,
capturing,
playing,


+ 2
- 2
common/JackDummyDriver.h View File

@@ -44,8 +44,8 @@ class JackDummyDriver : public JackAudioDriver
virtual ~JackDummyDriver()
{}

int Open(jack_nframes_t frames_per_cycle,
jack_nframes_t rate,
int Open(jack_nframes_t buffersize,
jack_nframes_t samplerate,
bool capturing,
bool playing,
int chan_in,


+ 2
- 2
common/JackNetDriver.cpp View File

@@ -63,12 +63,12 @@ namespace Jack

//*************************************initialization***********************************************************************

int JackNetDriver::Open ( jack_nframes_t nframes, jack_nframes_t samplerate, bool capturing, bool playing,
int JackNetDriver::Open ( jack_nframes_t buffer_size, jack_nframes_t samplerate, bool capturing, bool playing,
int inchannels, int outchannels, bool monitor,
const char* capture_driver_name, const char* playback_driver_name,
jack_nframes_t capture_latency, jack_nframes_t playback_latency )
{
int res = JackAudioDriver::Open ( nframes, samplerate, capturing, playing, inchannels, outchannels, monitor,
int res = JackAudioDriver::Open ( buffer_size, samplerate, capturing, playing, inchannels, outchannels, monitor,
capture_driver_name, playback_driver_name, capture_latency, playback_latency );
fEngineControl->fPeriod = 0;
fEngineControl->fComputation = 500 * 1000;


+ 0
- 1
common/JackServer.cpp View File

@@ -107,7 +107,6 @@ int JackServer::Open(jack_driver_desc_t* driver_desc, JSList* driver_params)
return -1;
}

// Before engine open
if (fLoopbackDriver->Open(fEngineControl->fBufferSize, fEngineControl->fSampleRate, 1, 1, fLoopback, fLoopback, false, "loopback", "loopback", 0, 0) != 0) {
jack_error("Cannot open driver");
return -1;


+ 2
- 2
common/JackThreadedDriver.cpp View File

@@ -50,7 +50,7 @@ int JackThreadedDriver::Open()
return fDriver->Open();
}

int JackThreadedDriver::Open(jack_nframes_t nframes,
int JackThreadedDriver::Open(jack_nframes_t buffer_size,
jack_nframes_t samplerate,
bool capturing,
bool playing,
@@ -62,7 +62,7 @@ int JackThreadedDriver::Open(jack_nframes_t nframes,
jack_nframes_t capture_latency,
jack_nframes_t playback_latency)
{
return fDriver->Open(nframes, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_name, playback_driver_name, capture_latency, playback_latency);
return fDriver->Open(buffer_size, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_name, playback_driver_name, capture_latency, playback_latency);
}

int JackThreadedDriver::Close()


+ 1
- 1
common/JackThreadedDriver.h View File

@@ -45,7 +45,7 @@ class EXPORT JackThreadedDriver : public JackDriverClientInterface, public JackR
virtual ~JackThreadedDriver();

virtual int Open();
virtual int Open(jack_nframes_t nframes,
virtual int Open(jack_nframes_t buffer_size,
jack_nframes_t samplerate,
bool capturing,
bool playing,


+ 1
- 1
common/Jackdmp.cpp View File

@@ -262,7 +262,7 @@ int main(int argc, char* argv[])
break;

case 'L':
param = jackctl_get_parameter(server_parameters, "loopback ports");
param = jackctl_get_parameter(server_parameters, "loopback-ports");
if (param != NULL) {
value.ui = atoi(optarg);
jackctl_parameter_set_value(param, &value);


+ 2
- 2
linux/alsa/JackAlsaDriver.h View File

@@ -121,7 +121,7 @@ class JackAlsaDriver : public JackAudioDriver
virtual ~JackAlsaDriver()
{}

int Open(jack_nframes_t nframes,
int Open(jack_nframes_t buffer_size,
jack_nframes_t user_nperiods,
jack_nframes_t samplerate,
bool hw_monitoring,
@@ -156,7 +156,7 @@ class JackAlsaDriver : public JackAudioDriver
return false;
}

int SetBufferSize(jack_nframes_t nframes);
int SetBufferSize(jack_nframes_t buffer_size);

// jack api emulation for the midi driver
int is_realtime() const;


+ 2
- 2
macosx/JackCoreAudioAdapter.h View File

@@ -86,11 +86,11 @@ namespace Jack
int outchannels,
int in_nChannels,
int out_nChannels,
jack_nframes_t nframes,
jack_nframes_t buffer_size,
jack_nframes_t samplerate,
bool strict);

int SetupBufferSizeAndSampleRate(jack_nframes_t nframes, jack_nframes_t samplerate);
int SetupBufferSizeAndSampleRate(jack_nframes_t buffer_size, jack_nframes_t samplerate);
int SetupBuffers(int inchannels, int outchannels);
void DisposeBuffers();
void CloseAUHAL();


+ 10
- 10
macosx/JackCoreAudioDriver.cpp View File

@@ -533,7 +533,7 @@ int JackCoreAudioDriver::SetupChannels(bool capturing, bool playing, int& inchan
return 0;
}

int JackCoreAudioDriver::SetupBufferSizeAndSampleRate(jack_nframes_t nframes, jack_nframes_t samplerate)
int JackCoreAudioDriver::SetupBufferSizeAndSampleRate(jack_nframes_t buffer_size, jack_nframes_t samplerate)
{
OSStatus err = noErr;
UInt32 outSize;
@@ -541,9 +541,9 @@ int JackCoreAudioDriver::SetupBufferSizeAndSampleRate(jack_nframes_t nframes, ja

// Setting buffer size
outSize = sizeof(UInt32);
err = AudioDeviceSetProperty(fDeviceID, NULL, 0, false, kAudioDevicePropertyBufferFrameSize, outSize, &nframes);
err = AudioDeviceSetProperty(fDeviceID, NULL, 0, false, kAudioDevicePropertyBufferFrameSize, outSize, &buffer_size);
if (err != noErr) {
jack_error("Cannot set buffer size %ld", nframes);
jack_error("Cannot set buffer size %ld", buffer_size);
printError(err);
return -1;
}
@@ -595,7 +595,7 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
int outchannels,
int in_nChannels,
int out_nChannels,
jack_nframes_t nframes,
jack_nframes_t buffer_size,
jack_nframes_t samplerate,
bool strict)
{
@@ -658,7 +658,7 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,

// Set buffer size
if (capturing && inchannels > 0) {
err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 1, (UInt32*) & nframes, sizeof(UInt32));
err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 1, (UInt32*) & buffer_size, sizeof(UInt32));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_MaximumFramesPerSlice");
printError(err1);
@@ -668,7 +668,7 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
}

if (playing && outchannels > 0) {
err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 0, (UInt32*) & nframes, sizeof(UInt32));
err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global, 0, (UInt32*) & buffer_size, sizeof(UInt32));
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_MaximumFramesPerSlice");
printError(err1);
@@ -871,7 +871,7 @@ void JackCoreAudioDriver::RemoveListeners()
AudioDeviceRemovePropertyListener(fDeviceID, 0, false, kAudioDevicePropertyStreamConfiguration, DeviceNotificationCallback);
}

int JackCoreAudioDriver::Open(jack_nframes_t nframes,
int JackCoreAudioDriver::Open(jack_nframes_t buffer_size,
jack_nframes_t samplerate,
bool capturing,
bool playing,
@@ -905,16 +905,16 @@ int JackCoreAudioDriver::Open(jack_nframes_t nframes,
return -1;

// Generic JackAudioDriver Open
if (JackAudioDriver::Open(nframes, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_name, playback_driver_name, capture_latency, playback_latency) != 0)
if (JackAudioDriver::Open(buffer_size, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_name, playback_driver_name, capture_latency, playback_latency) != 0)
return -1;

if (SetupChannels(capturing, playing, inchannels, outchannels, in_nChannels, out_nChannels, true) < 0)
return -1;

if (SetupBufferSizeAndSampleRate(nframes, samplerate) < 0)
if (SetupBufferSizeAndSampleRate(buffer_size, samplerate) < 0)
return -1;

if (OpenAUHAL(capturing, playing, inchannels, outchannels, in_nChannels, out_nChannels, nframes, samplerate, true) < 0)
if (OpenAUHAL(capturing, playing, inchannels, outchannels, in_nChannels, out_nChannels, buffer_size, samplerate, true) < 0)
goto error;

if (capturing && inchannels > 0)


+ 3
- 3
macosx/JackCoreAudioDriver.h View File

@@ -129,7 +129,7 @@ class JackCoreAudioDriver : public JackAudioDriver
int SetupBuffers(int inchannels, int outchannels);
void DisposeBuffers();

int SetupBufferSizeAndSampleRate(jack_nframes_t nframes, jack_nframes_t samplerate);
int SetupBufferSizeAndSampleRate(jack_nframes_t buffer_size, jack_nframes_t samplerate);

int OpenAUHAL(bool capturing,
bool playing,
@@ -150,8 +150,8 @@ class JackCoreAudioDriver : public JackAudioDriver
JackCoreAudioDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table);
virtual ~JackCoreAudioDriver();

int Open(jack_nframes_t frames_per_cycle,
jack_nframes_t rate,
int Open(jack_nframes_t buffer_size,
jack_nframes_t samplerate,
bool capturing,
bool playing,
int chan_in,


+ 2
- 2
macosx/Jackdmp.xcodeproj/project.pbxproj View File

@@ -1239,7 +1239,7 @@
4B3F49070AD8503300491C6E /* jack_cpu.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = jack_cpu.c; path = ../tests/jack_cpu.c; sourceTree = SOURCE_ROOT; };
4B4259E5076B635E00C1ECE1 /* JackMacEngineRPC.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JackMacEngineRPC.cpp; sourceTree = SOURCE_ROOT; };
4B44FAE50C7598370033A72C /* JackServerLaunch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackServerLaunch.cpp; path = ../common/JackServerLaunch.cpp; sourceTree = SOURCE_ROOT; };
4B464301076CAC7700E5077C /* Jack-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "Jack-Info.plist"; sourceTree = SOURCE_ROOT; };
4B464301076CAC7700E5077C /* Jack-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Jack-Info.plist"; sourceTree = SOURCE_ROOT; };
4B4CA9730E02CF9600F4BFDA /* JackRestartThreadedDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackRestartThreadedDriver.h; path = ../common/JackRestartThreadedDriver.h; sourceTree = SOURCE_ROOT; };
4B4CA9740E02CF9600F4BFDA /* JackRestartThreadedDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackRestartThreadedDriver.cpp; path = ../common/JackRestartThreadedDriver.cpp; sourceTree = SOURCE_ROOT; };
4B4F9C8A0DC20C0400706CB0 /* JackMessageBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackMessageBuffer.cpp; path = ../common/JackMessageBuffer.cpp; sourceTree = SOURCE_ROOT; };
@@ -1349,7 +1349,7 @@
4BD6240C0CBCF16600DE782F /* inprocess.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = inprocess.c; path = "../example-clients/inprocess.c"; sourceTree = SOURCE_ROOT; };
4BE4CBFF0CDA153400CCF5BB /* JackTools.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackTools.cpp; path = ../common/JackTools.cpp; sourceTree = SOURCE_ROOT; };
4BE4CC000CDA153400CCF5BB /* JackTools.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackTools.h; path = ../common/JackTools.h; sourceTree = SOURCE_ROOT; };
4BE50F8F0B01EE8000C05E63 /* Jackwrapper-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Jackwrapper-Info.plist"; sourceTree = "<group>"; };
4BE50F8F0B01EE8000C05E63 /* Jackwrapper-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Jackwrapper-Info.plist"; sourceTree = "<group>"; };
4BE6C6A30A3E096F005A203A /* jack_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_test; sourceTree = BUILT_PRODUCTS_DIR; };
4BE6C6AC0A3E0A65005A203A /* jack_test.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = jack_test.cpp; path = ../tests/jack_test.cpp; sourceTree = SOURCE_ROOT; };
4BE99D300AD7A04800C59091 /* jack_cpu */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_cpu; sourceTree = BUILT_PRODUCTS_DIR; };


+ 3
- 3
windows/JackPortAudioDriver.cpp View File

@@ -72,7 +72,7 @@ namespace Jack
return 0;
}

int JackPortAudioDriver::Open(jack_nframes_t nframes,
int JackPortAudioDriver::Open(jack_nframes_t buffer_size,
jack_nframes_t samplerate,
bool capturing,
bool playing,
@@ -91,10 +91,10 @@ namespace Jack
int out_max = 0;

jack_log("JackPortAudioDriver::Open nframes = %ld in = %ld out = %ld capture name = %s playback name = %s samplerate = %ld",
nframes, inchannels, outchannels, capture_driver_uid, playback_driver_uid, samplerate);
buffer_size, inchannels, outchannels, capture_driver_uid, playback_driver_uid, samplerate);

// Generic JackAudioDriver Open
if (JackAudioDriver::Open(nframes, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_uid, playback_driver_uid, capture_latency, playback_latency) != 0)
if (JackAudioDriver::Open(buffer_size, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_uid, playback_driver_uid, capture_latency, playback_latency) != 0)
{
return -1;
}


+ 2
- 2
windows/JackPortAudioDriver.h View File

@@ -62,8 +62,8 @@ class JackPortAudioDriver : public JackAudioDriver
delete fPaDevices;
}

int Open(jack_nframes_t frames_per_cycle,
jack_nframes_t rate,
int Open(jack_nframes_t buffe_size,
jack_nframes_t samplerate,
bool capturing,
bool playing,
int chan_in,


Loading…
Cancel
Save