summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224>2009-10-30 14:47:29 +0000
committersletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224>2009-10-30 14:47:29 +0000
commit224c41eb59c0a8d547bd7e322b0e1185a1558cde (patch)
tree7ed3b344bfcfbb7df4f9fa42f4aa3c1fa60d3970
parent5d29fcff36b77a02e60b6177e957cdc52cb61ecc (diff)
downloadjack2-224c41eb59c0a8d547bd7e322b0e1185a1558cde.tar.gz
rebase from trunk 3638:3684
git-svn-id: http://subversion.jackaudio.org/jack/jack2/branches/libjacknet@3685 0c269be4-1314-0410-8aa9-9f06e86f4224
-rw-r--r--ChangeLog91
-rw-r--r--common/JackAPI.cpp16
-rw-r--r--common/JackAudioAdapterInterface.cpp12
-rw-r--r--common/JackChannel.h2
-rw-r--r--common/JackClient.cpp37
-rw-r--r--common/JackClient.h7
-rw-r--r--common/JackClientInterface.h2
-rw-r--r--common/JackConstants.h3
-rw-r--r--common/JackDebugClient.cpp10
-rw-r--r--common/JackDebugClient.h3
-rw-r--r--common/JackDriver.cpp21
-rw-r--r--common/JackDriver.h3
-rw-r--r--common/JackDriverLoader.cpp2
-rw-r--r--common/JackEngine.cpp51
-rw-r--r--common/JackEngine.h8
-rw-r--r--common/JackError.cpp4
-rw-r--r--common/JackError.h2
-rw-r--r--common/JackExternalClient.cpp4
-rw-r--r--common/JackExternalClient.h2
-rw-r--r--common/JackGlobals.cpp2
-rw-r--r--common/JackGlobals.h4
-rw-r--r--common/JackInternalClientChannel.h4
-rw-r--r--common/JackLibClient.cpp4
-rw-r--r--common/JackLibClient.h2
-rw-r--r--common/JackLockedEngine.h10
-rw-r--r--common/JackMessageBuffer.cpp17
-rw-r--r--common/JackMessageBuffer.h5
-rw-r--r--common/JackNetDriver.cpp32
-rw-r--r--common/JackNetDriver.h7
-rw-r--r--common/JackNetManager.cpp7
-rw-r--r--common/JackNetTool.cpp2
-rw-r--r--common/JackNotification.h1
-rw-r--r--common/JackRequest.h16
-rw-r--r--common/JackServer.cpp13
-rw-r--r--common/JackServerGlobals.cpp1
-rw-r--r--common/JackServerGlobals.h3
-rw-r--r--common/JackThreadedDriver.cpp4
-rw-r--r--common/JackThreadedDriver.h2
-rw-r--r--common/Jackdmp.cpp30
-rw-r--r--common/jack/jack.h23
-rw-r--r--common/jack/types.h24
-rw-r--r--common/memops.c29
-rw-r--r--dbus/controller_iface_control.c4
-rw-r--r--macosx/JackMacEngineRPC.cpp10
-rw-r--r--macosx/JackMacLibClientRPC.cpp12
-rw-r--r--macosx/JackMachClientChannel.cpp4
-rw-r--r--macosx/JackMachClientChannel.h2
-rw-r--r--macosx/JackMachNotifyChannel.cpp6
-rw-r--r--macosx/JackMachNotifyChannel.h2
-rw-r--r--macosx/JackMachServerChannel.cpp20
-rw-r--r--macosx/JackMachServerChannel.h5
-rw-r--r--macosx/Jackdmp.xcodeproj/project.pbxproj327
-rw-r--r--macosx/RPC/JackRPCClient.defs6
-rw-r--r--macosx/RPC/JackRPCClient.h6
-rw-r--r--macosx/RPC/JackRPCClientServer.c214
-rw-r--r--macosx/RPC/JackRPCClientUser.c41
-rw-r--r--macosx/RPC/JackRPCEngine.defs6
-rw-r--r--macosx/RPC/JackRPCEngine.h2
-rw-r--r--macosx/RPC/JackRPCEngineServer.c221
-rw-r--r--macosx/RPC/JackRPCEngineUser.c74
-rw-r--r--macosx/RPC/Jackdefs.h3
-rw-r--r--macosx/coreaudio/JackCoreAudioAdapter.cpp620
-rw-r--r--macosx/coreaudio/JackCoreAudioAdapter.h21
-rw-r--r--macosx/coreaudio/JackCoreAudioDriver.cpp675
-rw-r--r--macosx/coreaudio/JackCoreAudioDriver.h28
-rw-r--r--posix/JackPosixMutex.h41
-rw-r--r--posix/JackPosixThread.cpp4
-rw-r--r--posix/JackProcessSync.cpp25
-rw-r--r--posix/JackProcessSync.h6
-rw-r--r--posix/JackSocketClientChannel.cpp6
-rw-r--r--posix/JackSocketClientChannel.h2
-rw-r--r--posix/JackSocketNotifyChannel.cpp4
-rw-r--r--posix/JackSocketNotifyChannel.h2
-rw-r--r--posix/JackSocketServerChannel.cpp38
-rw-r--r--posix/JackSocketServerChannel.h6
-rw-r--r--tests/test.cpp7
-rw-r--r--windows/JackWinNamedPipeClientChannel.cpp6
-rw-r--r--windows/JackWinNamedPipeClientChannel.h2
-rw-r--r--windows/JackWinNamedPipeNotifyChannel.cpp4
-rw-r--r--windows/JackWinNamedPipeNotifyChannel.h2
-rw-r--r--windows/JackWinNamedPipeServerChannel.cpp57
-rw-r--r--windows/JackWinNamedPipeServerChannel.h12
-rw-r--r--windows/Setup/src/README10
-rw-r--r--wscript2
84 files changed, 2001 insertions, 1066 deletions
diff --git a/ChangeLog b/ChangeLog
index c6f6ec3f..f5aed4c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,35 +25,98 @@ Paul Davis
Jackdmp changes log
---------------------------
-2009-08-28 Stephane Letz <letz@grame.fr>
+2009-10-30 Stephane Letz <letz@grame.fr>
- * Correct monitor port naming in JackAudioDriver and JackCoreAudioDriver.
- * Big endian bug fix in memops.c (http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=11_be24bit.patch;att=1;bug=486308)
+ * In JackCoreAudioDriver, improve management of input/output channels: -1 is now used internally to indicate a wanted max value.
+ * In JackCoreAudioDriver::OpenAUHAL, correct stream format setup and cleanup.
+ * Correct crash bug in JackAudioAdapterInterface when not input is used in adapter (temporary fix...)
+ * Sync JackCoreAudioAdapter code on JackCoreAudioDriver one.
+ * JACK_SCHED_POLICY switched to SCHED_FIFO.
-2009-07-31 Stephane Letz <letz@grame.fr>
+2009-10-29 Stephane Letz <letz@grame.fr>
- * Use SNDCTL_DSP_SYNCGROUP/SNDCTL_DSP_SYNCSTART API to synchronize input and output in Solaris boomer backend.
+ * In JackCoreAudioDriver::Start, wait for the audio driver to effectively start (use the MeasureCallback).
+2009-10-28 Stephane Letz <letz@grame.fr>
+
+ * In JackCoreAudioDriver, force the SR value to the wanted one *before* creating aggregate device (otherwise creation will fail).
+ * In JackCoreAudioDriver, better cleanup of AD when intermediate open failure.
-2009-07-29 Stephane Letz <letz@grame.fr>
+2009-10-27 Stephane Letz <letz@grame.fr>
- * Add a -G parameter in CoreAudio backend (the computation value in RT thread expressed as percent of period).
+ * Dynamic system version detection in JackCoreAudioDriver to either create public or private aggregate device.
-2009-07-28 Stephane Letz <letz@grame.fr>
+2009-10-26 Stephane Letz <letz@grame.fr>
- * Fix CopyAndConvertIn for Solaris backends.
+ * Implement "hog mode" (exclusive access of the audio device) in JackCoreAudioDriver.
+ * Fix jack_set_sample_rate_callback to have he same behavior as in JACK1.
+2009-10-25 Stephane Letz <letz@grame.fr>
+
+ * Improve aggregate device management in JackCoreAudioDriver : now a "private" device only and cleanup properly.
+ * Aggregate device code added to JackCoreAudioAdapter.
+
+2009-10-23 Stephane Letz <letz@grame.fr>
+
+ * Correct JackProcessSync::LockedTimedWait.
+ * Correct JACK_MESSAGE_SIZE value, particularly in OSX RPC code.
+ * Now start server channel thread only when backend has been started (so in JackServer::Start). Should solve race conditions at start time.
+ * jack_verbose moved to JackGlobals class.
+
+2009-10-22 Stephane Letz <letz@grame.fr>
+
+ * Correct jackdmp.cpp (failures case were not correct..). Improve JackCoreAudioDriver code. Raise default port number to 2048.
+
+2009-10-20 Stephane Letz <letz@grame.fr>
+
+ * Add a string parameter to server ==> client notification, add a new JackInfoShutdownCallback type.
+ * CoreAudio backend now issue a JackInfoShutdownCallback when an unrecoverable error is detected (sampling rate change, stream configuration changeÉ)
+
+2009-10-17 Stephane Letz <letz@grame.fr>
+
+ * Correct server temporary mode : now set a global and quit after server/client message handling is finished.
+
+2009-10-15 Stephane Letz <letz@grame.fr>
+
+ * Change CoreAudio notification thread setup for OSX Snow Leopard.
+
+2009-09-18 Stephane Letz <letz@grame.fr>
+
+ * Simplify transport in NetJack2: master only can control transport.
+
+2009-09-15 Stephane Letz <letz@grame.fr>
+
+ * Correct CPU timing in JackNetDriver, now take cycle begin time after Read.
+ * Fix issues in JackNetDriver::DecodeTransportData and JackNetDriver::Initialize.
+
+2009-08-28 Stephane Letz <letz@grame.fr>
+
+ * Correct monitor port naming in JackAudioDriver and JackCoreAudioDriver.
+ * Big endian bug fix in memops.c (http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=11_be24bit.patch;att=1;bug=486308)
+
+2009-07-31 Stephane Letz <letz@grame.fr>
+
+ * Use SNDCTL_DSP_SYNCGROUP/SNDCTL_DSP_SYNCSTART API to synchronize input and output in Solaris boomer backend.
+
+2009-07-29 Stephane Letz <letz@grame.fr>
+
+ * Add a -G parameter in CoreAudio backend (the computation value in RT thread expressed as percent of period).
+
+2009-07-28 Stephane Letz <letz@grame.fr>
+
+ * Fix CopyAndConvertIn for Solaris backends.
+
2009-07-22 Stephane Letz <letz@grame.fr>
- * Version 1.9.4 started.
- * Solaris boomer backend now working in capture or playback only mode.
+ * Version 1.9.4 started.
+ * Solaris boomer backend now working in capture or playback only mode.
* Fix control.h for proper compilation on Solaris.
-
+
2009-07-17 Stephane Letz <letz@grame.fr>
- * Loopback backend reborn as a dynamically loadable separated backend.
+ * Loopback backend reborn as a dynamically loadable separated backend.
* -L parameter for loopback backend activated again in jackd.
-
+
2009-07-17 Stephane Letz <letz@grame.fr>
* Big rewrite of Solaris boomer driver, seems to work in duplex mode at least.
diff --git a/common/JackAPI.cpp b/common/JackAPI.cpp
index d609a915..34e591e4 100644
--- a/common/JackAPI.cpp
+++ b/common/JackAPI.cpp
@@ -72,6 +72,8 @@ extern "C"
EXPORT int jack_is_realtime (jack_client_t *client);
EXPORT void jack_on_shutdown (jack_client_t *client,
JackShutdownCallback shutdown_callback, void *arg);
+ EXPORT void jack_on_info_shutdown (jack_client_t *client,
+ JackInfoShutdownCallback shutdown_callback, void *arg);
EXPORT int jack_set_process_callback (jack_client_t *client,
JackProcessCallback process_callback,
void *arg);
@@ -812,6 +814,7 @@ EXPORT void jack_on_shutdown(jack_client_t* ext_client, JackShutdownCallback cal
JackLibGlobals::CheckContext();
#endif
JackClient* client = (JackClient*)ext_client;
+ jack_error("jack_on_shutdown: deprecated, use jack_on_info_shutdown");
if (client == NULL) {
jack_error("jack_on_shutdown called with a NULL client");
} else {
@@ -819,6 +822,19 @@ EXPORT void jack_on_shutdown(jack_client_t* ext_client, JackShutdownCallback cal
}
}
+EXPORT void jack_on_info_shutdown(jack_client_t* ext_client, JackInfoShutdownCallback callback, void* arg)
+{
+#ifdef __CLIENTDEBUG__
+ JackLibGlobals::CheckContext();
+#endif
+ JackClient* client = (JackClient*)ext_client;
+ if (client == NULL) {
+ jack_error("jack_on_info_shutdown called with a NULL client");
+ } else {
+ client->OnInfoShutdown(callback, arg);
+ }
+}
+
EXPORT int jack_set_process_callback(jack_client_t* ext_client, JackProcessCallback callback, void* arg)
{
#ifdef __CLIENTDEBUG__
diff --git a/common/JackAudioAdapterInterface.cpp b/common/JackAudioAdapterInterface.cpp
index ece82fc7..a347ca12 100644
--- a/common/JackAudioAdapterInterface.cpp
+++ b/common/JackAudioAdapterInterface.cpp
@@ -240,10 +240,18 @@ namespace Jack
// Finer estimation of the position in the ringbuffer
int delta_frames = (fPullAndPushTime > 0) ? (int)((float(long(GetMicroSeconds() - fPullAndPushTime)) * float(fAdaptedSampleRate)) / 1000000.f) : 0;
- double ratio = fPIControler.GetRatio(fCaptureRingBuffer[0]->GetError() - delta_frames);
+
+ double ratio = 1;
+
+ // TODO : done like this just to avoid crash when input only or output only...
+ if (fCaptureChannels > 0)
+ ratio = fPIControler.GetRatio(fCaptureRingBuffer[0]->GetError() - delta_frames);
+ else if (fPlaybackChannels > 0)
+ ratio = fPIControler.GetRatio(fPlaybackRingBuffer[0]->GetError() - delta_frames);
#ifdef JACK_MONITOR
- fTable.Write(fCaptureRingBuffer[0]->GetError(), fCaptureRingBuffer[0]->GetError() - delta_frames, ratio, 1/ratio, fCaptureRingBuffer[0]->ReadSpace(), fCaptureRingBuffer[0]->ReadSpace());
+ if (fCaptureRingBuffer[0] != NULL)
+ fTable.Write(fCaptureRingBuffer[0]->GetError(), fCaptureRingBuffer[0]->GetError() - delta_frames, ratio, 1/ratio, fCaptureRingBuffer[0]->ReadSpace(), fCaptureRingBuffer[0]->ReadSpace());
#endif
// Push/pull from ringbuffer
diff --git a/common/JackChannel.h b/common/JackChannel.h
index 654887ed..655e2bcf 100644
--- a/common/JackChannel.h
+++ b/common/JackChannel.h
@@ -82,7 +82,7 @@ class JackClientChannelInterface
virtual void ClientClose(int refnum, int* result)
{}
- virtual void ClientActivate(int refnum, int state, int* result)
+ virtual void ClientActivate(int refnum, int is_real_time, int* result)
{}
virtual void ClientDeactivate(int refnum, int* result)
{}
diff --git a/common/JackClient.cpp b/common/JackClient.cpp
index 75beefbc..7cfb50ef 100644
--- a/common/JackClient.cpp
+++ b/common/JackClient.cpp
@@ -49,6 +49,7 @@ JackClient::JackClient(JackSynchro* table):fThread(this)
fGraphOrder = NULL;
fXrun = NULL;
fShutdown = NULL;
+ fInfoShutdown = NULL;
fInit = NULL;
fBufferSize = NULL;
fClientRegistration = NULL;
@@ -63,6 +64,7 @@ JackClient::JackClient(JackSynchro* table):fThread(this)
fGraphOrderArg = NULL;
fXrunArg = NULL;
fShutdownArg = NULL;
+ fInfoShutdownArg = NULL;
fInitArg = NULL;
fBufferSizeArg = NULL;
fFreewheelArg = NULL;
@@ -132,12 +134,12 @@ void JackClient::SetupDriverSync(bool freewheel)
\brief Notification received from the server.
*/
-int JackClient::ClientNotifyImp(int refnum, const char* name, int notify, int sync, int value1, int value2)
+int JackClient::ClientNotifyImp(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
{
return 0;
}
-int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2)
+int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
{
int res = 0;
@@ -145,11 +147,11 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
switch (notify) {
case kAddClient:
- res = ClientNotifyImp(refnum, name, notify, sync, value1, value2);
+ res = ClientNotifyImp(refnum, name, notify, sync, message, value1, value2);
break;
case kRemoveClient:
- res = ClientNotifyImp(refnum, name, notify, sync, value1, value2);
+ res = ClientNotifyImp(refnum, name, notify, sync, message, value1, value2);
break;
case kActivateClient:
@@ -247,6 +249,14 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
if (fXrun)
res = fXrun(fXrunArg);
break;
+
+ case kShutDownCallback:
+ jack_log("JackClient::kShutDownCallback");
+ if (fInfoShutdown) {
+ fInfoShutdown(value1, message, fInfoShutdownArg);
+ fInfoShutdown = NULL;
+ }
+ break;
}
}
@@ -582,7 +592,10 @@ void JackClient::ShutDown()
jack_log("ShutDown");
JackGlobals::fServerRunning = false;
- if (fShutdown) {
+ if (fInfoShutdown) {
+ fInfoShutdown(JackFailure, "JACK server has been closed", fInfoShutdownArg);
+ fInfoShutdown = NULL;
+ } else if (fShutdown) {
fShutdown(fShutdownArg);
fShutdown = NULL;
}
@@ -772,6 +785,17 @@ void JackClient::OnShutdown(JackShutdownCallback callback, void *arg)
fShutdown = callback;
}
}
+
+void JackClient::OnInfoShutdown(JackInfoShutdownCallback callback, void *arg)
+{
+ if (IsActive()) {
+ jack_error("You cannot set callbacks on an active client");
+ } else {
+ GetClientControl()->fCallback[kShutDownCallback] = (callback != NULL);
+ fInfoShutdownArg = arg;
+ fInfoShutdown = callback;
+ }
+}
int JackClient::SetProcessCallback(JackProcessCallback callback, void *arg)
{
@@ -850,6 +874,9 @@ int JackClient::SetSampleRateCallback(JackSampleRateCallback callback, void *arg
GetClientControl()->fCallback[kSampleRateCallback] = (callback != NULL);
fSampleRateArg = arg;
fSampleRate = callback;
+ // Now invoke it
+ if (callback)
+ callback(GetEngineControl()->fSampleRate, arg);
return 0;
}
}
diff --git a/common/JackClient.h b/common/JackClient.h
index 73ee17fc..215098a0 100644
--- a/common/JackClient.h
+++ b/common/JackClient.h
@@ -54,6 +54,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface
JackGraphOrderCallback fGraphOrder;
JackXRunCallback fXrun;
JackShutdownCallback fShutdown;
+ JackInfoShutdownCallback fInfoShutdown;
JackThreadInitCallback fInit;
JackBufferSizeCallback fBufferSize;
JackSampleRateCallback fSampleRate;
@@ -70,6 +71,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface
void* fGraphOrderArg;
void* fXrunArg;
void* fShutdownArg;
+ void* fInfoShutdownArg;
void* fInitArg;
void* fBufferSizeArg;
void* fSampleRateArg;
@@ -95,7 +97,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface
void CallSyncCallback();
void CallTimebaseCallback();
- virtual int ClientNotifyImp(int refnum, const char* name, int notify, int sync, int value1, int value);
+ virtual int ClientNotifyImp(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value);
inline void DummyCycle();
inline void ExecuteThread();
@@ -123,7 +125,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface
virtual JackEngineControl* GetEngineControl() const = 0;
// Notifications
- virtual int ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2);
+ virtual int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);
virtual int Activate();
virtual int Deactivate();
@@ -159,6 +161,7 @@ class JackClient : public JackClientInterface, public JackRunnableInterface
// Callbacks
virtual void OnShutdown(JackShutdownCallback callback, void *arg);
+ virtual void OnInfoShutdown(JackInfoShutdownCallback callback, void *arg);
virtual int SetProcessCallback(JackProcessCallback callback, void* arg);
virtual int SetXRunCallback(JackXRunCallback callback, void* arg);
virtual int SetInitCallback(JackThreadInitCallback callback, void* arg);
diff --git a/common/JackClientInterface.h b/common/JackClientInterface.h
index 1794328c..bd94ed38 100644
--- a/common/JackClientInterface.h
+++ b/common/JackClientInterface.h
@@ -44,7 +44,7 @@ class SERVER_EXPORT JackClientInterface
virtual int Close() = 0;
- virtual int ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2) = 0;
+ virtual int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2) = 0;
virtual JackClientControl* GetClientControl() const = 0;
};
diff --git a/common/JackConstants.h b/common/JackConstants.h
index 709aa364..00a0be99 100644
--- a/common/JackConstants.h
+++ b/common/JackConstants.h
@@ -32,9 +32,10 @@
#define JACK_PORT_TYPE_SIZE 32
#define JACK_CLIENT_NAME_SIZE 64
+#define JACK_MESSAGE_SIZE 256
#ifndef PORT_NUM
-#define PORT_NUM 1024
+#define PORT_NUM 2048
#endif
#define DRIVER_PORT_NUM 256
diff --git a/common/JackDebugClient.cpp b/common/JackDebugClient.cpp
index 74566c5e..a2a61d8d 100644
--- a/common/JackDebugClient.cpp
+++ b/common/JackDebugClient.cpp
@@ -139,10 +139,10 @@ JackEngineControl* JackDebugClient::GetEngineControl() const
\brief Notification received from the server.
*/
-int JackDebugClient::ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2)
+int JackDebugClient::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
{
CheckClient();
- return fClient->ClientNotify( refnum, name, notify, sync, value1, value2);
+ return fClient->ClientNotify( refnum, name, notify, sync, message, value1, value2);
}
int JackDebugClient::Activate()
@@ -416,6 +416,12 @@ void JackDebugClient::OnShutdown(JackShutdownCallback callback, void *arg)
fClient->OnShutdown(callback, arg);
}
+void JackDebugClient::OnInfoShutdown(JackInfoShutdownCallback callback, void *arg)
+{
+ CheckClient();
+ fClient->OnInfoShutdown(callback, arg);
+}
+
int JackDebugClient::TimeCallback(jack_nframes_t nframes, void *arg)
{
JackDebugClient* client = (JackDebugClient*)arg;
diff --git a/common/JackDebugClient.h b/common/JackDebugClient.h
index 430c9610..0bb21b20 100644
--- a/common/JackDebugClient.h
+++ b/common/JackDebugClient.h
@@ -75,7 +75,7 @@ class JackDebugClient : public JackClient
virtual JackEngineControl* GetEngineControl() const;
// Notifications
- int ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2);
+ int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);
int Activate();
int Deactivate();
@@ -110,6 +110,7 @@ class JackDebugClient : public JackClient
// Callbacks
void OnShutdown(JackShutdownCallback callback, void *arg);
+ void OnInfoShutdown(JackInfoShutdownCallback callback, void *arg);
int SetProcessCallback(JackProcessCallback callback, void* arg);
int SetXRunCallback(JackXRunCallback callback, void* arg);
int SetInitCallback(JackThreadInitCallback callback, void* arg);
diff --git a/common/JackDriver.cpp b/common/JackDriver.cpp
index 9fde4917..bab5db0f 100644
--- a/common/JackDriver.cpp
+++ b/common/JackDriver.cpp
@@ -167,11 +167,15 @@ int JackDriver::Open(jack_nframes_t buffer_size,
int JackDriver::Close()
{
- jack_log("JackDriver::Close");
- fGraphManager->DirectDisconnect(fClientControl.fRefNum, fClientControl.fRefNum); // Disconnect driver from itself for sync
- fClientControl.fActive = false;
- fEngineControl->fDriverNum--;
- return fEngine->ClientInternalClose(fClientControl.fRefNum, false);
+ if (fClientControl.fRefNum > 0) {
+ jack_log("JackDriver::Close");
+ fGraphManager->DirectDisconnect(fClientControl.fRefNum, fClientControl.fRefNum); // Disconnect driver from itself for sync
+ fClientControl.fActive = false;
+ fEngineControl->fDriverNum--;
+ return fEngine->ClientInternalClose(fClientControl.fRefNum, false);
+ } else {
+ return -1;
+ }
}
/*!
@@ -190,7 +194,7 @@ void JackDriver::SetupDriverSync(int ref, bool freewheel)
}
}
-int JackDriver::ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2)
+int JackDriver::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
{
switch (notify) {
@@ -250,6 +254,11 @@ void JackDriver::NotifySampleRate(jack_nframes_t sample_rate)
fEngine->NotifySampleRate(sample_rate);
fEngineControl->InitFrameTime();
}
+
+void JackDriver::NotifyFailure(int code, const char* reason)
+{
+ fEngine->NotifyFailure(code, reason);
+}
void JackDriver::SetMaster(bool onoff)
{
diff --git a/common/JackDriver.h b/common/JackDriver.h
index 6b80dc33..83f7e250 100644
--- a/common/JackDriver.h
+++ b/common/JackDriver.h
@@ -140,6 +140,7 @@ class SERVER_EXPORT JackDriver : public JackDriverClientInterface
void NotifyXRun(jack_time_t callback_usecs, float delayed_usecs); // XRun notification sent by the driver
void NotifyBufferSize(jack_nframes_t buffer_size); // BufferSize notification sent by the driver
void NotifySampleRate(jack_nframes_t sample_rate); // SampleRate notification sent by the driver
+ void NotifyFailure(int code, const char* reason); // Failure notification sent by the driver
public:
@@ -199,7 +200,7 @@ class SERVER_EXPORT JackDriver : public JackDriverClientInterface
virtual int SetBufferSize(jack_nframes_t buffer_size);
virtual int SetSampleRate(jack_nframes_t sample_rate);
- virtual int ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2);
+ virtual int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);
virtual JackClientControl* GetClientControl() const;
virtual bool IsRealTime() const;
diff --git a/common/JackDriverLoader.cpp b/common/JackDriverLoader.cpp
index 52c4aeed..428d3ab0 100644
--- a/common/JackDriverLoader.cpp
+++ b/common/JackDriverLoader.cpp
@@ -62,7 +62,7 @@ SERVER_EXPORT void jack_print_driver_options (jack_driver_desc_t* desc, FILE* fi
fprintf (file, "\t-%c, --%s \t%s (default: %s)\n",
desc->params[i].character,
desc->params[i].name,
- desc->params[i].short_desc,
+ desc->params[i].long_desc,
arg_default);
}
}
diff --git a/common/JackEngine.cpp b/common/JackEngine.cpp
index 20b8f16b..83a22ad4 100644
--- a/common/JackEngine.cpp
+++ b/common/JackEngine.cpp
@@ -119,9 +119,7 @@ void JackEngine::ReleaseRefnum(int ref)
// last client and temporay case: quit the server
jack_log("JackEngine::ReleaseRefnum server quit");
fEngineControl->fTemporary = false;
-#ifndef WIN32
- exit(0);
-#endif
+ JackServerGlobals::fKilled = true;
}
}
}
@@ -205,7 +203,7 @@ void JackEngine::CheckXRun(jack_time_t callback_usecs) // REVOIR les conditions
// Notifications
//---------------
-void JackEngine::NotifyClient(int refnum, int event, int sync, int value1, int value2)
+void JackEngine::NotifyClient(int refnum, int event, int sync, const char* message, int value1, int value2)
{
JackClientInterface* client = fClientTable[refnum];
@@ -213,20 +211,20 @@ void JackEngine::NotifyClient(int refnum, int event, int sync, int value1, int v
if (!client) {
jack_log("JackEngine::NotifyClient: client not available anymore");
} else if (client->GetClientControl()->fCallback[event]) {
- if (client->ClientNotify(refnum, client->GetClientControl()->fName, event, sync, value1, value2) < 0)
+ if (client->ClientNotify(refnum, client->GetClientControl()->fName, event, sync, message, value1, value2) < 0)
jack_error("NotifyClient fails name = %s event = %ld val1 = %ld val2 = %ld", client->GetClientControl()->fName, event, value1, value2);
} else {
jack_log("JackEngine::NotifyClient: no callback for event = %ld", event);
}
}
-void JackEngine::NotifyClients(int event, int sync, int value1, int value2)
+void JackEngine::NotifyClients(int event, int sync, const char* message, int value1, int value2)
{
for (int i = 0; i < CLIENT_NUM; i++) {
JackClientInterface* client = fClientTable[i];
if (client) {
if (client->GetClientControl()->fCallback[event]) {
- if (client->ClientNotify(i, client->GetClientControl()->fName, event, sync, value1, value2) < 0)
+ if (client->ClientNotify(i, client->GetClientControl()->fName, event, sync, message, value1, value2) < 0)
jack_error("NotifyClient fails name = %s event = %ld val1 = %ld val2 = %ld", client->GetClientControl()->fName, event, value1, value2);
} else {
jack_log("JackEngine::NotifyClients: no callback for event = %ld", event);
@@ -242,11 +240,11 @@ int JackEngine::NotifyAddClient(JackClientInterface* new_client, const char* nam
for (int i = 0; i < CLIENT_NUM; i++) {
JackClientInterface* old_client = fClientTable[i];
if (old_client) {
- if (old_client->ClientNotify(refnum, name, kAddClient, true, 0, 0) < 0) {
+ if (old_client->ClientNotify(refnum, name, kAddClient, true, "", 0, 0) < 0) {
jack_error("NotifyAddClient old_client fails name = %s", old_client->GetClientControl()->fName);
return -1;
}
- if (new_client->ClientNotify(i, old_client->GetClientControl()->fName, kAddClient, true, 0, 0) < 0) {
+ if (new_client->ClientNotify(i, old_client->GetClientControl()->fName, kAddClient, true, "", 0, 0) < 0) {
jack_error("NotifyAddClient new_client fails name = %s", name);
return -1;
}
@@ -262,7 +260,7 @@ void JackEngine::NotifyRemoveClient(const char* name, int refnum)
for (int i = 0; i < CLIENT_NUM; i++) {
JackClientInterface* client = fClientTable[i];
if (client) {
- client->ClientNotify(refnum, name, kRemoveClient, true, 0, 0);
+ client->ClientNotify(refnum, name, kRemoveClient, true, "",0, 0);
}
}
}
@@ -279,51 +277,56 @@ void JackEngine::NotifyXRun(jack_time_t callback_usecs, float delayed_usecs)
void JackEngine::NotifyXRun(int refnum)
{
if (refnum == ALL_CLIENTS) {
- NotifyClients(kXRunCallback, false, 0, 0);
+ NotifyClients(kXRunCallback, false, "", 0, 0);
} else {
- NotifyClient(refnum, kXRunCallback, false, 0, 0);
+ NotifyClient(refnum, kXRunCallback, false, "", 0, 0);
}
}
void JackEngine::NotifyGraphReorder()
{
- NotifyClients(kGraphOrderCallback, false, 0, 0);
+ NotifyClients(kGraphOrderCallback, false, "", 0, 0);
}
void JackEngine::NotifyBufferSize(jack_nframes_t buffer_size)
{
- NotifyClients(kBufferSizeCallback, true, buffer_size, 0);
+ NotifyClients(kBufferSizeCallback, true, "", buffer_size, 0);
}
void JackEngine::NotifySampleRate(jack_nframes_t sample_rate)
{
- NotifyClients(kSampleRateCallback, true, sample_rate, 0);
+ NotifyClients(kSampleRateCallback, true, "", sample_rate, 0);
}
+void JackEngine::NotifyFailure(int code, const char* reason)
+{
+ NotifyClients(kShutDownCallback, false, reason, code, 0);
+}
+
void JackEngine::NotifyFreewheel(bool onoff)
{
fEngineControl->fRealTime = !onoff;
- NotifyClients((onoff ? kStartFreewheelCallback : kStopFreewheelCallback), true, 0, 0);
+ NotifyClients((onoff ? kStartFreewheelCallback : kStopFreewheelCallback), true, "", 0, 0);
}
void JackEngine::NotifyPortRegistation(jack_port_id_t port_index, bool onoff)
{
- NotifyClients((onoff ? kPortRegistrationOnCallback : kPortRegistrationOffCallback), false, port_index, 0);
+ NotifyClients((onoff ? kPortRegistrationOnCallback : kPortRegistrationOffCallback), false, "", port_index, 0);
}
void JackEngine::NotifyPortRename(jack_port_id_t port)
{
- NotifyClients(kPortRenameCallback, false, port, 0);
+ NotifyClients(kPortRenameCallback, false, "", port, 0);
}
void JackEngine::NotifyPortConnect(jack_port_id_t src, jack_port_id_t dst, bool onoff)
{
- NotifyClients((onoff ? kPortConnectCallback : kPortDisconnectCallback), false, src, dst);
+ NotifyClients((onoff ? kPortConnectCallback : kPortDisconnectCallback), false, "", src, dst);
}
void JackEngine::NotifyActivate(int refnum)
{
- NotifyClient(refnum, kActivateClient, true, 0, 0);
+ NotifyClient(refnum, kActivateClient, true, "", 0, 0);
}
//----------------------------
@@ -481,7 +484,7 @@ int JackEngine::GetClientRefNum(const char* name)
// Used for external clients
int JackEngine::ClientExternalOpen(const char* name, int pid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
{
- jack_log("JackEngine::ClientOpen: name = %s ", name);
+ jack_log("JackEngine::ClientExternalOpen: name = %s ", name);
int refnum = AllocateRefnum();
if (refnum < 0) {
@@ -533,7 +536,7 @@ error:
// Used for server driver clients
int JackEngine::ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait)
{
- jack_log("JackEngine::ClientInternalNew: name = %s", name);
+ jack_log("JackEngine::ClientInternalOpen: name = %s", name);
int refnum = AllocateRefnum();
if (refnum < 0) {
@@ -638,14 +641,14 @@ int JackEngine::ClientCloseAux(int refnum, JackClientInterface* client, bool wai
return 0;
}
-int JackEngine::ClientActivate(int refnum, bool state)
+int JackEngine::ClientActivate(int refnum, bool is_real_time)
{
AssertRefnum(refnum);
JackClientInterface* client = fClientTable[refnum];
assert(fClientTable[refnum]);
jack_log("JackEngine::ClientActivate ref = %ld name = %s", refnum, client->GetClientControl()->fName);
- if (state)
+ if (is_real_time)
fGraphManager->Activate(refnum);
// Wait for graph state change to be effective
diff --git a/common/JackEngine.h b/common/JackEngine.h
index 9ec65124..8212daf9 100644
--- a/common/JackEngine.h
+++ b/common/JackEngine.h
@@ -64,8 +64,9 @@ class SERVER_EXPORT JackEngine
int AllocateRefnum();
void ReleaseRefnum(int ref);
- void NotifyClient(int refnum, int event, int sync, int value1, int value2);
- void NotifyClients(int event, int sync, int value1, int value2);
+ void NotifyClient(int refnum, int event, int sync, const char* message, int value1, int value2);
+ void NotifyClients(int event, int sync, const char* message, int value1, int value2);
+
void NotifyPortRegistation(jack_port_id_t port_index, bool onoff);
void NotifyPortConnect(jack_port_id_t src, jack_port_id_t dst, bool onoff);
void NotifyPortRename(jack_port_id_t src);
@@ -87,7 +88,7 @@ class SERVER_EXPORT JackEngine
int ClientExternalClose(int refnum);
int ClientInternalClose(int refnum, bool wait);
- int ClientActivate(int refnum, bool state);
+ int ClientActivate(int refnum, bool is_real_time);
int ClientDeactivate(int refnum);
int GetClientPID(const char* name);
@@ -115,6 +116,7 @@ class SERVER_EXPORT JackEngine
// Notifications
void NotifyXRun(jack_time_t callback_usecs, float delayed_usecs);
+ void NotifyFailure(int code, const char* reason);
void NotifyXRun(int refnum);
void NotifyGraphReorder();
void NotifyBufferSize(jack_nframes_t buffer_size);
diff --git a/common/JackError.cpp b/common/JackError.cpp
index aad72327..3705c35c 100644
--- a/common/JackError.cpp
+++ b/common/JackError.cpp
@@ -25,8 +25,6 @@
#include "JackGlobals.h"
#include "JackMessageBuffer.h"
-int jack_verbose = 0;
-
using namespace Jack;
void change_thread_log_function(jack_log_function_t log_function)
@@ -110,7 +108,7 @@ SERVER_EXPORT void jack_info(const char *fmt, ...)
SERVER_EXPORT void jack_log(const char *fmt,...)
{
- if (jack_verbose) {
+ if (JackGlobals::fVerbose) {
va_list ap;
va_start(ap, fmt);
jack_format_and_log(LOG_LEVEL_INFO, "Jack: ", fmt, ap);
diff --git a/common/JackError.h b/common/JackError.h
index fca6ec30..403c55ae 100644
--- a/common/JackError.h
+++ b/common/JackError.h
@@ -58,8 +58,6 @@ extern "C"
void jack_log_function(int level, const char *message);
SERVER_EXPORT void set_threaded_log_function();
-
- extern int jack_verbose;
#ifdef __cplusplus
}
diff --git a/common/JackExternalClient.cpp b/common/JackExternalClient.cpp
index c86f1d17..4d56557b 100644
--- a/common/JackExternalClient.cpp
+++ b/common/JackExternalClient.cpp
@@ -33,11 +33,11 @@ JackExternalClient::JackExternalClient(): fClientControl(NULL)
JackExternalClient::~JackExternalClient()
{}
-int JackExternalClient::ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2)
+int JackExternalClient::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
{
int result = -1;
jack_log("JackExternalClient::ClientNotify ref = %ld name = %s notify = %ld", refnum, name, notify);
- fChannel.ClientNotify(refnum, name, notify, sync, value1, value2, &result);
+ fChannel.ClientNotify(refnum, name, notify, sync, message, value1, value2, &result);
return result;
}
diff --git a/common/JackExternalClient.h b/common/JackExternalClient.h
index daafb199..29e0f7d6 100644
--- a/common/JackExternalClient.h
+++ b/common/JackExternalClient.h
@@ -49,7 +49,7 @@ class JackExternalClient : public JackClientInterface
int Open(const char* name, int pid, int refnum, int* shared_client);
int Close();
- int ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2);
+ int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);
JackClientControl* GetClientControl() const;
};
diff --git a/common/JackGlobals.cpp b/common/JackGlobals.cpp
index 599523db..c8c40545 100644
--- a/common/JackGlobals.cpp
+++ b/common/JackGlobals.cpp
@@ -22,6 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Jack
{
+bool JackGlobals::fVerbose = 0;
+
jack_tls_key JackGlobals::fRealTime;
static bool gKeyRealtimeInitialized = jack_tls_allocate_key(&JackGlobals::fRealTime);
diff --git a/common/JackGlobals.h b/common/JackGlobals.h
index f5516f73..7586708e 100644
--- a/common/JackGlobals.h
+++ b/common/JackGlobals.h
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Jack
{
-// Globals used for client management on server or libray side.
+// Globals used for client management on server or library side.
struct JackGlobals {
static jack_tls_key fRealTime;
@@ -34,10 +34,10 @@ struct JackGlobals {
static JackMutex* fOpenMutex;
static bool fServerRunning;
static JackClient* fClientTable[];
+ static bool fVerbose;
#ifndef WIN32
static jack_thread_creator_t fJackThreadCreator;
#endif
-
};
// Each "side" server and client will implement this to get the shared graph manager, engine control and inter-process synchro table.
diff --git a/common/JackInternalClientChannel.h b/common/JackInternalClientChannel.h
index 59eaa8c9..93130ca5 100644
--- a/common/JackInternalClientChannel.h
+++ b/common/JackInternalClientChannel.h
@@ -63,9 +63,9 @@ class JackInternalClientChannel : public detail::JackClientChannelInterface
*result = fEngine->ClientInternalClose(refnum, true);
}
- void ClientActivate(int refnum, int state, int* result)
+ void ClientActivate(int refnum, int is_real_time, int* result)
{
- *result = fEngine->ClientActivate(refnum, state);
+ *result = fEngine->ClientActivate(refnum, is_real_time);
}
void ClientDeactivate(int refnum, int* result)
{
diff --git a/common/JackLibClient.cpp b/common/JackLibClient.cpp
index ff6055e5..4c92e9e3 100644
--- a/common/JackLibClient.cpp
+++ b/common/JackLibClient.cpp
@@ -99,7 +99,7 @@ int JackLibClient::Open(const char* server_name, const char* name, jack_options_
JackLibGlobals::fGlobals->fEngineControl.SetShmIndex(shared_engine, fServerName);
JackLibGlobals::fGlobals->fGraphManager.SetShmIndex(shared_graph, fServerName);
fClientControl.SetShmIndex(shared_client, fServerName);
- jack_verbose = GetEngineControl()->fVerbose;
+ JackGlobals::fVerbose = GetEngineControl()->fVerbose;
} catch (int n) {
jack_error("Map shared memory segments exception %d", n);
goto error;
@@ -128,7 +128,7 @@ error:
// Notifications received from the server
// TODO this should be done once for all clients in the process, when a shared notification channel
// will be shared by all clients...
-int JackLibClient::ClientNotifyImp(int refnum, const char* name, int notify, int sync, int value1, int value2)
+int JackLibClient::ClientNotifyImp(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
{
int res = 0;
diff --git a/common/JackLibClient.h b/common/JackLibClient.h
index 3ad9e3c9..0621ed15 100644
--- a/common/JackLibClient.h
+++ b/common/JackLibClient.h
@@ -46,7 +46,7 @@ class JackLibClient : public JackClient
int Open(const char* server_name, const char* name, jack_options_t options, jack_status_t* status);
- int ClientNotifyImp(int refnum, const char* name, int notify, int sync, int value1, int value2);
+ int ClientNotifyImp(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);
JackGraphManager* GetGraphManager() const;
JackEngineControl* GetEngineControl() const;
diff --git a/common/JackLockedEngine.h b/common/JackLockedEngine.h
index c8799f49..d1d9d3d1 100644
--- a/common/JackLockedEngine.h
+++ b/common/JackLockedEngine.h
@@ -83,10 +83,10 @@ class SERVER_EXPORT JackLockedEngine : public JackLockAble
return fEngine.ClientInternalClose(refnum, wait);
}
- int ClientActivate(int refnum, bool state)
+ int ClientActivate(int refnum, bool is_real_time)
{
JackLock lock(this);
- return fEngine.ClientActivate(refnum, state);
+ return fEngine.ClientActivate(refnum, is_real_time);
}
int ClientDeactivate(int refnum)
{
@@ -191,6 +191,12 @@ class SERVER_EXPORT JackLockedEngine : public JackLockAble
fEngine.NotifyFreewheel(onoff);
}
+ void NotifyFailure(int code, const char* reason)
+ {
+ JackLock lock(this);
+ fEngine.NotifyFailure(code, reason);
+ }
+
int GetClientPID(const char* name)
{
JackLock lock(this);
diff --git a/common/JackMessageBuffer.cpp b/common/JackMessageBuffer.cpp
index 18e4d52f..bc380a52 100644
--- a/common/JackMessageBuffer.cpp
+++ b/common/JackMessageBuffer.cpp
@@ -29,13 +29,19 @@ namespace Jack
JackMessageBuffer* JackMessageBuffer::fInstance = NULL;
JackMessageBuffer::JackMessageBuffer()
- :fThread(this),fInBuffer(0),fOutBuffer(0),fOverruns(0)
+ :fThread(this),fInBuffer(0),fOutBuffer(0),fOverruns(0),fRunning(false)
+{}
+
+JackMessageBuffer::~JackMessageBuffer()
+{}
+
+void JackMessageBuffer::Start()
{
fRunning = true;
fThread.StartSync();
}
-JackMessageBuffer::~JackMessageBuffer()
+void JackMessageBuffer::Stop()
{
if (fOverruns > 0) {
jack_error("WARNING: %d message buffer overruns!", fOverruns);
@@ -49,7 +55,7 @@ JackMessageBuffer::~JackMessageBuffer()
fThread.Stop();
Flush();
}
-
+
void JackMessageBuffer::Flush()
{
while (fOutBuffer != fInBuffer) {
@@ -86,12 +92,14 @@ void JackMessageBuffer::Create()
{
if (fInstance == NULL) {
fInstance = new JackMessageBuffer();
+ fInstance->Start();
}
}
void JackMessageBuffer::Destroy()
{
if (fInstance != NULL) {
+ fInstance->Stop();
delete fInstance;
fInstance = NULL;
}
@@ -100,8 +108,7 @@ void JackMessageBuffer::Destroy()
void JackMessageBufferAdd(int level, const char *message)
{
if (Jack::JackMessageBuffer::fInstance == NULL) {
- /* Unable to print message with realtime safety.
- * Complain and print it anyway. */
+ /* Unable to print message with realtime safety. Complain and print it anyway. */
jack_log_function(LOG_LEVEL_ERROR, "messagebuffer not initialized, skip message");
} else {
Jack::JackMessageBuffer::fInstance->AddMessage(level, message);
diff --git a/common/JackMessageBuffer.h b/common/JackMessageBuffer.h
index 23bb12a6..5e3472a5 100644
--- a/common/JackMessageBuffer.h
+++ b/common/JackMessageBuffer.h
@@ -66,10 +66,13 @@ class JackMessageBuffer : public JackRunnableInterface
bool fRunning;
void Flush();
+
+ void Start();
+ void Stop();
public:
- JackMessageBuffer();
+ JackMessageBuffer();
~JackMessageBuffer();
// JackRunnableInterface interface
diff --git a/common/JackNetDriver.cpp b/common/JackNetDriver.cpp
index 641c95c4..5f5af5db 100644
--- a/common/JackNetDriver.cpp
+++ b/common/JackNetDriver.cpp
@@ -53,6 +53,7 @@ namespace Jack
fMidiPlaybackPortList = NULL;
#ifdef JACK_MONITOR
fNetTimeMon = NULL;
+ fRcvSyncUst = 0;
#endif
}
@@ -208,7 +209,7 @@ namespace Jack
JackDriver::NotifySampleRate ( fParams.fSampleRate );
//transport engine parametering
- fEngineControl->fTransport.SetNetworkSync ( true );
+ fEngineControl->fTransport.SetNetworkSync ( fParams.fTransportSync );
return true;
}
@@ -418,6 +419,7 @@ namespace Jack
break;
case JackTransportRolling :
+ //fEngineControl->fTransport.SetCommand ( TransportCommandStart );
fEngineControl->fTransport.SetState ( JackTransportRolling );
jack_info ( "Master is rolling." );
break;
@@ -427,6 +429,7 @@ namespace Jack
void JackNetDriver::EncodeTransportData()
{
+ /* Desactivated
//is there a timebase master change ?
int refnum;
bool conditional;
@@ -449,12 +452,14 @@ namespace Jack
}
else
fReturnTransportData.fTimebaseMaster = NO_CHANGE;
-
+ */
+
//update transport state and position
fReturnTransportData.fState = fEngineControl->fTransport.Query ( &fReturnTransportData.fPosition );
-
+
//is it a new state (that the master need to know...) ?
- fReturnTransportData.fNewState = ( ( fReturnTransportData.fState != fLastTransportState ) &&
+ fReturnTransportData.fNewState = (( fReturnTransportData.fState == JackTransportNetStarting) &&
+ ( fReturnTransportData.fState != fLastTransportState ) &&
( fReturnTransportData.fState != fSendTransportData.fState ) );
if ( fReturnTransportData.fNewState )
jack_info ( "Sending '%s'.", GetTransportState ( fReturnTransportData.fState ) );
@@ -481,22 +486,27 @@ namespace Jack
if ( SyncRecv() == SOCKET_ERROR )
return 0;
- //take the time at the beginning of the cycle
- JackDriver::CycleTakeBeginTime();
+#ifdef JACK_MONITOR
+ // For timing
+ fRcvSyncUst = GetMicroSeconds();
+#endif
//decode sync
//if there is an error, don't return -1, it will skip Write() and the network error probably won't be identified
DecodeSyncPacket();
#ifdef JACK_MONITOR
- fNetTimeMon->Add ( ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f );
+ fNetTimeMon->Add ( ( ( float ) ( GetMicroSeconds() - fRcvSyncUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f );
#endif
//audio, midi or sync if driver is late
if ( DataRecv() == SOCKET_ERROR )
return SOCKET_ERROR;
+ //take the time at the beginning of the cycle
+ JackDriver::CycleTakeBeginTime();
+
#ifdef JACK_MONITOR
- fNetTimeMon->Add ( ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f );
+ fNetTimeMon->Add ( ( ( float ) ( GetMicroSeconds() - fRcvSyncUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f );
#endif
return 0;
@@ -514,7 +524,7 @@ namespace Jack
fNetAudioPlaybackBuffer->SetBuffer ( audio_port_index, GetOutputBuffer ( audio_port_index ) );
#ifdef JACK_MONITOR
- fNetTimeMon->Add ( ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f );
+ fNetTimeMon->Add ( ( ( float ) ( GetMicroSeconds() - fRcvSyncUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f );
#endif
//sync
@@ -525,7 +535,7 @@ namespace Jack
return SOCKET_ERROR;
#ifdef JACK_MONITOR
- fNetTimeMon->Add ( ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f );
+ fNetTimeMon->Add ( ( ( float ) ( GetMicroSeconds() - fRcvSyncUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f );
#endif
//send data
@@ -533,7 +543,7 @@ namespace Jack
return SOCKET_ERROR;
#ifdef JACK_MONITOR
- fNetTimeMon->AddLast ( ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f );
+ fNetTimeMon->AddLast ( ( ( float ) ( GetMicroSeconds() - fRcvSyncUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f );
#endif
return 0;
diff --git a/common/JackNetDriver.h b/common/JackNetDriver.h
index d8fb0bb2..af137b43 100644
--- a/common/JackNetDriver.h
+++ b/common/JackNetDriver.h
@@ -40,15 +40,16 @@ namespace Jack
//jack data
jack_port_id_t* fMidiCapturePortList;
jack_port_id_t* fMidiPlaybackPortList;
-
+
//transport
int fLastTransportState;
int fLastTimebaseMaster;
//monitoring
-#ifdef JACK_MONITOR
+ #ifdef JACK_MONITOR
JackGnuPlotMonitor<float>* fNetTimeMon;
-#endif
+ jack_time_t fRcvSyncUst;
+ #endif
bool Initialize();
void FreeAll();
diff --git a/common/JackNetManager.cpp b/common/JackNetManager.cpp
index b4e45853..b42d970e 100644
--- a/common/JackNetManager.cpp
+++ b/common/JackNetManager.cpp
@@ -305,6 +305,7 @@ namespace Jack
else
jack_info ( "'%s' isn't the timebase master anymore.", fParams.fName );
break;
+
case TIMEBASEMASTER :
timebase = jack_set_timebase_callback ( fJackClient, 0, SetTimebaseCallback, this );
if ( timebase < 0 )
@@ -312,6 +313,7 @@ namespace Jack
else
jack_info ( "'%s' is the new timebase master.", fParams.fName );
break;
+
case CONDITIONAL_TIMEBASEMASTER :
timebase = jack_set_timebase_callback ( fJackClient, 1, SetTimebaseCallback, this );
if ( timebase != EBUSY )
@@ -334,15 +336,18 @@ namespace Jack
jack_transport_stop ( fJackClient );
jack_info ( "'%s' stops transport.", fParams.fName );
break;
+
case JackTransportStarting :
if ( jack_transport_reposition ( fJackClient, &fReturnTransportData.fPosition ) == EINVAL )
jack_error ( "Can't set new position." );
jack_transport_start ( fJackClient );
- jack_info ( "'%s' starts transport frame = %d frame = %d", fParams.fName, fReturnTransportData.fPosition.frame);
+ jack_info ( "'%s' starts transport frame = %d", fParams.fName, fReturnTransportData.fPosition.frame);
break;
+
case JackTransportNetStarting :
jack_info ( "'%s' is ready to roll..", fParams.fName );
break;
+
case JackTransportRolling :
jack_info ( "'%s' is rolling.", fParams.fName );
break;
diff --git a/common/JackNetTool.cpp b/common/JackNetTool.cpp
index 0d63f33d..81e2404f 100644
--- a/common/JackNetTool.cpp
+++ b/common/JackNetTool.cpp
@@ -417,6 +417,7 @@ namespace Jack
dst_params->fPosition.usecs = htonl(src_params->fPosition.usecs);
dst_params->fPosition.frame_rate = htonl(src_params->fPosition.frame_rate);
dst_params->fPosition.frame = htonl(src_params->fPosition.frame);
+ dst_params->fPosition.valid = (jack_position_bits_t)htonl((uint32_t)src_params->fPosition.valid);
dst_params->fPosition.bar = htonl(src_params->fPosition.bar);
dst_params->fPosition.beat = htonl(src_params->fPosition.beat);
dst_params->fPosition.tick = htonl(src_params->fPosition.tick);
@@ -442,6 +443,7 @@ namespace Jack
dst_params->fPosition.usecs = ntohl(src_params->fPosition.usecs);
dst_params->fPosition.frame_rate = ntohl(src_params->fPosition.frame_rate);
dst_params->fPosition.frame = ntohl(src_params->fPosition.frame);
+ dst_params->fPosition.valid = (jack_position_bits_t)ntohl((uint32_t)src_params->fPosition.valid);
dst_params->fPosition.bar = ntohl(src_params->fPosition.bar);
dst_params->fPosition.beat = ntohl(src_params->fPosition.beat);
dst_params->fPosition.tick = ntohl(src_params->fPosition.tick);
diff --git a/common/JackNotification.h b/common/JackNotification.h
index 0667c1d5..43611a4f 100644
--- a/common/JackNotification.h
+++ b/common/JackNotification.h
@@ -43,6 +43,7 @@ enum NotificationType {
kPortDisconnectCallback = 12,
kPortRenameCallback = 13,
kRealTimeCallback = 14,
+ kShutDownCallback = 15,
kMaxNotification
};
diff --git a/common/JackRequest.h b/common/JackRequest.h
index e6243b7b..d366f69e 100644
--- a/common/JackRequest.h
+++ b/common/JackRequest.h
@@ -297,25 +297,25 @@ struct JackActivateRequest : public JackRequest
{
int fRefNum;
- int fState;
+ int fIsRealTime;
JackActivateRequest()
{}
- JackActivateRequest(int refnum, int state)
- : JackRequest(JackRequest::kActivateClient), fRefNum(refnum), fState(state)
+ JackActivateRequest(int refnum, int is_real_time)
+ : JackRequest(JackRequest::kActivateClient), fRefNum(refnum), fIsRealTime(is_real_time)
{}
int Read(JackChannelTransaction* trans)
{
CheckRes(trans->Read(&fRefNum, sizeof(int)));
- return trans->Read(&fState, sizeof(int));
+ return trans->Read(&fIsRealTime, sizeof(int));
}
int Write(JackChannelTransaction* trans)
{
CheckRes(JackRequest::Write(trans));
CheckRes(trans->Write(&fRefNum, sizeof(int)));
- return trans->Write(&fState, sizeof(int));
+ return trans->Write(&fIsRealTime, sizeof(int));
}
} POST_PACKED_STRUCTURE;
@@ -1079,13 +1079,15 @@ struct JackClientNotification
int fValue1;
int fValue2;
int fSync;
+ char fMessage[JACK_MESSAGE_SIZE + 1];
JackClientNotification(): fNotify(-1), fValue1(-1), fValue2(-1)
{}
- JackClientNotification(const char* name, int refnum, int notify, int sync, int value1, int value2)
+ JackClientNotification(const char* name, int refnum, int notify, int sync, const char* message, int value1, int value2)
: fRefNum(refnum), fNotify(notify), fValue1(value1), fValue2(value2), fSync(sync)
{
snprintf(fName, sizeof(fName), "%s", name);
+ snprintf(fMessage, sizeof(fMessage), "%s", message);
}
int Read(JackChannelTransaction* trans)
@@ -1096,6 +1098,7 @@ struct JackClientNotification
CheckRes(trans->Read(&fValue1, sizeof(int)));
CheckRes(trans->Read(&fValue2, sizeof(int)));
CheckRes(trans->Read(&fSync, sizeof(int)));
+ CheckRes(trans->Read(&fMessage, JACK_MESSAGE_SIZE + 1));
return 0;
}
@@ -1107,6 +1110,7 @@ struct JackClientNotification
CheckRes(trans->Write(&fValue1, sizeof(int)));
CheckRes(trans->Write(&fValue2, sizeof(int)));
CheckRes(trans->Write(&fSync, sizeof(int)));
+ CheckRes(trans->Write(&fMessage, JACK_MESSAGE_SIZE + 1));
return 0;
}
diff --git a/common/JackServer.cpp b/common/JackServer.cpp
index 081e743b..a260b47a 100644
--- a/common/JackServer.cpp
+++ b/common/JackServer.cpp
@@ -55,7 +55,7 @@ JackServer::JackServer(bool sync, bool temporary, long timeout, bool rt, long pr
fFreewheel = false;
JackServerGlobals::fInstance = this; // Unique instance
JackServerGlobals::fUserCount = 1; // One user
- jack_verbose = verbose;
+ JackGlobals::fVerbose = verbose;
}
JackServer::~JackServer()
@@ -78,7 +78,7 @@ int JackServer::Open(jack_driver_desc_t* driver_desc, JSList* driver_params)
goto fail_close1;
}
- if (fEngine->Open() != 0) {
+ if (fEngine->Open() < 0) {
jack_error("Cannot open engine");
goto fail_close2;
}
@@ -88,12 +88,12 @@ int JackServer::Open(jack_driver_desc_t* driver_desc, JSList* driver_params)
goto fail_close3;
}
- if (fFreewheelDriver->Open() != 0) { // before engine open
+ if (fFreewheelDriver->Open() < 0) { // before engine open
jack_error("Cannot open driver");
goto fail_close4;
}
- if (fAudioDriver->Attach() != 0) {
+ if (fAudioDriver->Attach() < 0) {
jack_error("Cannot attach audio driver");
goto fail_close5;
}
@@ -168,7 +168,10 @@ int JackServer::InternalClientLoadAux(JackLoadableInternalClient* client, const
int JackServer::Start()
{
jack_log("JackServer::Start");
- return fAudioDriver->Start();
+ if (fAudioDriver->Start() < 0) {
+ return -1;
+ }
+ return fChannel.Start();
}
int JackServer::Stop()
diff --git a/common/JackServerGlobals.cpp b/common/JackServerGlobals.cpp
index 7698c640..18dfaf66 100644
--- a/common/JackServerGlobals.cpp
+++ b/common/JackServerGlobals.cpp
@@ -28,6 +28,7 @@ static char* server_name = NULL;
namespace Jack
{
+bool JackServerGlobals::fKilled = false;
JackServer* JackServerGlobals::fInstance;
unsigned int JackServerGlobals::fUserCount;
bool (* JackServerGlobals::on_device_acquire)(const char * device_name) = NULL;
diff --git a/common/JackServerGlobals.h b/common/JackServerGlobals.h
index fac85bd3..e037f69b 100644
--- a/common/JackServerGlobals.h
+++ b/common/JackServerGlobals.h
@@ -36,6 +36,7 @@ class JackClient;
struct SERVER_EXPORT JackServerGlobals
{
+ static bool fKilled;
static JackServer* fInstance;
static unsigned int fUserCount;
static bool (* on_device_acquire)(const char * device_name);
@@ -46,7 +47,7 @@ struct SERVER_EXPORT JackServerGlobals
static bool Init();
static void Destroy();
- static int Start (const char* server_name,
+ static int Start(const char* server_name,
jack_driver_desc_t* driver_desc,
JSList* driver_params,
int sync,
diff --git a/common/JackThreadedDriver.cpp b/common/JackThreadedDriver.cpp
index 0ab139eb..df2b6d27 100644
--- a/common/JackThreadedDriver.cpp
+++ b/common/JackThreadedDriver.cpp
@@ -137,9 +137,9 @@ std::list<JackDriverInterface*> JackThreadedDriver::GetSlaves()
return fDriver->GetSlaves();
}
-int JackThreadedDriver::ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2)
+int JackThreadedDriver::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
{
- return fDriver->ClientNotify(refnum, name, notify, sync, value1, value2);
+ return fDriver->ClientNotify(refnum, name, notify, sync, message, value1, value2);
}
JackClientControl* JackThreadedDriver::GetClientControl() const
diff --git a/common/JackThreadedDriver.h b/common/JackThreadedDriver.h
index 5949472d..f7bbf2d0 100644
--- a/common/JackThreadedDriver.h
+++ b/common/JackThreadedDriver.h
@@ -94,7 +94,7 @@ class SERVER_EXPORT JackThreadedDriver : public JackDriverClientInterface, publi
virtual std::list<JackDriverInterface*> GetSlaves();
virtual int ProcessSlaves();
- virtual int ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2);
+ virtual int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);
virtual JackClientControl* GetClientControl() const;
virtual bool IsRealTime() const;
diff --git a/common/Jackdmp.cpp b/common/Jackdmp.cpp
index 53a10bb0..a414b8b4 100644
--- a/common/Jackdmp.cpp
+++ b/common/Jackdmp.cpp
@@ -247,7 +247,7 @@ int main(int argc, char* argv[])
jackctl_parameter_set_value(param, &value);
} else {
usage(stdout);
- goto fail_free;
+ goto fail_free1;
}
}
break;
@@ -358,7 +358,7 @@ int main(int argc, char* argv[])
case 'h':
usage(stdout);
- goto fail_free;
+ goto fail_free1;
}
}
@@ -372,14 +372,14 @@ int main(int argc, char* argv[])
if (!seen_audio_driver) {
usage(stderr);
- goto fail_free;
+ goto fail_free1;
}
// Audio driver
audio_driver_ctl = jackctl_server_get_driver(server_ctl, audio_driver_name);
if (audio_driver_ctl == NULL) {
fprintf(stderr, "Unkown driver \"%s\"\n", audio_driver_name);
- goto fail_free;
+ goto fail_free1;
}
if (optind < argc) {
@@ -391,7 +391,7 @@ int main(int argc, char* argv[])
if (audio_driver_nargs == 0) {
fprintf(stderr, "No driver specified ... hmm. JACK won't do"
" anything when run like this.\n");
- goto fail_free;
+ goto fail_free1;
}
audio_driver_args = (char **) malloc(sizeof(char *) * audio_driver_nargs);
@@ -402,13 +402,13 @@ int main(int argc, char* argv[])
}
if (jackctl_parse_driver_params(audio_driver_ctl, audio_driver_nargs, audio_driver_args)) {
- goto fail_free;
+ goto fail_free1;
}
// Start server
if (!jackctl_server_start(server_ctl, audio_driver_ctl)) {
fprintf(stderr, "Failed to start server\n");
- goto fail_free;
+ goto fail_free1;
}
// MIDI driver
@@ -417,7 +417,7 @@ int main(int argc, char* argv[])
midi_driver_ctl = jackctl_server_get_driver(server_ctl, midi_driver_name);
if (midi_driver_ctl == NULL) {
fprintf(stderr, "Unkown driver \"%s\"\n", midi_driver_name);
- goto fail_free;
+ goto fail_free2;
}
jackctl_server_add_slave(server_ctl, midi_driver_ctl);
@@ -445,10 +445,18 @@ int main(int argc, char* argv[])
if (!jackctl_server_stop(server_ctl))
fprintf(stderr, "Cannot stop server...\n");
+
+ jackctl_server_destroy(server_ctl);
+ notify_server_stop(server_name);
+ return 0;
-fail_free:
-
+fail_free1:
+ jackctl_server_destroy(server_ctl);
+ return -1;
+
+fail_free2:
+ jackctl_server_stop(server_ctl);
jackctl_server_destroy(server_ctl);
notify_server_stop(server_name);
- return 1;
+ return -1;
}
diff --git a/common/jack/jack.h b/common/jack/jack.h
index 5dc6290e..ebdded77 100644
--- a/common/jack/jack.h
+++ b/common/jack/jack.h
@@ -282,7 +282,7 @@ int jack_set_thread_init_callback (jack_client_t *client,
* @param function The jack_shutdown function pointer.
* @param arg The arguments for the jack_shutdown function.
*
- * Register a function (and argument) to be called if and when the
+ * @deprecated Register a function (and argument) to be called if and when the
* JACK server shuts down the client thread. The function must
* be written as if it were an asynchonrous POSIX signal
* handler --- use only async-safe functions, and remember that it
@@ -299,6 +299,27 @@ void jack_on_shutdown (jack_client_t *client,
JackShutdownCallback shutdown_callback, void *arg);
/**
+ * @param client pointer to JACK client structure.
+ * @param function The jack_shutdown function pointer.
+ * @param arg The arguments for the jack_shutdown function.
+ *
+ * Register a function (and argument) to be called if and when the
+ * JACK server shuts down the client thread. The function must
+ * be written as if it were an asynchonrous POSIX signal
+ * handler --- use only async-safe functions, and remember that it
+ * is executed from another thread. A typical function might
+ * set a flag or write to a pipe so that the rest of the
+ * application knows that the JACK client thread has shut
+ * down.
+ *
+ * NOTE: clients do not need to call this. It exists only
+ * to help more complex clients understand what is going
+ * on. It should be called before jack_client_activate().
+ */
+void jack_on_info_shutdown (jack_client_t *client,
+ JackInfoShutdownCallback shutdown_callback, void *arg);
+
+/**
* Tell the Jack server to call @a process_callback whenever there is
* work be done, passing @a arg as the second argument.
*
diff --git a/common/jack/types.h b/common/jack/types.h
index fa65ce5c..f7e03d3c 100644
--- a/common/jack/types.h
+++ b/common/jack/types.h
@@ -214,7 +214,7 @@ typedef int (*JackPortRenameCallback)(jack_port_id_t port, const char* new_name,
typedef void (*JackFreewheelCallback)(int starting, void *arg);
/**
- * Prototype for the client supplied function that is called
+ * @deprecated Prototype for the client supplied function that is called
* whenever jackd is shutdown. Note that after server shutdown,
* the client pointer is *not* deallocated by libjack,
* the application is responsible to properly use jack_client_close()
@@ -227,6 +227,21 @@ typedef void (*JackFreewheelCallback)(int starting, void *arg);
typedef void (*JackShutdownCallback)(void *arg);
/**
+ * Prototype for the client supplied function that is called
+ * whenever jackd is shutdown. Note that after server shutdown,
+ * the client pointer is *not* deallocated by libjack,
+ * the application is responsible to properly use jack_client_close()
+ * to release client ressources. Warning: jack_client_close() cannot be
+ * safely used inside the shutdown callback and has to be called outside of
+ * the callback context.
+
+ * @param code a shuntdown code
+ * @param reason a string discribing the shuntdown reason (backend failure, server crash... etc...)
+ * @param arg pointer to a client supplied structure
+ */
+typedef void (*JackInfoShutdownCallback)(int code, const char* reason, void *arg);
+
+/**
* Used for the type argument of jack_port_register() for default
* audio ports and midi ports.
*/
@@ -419,7 +434,12 @@ enum JackStatus {
/**
* Client's protocol version does not match
*/
- JackVersionError = 0x400
+ JackVersionError = 0x400,
+
+ /**
+ * Backend failure
+ */
+ JackBackendError = 0x800
};
/**
diff --git a/common/memops.c b/common/memops.c
index 3731a682..8ef4f099 100644
--- a/common/memops.c
+++ b/common/memops.c
@@ -37,6 +37,9 @@
#if defined (__SSE2__) && !defined (__sun__)
#include <emmintrin.h>
+#ifdef __SSE4_1__
+#include <smmintrin.h>
+#endif
#endif
/* Notes about these *_SCALING values.
@@ -285,6 +288,12 @@ void sample_move_d32u24_sS (char *dst, jack_default_audio_sample_t *src, unsigne
__m128i y = _mm_cvttps_epi32(clipped);
__m128i shifted = _mm_slli_epi32(y, 8);
+#ifdef __SSE4_1__
+ *(int32_t*)dst = _mm_extract_epi32(shifted, 0);
+ *(int32_t*)(dst+dst_skip) = _mm_extract_epi32(shifted, 1);
+ *(int32_t*)(dst+2*dst_skip) = _mm_extract_epi32(shifted, 2);
+ *(int32_t*)(dst+3*dst_skip) = _mm_extract_epi32(shifted, 3);
+#else
__m128i shuffled1 = _mm_shuffle_epi32(shifted, _MM_SHUFFLE(0, 3, 2, 1));
__m128i shuffled2 = _mm_shuffle_epi32(shifted, _MM_SHUFFLE(1, 0, 3, 2));
__m128i shuffled3 = _mm_shuffle_epi32(shifted, _MM_SHUFFLE(2, 1, 0, 3));
@@ -294,6 +303,7 @@ void sample_move_d32u24_sS (char *dst, jack_default_audio_sample_t *src, unsigne
_mm_store_ss((float*)(dst+dst_skip), (__m128)shuffled1);
_mm_store_ss((float*)(dst+2*dst_skip), (__m128)shuffled2);
_mm_store_ss((float*)(dst+3*dst_skip), (__m128)shuffled3);
+#endif
dst += 4*dst_skip;
src+= 4;
@@ -421,6 +431,12 @@ void sample_move_d24_sS (char *dst, jack_default_audio_sample_t *src, unsigned l
__m128 samples = _mm_loadu_ps(src);
__m128i converted = float_24_sse(samples);
+#ifdef __SSE4_1__
+ z[0] = _mm_extract_epi32(converted, 0);
+ z[1] = _mm_extract_epi32(converted, 1);
+ z[2] = _mm_extract_epi32(converted, 2);
+ z[3] = _mm_extract_epi32(converted, 3);
+#else
__m128i shuffled1 = _mm_shuffle_epi32(converted, _MM_SHUFFLE(0, 3, 2, 1));
__m128i shuffled2 = _mm_shuffle_epi32(converted, _MM_SHUFFLE(1, 0, 3, 2));
__m128i shuffled3 = _mm_shuffle_epi32(converted, _MM_SHUFFLE(2, 1, 0, 3));
@@ -431,13 +447,11 @@ void sample_move_d24_sS (char *dst, jack_default_audio_sample_t *src, unsigned l
_mm_store_ss((float*)z+3, (__m128)shuffled3);
for (i = 0; i != 4; ++i) {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
memcpy (dst, z+i, 3);
-#elif __BYTE_ORDER == __BIG_ENDIAN
- memcpy (dst, (float*)((char *)&z + 1)+i, 3);
-#endif
dst += dst_skip;
}
+#endif
+
nsamples -= 4;
src += 4;
}
@@ -500,17 +514,10 @@ void sample_move_dS_s24 (jack_default_audio_sample_t *dst, char *src, unsigned l
while (nsamples >= 4) {
int x0, x1, x2, x3;
-#if __BYTE_ORDER == __LITTLE_ENDIAN
memcpy((char*)&x0 + 1, src, 3);
memcpy((char*)&x1 + 1, src+src_skip, 3);
memcpy((char*)&x2 + 1, src+2*src_skip, 3);
memcpy((char*)&x3 + 1, src+3*src_skip, 3);
-#elif __BYTE_ORDER == __BIG_ENDIAN
- memcpy(&x0, src, 3);
- memcpy(&x1, src+src_skip, 3);
- memcpy(&x2, src+2*src_skip, 3);
- memcpy(&x3, src+3*src_skip, 3);
-#endif
src += 4 * src_skip;
const __m128i block_i = _mm_set_epi32(x3, x2, x1, x0);
diff --git a/dbus/controller_iface_control.c b/dbus/controller_iface_control.c
index f55fb608..768c192f 100644
--- a/dbus/controller_iface_control.c
+++ b/dbus/controller_iface_control.c
@@ -340,7 +340,7 @@ JACK_DBUS_METHOD_ARGUMENTS_BEGIN(LoadInternal)
JACK_DBUS_METHOD_ARGUMENT("internal", "s", false)
JACK_DBUS_METHOD_ARGUMENTS_END
-JACK_DBUS_METHOD_ARGUMENTS_BEGIN(UnlooadInternal)
+JACK_DBUS_METHOD_ARGUMENTS_BEGIN(UnloadInternal)
JACK_DBUS_METHOD_ARGUMENT("internal", "s", false)
JACK_DBUS_METHOD_ARGUMENTS_END
@@ -366,7 +366,7 @@ JACK_DBUS_METHODS_BEGIN
JACK_DBUS_METHOD_DESCRIBE(IsRealtime, NULL)
JACK_DBUS_METHOD_DESCRIBE(ResetXruns, NULL)
JACK_DBUS_METHOD_DESCRIBE(LoadInternal, NULL)
- JACK_DBUS_METHOD_DESCRIBE(UnlooadInternal, NULL)
+ JACK_DBUS_METHOD_DESCRIBE(UnloadInternal, NULL)
JACK_DBUS_METHOD_DESCRIBE(AddSlave, NULL)
JACK_DBUS_METHOD_DESCRIBE(RemoveSlave, NULL)
JACK_DBUS_METHODS_END
diff --git a/macosx/JackMacEngineRPC.cpp b/macosx/JackMacEngineRPC.cpp
index 7d28b619..4ddb0b1c 100644
--- a/macosx/JackMacEngineRPC.cpp
+++ b/macosx/JackMacEngineRPC.cpp
@@ -59,12 +59,12 @@ rpc_type server_rpc_jack_client_close(mach_port_t private_port, int refnum, int*
return KERN_SUCCESS;
}
-rpc_type server_rpc_jack_client_activate(mach_port_t private_port, int refnum, int state, int* result)
+rpc_type server_rpc_jack_client_activate(mach_port_t private_port, int refnum, int is_real_time, int* result)
{
jack_log("rpc_jack_client_activate");
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port];
assert(channel);
- *result = channel->GetEngine()->ClientActivate(refnum, state);
+ *result = channel->GetEngine()->ClientActivate(refnum, is_real_time);
return KERN_SUCCESS;
}
@@ -83,7 +83,7 @@ rpc_type server_rpc_jack_client_deactivate(mach_port_t private_port, int refnum,
rpc_type server_rpc_jack_port_register(mach_port_t private_port, int refnum, client_port_name_t name, client_port_type_t type, unsigned int flags, unsigned int buffer_size, unsigned int* port_index, int* result)
{
- jack_log("rpc_jack_port_register ref = %ld name = %s", refnum, name);
+ jack_log("rpc_jack_port_register ref = %d name = %s", refnum, name);
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port];
assert(channel);
*result = channel->GetEngine()->PortRegister(refnum, name, type, flags, buffer_size, port_index);
@@ -92,7 +92,7 @@ rpc_type server_rpc_jack_port_register(mach_port_t private_port, int refnum, cli
rpc_type server_rpc_jack_port_unregister(mach_port_t private_port, int refnum, int port, int* result)
{
- jack_log("rpc_jack_port_unregister ref = %ld port = %ld ", refnum, port);
+ jack_log("rpc_jack_port_unregister ref = %d port = %d ", refnum, port);
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port];
assert(channel);
*result = channel->GetEngine()->PortUnRegister(refnum, port);
@@ -234,7 +234,7 @@ rpc_type server_rpc_jack_internal_clientunload(mach_port_t private_port, int ref
rpc_type server_rpc_jack_client_rt_notify(mach_port_t server_port, int refnum, int notify, int value)
{
- jack_log("rpc_jack_client_rt_notify ref = %ld notify = %ld value = %ld", refnum, notify, value);
+ jack_log("rpc_jack_client_rt_notify ref = %d notify = %d value = %d", refnum, notify, value);
JackMachServerChannel* channel = JackMachServerChannel::fPortTable[server_port];
assert(channel);
assert(channel->GetServer());
diff --git a/macosx/JackMacLibClientRPC.cpp b/macosx/JackMacLibClientRPC.cpp
index 07f5e51c..b70878a1 100644
--- a/macosx/JackMacLibClientRPC.cpp
+++ b/macosx/JackMacLibClientRPC.cpp
@@ -27,21 +27,21 @@ using namespace Jack;
#define rpc_type kern_return_t // for astyle
-rpc_type rpc_jack_client_sync_notify(mach_port_t client_port, int refnum, client_name_t name, int notify, int value1, int value2, int* result)
+rpc_type rpc_jack_client_sync_notify(mach_port_t client_port, int refnum, client_name_t name, int notify, message_t message, int value1, int value2, int* result)
{
- jack_log("rpc_jack_client_sync_notify ref = %ld name = %s notify = %ld val1 = %ld val2 = %ld", refnum, name, notify, value1, value2);
+ jack_log("rpc_jack_client_sync_notify ref = %ld name = %s notify = %ld message %s val1 = %ld val2 = %ld", refnum, name, notify, message, value1, value2);
JackClient* client = gClientTable[client_port];
assert(client);
- *result = client->ClientNotify(refnum, name, notify, true, value1, value2);
+ *result = client->ClientNotify(refnum, name, notify, true, message, value1, value2);
return KERN_SUCCESS;
}
-rpc_type rpc_jack_client_async_notify(mach_port_t client_port, int refnum, client_name_t name, int notify, int value1, int value2)
+rpc_type rpc_jack_client_async_notify(mach_port_t client_port, int refnum, client_name_t name, int notify, message_t message, int value1, int value2)
{
- jack_log("rpc_jack_client_async_notify ref = %ld name = %s notify = %ld val1 = %ld val2 = %ld", refnum, name, notify, value1, value2);
+ jack_log("rpc_jack_client_async_notify ref = %ld name = %s notify = %ld message %s val1 = %ld val2 = %ld", refnum, name, notify, message, value1, value2);
JackClient* client = gClientTable[client_port];
assert(client);
- client->ClientNotify(refnum, name, notify, false, value1, value2);
+ client->ClientNotify(refnum, name, notify, false, message, value1, value2);
return KERN_SUCCESS;
}
diff --git a/macosx/JackMachClientChannel.cpp b/macosx/JackMachClientChannel.cpp
index d3d81bdd..c666bbb3 100644
--- a/macosx/JackMachClientChannel.cpp
+++ b/macosx/JackMachClientChannel.cpp
@@ -154,9 +154,9 @@ void JackMachClientChannel::ClientClose(int refnum, int* result)
}
}
-void JackMachClientChannel::ClientActivate(int refnum, int state, int* result)
+void JackMachClientChannel::ClientActivate(int refnum, int is_real_time, int* result)
{
- kern_return_t res = rpc_jack_client_activate(fPrivatePort, refnum, state, result);
+ kern_return_t res = rpc_jack_client_activate(fPrivatePort, refnum, is_real_time, result);
if (res != KERN_SUCCESS) {
*result = -1;
jack_error("JackMachClientChannel::ClientActivate err = %s", mach_error_string(res));
diff --git a/macosx/JackMachClientChannel.h b/macosx/JackMachClientChannel.h
index 9e323cf5..379fb535 100644
--- a/macosx/JackMachClientChannel.h
+++ b/macosx/JackMachClientChannel.h
@@ -61,7 +61,7 @@ class JackMachClientChannel : public detail::JackClientChannelInterface, public
{}
void ClientClose(int refnum, int* result);
- void ClientActivate(int refnum, int state, int* result);
+ void ClientActivate(int refnum, int is_real_time, int* result);
void ClientDeactivate(int refnum, int* result);
void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result);
diff --git a/macosx/JackMachNotifyChannel.cpp b/macosx/JackMachNotifyChannel.cpp
index 86236304..56d6b425 100644
--- a/macosx/JackMachNotifyChannel.cpp
+++ b/macosx/JackMachNotifyChannel.cpp
@@ -49,11 +49,11 @@ void JackMachNotifyChannel::Close()
fClientPort.DisconnectPort();
}
-void JackMachNotifyChannel::ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2, int* result)
+void JackMachNotifyChannel::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2, int* result)
{
kern_return_t res = (sync)
- ? rpc_jack_client_sync_notify(fClientPort.GetPort(), refnum, (char*)name, notify, value1, value2, result)
- : rpc_jack_client_async_notify(fClientPort.GetPort(), refnum, (char*)name, notify, value1, value2);
+ ? rpc_jack_client_sync_notify(fClientPort.GetPort(), refnum, (char*)name, notify, (char*)message, value1, value2, result)
+ : rpc_jack_client_async_notify(fClientPort.GetPort(), refnum, (char*)name, notify, (char*)message, value1, value2);
if (res == KERN_SUCCESS) {
*result = 0;
} else {
diff --git a/macosx/JackMachNotifyChannel.h b/macosx/JackMachNotifyChannel.h
index 14afeb3f..ab99fef4 100644
--- a/macosx/JackMachNotifyChannel.h
+++ b/macosx/JackMachNotifyChannel.h
@@ -44,7 +44,7 @@ class JackMachNotifyChannel
int Open(const char* name); // Open the Server/Client connection
void Close(); // Close the Server/Client connection
- void ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2, int* result);
+ void ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2, int* result);
};
} // end of namespace
diff --git a/macosx/JackMachServerChannel.cpp b/macosx/JackMachServerChannel.cpp
index 84d87b93..5b646c56 100644
--- a/macosx/JackMachServerChannel.cpp
+++ b/macosx/JackMachServerChannel.cpp
@@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "JackServer.h"
#include "JackLockedEngine.h"
#include "JackNotification.h"
+#include "JackServerGlobals.h"
using namespace std;
@@ -49,11 +50,6 @@ int JackMachServerChannel::Open(const char* server_name, JackServer* server)
return -1;
}
- if (fThread.Start() != 0) {
- jack_error("Cannot start Jack server listener");
- return -1;
- }
-
fServer = server;
fPortTable[fServerPort.GetPort()] = this;
return 0;
@@ -65,6 +61,16 @@ void JackMachServerChannel::Close()
fThread.Kill();
fServerPort.DestroyPort();
}
+
+int JackMachServerChannel::Start()
+{
+ if (fThread.Start() != 0) {
+ jack_error("Cannot start Jack server listener");
+ return -1;
+ }
+
+ return 0;
+}
JackLockedEngine* JackMachServerChannel::GetEngine()
{
@@ -137,6 +143,10 @@ boolean_t JackMachServerChannel::MessageHandler(mach_msg_header_t* Request, mach
channel->ClientKill(Request->msgh_local_port);
} else {
JackRPCEngine_server(Request, Reply);
+ // Issued by JackEngine::ReleaseRefnum when temporary mode is used
+ if (JackServerGlobals::fKilled) {
+ kill(JackTools::GetPID(), SIGINT);
+ }
}
return true;
}
diff --git a/macosx/JackMachServerChannel.h b/macosx/JackMachServerChannel.h
index 9e5ac35f..fc5a100b 100644
--- a/macosx/JackMachServerChannel.h
+++ b/macosx/JackMachServerChannel.h
@@ -53,7 +53,9 @@ class JackMachServerChannel : public JackRunnableInterface
int Open(const char* server_name, JackServer* server); // Open the Server/Client connection
void Close(); // Close the Server/Client connection
-
+
+ int Start();
+
JackLockedEngine* GetEngine();
JackServer* GetServer();
@@ -64,6 +66,7 @@ class JackMachServerChannel : public JackRunnableInterface
bool Execute();
+ // Has to be public..
static std::map<mach_port_t, JackMachServerChannel*> fPortTable;
};
diff --git a/macosx/Jackdmp.xcodeproj/project.pbxproj b/macosx/Jackdmp.xcodeproj/project.pbxproj
index d6c37727..4d5d42c8 100644
--- a/macosx/Jackdmp.xcodeproj/project.pbxproj
+++ b/macosx/Jackdmp.xcodeproj/project.pbxproj
@@ -86,7 +86,6 @@
4BFA99540AAAED90009E916C /* PBXTargetDependency */,
4B363E750DEB0838001F72D9 /* PBXTargetDependency */,
4B363E770DEB0838001F72D9 /* PBXTargetDependency */,
- 4B363EF20DEB0965001F72D9 /* PBXTargetDependency */,
4B363F250DEB0ABE001F72D9 /* PBXTargetDependency */,
4B363F530DEB0CFE001F72D9 /* PBXTargetDependency */,
4B363F780DEB0D85001F72D9 /* PBXTargetDependency */,
@@ -845,13 +844,6 @@
remoteGlobalIDString = 4B363E440DEB0775001F72D9;
remoteInfo = "jack_bufsize Universal";
};
- 4B363EF10DEB0965001F72D9 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 4B363EDF0DEB091C001F72D9;
- remoteInfo = "jack_rec Universal";
- };
4B363F240DEB0ABE001F72D9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
@@ -1233,7 +1225,7 @@
4B363EED0DEB094B001F72D9 /* capture_client.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = capture_client.c; path = "../example-clients/capture_client.c"; sourceTree = SOURCE_ROOT; };
4B363F1E0DEB0A6A001F72D9 /* jack_midiseq */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_midiseq; sourceTree = BUILT_PRODUCTS_DIR; };
4B363F220DEB0AB0001F72D9 /* monitor_client.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = monitor_client.c; path = "../example-clients/monitor_client.c"; sourceTree = SOURCE_ROOT; };
- 4B363F350DEB0BD1001F72D9 /* jack_midiseq */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_midiseq; sourceTree = BUILT_PRODUCTS_DIR; };
+ 4B363F350DEB0BD1001F72D9 /* jack_showtime */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_showtime; sourceTree = BUILT_PRODUCTS_DIR; };
4B363F3D0DEB0C31001F72D9 /* showtime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = showtime.c; path = "../example-clients/showtime.c"; sourceTree = SOURCE_ROOT; };
4B363F720DEB0D4E001F72D9 /* jack_midiseq */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jack_midiseq; sourceTree = BUILT_PRODUCTS_DIR; };
4B363F750DEB0D7D001F72D9 /* impulse_grabber.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = impulse_grabber.c; path = "../example-clients/impulse_grabber.c"; sourceTree = SOURCE_ROOT; };
@@ -2165,7 +2157,7 @@
4B363E4E0DEB0775001F72D9 /* jack_midiseq */,
4B363EE90DEB091C001F72D9 /* jack_midiseq */,
4B363F1E0DEB0A6A001F72D9 /* jack_midiseq */,
- 4B363F350DEB0BD1001F72D9 /* jack_midiseq */,
+ 4B363F350DEB0BD1001F72D9 /* jack_showtime */,
4B363F720DEB0D4E001F72D9 /* jack_midiseq */,
4BFA5E980DEC4D9C00FA4CDB /* testSem */,
4BFA828C0DF6A9E40087B4E1 /* jack_midiseq */,
@@ -4186,7 +4178,7 @@
name = "jack_showtime Universal";
productInstallPath = /usr/local/bin;
productName = jack_metro;
- productReference = 4B363F350DEB0BD1001F72D9 /* jack_midiseq */;
+ productReference = 4B363F350DEB0BD1001F72D9 /* jack_showtime */;
productType = "com.apple.product-type.tool";
};
4B363F680DEB0D4E001F72D9 /* jack_impulse_grabber Universal */ = {
@@ -6588,11 +6580,6 @@
target = 4B363E440DEB0775001F72D9 /* jack_bufsize Universal */;
targetProxy = 4B363E760DEB0838001F72D9 /* PBXContainerItemProxy */;
};
- 4B363EF20DEB0965001F72D9 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 4B363EDF0DEB091C001F72D9 /* jack_rec Universal */;
- targetProxy = 4B363EF10DEB0965001F72D9 /* PBXContainerItemProxy */;
- };
4B363F250DEB0ABE001F72D9 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 4B363F140DEB0A6A001F72D9 /* jack_monitor_client Universal */;
@@ -6923,12 +6910,8 @@
4B0A292B0D52108E002EFF74 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- i386,
- ppc,
- ppc64,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_OPTIMIZATION_LEVEL = 3;
@@ -7130,12 +7113,8 @@
4B35C4220D4731D1000DE7AE /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
FRAMEWORK_SEARCH_PATHS = "";
@@ -7191,12 +7170,8 @@
4B35C4230D4731D1000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
FRAMEWORK_SEARCH_PATHS = "";
@@ -7307,12 +7282,8 @@
4B35C4800D4731D1000DE7AE /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = NO;
DEBUGGING_SYMBOLS = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
@@ -7375,12 +7346,8 @@
4B35C4810D4731D1000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
@@ -7506,12 +7473,8 @@
4B35C4F90D4731D1000DE7AE /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = NO;
DEBUGGING_SYMBOLS = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
@@ -7574,12 +7537,8 @@
4B35C4FA0D4731D1000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
@@ -7744,12 +7703,8 @@
4B35C5120D4731D1000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -7847,12 +7802,8 @@
4B35C51E0D4731D1000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -7950,12 +7901,8 @@
4B35C52A0D4731D1000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -8051,12 +7998,8 @@
4B35C5360D4731D1000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -8148,12 +8091,8 @@
4B35C5420D4731D1000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
HEADER_SEARCH_PATHS = ../common;
@@ -8244,12 +8183,8 @@
4B35C54E0D4731D1000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
HEADER_SEARCH_PATHS = ../common;
@@ -8340,12 +8275,8 @@
4B35C55C0D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
HEADER_SEARCH_PATHS = ../common;
@@ -8439,12 +8370,8 @@
4B35C5680D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -8539,12 +8466,8 @@
4B35C5740D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -8650,12 +8573,8 @@
4B35C5840D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@@ -8763,12 +8682,8 @@
4B35C5980D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_OPTIMIZATION_LEVEL = 3;
@@ -8865,12 +8780,8 @@
4B35C5A40D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
HEADER_SEARCH_PATHS = ../common;
@@ -8961,12 +8872,8 @@
4B35C5B00D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_OPTIMIZATION_LEVEL = 3;
@@ -9057,12 +8964,8 @@
4B35C5BC0D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_OPTIMIZATION_LEVEL = 3;
@@ -9153,12 +9056,8 @@
4B35C5C80D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_OPTIMIZATION_LEVEL = 3;
@@ -9249,12 +9148,8 @@
4B35C5D40D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_OPTIMIZATION_LEVEL = 3;
@@ -9354,12 +9249,8 @@
4B35C5E80D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
HEADER_SEARCH_PATHS = (
@@ -9474,12 +9365,8 @@
4B35C5FC0D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
HEADER_SEARCH_PATHS = (
@@ -9593,12 +9480,8 @@
4B35C6100D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
HEADER_SEARCH_PATHS = (
@@ -9724,12 +9607,8 @@
4B35C61C0D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -9879,12 +9758,8 @@
4B35C6270D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -10034,12 +9909,8 @@
4B35C6320D4731D2000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -10179,12 +10050,8 @@
4B35C63C0D4731D3000DE7AE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -10775,7 +10642,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.4;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
- "-lsndfile",
"-framework",
Jackmp,
"-framework",
@@ -10873,7 +10739,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.4;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
- "-lsndfile",
"-framework",
Jackmp,
"-framework",
@@ -10971,7 +10836,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.4;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
- "-lsndfile",
"-framework",
Jackmp,
"-framework",
@@ -11216,7 +11080,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
- ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "ppc i386 ppc64 x86_64";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -14419,7 +14283,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
- ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "ppc i386 ppc64 x86_64";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -14567,7 +14431,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
- ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "ppc i386 ppc64 x86_64";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -14709,7 +14573,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
- ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "ppc i386 ppc64 x86_64";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -14852,8 +14716,7 @@
4BDCDBFD1001FD7300B15929 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
- ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
+ ARCHS = "$(NATIVE_ARCH_ACTUAL)";
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -14997,8 +14860,7 @@
4BDCDC231001FDE300B15929 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
- ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
+ ARCHS = "$(NATIVE_ARCH_ACTUAL)";
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -15574,12 +15436,8 @@
4BFA828A0DF6A9E40087B4E1 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -15677,12 +15535,8 @@
4BFA829D0DF6A9E40087B4E1 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -15783,12 +15637,8 @@
4BFA82A90DF6A9E40087B4E1 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -15889,12 +15739,8 @@
4BFA82B50DF6A9E40087B4E1 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -15902,7 +15748,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.4;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
- "-lsndfile",
"-framework",
Jackmp,
"-framework",
@@ -15991,12 +15836,8 @@
4BFA82C10DF6A9E40087B4E1 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -16004,7 +15845,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.4;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
- "-lsndfile",
"-framework",
Jackmp,
"-framework",
@@ -16093,12 +15933,8 @@
4BFA82CD0DF6A9E40087B4E1 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc64,
- ppc,
- i386,
- x86_64,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -16106,7 +15942,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.4;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
- "-lsndfile",
"-framework",
Jackmp,
"-framework",
diff --git a/macosx/RPC/JackRPCClient.defs b/macosx/RPC/JackRPCClient.defs
index ea5489ca..3c3eb515 100644
--- a/macosx/RPC/JackRPCClient.defs
+++ b/macosx/RPC/JackRPCClient.defs
@@ -24,14 +24,15 @@ subsystem JackRPCClient 1000;
import "Jackdefs.h";
waittime 5000;
-type client_name_t = c_string[128];
-type client_port_name_t = c_string[128];
+type client_name_t = c_string[64];
+type message_t = c_string[256];
routine rpc_jack_client_sync_notify(
client_port : mach_port_t;
refnum : int;
client_name : client_name_t;
notify : int;
+ message : message_t;
value1 : int;
value2 : int;
out result : int);
@@ -41,5 +42,6 @@ simpleroutine rpc_jack_client_async_notify(
refnum : int;
client_name : client_name_t;
notify : int;
+ message : message_t;
value1 : int;
value2 : int);
diff --git a/macosx/RPC/JackRPCClient.h b/macosx/RPC/JackRPCClient.h
index 72c53fda..d4462479 100644
--- a/macosx/RPC/JackRPCClient.h
+++ b/macosx/RPC/JackRPCClient.h
@@ -21,7 +21,7 @@ typedef struct {
char *name;
function_ptr_t function;
} function_table_entry;
-typedef function_table_entry *function_table_t;
+typedef function_table_entry *function_table_t;
#endif /* FUNCTION_PTR_T */
#endif /* AUTOTEST */
@@ -55,6 +55,7 @@ kern_return_t rpc_jack_client_sync_notify
int refnum,
client_name_t client_name,
int notify,
+ message_t message,
int value1,
int value2,
int *result
@@ -72,6 +73,7 @@ kern_return_t rpc_jack_client_async_notify
int refnum,
client_name_t client_name,
int notify,
+ message_t message,
int value1,
int value2
);
@@ -103,6 +105,7 @@ __END_DECLS
int refnum;
client_name_t client_name;
int notify;
+ message_t message;
int value1;
int value2;
} __Request__rpc_jack_client_sync_notify_t;
@@ -119,6 +122,7 @@ __END_DECLS
int refnum;
client_name_t client_name;
int notify;
+ message_t message;
int value1;
int value2;
} __Request__rpc_jack_client_async_notify_t;
diff --git a/macosx/RPC/JackRPCClientServer.c b/macosx/RPC/JackRPCClientServer.c
index efb4e9e9..7f5af274 100644
--- a/macosx/RPC/JackRPCClientServer.c
+++ b/macosx/RPC/JackRPCClientServer.c
@@ -1,7 +1,7 @@
/*
* IDENTIFICATION:
- * stub generated Mon Sep 1 17:42:27 2008
- * with a MiG generated Tue Feb 19 02:01:43 PST 2008 by root@b75.local
+ * stub generated Fri Oct 23 10:35:08 2009
+ * with a MiG generated Mon May 18 09:59:33 PDT 2009 by root@sulitlana.apple.com
* OPTIONS:
*/
@@ -113,6 +113,7 @@
int refnum;
client_name_t client_name;
int notify;
+ message_t message;
int value1;
int value2;
} __Request__rpc_jack_client_sync_notify_t;
@@ -129,6 +130,7 @@
int refnum;
client_name_t client_name;
int notify;
+ message_t message;
int value1;
int value2;
} __Request__rpc_jack_client_async_notify_t;
@@ -224,11 +226,11 @@ mig_internal novalue _Xrpc_jack_client_async_notify
#elif defined(__NDR_convert__int_rep__JackRPCClient__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__client_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__client_name(a, f) \
- __NDR_convert__int_rep__JackRPCClient__string(a, f, 128)
+ __NDR_convert__int_rep__JackRPCClient__string(a, f, 64)
#elif defined(__NDR_convert__int_rep__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__client_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__client_name(a, f) \
- __NDR_convert__int_rep__string(a, f, 128)
+ __NDR_convert__int_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__client_name__defined */
@@ -252,6 +254,26 @@ mig_internal novalue _Xrpc_jack_client_async_notify
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__notify__defined */
+#ifndef __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#if defined(__NDR_convert__int_rep__JackRPCClient__message_t__defined)
+#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message(a, f) \
+ __NDR_convert__int_rep__JackRPCClient__message_t((message_t *)(a), f)
+#elif defined(__NDR_convert__int_rep__message_t__defined)
+#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message(a, f) \
+ __NDR_convert__int_rep__message_t((message_t *)(a), f)
+#elif defined(__NDR_convert__int_rep__JackRPCClient__string__defined)
+#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message(a, f) \
+ __NDR_convert__int_rep__JackRPCClient__string(a, f, 256)
+#elif defined(__NDR_convert__int_rep__string__defined)
+#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message(a, f) \
+ __NDR_convert__int_rep__string(a, f, 256)
+#endif /* defined(__NDR_convert__*__defined) */
+#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message__defined */
+
#ifndef __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__value1__defined
#if defined(__NDR_convert__int_rep__JackRPCClient__int__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__value1__defined
@@ -324,11 +346,11 @@ mig_internal novalue _Xrpc_jack_client_async_notify
#elif defined(__NDR_convert__char_rep__JackRPCClient__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__client_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__client_name(a, f) \
- __NDR_convert__char_rep__JackRPCClient__string(a, f, 128)
+ __NDR_convert__char_rep__JackRPCClient__string(a, f, 64)
#elif defined(__NDR_convert__char_rep__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__client_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__client_name(a, f) \
- __NDR_convert__char_rep__string(a, f, 128)
+ __NDR_convert__char_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__client_name__defined */
@@ -352,6 +374,26 @@ mig_internal novalue _Xrpc_jack_client_async_notify
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__notify__defined */
+#ifndef __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#if defined(__NDR_convert__char_rep__JackRPCClient__message_t__defined)
+#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message(a, f) \
+ __NDR_convert__char_rep__JackRPCClient__message_t((message_t *)(a), f)
+#elif defined(__NDR_convert__char_rep__message_t__defined)
+#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message(a, f) \
+ __NDR_convert__char_rep__message_t((message_t *)(a), f)
+#elif defined(__NDR_convert__char_rep__JackRPCClient__string__defined)
+#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message(a, f) \
+ __NDR_convert__char_rep__JackRPCClient__string(a, f, 256)
+#elif defined(__NDR_convert__char_rep__string__defined)
+#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message(a, f) \
+ __NDR_convert__char_rep__string(a, f, 256)
+#endif /* defined(__NDR_convert__*__defined) */
+#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message__defined */
+
#ifndef __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__value1__defined
#if defined(__NDR_convert__char_rep__JackRPCClient__int__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__value1__defined
@@ -424,11 +466,11 @@ mig_internal novalue _Xrpc_jack_client_async_notify
#elif defined(__NDR_convert__float_rep__JackRPCClient__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__client_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__client_name(a, f) \
- __NDR_convert__float_rep__JackRPCClient__string(a, f, 128)
+ __NDR_convert__float_rep__JackRPCClient__string(a, f, 64)
#elif defined(__NDR_convert__float_rep__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__client_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__client_name(a, f) \
- __NDR_convert__float_rep__string(a, f, 128)
+ __NDR_convert__float_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__client_name__defined */
@@ -452,6 +494,26 @@ mig_internal novalue _Xrpc_jack_client_async_notify
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__notify__defined */
+#ifndef __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#if defined(__NDR_convert__float_rep__JackRPCClient__message_t__defined)
+#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message(a, f) \
+ __NDR_convert__float_rep__JackRPCClient__message_t((message_t *)(a), f)
+#elif defined(__NDR_convert__float_rep__message_t__defined)
+#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message(a, f) \
+ __NDR_convert__float_rep__message_t((message_t *)(a), f)
+#elif defined(__NDR_convert__float_rep__JackRPCClient__string__defined)
+#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message(a, f) \
+ __NDR_convert__float_rep__JackRPCClient__string(a, f, 256)
+#elif defined(__NDR_convert__float_rep__string__defined)
+#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message__defined
+#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message(a, f) \
+ __NDR_convert__float_rep__string(a, f, 256)
+#endif /* defined(__NDR_convert__*__defined) */
+#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message__defined */
+
#ifndef __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__value1__defined
#if defined(__NDR_convert__float_rep__JackRPCClient__int__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__value1__defined
@@ -503,9 +565,24 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_sync_notify_t(_
return MIG_BAD_ARGUMENTS;
#endif /* __MigTypeCheck */
+#if __MigTypeCheck
+ {
+ char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
+ size_t memchr_limit;
+
+ memchr_limit = min((msg_limit - In0P->client_name), 64);
+ if (( memchr(In0P->client_name, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ memchr_limit = min((msg_limit - In0P->message), 256);
+ if (( memchr(In0P->message, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ }
+#endif /* __MigTypeCheck */
+
#if defined(__NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__refnum__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__client_name__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__notify__defined) || \
+ defined(__NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__value1__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__value2__defined)
if (In0P->NDR.int_rep != NDR_record.int_rep) {
@@ -518,6 +595,9 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_sync_notify_t(_
#if defined(__NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__notify__defined)
__NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__notify(&In0P->notify, In0P->NDR.int_rep);
#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__notify__defined */
+#if defined(__NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message__defined)
+ __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message(&In0P->message, In0P->NDR.int_rep);
+#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__message__defined */
#if defined(__NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__value1__defined)
__NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__value1(&In0P->value1, In0P->NDR.int_rep);
#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_sync_notify_t__value1__defined */
@@ -530,6 +610,7 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_sync_notify_t(_
#if defined(__NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__refnum__defined) || \
defined(__NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__client_name__defined) || \
defined(__NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__notify__defined) || \
+ defined(__NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message__defined) || \
defined(__NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__value1__defined) || \
defined(__NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__value2__defined)
if (In0P->NDR.char_rep != NDR_record.char_rep) {
@@ -542,6 +623,9 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_sync_notify_t(_
#if defined(__NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__notify__defined)
__NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__notify(&In0P->notify, In0P->NDR.char_rep);
#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__notify__defined */
+#if defined(__NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message__defined)
+ __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message(&In0P->message, In0P->NDR.char_rep);
+#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__message__defined */
#if defined(__NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__value1__defined)
__NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__value1(&In0P->value1, In0P->NDR.char_rep);
#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_sync_notify_t__value1__defined */
@@ -554,6 +638,7 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_sync_notify_t(_
#if defined(__NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__refnum__defined) || \
defined(__NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__client_name__defined) || \
defined(__NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__notify__defined) || \
+ defined(__NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message__defined) || \
defined(__NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__value1__defined) || \
defined(__NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__value2__defined)
if (In0P->NDR.float_rep != NDR_record.float_rep) {
@@ -566,6 +651,9 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_sync_notify_t(_
#if defined(__NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__notify__defined)
__NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__notify(&In0P->notify, In0P->NDR.float_rep);
#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__notify__defined */
+#if defined(__NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message__defined)
+ __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message(&In0P->message, In0P->NDR.float_rep);
+#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__message__defined */
#if defined(__NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__value1__defined)
__NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__value1(&In0P->value1, In0P->NDR.float_rep);
#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_sync_notify_t__value1__defined */
@@ -594,6 +682,7 @@ kern_return_t rpc_jack_client_sync_notify
int refnum,
client_name_t client_name,
int notify,
+ message_t message,
int value1,
int value2,
int *result
@@ -613,6 +702,7 @@ mig_internal novalue _Xrpc_jack_client_sync_notify
int refnum;
client_name_t client_name;
int notify;
+ message_t message;
int value1;
int value2;
mach_msg_trailer_t trailer;
@@ -646,7 +736,7 @@ mig_internal novalue _Xrpc_jack_client_sync_notify
{ MIG_RETURN_ERROR(OutP, check_result); }
#endif /* defined(__MIG_check__Request__rpc_jack_client_sync_notify_t__defined) */
- OutP->RetCode = rpc_jack_client_sync_notify(In0P->Head.msgh_request_port, In0P->refnum, In0P->client_name, In0P->notify, In0P->value1, In0P->value2, &OutP->result);
+ OutP->RetCode = rpc_jack_client_sync_notify(In0P->Head.msgh_request_port, In0P->refnum, In0P->client_name, In0P->notify, In0P->message, In0P->value1, In0P->value2, &OutP->result);
if (OutP->RetCode != KERN_SUCCESS) {
MIG_RETURN_ERROR(OutP, OutP->RetCode);
}
@@ -694,11 +784,11 @@ mig_internal novalue _Xrpc_jack_client_sync_notify
#elif defined(__NDR_convert__int_rep__JackRPCClient__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__client_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__client_name(a, f) \
- __NDR_convert__int_rep__JackRPCClient__string(a, f, 128)
+ __NDR_convert__int_rep__JackRPCClient__string(a, f, 64)
#elif defined(__NDR_convert__int_rep__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__client_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__client_name(a, f) \
- __NDR_convert__int_rep__string(a, f, 128)
+ __NDR_convert__int_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__client_name__defined */
@@ -722,6 +812,26 @@ mig_internal novalue _Xrpc_jack_client_sync_notify
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__notify__defined */
+#ifndef __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#if defined(__NDR_convert__int_rep__JackRPCClient__message_t__defined)
+#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message(a, f) \
+ __NDR_convert__int_rep__JackRPCClient__message_t((message_t *)(a), f)
+#elif defined(__NDR_convert__int_rep__message_t__defined)
+#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message(a, f) \
+ __NDR_convert__int_rep__message_t((message_t *)(a), f)
+#elif defined(__NDR_convert__int_rep__JackRPCClient__string__defined)
+#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message(a, f) \
+ __NDR_convert__int_rep__JackRPCClient__string(a, f, 256)
+#elif defined(__NDR_convert__int_rep__string__defined)
+#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message(a, f) \
+ __NDR_convert__int_rep__string(a, f, 256)
+#endif /* defined(__NDR_convert__*__defined) */
+#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message__defined */
+
#ifndef __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__value1__defined
#if defined(__NDR_convert__int_rep__JackRPCClient__int__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__value1__defined
@@ -794,11 +904,11 @@ mig_internal novalue _Xrpc_jack_client_sync_notify
#elif defined(__NDR_convert__char_rep__JackRPCClient__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__client_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__client_name(a, f) \
- __NDR_convert__char_rep__JackRPCClient__string(a, f, 128)
+ __NDR_convert__char_rep__JackRPCClient__string(a, f, 64)
#elif defined(__NDR_convert__char_rep__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__client_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__client_name(a, f) \
- __NDR_convert__char_rep__string(a, f, 128)
+ __NDR_convert__char_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__client_name__defined */
@@ -822,6 +932,26 @@ mig_internal novalue _Xrpc_jack_client_sync_notify
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__notify__defined */
+#ifndef __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#if defined(__NDR_convert__char_rep__JackRPCClient__message_t__defined)
+#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message(a, f) \
+ __NDR_convert__char_rep__JackRPCClient__message_t((message_t *)(a), f)
+#elif defined(__NDR_convert__char_rep__message_t__defined)
+#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message(a, f) \
+ __NDR_convert__char_rep__message_t((message_t *)(a), f)
+#elif defined(__NDR_convert__char_rep__JackRPCClient__string__defined)
+#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message(a, f) \
+ __NDR_convert__char_rep__JackRPCClient__string(a, f, 256)
+#elif defined(__NDR_convert__char_rep__string__defined)
+#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message(a, f) \
+ __NDR_convert__char_rep__string(a, f, 256)
+#endif /* defined(__NDR_convert__*__defined) */
+#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message__defined */
+
#ifndef __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__value1__defined
#if defined(__NDR_convert__char_rep__JackRPCClient__int__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__value1__defined
@@ -894,11 +1024,11 @@ mig_internal novalue _Xrpc_jack_client_sync_notify
#elif defined(__NDR_convert__float_rep__JackRPCClient__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__client_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__client_name(a, f) \
- __NDR_convert__float_rep__JackRPCClient__string(a, f, 128)
+ __NDR_convert__float_rep__JackRPCClient__string(a, f, 64)
#elif defined(__NDR_convert__float_rep__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__client_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__client_name(a, f) \
- __NDR_convert__float_rep__string(a, f, 128)
+ __NDR_convert__float_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__client_name__defined */
@@ -922,6 +1052,26 @@ mig_internal novalue _Xrpc_jack_client_sync_notify
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__notify__defined */
+#ifndef __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#if defined(__NDR_convert__float_rep__JackRPCClient__message_t__defined)
+#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message(a, f) \
+ __NDR_convert__float_rep__JackRPCClient__message_t((message_t *)(a), f)
+#elif defined(__NDR_convert__float_rep__message_t__defined)
+#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message(a, f) \
+ __NDR_convert__float_rep__message_t((message_t *)(a), f)
+#elif defined(__NDR_convert__float_rep__JackRPCClient__string__defined)
+#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message(a, f) \
+ __NDR_convert__float_rep__JackRPCClient__string(a, f, 256)
+#elif defined(__NDR_convert__float_rep__string__defined)
+#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message__defined
+#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message(a, f) \
+ __NDR_convert__float_rep__string(a, f, 256)
+#endif /* defined(__NDR_convert__*__defined) */
+#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message__defined */
+
#ifndef __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__value1__defined
#if defined(__NDR_convert__float_rep__JackRPCClient__int__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__value1__defined
@@ -973,9 +1123,24 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_async_notify_t(
return MIG_BAD_ARGUMENTS;
#endif /* __MigTypeCheck */
+#if __MigTypeCheck
+ {
+ char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
+ size_t memchr_limit;
+
+ memchr_limit = min((msg_limit - In0P->client_name), 64);
+ if (( memchr(In0P->client_name, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ memchr_limit = min((msg_limit - In0P->message), 256);
+ if (( memchr(In0P->message, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ }
+#endif /* __MigTypeCheck */
+
#if defined(__NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__refnum__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__client_name__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__notify__defined) || \
+ defined(__NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__value1__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__value2__defined)
if (In0P->NDR.int_rep != NDR_record.int_rep) {
@@ -988,6 +1153,9 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_async_notify_t(
#if defined(__NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__notify__defined)
__NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__notify(&In0P->notify, In0P->NDR.int_rep);
#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__notify__defined */
+#if defined(__NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message__defined)
+ __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message(&In0P->message, In0P->NDR.int_rep);
+#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__message__defined */
#if defined(__NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__value1__defined)
__NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__value1(&In0P->value1, In0P->NDR.int_rep);
#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_async_notify_t__value1__defined */
@@ -1000,6 +1168,7 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_async_notify_t(
#if defined(__NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__refnum__defined) || \
defined(__NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__client_name__defined) || \
defined(__NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__notify__defined) || \
+ defined(__NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message__defined) || \
defined(__NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__value1__defined) || \
defined(__NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__value2__defined)
if (In0P->NDR.char_rep != NDR_record.char_rep) {
@@ -1012,6 +1181,9 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_async_notify_t(
#if defined(__NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__notify__defined)
__NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__notify(&In0P->notify, In0P->NDR.char_rep);
#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__notify__defined */
+#if defined(__NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message__defined)
+ __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message(&In0P->message, In0P->NDR.char_rep);
+#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__message__defined */
#if defined(__NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__value1__defined)
__NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__value1(&In0P->value1, In0P->NDR.char_rep);
#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_async_notify_t__value1__defined */
@@ -1024,6 +1196,7 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_async_notify_t(
#if defined(__NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__refnum__defined) || \
defined(__NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__client_name__defined) || \
defined(__NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__notify__defined) || \
+ defined(__NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message__defined) || \
defined(__NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__value1__defined) || \
defined(__NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__value2__defined)
if (In0P->NDR.float_rep != NDR_record.float_rep) {
@@ -1036,6 +1209,9 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_async_notify_t(
#if defined(__NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__notify__defined)
__NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__notify(&In0P->notify, In0P->NDR.float_rep);
#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__notify__defined */
+#if defined(__NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message__defined)
+ __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message(&In0P->message, In0P->NDR.float_rep);
+#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__message__defined */
#if defined(__NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__value1__defined)
__NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__value1(&In0P->value1, In0P->NDR.float_rep);
#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_async_notify_t__value1__defined */
@@ -1064,6 +1240,7 @@ kern_return_t rpc_jack_client_async_notify
int refnum,
client_name_t client_name,
int notify,
+ message_t message,
int value1,
int value2
);
@@ -1082,6 +1259,7 @@ mig_internal novalue _Xrpc_jack_client_async_notify
int refnum;
client_name_t client_name;
int notify;
+ message_t message;
int value1;
int value2;
mach_msg_trailer_t trailer;
@@ -1115,7 +1293,7 @@ mig_internal novalue _Xrpc_jack_client_async_notify
{ MIG_RETURN_ERROR(OutP, check_result); }
#endif /* defined(__MIG_check__Request__rpc_jack_client_async_notify_t__defined) */
- OutP->RetCode = rpc_jack_client_async_notify(In0P->Head.msgh_request_port, In0P->refnum, In0P->client_name, In0P->notify, In0P->value1, In0P->value2);
+ OutP->RetCode = rpc_jack_client_async_notify(In0P->Head.msgh_request_port, In0P->refnum, In0P->client_name, In0P->notify, In0P->message, In0P->value1, In0P->value2);
__AfterRcvSimple(1001, "rpc_jack_client_async_notify")
}
@@ -1145,9 +1323,9 @@ const struct JackRPCClient_subsystem {
(vm_address_t)0,
{
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_client_sync_notify, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_sync_notify_t)},
+ (mig_stub_routine_t) _Xrpc_jack_client_sync_notify, 8, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_sync_notify_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_client_async_notify, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_async_notify_t)},
+ (mig_stub_routine_t) _Xrpc_jack_client_async_notify, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_async_notify_t)},
}
};
diff --git a/macosx/RPC/JackRPCClientUser.c b/macosx/RPC/JackRPCClientUser.c
index 4dc66a10..e6fef35e 100644
--- a/macosx/RPC/JackRPCClientUser.c
+++ b/macosx/RPC/JackRPCClientUser.c
@@ -1,7 +1,7 @@
/*
* IDENTIFICATION:
- * stub generated Mon Sep 1 17:42:27 2008
- * with a MiG generated Tue Feb 19 02:01:43 PST 2008 by root@b75.local
+ * stub generated Fri Oct 23 10:35:08 2009
+ * with a MiG generated Mon May 18 09:59:33 PDT 2009 by root@sulitlana.apple.com
* OPTIONS:
*/
#define __MIG_check__Reply__JackRPCClient_subsystem__ 1
@@ -50,15 +50,15 @@
#ifndef __MachMsgErrorWithTimeout
#define __MachMsgErrorWithTimeout(_R_) { \
switch (_R_) { \
- case MACH_SEND_INVALID_REPLY: \
- case MACH_RCV_INVALID_NAME: \
- case MACH_RCV_PORT_DIED: \
- case MACH_RCV_PORT_CHANGED: \
- case MACH_RCV_TIMED_OUT: \
- mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
+ case MACH_SEND_INVALID_DATA: \
+ case MACH_SEND_INVALID_DEST: \
+ case MACH_SEND_INVALID_HEADER: \
+ mig_put_reply_port(InP->Head.msgh_reply_port); \
break; \
+ case MACH_SEND_TIMED_OUT: \
+ case MACH_RCV_TIMED_OUT: \
default: \
- mig_put_reply_port(InP->Head.msgh_reply_port); \
+ mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
} \
}
#endif /* __MachMsgErrorWithTimeout */
@@ -66,14 +66,13 @@
#ifndef __MachMsgErrorWithoutTimeout
#define __MachMsgErrorWithoutTimeout(_R_) { \
switch (_R_) { \
- case MACH_SEND_INVALID_REPLY: \
- case MACH_RCV_INVALID_NAME: \
- case MACH_RCV_PORT_DIED: \
- case MACH_RCV_PORT_CHANGED: \
- mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
+ case MACH_SEND_INVALID_DATA: \
+ case MACH_SEND_INVALID_DEST: \
+ case MACH_SEND_INVALID_HEADER: \
+ mig_put_reply_port(InP->Head.msgh_reply_port); \
break; \
default: \
- mig_put_reply_port(InP->Head.msgh_reply_port); \
+ mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
} \
}
#endif /* __MachMsgErrorWithoutTimeout */
@@ -265,6 +264,7 @@ mig_external kern_return_t rpc_jack_client_sync_notify
int refnum,
client_name_t client_name,
int notify,
+ message_t message,
int value1,
int value2,
int *result
@@ -280,6 +280,7 @@ mig_external kern_return_t rpc_jack_client_sync_notify
int refnum;
client_name_t client_name;
int notify;
+ message_t message;
int value1;
int value2;
} Request;
@@ -341,10 +342,12 @@ mig_external kern_return_t rpc_jack_client_sync_notify
InP->refnum = refnum;
- (void) mig_strncpy(InP->client_name, client_name, 128);
+ (void) mig_strncpy(InP->client_name, client_name, 64);
InP->notify = notify;
+ (void) mig_strncpy(InP->message, message, 256);
+
InP->value1 = value1;
InP->value2 = value2;
@@ -387,6 +390,7 @@ mig_external kern_return_t rpc_jack_client_async_notify
int refnum,
client_name_t client_name,
int notify,
+ message_t message,
int value1,
int value2
)
@@ -401,6 +405,7 @@ mig_external kern_return_t rpc_jack_client_async_notify
int refnum;
client_name_t client_name;
int notify;
+ message_t message;
int value1;
int value2;
} Request;
@@ -433,10 +438,12 @@ mig_external kern_return_t rpc_jack_client_async_notify
InP->refnum = refnum;
- (void) mig_strncpy(InP->client_name, client_name, 128);
+ (void) mig_strncpy(InP->client_name, client_name, 64);
InP->notify = notify;
+ (void) mig_strncpy(InP->message, message, 256);
+
InP->value1 = value1;
InP->value2 = value2;
diff --git a/macosx/RPC/JackRPCEngine.defs b/macosx/RPC/JackRPCEngine.defs
index 63500f41..468b3775 100644
--- a/macosx/RPC/JackRPCEngine.defs
+++ b/macosx/RPC/JackRPCEngine.defs
@@ -25,11 +25,11 @@ import "Jackdefs.h";
ServerPrefix server_;
-type client_name_t = c_string[128];
+type client_name_t = c_string[64];
type client_port_name_t = c_string[128];
type client_port_type_t = c_string[128];
-type so_name_t = c_string[1024];
-type objet_data_t = c_string[1024];
+type so_name_t = c_string[256];
+type objet_data_t = c_string[256];
routine rpc_jack_client_open(
server_port : mach_port_t;
diff --git a/macosx/RPC/JackRPCEngine.h b/macosx/RPC/JackRPCEngine.h
index 8b4fddf4..b9ba07f0 100644
--- a/macosx/RPC/JackRPCEngine.h
+++ b/macosx/RPC/JackRPCEngine.h
@@ -21,7 +21,7 @@ typedef struct {
char *name;
function_ptr_t function;
} function_table_entry;
-typedef function_table_entry *function_table_t;
+typedef function_table_entry *function_table_t;
#endif /* FUNCTION_PTR_T */
#endif /* AUTOTEST */
diff --git a/macosx/RPC/JackRPCEngineServer.c b/macosx/RPC/JackRPCEngineServer.c
index 16508dcf..7ef5d556 100644
--- a/macosx/RPC/JackRPCEngineServer.c
+++ b/macosx/RPC/JackRPCEngineServer.c
@@ -1,7 +1,7 @@
/*
* IDENTIFICATION:
- * stub generated Mon Sep 1 17:42:28 2008
- * with a MiG generated Tue Feb 19 02:01:43 PST 2008 by root@b75.local
+ * stub generated Fri Oct 23 10:35:08 2009
+ * with a MiG generated Mon May 18 09:59:33 PDT 2009 by root@sulitlana.apple.com
* OPTIONS:
*/
@@ -791,11 +791,11 @@ mig_internal novalue _Xrpc_jack_client_rt_notify
#elif defined(__NDR_convert__int_rep__JackRPCEngine__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_client_open_t__client_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_client_open_t__client_name(a, f) \
- __NDR_convert__int_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__int_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__int_rep__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_client_open_t__client_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_client_open_t__client_name(a, f) \
- __NDR_convert__int_rep__string(a, f, 128)
+ __NDR_convert__int_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_open_t__client_name__defined */
@@ -831,11 +831,11 @@ mig_internal novalue _Xrpc_jack_client_rt_notify
#elif defined(__NDR_convert__char_rep__JackRPCEngine__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_client_open_t__client_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_client_open_t__client_name(a, f) \
- __NDR_convert__char_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__char_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__char_rep__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_client_open_t__client_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_client_open_t__client_name(a, f) \
- __NDR_convert__char_rep__string(a, f, 128)
+ __NDR_convert__char_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_open_t__client_name__defined */
@@ -871,11 +871,11 @@ mig_internal novalue _Xrpc_jack_client_rt_notify
#elif defined(__NDR_convert__float_rep__JackRPCEngine__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_client_open_t__client_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_client_open_t__client_name(a, f) \
- __NDR_convert__float_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__float_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__float_rep__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_client_open_t__client_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_client_open_t__client_name(a, f) \
- __NDR_convert__float_rep__string(a, f, 128)
+ __NDR_convert__float_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_open_t__client_name__defined */
@@ -910,6 +910,17 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_open_t(__attrib
return MIG_BAD_ARGUMENTS;
#endif /* __MigTypeCheck */
+#if __MigTypeCheck
+ {
+ char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
+ size_t memchr_limit;
+
+ memchr_limit = min((msg_limit - In0P->client_name), 64);
+ if (( memchr(In0P->client_name, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ }
+#endif /* __MigTypeCheck */
+
#if defined(__NDR_convert__int_rep__Request__rpc_jack_client_open_t__client_name__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_client_open_t__pid__defined)
if (In0P->NDR.int_rep != NDR_record.int_rep) {
@@ -1064,11 +1075,11 @@ mig_internal novalue _Xrpc_jack_client_open
#elif defined(__NDR_convert__int_rep__JackRPCEngine__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__client_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__client_name(a, f) \
- __NDR_convert__int_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__int_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__int_rep__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__client_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__client_name(a, f) \
- __NDR_convert__int_rep__string(a, f, 128)
+ __NDR_convert__int_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_check_t__client_name__defined */
@@ -1124,11 +1135,11 @@ mig_internal novalue _Xrpc_jack_client_open
#elif defined(__NDR_convert__char_rep__JackRPCEngine__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__client_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__client_name(a, f) \
- __NDR_convert__char_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__char_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__char_rep__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__client_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__client_name(a, f) \
- __NDR_convert__char_rep__string(a, f, 128)
+ __NDR_convert__char_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_check_t__client_name__defined */
@@ -1184,11 +1195,11 @@ mig_internal novalue _Xrpc_jack_client_open
#elif defined(__NDR_convert__float_rep__JackRPCEngine__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__client_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__client_name(a, f) \
- __NDR_convert__float_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__float_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__float_rep__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__client_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__client_name(a, f) \
- __NDR_convert__float_rep__string(a, f, 128)
+ __NDR_convert__float_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_check_t__client_name__defined */
@@ -1243,6 +1254,17 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_check_t(__attri
return MIG_BAD_ARGUMENTS;
#endif /* __MigTypeCheck */
+#if __MigTypeCheck
+ {
+ char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
+ size_t memchr_limit;
+
+ memchr_limit = min((msg_limit - In0P->client_name), 64);
+ if (( memchr(In0P->client_name, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ }
+#endif /* __MigTypeCheck */
+
#if defined(__NDR_convert__int_rep__Request__rpc_jack_client_check_t__client_name__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_client_check_t__options__defined)
@@ -2283,6 +2305,20 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_port_register_t(__attr
return MIG_BAD_ARGUMENTS;
#endif /* __MigTypeCheck */
+#if __MigTypeCheck
+ {
+ char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
+ size_t memchr_limit;
+
+ memchr_limit = min((msg_limit - In0P->name), 128);
+ if (( memchr(In0P->name, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ memchr_limit = min((msg_limit - In0P->port_type), 128);
+ if (( memchr(In0P->port_type, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ }
+#endif /* __MigTypeCheck */
+
#if defined(__NDR_convert__int_rep__Request__rpc_jack_port_register_t__refnum__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_port_register_t__name__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_port_register_t__port_type__defined) || \
@@ -3526,6 +3562,20 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_port_connect_name_t(__
return MIG_BAD_ARGUMENTS;
#endif /* __MigTypeCheck */
+#if __MigTypeCheck
+ {
+ char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
+ size_t memchr_limit;
+
+ memchr_limit = min((msg_limit - In0P->src), 128);
+ if (( memchr(In0P->src, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ memchr_limit = min((msg_limit - In0P->dst), 128);
+ if (( memchr(In0P->dst, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ }
+#endif /* __MigTypeCheck */
+
#if defined(__NDR_convert__int_rep__Request__rpc_jack_port_connect_name_t__refnum__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_port_connect_name_t__src__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_port_connect_name_t__dst__defined)
@@ -3848,6 +3898,20 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_port_disconnect_name_t
return MIG_BAD_ARGUMENTS;
#endif /* __MigTypeCheck */
+#if __MigTypeCheck
+ {
+ char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
+ size_t memchr_limit;
+
+ memchr_limit = min((msg_limit - In0P->src), 128);
+ if (( memchr(In0P->src, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ memchr_limit = min((msg_limit - In0P->dst), 128);
+ if (( memchr(In0P->dst, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ }
+#endif /* __MigTypeCheck */
+
#if defined(__NDR_convert__int_rep__Request__rpc_jack_port_disconnect_name_t__refnum__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_port_disconnect_name_t__src__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_port_disconnect_name_t__dst__defined)
@@ -4170,6 +4234,17 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_port_rename_t(__attrib
return MIG_BAD_ARGUMENTS;
#endif /* __MigTypeCheck */
+#if __MigTypeCheck
+ {
+ char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
+ size_t memchr_limit;
+
+ memchr_limit = min((msg_limit - In0P->name), 128);
+ if (( memchr(In0P->name, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ }
+#endif /* __MigTypeCheck */
+
#if defined(__NDR_convert__int_rep__Request__rpc_jack_port_rename_t__refnum__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_port_rename_t__src__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_port_rename_t__name__defined)
@@ -5352,11 +5427,11 @@ mig_internal novalue _Xrpc_jack_get_internal_clientname
#elif defined(__NDR_convert__int_rep__JackRPCEngine__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clienthandle_t__client_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clienthandle_t__client_name(a, f) \
- __NDR_convert__int_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__int_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__int_rep__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clienthandle_t__client_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clienthandle_t__client_name(a, f) \
- __NDR_convert__int_rep__string(a, f, 128)
+ __NDR_convert__int_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__int_rep__Request__rpc_jack_internal_clienthandle_t__client_name__defined */
@@ -5392,11 +5467,11 @@ mig_internal novalue _Xrpc_jack_get_internal_clientname
#elif defined(__NDR_convert__char_rep__JackRPCEngine__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clienthandle_t__client_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clienthandle_t__client_name(a, f) \
- __NDR_convert__char_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__char_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__char_rep__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clienthandle_t__client_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clienthandle_t__client_name(a, f) \
- __NDR_convert__char_rep__string(a, f, 128)
+ __NDR_convert__char_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__char_rep__Request__rpc_jack_internal_clienthandle_t__client_name__defined */
@@ -5432,11 +5507,11 @@ mig_internal novalue _Xrpc_jack_get_internal_clientname
#elif defined(__NDR_convert__float_rep__JackRPCEngine__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clienthandle_t__client_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clienthandle_t__client_name(a, f) \
- __NDR_convert__float_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__float_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__float_rep__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clienthandle_t__client_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clienthandle_t__client_name(a, f) \
- __NDR_convert__float_rep__string(a, f, 128)
+ __NDR_convert__float_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__float_rep__Request__rpc_jack_internal_clienthandle_t__client_name__defined */
@@ -5451,6 +5526,17 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_internal_clienthandle_
return MIG_BAD_ARGUMENTS;
#endif /* __MigTypeCheck */
+#if __MigTypeCheck
+ {
+ char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
+ size_t memchr_limit;
+
+ memchr_limit = min((msg_limit - In0P->client_name), 64);
+ if (( memchr(In0P->client_name, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ }
+#endif /* __MigTypeCheck */
+
#if defined(__NDR_convert__int_rep__Request__rpc_jack_internal_clienthandle_t__refnum__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_internal_clienthandle_t__client_name__defined)
if (In0P->NDR.int_rep != NDR_record.int_rep) {
@@ -5602,11 +5688,11 @@ mig_internal novalue _Xrpc_jack_internal_clienthandle
#elif defined(__NDR_convert__int_rep__JackRPCEngine__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__client_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__client_name(a, f) \
- __NDR_convert__int_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__int_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__int_rep__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__client_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__client_name(a, f) \
- __NDR_convert__int_rep__string(a, f, 128)
+ __NDR_convert__int_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__client_name__defined */
@@ -5622,11 +5708,11 @@ mig_internal novalue _Xrpc_jack_internal_clienthandle
#elif defined(__NDR_convert__int_rep__JackRPCEngine__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__so_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__so_name(a, f) \
- __NDR_convert__int_rep__JackRPCEngine__string(a, f, 1024)
+ __NDR_convert__int_rep__JackRPCEngine__string(a, f, 256)
#elif defined(__NDR_convert__int_rep__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__so_name__defined
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__so_name(a, f) \
- __NDR_convert__int_rep__string(a, f, 1024)
+ __NDR_convert__int_rep__string(a, f, 256)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__so_name__defined */
@@ -5642,11 +5728,11 @@ mig_internal novalue _Xrpc_jack_internal_clienthandle
#elif defined(__NDR_convert__int_rep__JackRPCEngine__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__objet_data__defined
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__objet_data(a, f) \
- __NDR_convert__int_rep__JackRPCEngine__string(a, f, 1024)
+ __NDR_convert__int_rep__JackRPCEngine__string(a, f, 256)
#elif defined(__NDR_convert__int_rep__string__defined)
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__objet_data__defined
#define __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__objet_data(a, f) \
- __NDR_convert__int_rep__string(a, f, 1024)
+ __NDR_convert__int_rep__string(a, f, 256)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__objet_data__defined */
@@ -5702,11 +5788,11 @@ mig_internal novalue _Xrpc_jack_internal_clienthandle
#elif defined(__NDR_convert__char_rep__JackRPCEngine__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__client_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__client_name(a, f) \
- __NDR_convert__char_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__char_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__char_rep__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__client_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__client_name(a, f) \
- __NDR_convert__char_rep__string(a, f, 128)
+ __NDR_convert__char_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__client_name__defined */
@@ -5722,11 +5808,11 @@ mig_internal novalue _Xrpc_jack_internal_clienthandle
#elif defined(__NDR_convert__char_rep__JackRPCEngine__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__so_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__so_name(a, f) \
- __NDR_convert__char_rep__JackRPCEngine__string(a, f, 1024)
+ __NDR_convert__char_rep__JackRPCEngine__string(a, f, 256)
#elif defined(__NDR_convert__char_rep__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__so_name__defined
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__so_name(a, f) \
- __NDR_convert__char_rep__string(a, f, 1024)
+ __NDR_convert__char_rep__string(a, f, 256)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__so_name__defined */
@@ -5742,11 +5828,11 @@ mig_internal novalue _Xrpc_jack_internal_clienthandle
#elif defined(__NDR_convert__char_rep__JackRPCEngine__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__objet_data__defined
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__objet_data(a, f) \
- __NDR_convert__char_rep__JackRPCEngine__string(a, f, 1024)
+ __NDR_convert__char_rep__JackRPCEngine__string(a, f, 256)
#elif defined(__NDR_convert__char_rep__string__defined)
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__objet_data__defined
#define __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__objet_data(a, f) \
- __NDR_convert__char_rep__string(a, f, 1024)
+ __NDR_convert__char_rep__string(a, f, 256)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__char_rep__Request__rpc_jack_internal_clientload_t__objet_data__defined */
@@ -5802,11 +5888,11 @@ mig_internal novalue _Xrpc_jack_internal_clienthandle
#elif defined(__NDR_convert__float_rep__JackRPCEngine__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__client_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__client_name(a, f) \
- __NDR_convert__float_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__float_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__float_rep__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__client_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__client_name(a, f) \
- __NDR_convert__float_rep__string(a, f, 128)
+ __NDR_convert__float_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__client_name__defined */
@@ -5822,11 +5908,11 @@ mig_internal novalue _Xrpc_jack_internal_clienthandle
#elif defined(__NDR_convert__float_rep__JackRPCEngine__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__so_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__so_name(a, f) \
- __NDR_convert__float_rep__JackRPCEngine__string(a, f, 1024)
+ __NDR_convert__float_rep__JackRPCEngine__string(a, f, 256)
#elif defined(__NDR_convert__float_rep__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__so_name__defined
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__so_name(a, f) \
- __NDR_convert__float_rep__string(a, f, 1024)
+ __NDR_convert__float_rep__string(a, f, 256)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__so_name__defined */
@@ -5842,11 +5928,11 @@ mig_internal novalue _Xrpc_jack_internal_clienthandle
#elif defined(__NDR_convert__float_rep__JackRPCEngine__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__objet_data__defined
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__objet_data(a, f) \
- __NDR_convert__float_rep__JackRPCEngine__string(a, f, 1024)
+ __NDR_convert__float_rep__JackRPCEngine__string(a, f, 256)
#elif defined(__NDR_convert__float_rep__string__defined)
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__objet_data__defined
#define __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__objet_data(a, f) \
- __NDR_convert__float_rep__string(a, f, 1024)
+ __NDR_convert__float_rep__string(a, f, 256)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__float_rep__Request__rpc_jack_internal_clientload_t__objet_data__defined */
@@ -5881,6 +5967,23 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_internal_clientload_t(
return MIG_BAD_ARGUMENTS;
#endif /* __MigTypeCheck */
+#if __MigTypeCheck
+ {
+ char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
+ size_t memchr_limit;
+
+ memchr_limit = min((msg_limit - In0P->client_name), 64);
+ if (( memchr(In0P->client_name, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ memchr_limit = min((msg_limit - In0P->so_name), 256);
+ if (( memchr(In0P->so_name, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ memchr_limit = min((msg_limit - In0P->objet_data), 256);
+ if (( memchr(In0P->objet_data, '\0', memchr_limit) == NULL ))
+ return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
+ }
+#endif /* __MigTypeCheck */
+
#if defined(__NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__refnum__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__client_name__defined) || \
defined(__NDR_convert__int_rep__Request__rpc_jack_internal_clientload_t__so_name__defined) || \
@@ -6626,47 +6729,47 @@ const struct server_JackRPCEngine_subsystem {
(vm_address_t)0,
{
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_client_open, 8, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_open_t)},
+ (mig_stub_routine_t) _Xrpc_jack_client_open, 8, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_open_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_client_check, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_check_t)},
+ (mig_stub_routine_t) _Xrpc_jack_client_check, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_check_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_client_close, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_close_t)},
+ (mig_stub_routine_t) _Xrpc_jack_client_close, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_close_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_client_activate, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_activate_t)},
+ (mig_stub_routine_t) _Xrpc_jack_client_activate, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_activate_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_client_deactivate, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_deactivate_t)},
+ (mig_stub_routine_t) _Xrpc_jack_client_deactivate, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_deactivate_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_port_register, 8, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_register_t)},
+ (mig_stub_routine_t) _Xrpc_jack_port_register, 8, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_register_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_port_unregister, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_unregister_t)},
+ (mig_stub_routine_t) _Xrpc_jack_port_unregister, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_unregister_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_port_connect, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_connect_t)},
+ (mig_stub_routine_t) _Xrpc_jack_port_connect, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_connect_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_port_disconnect, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_disconnect_t)},
+ (mig_stub_routine_t) _Xrpc_jack_port_disconnect, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_disconnect_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_port_connect_name, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_connect_name_t)},
+ (mig_stub_routine_t) _Xrpc_jack_port_connect_name, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_connect_name_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_port_disconnect_name, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_disconnect_name_t)},
+ (mig_stub_routine_t) _Xrpc_jack_port_disconnect_name, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_disconnect_name_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_port_rename, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_rename_t)},
+ (mig_stub_routine_t) _Xrpc_jack_port_rename, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_port_rename_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_set_buffer_size, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_set_buffer_size_t)},
+ (mig_stub_routine_t) _Xrpc_jack_set_buffer_size, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_set_buffer_size_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_set_freewheel, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_set_freewheel_t)},
+ (mig_stub_routine_t) _Xrpc_jack_set_freewheel, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_set_freewheel_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_release_timebase, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_release_timebase_t)},
+ (mig_stub_routine_t) _Xrpc_jack_release_timebase, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_release_timebase_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_set_timebase_callback, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_set_timebase_callback_t)},
+ (mig_stub_routine_t) _Xrpc_jack_set_timebase_callback, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_set_timebase_callback_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_get_internal_clientname, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_get_internal_clientname_t)},
+ (mig_stub_routine_t) _Xrpc_jack_get_internal_clientname, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_get_internal_clientname_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_internal_clienthandle, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_internal_clienthandle_t)},
+ (mig_stub_routine_t) _Xrpc_jack_internal_clienthandle, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_internal_clienthandle_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_internal_clientload, 9, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_internal_clientload_t)},
+ (mig_stub_routine_t) _Xrpc_jack_internal_clientload, 9, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_internal_clientload_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_internal_clientunload, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_internal_clientunload_t)},
+ (mig_stub_routine_t) _Xrpc_jack_internal_clientunload, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_internal_clientunload_t)},
{ (mig_impl_routine_t) 0,
- (mig_stub_routine_t) _Xrpc_jack_client_rt_notify, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_rt_notify_t)},
+ (mig_stub_routine_t) _Xrpc_jack_client_rt_notify, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_rt_notify_t)},
}
};
diff --git a/macosx/RPC/JackRPCEngineUser.c b/macosx/RPC/JackRPCEngineUser.c
index f6e5b3f0..e86e8cfc 100644
--- a/macosx/RPC/JackRPCEngineUser.c
+++ b/macosx/RPC/JackRPCEngineUser.c
@@ -1,7 +1,7 @@
/*
* IDENTIFICATION:
- * stub generated Mon Sep 1 17:42:28 2008
- * with a MiG generated Tue Feb 19 02:01:43 PST 2008 by root@b75.local
+ * stub generated Fri Oct 23 10:35:08 2009
+ * with a MiG generated Mon May 18 09:59:33 PDT 2009 by root@sulitlana.apple.com
* OPTIONS:
*/
#define __MIG_check__Reply__JackRPCEngine_subsystem__ 1
@@ -50,15 +50,15 @@
#ifndef __MachMsgErrorWithTimeout
#define __MachMsgErrorWithTimeout(_R_) { \
switch (_R_) { \
- case MACH_SEND_INVALID_REPLY: \
- case MACH_RCV_INVALID_NAME: \
- case MACH_RCV_PORT_DIED: \
- case MACH_RCV_PORT_CHANGED: \
- case MACH_RCV_TIMED_OUT: \
- mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
+ case MACH_SEND_INVALID_DATA: \
+ case MACH_SEND_INVALID_DEST: \
+ case MACH_SEND_INVALID_HEADER: \
+ mig_put_reply_port(InP->Head.msgh_reply_port); \
break; \
+ case MACH_SEND_TIMED_OUT: \
+ case MACH_RCV_TIMED_OUT: \
default: \
- mig_put_reply_port(InP->Head.msgh_reply_port); \
+ mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
} \
}
#endif /* __MachMsgErrorWithTimeout */
@@ -66,14 +66,13 @@
#ifndef __MachMsgErrorWithoutTimeout
#define __MachMsgErrorWithoutTimeout(_R_) { \
switch (_R_) { \
- case MACH_SEND_INVALID_REPLY: \
- case MACH_RCV_INVALID_NAME: \
- case MACH_RCV_PORT_DIED: \
- case MACH_RCV_PORT_CHANGED: \
- mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
+ case MACH_SEND_INVALID_DATA: \
+ case MACH_SEND_INVALID_DEST: \
+ case MACH_SEND_INVALID_HEADER: \
+ mig_put_reply_port(InP->Head.msgh_reply_port); \
break; \
default: \
- mig_put_reply_port(InP->Head.msgh_reply_port); \
+ mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
} \
}
#endif /* __MachMsgErrorWithoutTimeout */
@@ -399,8 +398,9 @@ mig_internal kern_return_t __MIG_check__Reply__rpc_jack_client_open_t(__Reply__r
#if __MigTypeCheck
if (Out0P->private_port.type != MACH_MSG_PORT_DESCRIPTOR ||
- Out0P->private_port.disposition != 17)
- { return MIG_TYPE_ERROR; }
+ Out0P->private_port.disposition != 17) {
+ return MIG_TYPE_ERROR;
+ }
#endif /* __MigTypeCheck */
#if defined(__NDR_convert__int_rep__Reply__rpc_jack_client_open_t__shared_engine__defined) || \
@@ -561,7 +561,7 @@ mig_external kern_return_t rpc_jack_client_open
InP->NDR = NDR_record;
- (void) mig_strncpy(InP->client_name, client_name, 128);
+ (void) mig_strncpy(InP->client_name, client_name, 64);
InP->pid = pid;
@@ -628,11 +628,11 @@ mig_external kern_return_t rpc_jack_client_open
#elif defined(__NDR_convert__int_rep__JackRPCEngine__string__defined)
#define __NDR_convert__int_rep__Reply__rpc_jack_client_check_t__client_name_res__defined
#define __NDR_convert__int_rep__Reply__rpc_jack_client_check_t__client_name_res(a, f) \
- __NDR_convert__int_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__int_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__int_rep__string__defined)
#define __NDR_convert__int_rep__Reply__rpc_jack_client_check_t__client_name_res__defined
#define __NDR_convert__int_rep__Reply__rpc_jack_client_check_t__client_name_res(a, f) \
- __NDR_convert__int_rep__string(a, f, 128)
+ __NDR_convert__int_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__int_rep__Reply__rpc_jack_client_check_t__client_name_res__defined */
@@ -692,11 +692,11 @@ mig_external kern_return_t rpc_jack_client_open
#elif defined(__NDR_convert__char_rep__JackRPCEngine__string__defined)
#define __NDR_convert__char_rep__Reply__rpc_jack_client_check_t__client_name_res__defined
#define __NDR_convert__char_rep__Reply__rpc_jack_client_check_t__client_name_res(a, f) \
- __NDR_convert__char_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__char_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__char_rep__string__defined)
#define __NDR_convert__char_rep__Reply__rpc_jack_client_check_t__client_name_res__defined
#define __NDR_convert__char_rep__Reply__rpc_jack_client_check_t__client_name_res(a, f) \
- __NDR_convert__char_rep__string(a, f, 128)
+ __NDR_convert__char_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__char_rep__Reply__rpc_jack_client_check_t__client_name_res__defined */
@@ -756,11 +756,11 @@ mig_external kern_return_t rpc_jack_client_open
#elif defined(__NDR_convert__float_rep__JackRPCEngine__string__defined)
#define __NDR_convert__float_rep__Reply__rpc_jack_client_check_t__client_name_res__defined
#define __NDR_convert__float_rep__Reply__rpc_jack_client_check_t__client_name_res(a, f) \
- __NDR_convert__float_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__float_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__float_rep__string__defined)
#define __NDR_convert__float_rep__Reply__rpc_jack_client_check_t__client_name_res__defined
#define __NDR_convert__float_rep__Reply__rpc_jack_client_check_t__client_name_res(a, f) \
- __NDR_convert__float_rep__string(a, f, 128)
+ __NDR_convert__float_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__float_rep__Reply__rpc_jack_client_check_t__client_name_res__defined */
@@ -983,7 +983,7 @@ mig_external kern_return_t rpc_jack_client_check
InP->NDR = NDR_record;
- (void) mig_strncpy(InP->client_name, client_name, 128);
+ (void) mig_strncpy(InP->client_name, client_name, 64);
InP->protocol = protocol;
@@ -1011,7 +1011,7 @@ mig_external kern_return_t rpc_jack_client_check
{ return check_result; }
#endif /* defined(__MIG_check__Reply__rpc_jack_client_check_t__defined) */
- (void) mig_strncpy(client_name_res, Out0P->client_name_res, 128);
+ (void) mig_strncpy(client_name_res, Out0P->client_name_res, 64);
*status = Out0P->status;
@@ -4739,11 +4739,11 @@ mig_external kern_return_t rpc_jack_set_timebase_callback
#elif defined(__NDR_convert__int_rep__JackRPCEngine__string__defined)
#define __NDR_convert__int_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res__defined
#define __NDR_convert__int_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res(a, f) \
- __NDR_convert__int_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__int_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__int_rep__string__defined)
#define __NDR_convert__int_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res__defined
#define __NDR_convert__int_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res(a, f) \
- __NDR_convert__int_rep__string(a, f, 128)
+ __NDR_convert__int_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__int_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res__defined */
@@ -4782,11 +4782,11 @@ mig_external kern_return_t rpc_jack_set_timebase_callback
#elif defined(__NDR_convert__char_rep__JackRPCEngine__string__defined)
#define __NDR_convert__char_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res__defined
#define __NDR_convert__char_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res(a, f) \
- __NDR_convert__char_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__char_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__char_rep__string__defined)
#define __NDR_convert__char_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res__defined
#define __NDR_convert__char_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res(a, f) \
- __NDR_convert__char_rep__string(a, f, 128)
+ __NDR_convert__char_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__char_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res__defined */
@@ -4825,11 +4825,11 @@ mig_external kern_return_t rpc_jack_set_timebase_callback
#elif defined(__NDR_convert__float_rep__JackRPCEngine__string__defined)
#define __NDR_convert__float_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res__defined
#define __NDR_convert__float_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res(a, f) \
- __NDR_convert__float_rep__JackRPCEngine__string(a, f, 128)
+ __NDR_convert__float_rep__JackRPCEngine__string(a, f, 64)
#elif defined(__NDR_convert__float_rep__string__defined)
#define __NDR_convert__float_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res__defined
#define __NDR_convert__float_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res(a, f) \
- __NDR_convert__float_rep__string(a, f, 128)
+ __NDR_convert__float_rep__string(a, f, 64)
#endif /* defined(__NDR_convert__*__defined) */
#endif /* __NDR_convert__float_rep__Reply__rpc_jack_get_internal_clientname_t__client_name_res__defined */
@@ -5040,7 +5040,7 @@ mig_external kern_return_t rpc_jack_get_internal_clientname
{ return check_result; }
#endif /* defined(__MIG_check__Reply__rpc_jack_get_internal_clientname_t__defined) */
- (void) mig_strncpy(client_name_res, Out0P->client_name_res, 128);
+ (void) mig_strncpy(client_name_res, Out0P->client_name_res, 64);
*result = Out0P->result;
@@ -5431,7 +5431,7 @@ mig_external kern_return_t rpc_jack_internal_clienthandle
InP->refnum = refnum;
- (void) mig_strncpy(InP->client_name, client_name, 128);
+ (void) mig_strncpy(InP->client_name, client_name, 64);
InP->Head.msgh_bits =
MACH_MSGH_BITS(19, MACH_MSG_TYPE_MAKE_SEND_ONCE);
@@ -5854,11 +5854,11 @@ mig_external kern_return_t rpc_jack_internal_clientload
InP->refnum = refnum;
- (void) mig_strncpy(InP->client_name, client_name, 128);
+ (void) mig_strncpy(InP->client_name, client_name, 64);
- (void) mig_strncpy(InP->so_name, so_name, 1024);
+ (void) mig_strncpy(InP->so_name, so_name, 256);
- (void) mig_strncpy(InP->objet_data, objet_data, 1024);
+ (void) mig_strncpy(InP->objet_data, objet_data, 256);
InP->options = options;
diff --git a/macosx/RPC/Jackdefs.h b/macosx/RPC/Jackdefs.h
index 5636c37e..5e73d984 100644
--- a/macosx/RPC/Jackdefs.h
+++ b/macosx/RPC/Jackdefs.h
@@ -18,7 +18,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
typedef char client_name_t[64];
-typedef char client_port_name_t[256];
+typedef char client_port_name_t[128];
typedef char client_port_type_t[128];
typedef char so_name_t[256];
typedef char objet_data_t[256];
+typedef char message_t[256];
diff --git a/macosx/coreaudio/JackCoreAudioAdapter.cpp b/macosx/coreaudio/JackCoreAudioAdapter.cpp
index 60f187cb..630366ec 100644
--- a/macosx/coreaudio/JackCoreAudioAdapter.cpp
+++ b/macosx/coreaudio/JackCoreAudioAdapter.cpp
@@ -26,6 +26,20 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
namespace Jack
{
+static void PrintStreamDesc(AudioStreamBasicDescription *inDesc)
+{
+ jack_log("- - - - - - - - - - - - - - - - - - - -");
+ jack_log(" Sample Rate:%f", inDesc->mSampleRate);
+ jack_log(" Format ID:%.*s", (int) sizeof(inDesc->mFormatID), (char*)&inDesc->mFormatID);
+ jack_log(" Format Flags:%lX", inDesc->mFormatFlags);
+ jack_log(" Bytes per Packet:%ld", inDesc->mBytesPerPacket);
+ jack_log(" Frames per Packet:%ld", inDesc->mFramesPerPacket);
+ jack_log(" Bytes per Frame:%ld", inDesc->mBytesPerFrame);
+ jack_log(" Channels per Frame:%ld", inDesc->mChannelsPerFrame);
+ jack_log(" Bits per Channel:%ld", inDesc->mBitsPerChannel);
+ jack_log("- - - - - - - - - - - - - - - - - - - -");
+}
+
static OSStatus DisplayDeviceNames()
{
UInt32 size;
@@ -164,70 +178,30 @@ OSStatus JackCoreAudioAdapter::SRNotificationCallback(AudioDeviceID inDevice,
}
// A better implementation would try to recover in case of hardware device change (see HALLAB HLFilePlayerWindowControllerAudioDevicePropertyListenerProc code)
-
OSStatus JackCoreAudioAdapter::DeviceNotificationCallback(AudioDeviceID inDevice,
UInt32 inChannel,
Boolean isInput,
AudioDevicePropertyID inPropertyID,
void* inClientData)
{
- JackCoreAudioAdapter* driver = (JackCoreAudioAdapter*)inClientData;
-
+
switch (inPropertyID) {
+
+ case kAudioDeviceProcessorOverload: {
+ jack_error("JackCoreAudioAdapter::DeviceNotificationCallback kAudioDeviceProcessorOverload");
+ break;
+ }
- case kAudioDevicePropertyStreamConfiguration:
+ case kAudioDevicePropertyStreamConfiguration: {
+ jack_error("Cannot handle kAudioDevicePropertyStreamConfiguration");
+ return kAudioHardwareUnsupportedOperationError;
+ }
+
case kAudioDevicePropertyNominalSampleRate: {
-
- UInt32 outSize = sizeof(Float64);
- Float64 sampleRate;
- int in_nChannels = 0;
- int out_nChannels = 0;
- char capture_driver_name[256];
- char playback_driver_name[256];
-
- // Stop and restart
- AudioOutputUnitStop(driver->fAUHAL);
- driver->RemoveListeners();
- driver->CloseAUHAL();
-
- OSStatus err = AudioDeviceGetProperty(driver->fDeviceID, 0, kAudioDeviceSectionGlobal, kAudioDevicePropertyNominalSampleRate, &outSize, &sampleRate);
- if (err != noErr) {
- jack_error("Cannot get current sample rate");
- printError(err);
- }
- jack_log("JackCoreAudioDriver::DeviceNotificationCallback kAudioDevicePropertyNominalSampleRate %ld", long(sampleRate));
-
- if (driver->SetupDevices(driver->fCaptureUID, driver->fPlaybackUID, capture_driver_name, playback_driver_name) < 0)
- return -1;
-
- if (driver->SetupChannels(driver->fCapturing, driver->fPlaying, driver->fCaptureChannels, driver->fPlaybackChannels, in_nChannels, out_nChannels, false) < 0)
- return -1;
-
- if (driver->SetupBufferSizeAndSampleRate(driver->fAdaptedBufferSize, sampleRate) < 0)
- return -1;
-
- driver->SetAdaptedSampleRate(sampleRate);
-
- if (driver->OpenAUHAL(driver->fCapturing,
- driver->fPlaying,
- driver->fCaptureChannels,
- driver->fPlaybackChannels,
- in_nChannels,
- out_nChannels,
- driver->fAdaptedBufferSize,
- sampleRate,
- false) < 0)
- goto error;
-
- if (driver->AddListeners() < 0)
- goto error;
-
- AudioOutputUnitStart(driver->fAUHAL);
- return noErr;
-error:
- driver->CloseAUHAL();
- break;
+ jack_error("Cannot handle kAudioDevicePropertyNominalSampleRate");
+ return kAudioHardwareUnsupportedOperationError;
}
+
}
return noErr;
}
@@ -237,7 +211,13 @@ int JackCoreAudioAdapter::AddListeners()
OSStatus err = noErr;
// Add listeners
-
+ err = AudioDeviceAddPropertyListener(fDeviceID, 0, true, kAudioDeviceProcessorOverload, DeviceNotificationCallback, this);
+ if (err != noErr) {
+ jack_error("Error calling AudioDeviceAddPropertyListener with kAudioDeviceProcessorOverload");
+ printError(err);
+ return -1;
+ }
+
err = AudioDeviceAddPropertyListener(fDeviceID, 0, true, kAudioHardwarePropertyDevices, DeviceNotificationCallback, this);
if (err != noErr) {
jack_error("Error calling AudioDeviceAddPropertyListener with kAudioHardwarePropertyDevices");
@@ -276,9 +256,9 @@ int JackCoreAudioAdapter::AddListeners()
return 0;
}
-
void JackCoreAudioAdapter::RemoveListeners()
{
+ AudioDeviceRemovePropertyListener(fDeviceID, 0, true, kAudioDeviceProcessorOverload, DeviceNotificationCallback);
AudioDeviceRemovePropertyListener(fDeviceID, 0, true, kAudioHardwarePropertyDevices, DeviceNotificationCallback);
AudioDeviceRemovePropertyListener(fDeviceID, 0, true, kAudioDevicePropertyNominalSampleRate, DeviceNotificationCallback);
AudioDeviceRemovePropertyListener(fDeviceID, 0, true, kAudioDevicePropertyDeviceIsRunning, DeviceNotificationCallback);
@@ -313,19 +293,33 @@ OSStatus JackCoreAudioAdapter::Render(void *inRefCon,
JackCoreAudioAdapter::JackCoreAudioAdapter(jack_nframes_t buffer_size, jack_nframes_t sample_rate, const JSList* params)
:JackAudioAdapterInterface(buffer_size, sample_rate), fInputData(0), fCapturing(false), fPlaying(false), fState(false)
{
-
const JSList* node;
const jack_driver_param_t* param;
-
+ int in_nChannels = 0;
+ int out_nChannels = 0;
char captureName[256];
char playbackName[256];
-
fCaptureUID[0] = 0;
fPlaybackUID[0] = 0;
// Default values
- fCaptureChannels = 0;
- fPlaybackChannels = 0;
+ fCaptureChannels = -1;
+ fPlaybackChannels = -1;
+
+ SInt32 major;
+ SInt32 minor;
+ Gestalt(gestaltSystemVersionMajor, &major);
+ Gestalt(gestaltSystemVersionMinor, &minor);
+
+ // Starting with 10.6 systems, the HAL notification thread is created internally
+ if (major == 10 && minor >= 6) {
+ CFRunLoopRef theRunLoop = NULL;
+ AudioObjectPropertyAddress theAddress = { kAudioHardwarePropertyRunLoop, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
+ OSStatus theError = AudioObjectSetPropertyData (kAudioObjectSystemObject, &theAddress, 0, NULL, sizeof(CFRunLoopRef), &theRunLoop);
+ if (theError != noErr) {
+ jack_error("JackCoreAudioAdapter::Open kAudioHardwarePropertyRunLoop error");
+ }
+ }
for (node = params; node; node = jack_slist_next(node)) {
param = (const jack_driver_param_t*) node->data;
@@ -391,26 +385,26 @@ JackCoreAudioAdapter::JackCoreAudioAdapter(jack_nframes_t buffer_size, jack_nfra
fCapturing = true;
fPlaying = true;
}
-
- int in_nChannels = 0;
- int out_nChannels = 0;
- if (SetupDevices(fCaptureUID, fPlaybackUID, captureName, playbackName) < 0)
+ if (SetupDevices(fCaptureUID, fPlaybackUID, captureName, playbackName, fAdaptedSampleRate) < 0)
throw -1;
if (SetupChannels(fCapturing, fPlaying, fCaptureChannels, fPlaybackChannels, in_nChannels, out_nChannels, true) < 0)
throw -1;
+
+ if (SetupBufferSize(fAdaptedBufferSize) < 0)
+ throw -1;
- if (SetupBufferSizeAndSampleRate(fAdaptedBufferSize, fAdaptedSampleRate) < 0)
+ if (SetupSampleRate(fAdaptedSampleRate) < 0)
throw -1;
-
+
+ if (OpenAUHAL(fCapturing, fPlaying, fCaptureChannels, fPlaybackChannels, in_nChannels, out_nChannels, fAdaptedBufferSize, fAdaptedSampleRate) < 0)
+ throw -1;
+
if (fCapturing && fCaptureChannels > 0)
if (SetupBuffers(fCaptureChannels) < 0)
throw -1;
-
- if (OpenAUHAL(fCapturing, fPlaying, fCaptureChannels, fPlaybackChannels, in_nChannels, out_nChannels, fAdaptedBufferSize, fAdaptedSampleRate, true) < 0)
- throw -1;
-
+
if (AddListeners() < 0)
throw -1;
}
@@ -430,7 +424,7 @@ OSStatus JackCoreAudioAdapter::GetDefaultDevice(AudioDeviceID* id)
jack_log("GetDefaultDevice: input = %ld output = %ld", inDefault, outDefault);
- // Get the device only if default input and ouput are the same
+ // Get the device only if default input and output are the same
if (inDefault == outDefault) {
*id = inDefault;
return noErr;
@@ -518,26 +512,43 @@ OSStatus JackCoreAudioAdapter::GetDeviceNameFromID(AudioDeviceID id, char* name)
int JackCoreAudioAdapter::SetupDevices(const char* capture_driver_uid,
const char* playback_driver_uid,
char* capture_driver_name,
- char* playback_driver_name)
+ char* playback_driver_name,
+ jack_nframes_t samplerate)
{
capture_driver_name[0] = 0;
playback_driver_name[0] = 0;
// Duplex
if (strcmp(capture_driver_uid, "") != 0 && strcmp(playback_driver_uid, "") != 0) {
- jack_log("JackCoreAudioAdapter::Open duplex");
- if (GetDeviceIDFromUID(playback_driver_uid, &fDeviceID) != noErr) {
- if (GetDefaultDevice(&fDeviceID) != noErr) {
- jack_error("Cannot open default device");
+
+ // Same device for capture and playback...
+ if (strcmp(capture_driver_uid, playback_driver_uid) == 0) {
+
+ if (GetDeviceIDFromUID(playback_driver_uid, &fDeviceID) != noErr) {
+ jack_log("Will take default in/out");
+ if (GetDefaultDevice(&fDeviceID) != noErr) {
+ jack_error("Cannot open default device");
+ return -1;
+ }
+ }
+ if (GetDeviceNameFromID(fDeviceID, capture_driver_name) != noErr || GetDeviceNameFromID(fDeviceID, playback_driver_name) != noErr) {
+ jack_error("Cannot get device name from device ID");
return -1;
}
- }
- if (GetDeviceNameFromID(fDeviceID, capture_driver_name) != noErr || GetDeviceNameFromID(fDeviceID, playback_driver_name) != noErr) {
- jack_error("Cannot get device name from device ID");
- return -1;
+
+ } else {
+
+ // Creates aggregate device
+ AudioDeviceID captureID, playbackID;
+ if (GetDeviceIDFromUID(capture_driver_uid, &captureID) != noErr)
+ return -1;
+ if (GetDeviceIDFromUID(playback_driver_uid, &playbackID) != noErr)
+ return -1;
+ if (CreateAggregateDevice(captureID, playbackID, samplerate, &fDeviceID) != noErr)
+ return -1;
}
- // Capture only
+ // Capture only
} else if (strcmp(capture_driver_uid, "") != 0) {
jack_log("JackCoreAudioAdapter::Open capture only");
if (GetDeviceIDFromUID(capture_driver_uid, &fDeviceID) != noErr) {
@@ -551,7 +562,7 @@ int JackCoreAudioAdapter::SetupDevices(const char* capture_driver_uid,
return -1;
}
- // Playback only
+ // Playback only
} else if (strcmp(playback_driver_uid, "") != 0) {
jack_log("JackCoreAudioAdapter::Open playback only");
if (GetDeviceIDFromUID(playback_driver_uid, &fDeviceID) != noErr) {
@@ -565,7 +576,7 @@ int JackCoreAudioAdapter::SetupDevices(const char* capture_driver_uid,
return -1;
}
- // Use default driver in duplex mode
+ // Use default driver in duplex mode
} else {
jack_log("JackCoreAudioAdapter::Open default driver");
if (GetDefaultDevice(&fDeviceID) != noErr) {
@@ -625,72 +636,82 @@ int JackCoreAudioAdapter::SetupChannels(bool capturing,
return -1;
}
- if (inchannels == 0) {
+ if (inchannels == -1) {
jack_log("Setup max in channels = %ld", in_nChannels);
inchannels = in_nChannels;
}
- if (outchannels == 0) {
+ if (outchannels == -1) {
jack_log("Setup max out channels = %ld", out_nChannels);
outchannels = out_nChannels;
}
-
+
return 0;
}
-int JackCoreAudioAdapter::SetupBufferSizeAndSampleRate(jack_nframes_t nframes, jack_nframes_t samplerate)
+int JackCoreAudioAdapter::SetupBufferSize(jack_nframes_t buffer_size)
{
- OSStatus err = noErr;
- UInt32 outSize;
- Float64 sampleRate;
-
// Setting buffer size
- outSize = sizeof(UInt32);
- err = AudioDeviceSetProperty(fDeviceID, NULL, 0, false, kAudioDevicePropertyBufferFrameSize, outSize, &nframes);
+ UInt32 outSize = sizeof(UInt32);
+ OSStatus 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;
}
+
+ return 0;
+}
+int JackCoreAudioAdapter::SetupSampleRate(jack_nframes_t samplerate)
+{
+ return SetupSampleRateAux(fDeviceID, samplerate);
+}
+
+int JackCoreAudioAdapter::SetupSampleRateAux(AudioDeviceID inDevice, jack_nframes_t samplerate)
+{
+ OSStatus err = noErr;
+ UInt32 outSize;
+ Float64 sampleRate;
+
// Get sample rate
outSize = sizeof(Float64);
- err = AudioDeviceGetProperty(fDeviceID, 0, kAudioDeviceSectionGlobal, kAudioDevicePropertyNominalSampleRate, &outSize, &sampleRate);
+ err = AudioDeviceGetProperty(inDevice, 0, kAudioDeviceSectionGlobal, kAudioDevicePropertyNominalSampleRate, &outSize, &sampleRate);
if (err != noErr) {
jack_error("Cannot get current sample rate");
printError(err);
return -1;
}
-
+
// If needed, set new sample rate
if (samplerate != (jack_nframes_t)sampleRate) {
sampleRate = (Float64)samplerate;
-
+
// To get SR change notification
- err = AudioDeviceAddPropertyListener(fDeviceID, 0, true, kAudioDevicePropertyNominalSampleRate, SRNotificationCallback, this);
+ err = AudioDeviceAddPropertyListener(inDevice, 0, true, kAudioDevicePropertyNominalSampleRate, SRNotificationCallback, this);
if (err != noErr) {
jack_error("Error calling AudioDeviceAddPropertyListener with kAudioDevicePropertyNominalSampleRate");
printError(err);
return -1;
}
- err = AudioDeviceSetProperty(fDeviceID, NULL, 0, kAudioDeviceSectionGlobal, kAudioDevicePropertyNominalSampleRate, outSize, &sampleRate);
+ err = AudioDeviceSetProperty(inDevice, NULL, 0, kAudioDeviceSectionGlobal, kAudioDevicePropertyNominalSampleRate, outSize, &sampleRate);
if (err != noErr) {
jack_error("Cannot set sample rate = %ld", samplerate);
printError(err);
return -1;
}
-
+
// Waiting for SR change notification
int count = 0;
- while (!fState && count++ < 100) {
+ while (!fState && count++ < WAIT_COUNTER) {
usleep(100000);
- jack_log("Wait count = %ld", count);
+ jack_log("Wait count = %d", count);
}
-
+
// Remove SR change notification
- AudioDeviceRemovePropertyListener(fDeviceID, 0, true, kAudioDevicePropertyNominalSampleRate, SRNotificationCallback);
+ AudioDeviceRemovePropertyListener(inDevice, 0, true, kAudioDevicePropertyNominalSampleRate, SRNotificationCallback);
}
-
+
return 0;
}
@@ -724,20 +745,21 @@ void JackCoreAudioAdapter::DisposeBuffers()
}
int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
- bool playing,
- int inchannels,
- int outchannels,
- int in_nChannels,
- int out_nChannels,
- jack_nframes_t buffer_size,
- jack_nframes_t samplerate,
- bool strict)
+ bool playing,
+ int inchannels,
+ int outchannels,
+ int in_nChannels,
+ int out_nChannels,
+ jack_nframes_t buffer_size,
+ jack_nframes_t samplerate)
{
ComponentResult err1;
UInt32 enableIO;
AudioStreamBasicDescription srcFormat, dstFormat;
+ AudioDeviceID currAudioDeviceID;
+ UInt32 size;
- jack_log("OpenAUHAL capturing = %ld playing = %ld inchannels = %ld outchannels = %ld in_nChannels = %ld out_nChannels = %ld ", capturing, playing, inchannels, outchannels, in_nChannels, out_nChannels);
+ jack_log("OpenAUHAL capturing = %d playing = %d inchannels = %d outchannels = %d in_nChannels = %d out_nChannels = %d", capturing, playing, inchannels, outchannels, in_nChannels, out_nChannels);
if (inchannels == 0 && outchannels == 0) {
jack_error("No input and output channels...");
@@ -752,14 +774,14 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling OpenAComponent");
printError(err1);
- return -1;
+ goto error;
}
err1 = AudioUnitInitialize(fAUHAL);
if (err1 != noErr) {
jack_error("Cannot initialize AUHAL unit");
printError(err1);
- return -1;
+ goto error;
}
// Start I/O
@@ -775,8 +797,7 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input");
printError(err1);
- if (strict)
- return -1;
+ goto error;
}
if (playing && outchannels > 0) {
@@ -791,18 +812,15 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_EnableIO,kAudioUnitScope_Output");
printError(err1);
- if (strict)
- return -1;
+ goto error;
}
- AudioDeviceID currAudioDeviceID;
- UInt32 size = sizeof(AudioDeviceID);
+ size = sizeof(AudioDeviceID);
err1 = AudioUnitGetProperty(fAUHAL, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &currAudioDeviceID, &size);
if (err1 != noErr) {
jack_error("Error calling AudioUnitGetProperty - kAudioOutputUnitProperty_CurrentDevice");
printError(err1);
- if (strict)
- return -1;
+ goto error;
} else {
jack_log("AudioUnitGetPropertyCurrentDevice = %d", currAudioDeviceID);
}
@@ -812,28 +830,16 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_CurrentDevice");
printError(err1);
- if (strict)
- return -1;
+ goto error;
}
-
- err1 = AudioUnitGetProperty(fAUHAL, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &currAudioDeviceID, &size);
- if (err1 != noErr) {
- jack_error("Error calling AudioUnitGetProperty - kAudioOutputUnitProperty_CurrentDevice");
- printError(err1);
- if (strict)
- return -1;
- } else {
- jack_log("AudioUnitGetPropertyCurrentDevice = %d", currAudioDeviceID);
- }
-
+
// Set buffer size
if (capturing && inchannels > 0) {
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);
- if (strict)
- return -1;
+ goto error;
}
}
@@ -842,8 +848,7 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_MaximumFramesPerSlice");
printError(err1);
- if (strict)
- return -1;
+ goto error;
}
}
@@ -860,6 +865,7 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_ChannelMap 1");
printError(err1);
+ goto error;
}
}
@@ -875,40 +881,71 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_ChannelMap 0");
printError(err1);
+ goto error;
}
}
// Setup stream converters
- jack_log("Setup AUHAL input stream converter SR = %ld", samplerate);
- srcFormat.mSampleRate = samplerate;
- srcFormat.mFormatID = kAudioFormatLinearPCM;
- srcFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kLinearPCMFormatFlagIsNonInterleaved;
- srcFormat.mBytesPerPacket = sizeof(float);
- srcFormat.mFramesPerPacket = 1;
- srcFormat.mBytesPerFrame = sizeof(float);
- srcFormat.mChannelsPerFrame = outchannels;
- srcFormat.mBitsPerChannel = 32;
-
- err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &srcFormat, sizeof(AudioStreamBasicDescription));
- if (err1 != noErr) {
- jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Input");
- printError(err1);
+ if (capturing && inchannels > 0) {
+
+ size = sizeof(AudioStreamBasicDescription);
+ err1 = AudioUnitGetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &srcFormat, &size);
+ if (err1 != noErr) {
+ jack_error("Error calling AudioUnitGetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Input");
+ printError(err1);
+ goto error;
+ }
+ PrintStreamDesc(&srcFormat);
+
+ jack_log("Setup AUHAL input stream converter SR = %ld", samplerate);
+ srcFormat.mSampleRate = samplerate;
+ srcFormat.mFormatID = kAudioFormatLinearPCM;
+ srcFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kLinearPCMFormatFlagIsNonInterleaved;
+ srcFormat.mBytesPerPacket = sizeof(float);
+ srcFormat.mFramesPerPacket = 1;
+ srcFormat.mBytesPerFrame = sizeof(float);
+ srcFormat.mChannelsPerFrame = inchannels;
+ srcFormat.mBitsPerChannel = 32;
+ PrintStreamDesc(&srcFormat);
+
+ err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 1, &srcFormat, sizeof(AudioStreamBasicDescription));
+
+ if (err1 != noErr) {
+ jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Input");
+ printError(err1);
+ goto error;
+ }
}
- jack_log("Setup AUHAL output stream converter SR = %ld", samplerate);
- dstFormat.mSampleRate = samplerate;
- dstFormat.mFormatID = kAudioFormatLinearPCM;
- dstFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kLinearPCMFormatFlagIsNonInterleaved;
- dstFormat.mBytesPerPacket = sizeof(float);
- dstFormat.mFramesPerPacket = 1;
- dstFormat.mBytesPerFrame = sizeof(float);
- dstFormat.mChannelsPerFrame = inchannels;
- dstFormat.mBitsPerChannel = 32;
-
- err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 1, &dstFormat, sizeof(AudioStreamBasicDescription));
- if (err1 != noErr) {
- jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Output");
- printError(err1);
+ if (playing && outchannels > 0) {
+
+ size = sizeof(AudioStreamBasicDescription);
+ err1 = AudioUnitGetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 1, &dstFormat, &size);
+ if (err1 != noErr) {
+ jack_error("Error calling AudioUnitGetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Output");
+ printError(err1);
+ goto error;
+ }
+ PrintStreamDesc(&dstFormat);
+
+ jack_log("Setup AUHAL output stream converter SR = %ld", samplerate);
+ dstFormat.mSampleRate = samplerate;
+ dstFormat.mFormatID = kAudioFormatLinearPCM;
+ dstFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kLinearPCMFormatFlagIsNonInterleaved;
+ dstFormat.mBytesPerPacket = sizeof(float);
+ dstFormat.mFramesPerPacket = 1;
+ dstFormat.mBytesPerFrame = sizeof(float);
+ dstFormat.mChannelsPerFrame = outchannels;
+ dstFormat.mBitsPerChannel = 32;
+ PrintStreamDesc(&dstFormat);
+
+ err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &dstFormat, sizeof(AudioStreamBasicDescription));
+
+ if (err1 != noErr) {
+ jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Output");
+ printError(err1);
+ goto error;
+ }
}
// Setup callbacks
@@ -920,7 +957,7 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_SetRenderCallback 1");
printError(err1);
- return -1;
+ goto error;
}
} else {
AURenderCallbackStruct output;
@@ -930,11 +967,236 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_SetRenderCallback 0");
printError(err1);
- return -1;
+ goto error;
}
}
return 0;
+
+error:
+ CloseAUHAL();
+ return -1;
+}
+
+OSStatus JackCoreAudioAdapter::DestroyAggregateDevice()
+{
+ OSStatus osErr = noErr;
+ AudioObjectPropertyAddress pluginAOPA;
+ pluginAOPA.mSelector = kAudioPlugInDestroyAggregateDevice;
+ pluginAOPA.mScope = kAudioObjectPropertyScopeGlobal;
+ pluginAOPA.mElement = kAudioObjectPropertyElementMaster;
+ UInt32 outDataSize;
+
+ osErr = AudioObjectGetPropertyDataSize(fPluginID, &pluginAOPA, 0, NULL, &outDataSize);
+ if (osErr != noErr) {
+ jack_error("JackCoreAudioDriver::DestroyAggregateDevice : AudioObjectGetPropertyDataSize error");
+ printError(osErr);
+ return osErr;
+ }
+
+ osErr = AudioObjectGetPropertyData(fPluginID, &pluginAOPA, 0, NULL, &outDataSize, &fDeviceID);
+ if (osErr != noErr) {
+ jack_error("JackCoreAudioDriver::DestroyAggregateDevice : AudioObjectGetPropertyData error");
+ printError(osErr);
+ return osErr;
+ }
+
+ return noErr;
+}
+
+static CFStringRef GetDeviceName(AudioDeviceID id)
+{
+ UInt32 size = sizeof(CFStringRef);
+ CFStringRef UIname;
+ OSStatus err = AudioDeviceGetProperty(id, 0, false, kAudioDevicePropertyDeviceUID, &size, &UIname);
+ return (err == noErr) ? UIname : NULL;
+}
+
+OSStatus JackCoreAudioAdapter::CreateAggregateDevice(AudioDeviceID captureDeviceID, AudioDeviceID playbackDeviceID, jack_nframes_t samplerate, AudioDeviceID* outAggregateDevice)
+{
+ OSStatus osErr = noErr;
+ UInt32 outSize;
+ Boolean outWritable;
+
+ // Check devices...
+ if (IsAggregateDevice(captureDeviceID) || IsAggregateDevice(playbackDeviceID)) {
+ jack_error("JackCoreAudioAdapter::CreateAggregateDevice : cannot agregate devices that are already aggregate devices...");
+ return -1;
+ }
+
+ //---------------------------------------------------------------------------
+ // Setup SR of both devices otherwise creating AD may fail...
+ //---------------------------------------------------------------------------
+ if (SetupSampleRateAux(captureDeviceID, samplerate) < 0) {
+ jack_error("JackCoreAudioDriver::CreateAggregateDevice : cannot set SR of input device");
+ }
+ if (SetupSampleRateAux(playbackDeviceID, samplerate) < 0) {
+ jack_error("JackCoreAudioDriver::CreateAggregateDevice : cannot set SR of output device");
+ }
+
+ //---------------------------------------------------------------------------
+ // Start to create a new aggregate by getting the base audio hardware plugin
+ //---------------------------------------------------------------------------
+
+ char capture_name[256];
+ char playback_name[256];
+ GetDeviceNameFromID(captureDeviceID, capture_name);
+ GetDeviceNameFromID(playbackDeviceID, playback_name);
+ jack_info("Separated input = '%s' and output = '%s' devices, create a private aggregate device to handle them...", capture_name, playback_name);
+
+ osErr = AudioHardwareGetPropertyInfo(kAudioHardwarePropertyPlugInForBundleID, &outSize, &outWritable);
+ if (osErr != noErr)
+ return osErr;
+
+ AudioValueTranslation pluginAVT;
+
+ CFStringRef inBundleRef = CFSTR("com.apple.audio.CoreAudio");
+
+ pluginAVT.mInputData = &inBundleRef;
+ pluginAVT.mInputDataSize = sizeof(inBundleRef);
+ pluginAVT.mOutputData = &fPluginID;
+ pluginAVT.mOutputDataSize = sizeof(fPluginID);
+
+ osErr = AudioHardwareGetProperty(kAudioHardwarePropertyPlugInForBundleID, &outSize, &pluginAVT);
+ if (osErr != noErr)
+ return osErr;
+
+ //-------------------------------------------------
+ // Create a CFDictionary for our aggregate device
+ //-------------------------------------------------
+
+ CFMutableDictionaryRef aggDeviceDict = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+
+ CFStringRef AggregateDeviceNameRef = CFSTR("JackDuplex");
+ CFStringRef AggregateDeviceUIDRef = CFSTR("com.grame.JackDuplex");
+
+ // add the name of the device to the dictionary
+ CFDictionaryAddValue(aggDeviceDict, CFSTR(kAudioAggregateDeviceNameKey), AggregateDeviceNameRef);
+
+ // add our choice of UID for the aggregate device to the dictionary
+ CFDictionaryAddValue(aggDeviceDict, CFSTR(kAudioAggregateDeviceUIDKey), AggregateDeviceUIDRef);
+
+ // add a "private aggregate key" to the dictionary
+ int value = 1;
+ CFNumberRef AggregateDeviceNumberRef = CFNumberCreate(NULL, kCFNumberIntType, &value);
+
+ SInt32 system;
+ Gestalt(gestaltSystemVersion, &system);
+
+ jack_log("JackCoreAudioDriver::CreateAggregateDevice : system version = %x limit = %x", system, 0x00001054);
+
+ // Starting with 10.5.4 systems, the AD can be internal... (better)
+ if (system < 0x00001054) {
+ jack_log("JackCoreAudioDriver::CreateAggregateDevice : public aggregate device....");
+ } else {
+ jack_log("JackCoreAudioDriver::CreateAggregateDevice : private aggregate device....");
+ CFDictionaryAddValue(aggDeviceDict, CFSTR(kAudioAggregateDeviceIsPrivateKey), AggregateDeviceNumberRef);
+ }
+
+ //-------------------------------------------------
+ // Create a CFMutableArray for our sub-device list
+ //-------------------------------------------------
+
+ CFStringRef captureDeviceUID = GetDeviceName(captureDeviceID);
+ CFStringRef playbackDeviceUID = GetDeviceName(playbackDeviceID);
+
+ if (captureDeviceUID == NULL || playbackDeviceUID == NULL)
+ return -1;
+
+ // we need to append the UID for each device to a CFMutableArray, so create one here
+ CFMutableArrayRef subDevicesArray = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+
+ // two sub-devices in this example, so append the sub-device's UID to the CFArray
+ CFArrayAppendValue(subDevicesArray, captureDeviceUID);
+ CFArrayAppendValue(subDevicesArray, playbackDeviceUID);
+
+ //-----------------------------------------------------------------------
+ // Feed the dictionary to the plugin, to create a blank aggregate device
+ //-----------------------------------------------------------------------
+
+ AudioObjectPropertyAddress pluginAOPA;
+ pluginAOPA.mSelector = kAudioPlugInCreateAggregateDevice;
+ pluginAOPA.mScope = kAudioObjectPropertyScopeGlobal;
+ pluginAOPA.mElement = kAudioObjectPropertyElementMaster;
+ UInt32 outDataSize;
+
+ osErr = AudioObjectGetPropertyDataSize(fPluginID, &pluginAOPA, 0, NULL, &outDataSize);
+ if (osErr != noErr)
+ return osErr;
+
+ osErr = AudioObjectGetPropertyData(fPluginID, &pluginAOPA, sizeof(aggDeviceDict), &aggDeviceDict, &outDataSize, outAggregateDevice);
+ if (osErr != noErr)
+ return osErr;
+
+ // pause for a bit to make sure that everything completed correctly
+ // this is to work around a bug in the HAL where a new aggregate device seems to disappear briefly after it is created
+ CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, false);
+
+ //-------------------------
+ // Set the sub-device list
+ //-------------------------
+
+ pluginAOPA.mSelector = kAudioAggregateDevicePropertyFullSubDeviceList;
+ pluginAOPA.mScope = kAudioObjectPropertyScopeGlobal;
+ pluginAOPA.mElement = kAudioObjectPropertyElementMaster;
+ outDataSize = sizeof(CFMutableArrayRef);
+ osErr = AudioObjectSetPropertyData(*outAggregateDevice, &pluginAOPA, 0, NULL, outDataSize, &subDevicesArray);
+ if (osErr != noErr)
+ return osErr;
+
+ // pause again to give the changes time to take effect
+ CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, false);
+
+ //-----------------------
+ // Set the master device
+ //-----------------------
+
+ // set the master device manually (this is the device which will act as the master clock for the aggregate device)
+ // pass in the UID of the device you want to use
+ pluginAOPA.mSelector = kAudioAggregateDevicePropertyMasterSubDevice;
+ pluginAOPA.mScope = kAudioObjectPropertyScopeGlobal;
+ pluginAOPA.mElement = kAudioObjectPropertyElementMaster;
+ outDataSize = sizeof(CFStringRef);
+ osErr = AudioObjectSetPropertyData(*outAggregateDevice, &pluginAOPA, 0, NULL, outDataSize, &captureDeviceUID); // capture is master...
+ if (osErr != noErr)
+ return osErr;
+
+ // pause again to give the changes time to take effect
+ CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, false);
+
+ //----------
+ // Clean up
+ //----------
+
+ CFRelease(AggregateDeviceNumberRef);
+
+ // release the CF objects we have created - we don't need them any more
+ CFRelease(aggDeviceDict);
+ CFRelease(subDevicesArray);
+
+ // release the device UID
+ CFRelease(captureDeviceUID);
+ CFRelease(playbackDeviceUID);
+
+ jack_log("New aggregate device %ld", *outAggregateDevice);
+ return noErr;
+}
+
+bool JackCoreAudioAdapter::IsAggregateDevice(AudioDeviceID device)
+{
+ OSStatus err = noErr;
+ AudioObjectID sub_device[32];
+ UInt32 outSize = sizeof(sub_device);
+ err = AudioDeviceGetProperty(device, 0, kAudioDeviceSectionGlobal, kAudioAggregateDevicePropertyActiveSubDeviceList, &outSize, sub_device);
+
+ if (err != noErr) {
+ jack_log("Device does not have subdevices");
+ return false;
+ } else {
+ int num_devices = outSize / sizeof(AudioObjectID);
+ jack_log("Device does has %d subdevices", num_devices);
+ return true;
+ }
}
void JackCoreAudioAdapter::CloseAUHAL()
@@ -957,6 +1219,8 @@ int JackCoreAudioAdapter::Close()
DisposeBuffers();
CloseAUHAL();
RemoveListeners();
+ if (fPluginID > 0)
+ DestroyAggregateDevice();
return 0;
}
@@ -995,25 +1259,25 @@ extern "C"
strcpy(desc->params[i].name, "channels");
desc->params[i].character = 'c';
desc->params[i].type = JackDriverParamInt;
- desc->params[i].value.ui = 0;
+ desc->params[i].value.ui = -1;
strcpy(desc->params[i].short_desc, "Maximum number of channels");
- strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
+ strcpy(desc->params[i].long_desc, "Maximum number of channels. If -1, max possible number of channels will be used");
i++;
strcpy(desc->params[i].name, "inchannels");
desc->params[i].character = 'i';
desc->params[i].type = JackDriverParamInt;
- desc->params[i].value.ui = 0;
+ desc->params[i].value.ui = -1;
strcpy(desc->params[i].short_desc, "Maximum number of input channels");
- strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
+ strcpy(desc->params[i].long_desc, "Maximum number of input channels. If -1, max possible number of input channels will be used");
i++;
strcpy(desc->params[i].name, "outchannels");
desc->params[i].character = 'o';
desc->params[i].type = JackDriverParamInt;
- desc->params[i].value.ui = 0;
+ desc->params[i].value.ui = -1;
strcpy(desc->params[i].short_desc, "Maximum number of output channels");
- strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
+ strcpy(desc->params[i].long_desc, "Maximum number of output channels. If -1, max possible number of output channels will be used");
i++;
strcpy(desc->params[i].name, "capture");
diff --git a/macosx/coreaudio/JackCoreAudioAdapter.h b/macosx/coreaudio/JackCoreAudioAdapter.h
index b40f7b65..d2f61006 100644
--- a/macosx/coreaudio/JackCoreAudioAdapter.h
+++ b/macosx/coreaudio/JackCoreAudioAdapter.h
@@ -36,6 +36,8 @@ typedef UInt8 CAAudioHardwareDeviceSectionID;
#define kAudioDeviceSectionGlobal ((CAAudioHardwareDeviceSectionID)0x00)
#define kAudioDeviceSectionWildcard ((CAAudioHardwareDeviceSectionID)0xFF)
+#define WAIT_COUNTER 60
+
/*!
\brief Audio adapter using CoreAudio API.
*/
@@ -54,7 +56,9 @@ class JackCoreAudioAdapter : public JackAudioAdapterInterface
bool fCapturing;
bool fPlaying;
- AudioDeviceID fDeviceID;
+ AudioDeviceID fDeviceID; // Used "duplex" device
+ AudioObjectID fPluginID; // Used for aggregate device
+
bool fState;
AudioUnitRenderActionFlags* fActionFags;
@@ -86,10 +90,15 @@ class JackCoreAudioAdapter : public JackAudioAdapterInterface
OSStatus GetDeviceNameFromID(AudioDeviceID id, char* name);
// Setup
+ OSStatus CreateAggregateDevice(AudioDeviceID captureDeviceID, AudioDeviceID playbackDeviceID, jack_nframes_t samplerate, AudioDeviceID* outAggregateDevice);
+ OSStatus DestroyAggregateDevice();
+ bool IsAggregateDevice(AudioDeviceID device);
+
int SetupDevices(const char* capture_driver_uid,
const char* playback_driver_uid,
char* capture_driver_name,
- char* playback_driver_name);
+ char* playback_driver_name,
+ jack_nframes_t samplerate);
int SetupChannels(bool capturing,
bool playing,
@@ -106,10 +115,12 @@ class JackCoreAudioAdapter : public JackAudioAdapterInterface
int in_nChannels,
int out_nChannels,
jack_nframes_t buffer_size,
- jack_nframes_t samplerate,
- bool strict);
+ jack_nframes_t samplerate);
- int SetupBufferSizeAndSampleRate(jack_nframes_t buffer_size, jack_nframes_t samplerate);
+ int SetupBufferSize(jack_nframes_t buffer_size);
+ int SetupSampleRate(jack_nframes_t samplerate);
+ int SetupSampleRateAux(AudioDeviceID inDevice, jack_nframes_t samplerate);
+
int SetupBuffers(int inchannels);
void DisposeBuffers();
void CloseAUHAL();
diff --git a/macosx/coreaudio/JackCoreAudioDriver.cpp b/macosx/coreaudio/JackCoreAudioDriver.cpp
index d0815cd1..3b2620cb 100644
--- a/macosx/coreaudio/JackCoreAudioDriver.cpp
+++ b/macosx/coreaudio/JackCoreAudioDriver.cpp
@@ -25,15 +25,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "JackClientControl.h"
#include "JackDriverLoader.h"
#include "JackGlobals.h"
+#include "JackTools.h"
#include "JackCompilerDeps.h"
#include <iostream>
#include <CoreServices/CoreServices.h>
+#include <CoreFoundation/CFNumber.h>
namespace Jack
{
-static void Print4CharCode(char* msg, long c)
+static void Print4CharCode(const char* msg, long c)
{
UInt32 __4CC_number = (c);
char __4CC_string[5];
@@ -42,6 +44,20 @@ static void Print4CharCode(char* msg, long c)
jack_log("%s'%s'", (msg), __4CC_string);
}
+static void PrintStreamDesc(AudioStreamBasicDescription *inDesc)
+{
+ jack_log("- - - - - - - - - - - - - - - - - - - -");
+ jack_log(" Sample Rate:%f", inDesc->mSampleRate);
+ jack_log(" Format ID:%.*s", (int) sizeof(inDesc->mFormatID), (char*)&inDesc->mFormatID);
+ jack_log(" Format Flags:%lX", inDesc->mFormatFlags);
+ jack_log(" Bytes per Packet:%ld", inDesc->mBytesPerPacket);
+ jack_log(" Frames per Packet:%ld", inDesc->mFramesPerPacket);
+ jack_log(" Bytes per Frame:%ld", inDesc->mBytesPerFrame);
+ jack_log(" Channels per Frame:%ld", inDesc->mChannelsPerFrame);
+ jack_log(" Bits per Channel:%ld", inDesc->mBitsPerChannel);
+ jack_log("- - - - - - - - - - - - - - - - - - - -\n");
+}
+
static void printError(OSStatus err)
{
switch (err) {
@@ -221,10 +237,13 @@ OSStatus JackCoreAudioDriver::MeasureCallback(AudioDeviceID inDevice,
JackMachThread::GetParams(pthread_self(), &driver->fEngineControl->fPeriod, &driver->fEngineControl->fComputation, &driver->fEngineControl->fConstraint);
if (driver->fComputationGrain > 0) {
- jack_log("JackCoreAudioDriver::MeasureCallback : RT thread computation setup to %ld percent of period", int(driver->fComputationGrain * 100));
+ jack_log("JackCoreAudioDriver::MeasureCallback : RT thread computation setup to %d percent of period", int(driver->fComputationGrain * 100));
driver->fEngineControl->fComputation = driver->fEngineControl->fPeriod * driver->fComputationGrain;
}
+ // Signal waiting start function...
+ driver->fState = true;
+
// Setup threadded based log function
set_threaded_log_function();
return noErr;
@@ -250,8 +269,7 @@ OSStatus JackCoreAudioDriver::SRNotificationCallback(AudioDeviceID inDevice,
return noErr;
}
-// A better implementation would try to recover in case of hardware device change (see HALLAB HLFilePlayerWindowControllerAudioDevicePropertyListenerProc code)
-
+// A better implementation would possibly try to recover in case of hardware device change (see HALLAB HLFilePlayerWindowControllerAudioDevicePropertyListenerProc code)
OSStatus JackCoreAudioDriver::DeviceNotificationCallback(AudioDeviceID inDevice,
UInt32 inChannel,
Boolean isInput,
@@ -261,87 +279,30 @@ OSStatus JackCoreAudioDriver::DeviceNotificationCallback(AudioDeviceID inDevice,
JackCoreAudioDriver* driver = (JackCoreAudioDriver*)inClientData;
switch (inPropertyID) {
-
+
case kAudioDeviceProcessorOverload: {
jack_error("JackCoreAudioDriver::DeviceNotificationCallback kAudioDeviceProcessorOverload");
jack_time_t cur_time = GetMicroSeconds();
driver->NotifyXRun(cur_time, float(cur_time - driver->fBeginDateUst)); // Better this value than nothing...
break;
- }
-
+ }
+
case kAudioDevicePropertyStreamConfiguration: {
- jack_error("Cannot handle kAudioDevicePropertyStreamConfiguration : server may not work correctly anymore...");
- return kAudioHardwareUnsupportedOperationError;
- }
-
- case kAudioDevicePropertyNominalSampleRate: {
- jack_error("Cannot handle kAudioDevicePropertyNominalSampleRate : server may not work correctly anymore...");
+ jack_error("Cannot handle kAudioDevicePropertyStreamConfiguration : server will quit...");
+ driver->NotifyFailure(JackBackendError, "Another application has changed the device configuration."); // Message length limited to JACK_MESSAGE_SIZE
+ driver->CloseAUHAL();
+ kill(JackTools::GetPID(), SIGINT);
return kAudioHardwareUnsupportedOperationError;
- }
-
- /*
+ }
+
case kAudioDevicePropertyNominalSampleRate: {
-
- UInt32 outSize = sizeof(Float64);
- Float64 sampleRate;
- int in_nChannels = 0;
- int out_nChannels = 0;
- char capture_driver_name[256];
- char playback_driver_name[256];
- CFStringRef ref;
-
- // Stop and restart
- driver->Stop();
- driver->RemoveListeners();
+ jack_error("Cannot handle kAudioDevicePropertyNominalSampleRate : server will quit...");
+ driver->NotifyFailure(JackBackendError, "Another application has changed the sample rate."); // Message length limited to JACK_MESSAGE_SIZE
driver->CloseAUHAL();
-
- OSStatus err = AudioDeviceGetProperty(driver->fDeviceID, 0, kAudioDeviceSectionGlobal, kAudioDevicePropertyNominalSampleRate, &outSize, &sampleRate);
- if (err != noErr) {
- jack_error("Cannot get current sample rate");
- printError(err);
- }
- jack_log("JackCoreAudioDriver::DeviceNotificationCallback kAudioDevicePropertyNominalSampleRate %ld", long(sampleRate));
-
- if (driver->SetupDevices(driver->fCaptureUID, driver->fPlaybackUID, capture_driver_name, playback_driver_name) < 0)
- return -1;
-
- if (driver->SetupChannels(driver->fCapturing, driver->fPlaying, driver->fInChannels, driver->fOutChannels, in_nChannels, out_nChannels, false) < 0)
- return -1;
-
- if (driver->SetupBufferSizeAndSampleRate(driver->fEngineControl->fBufferSize, sampleRate) < 0)
- return -1;
-
- if (driver->OpenAUHAL(driver->fCapturing,
- driver->fPlaying,
- driver->fInChannels,
- driver->fOutChannels,
- in_nChannels,
- out_nChannels,
- driver->fEngineControl->fBufferSize,
- sampleRate,
- false) < 0)
- goto error;
-
- if (driver->AddListeners() < 0)
- goto error;
-
- driver->Start();
-
- // Send notification to be used in JackPilot or JackRouter plugin
- jack_error("Device restart...");
- ref = CFStringCreateWithCString(NULL, driver->fEngineControl->fServerName, kCFStringEncodingMacRoman);
- CFNotificationCenterPostNotificationWithOptions(CFNotificationCenterGetDistributedCenter(),
- CFSTR("com.grame.jackserver.restart"),
- ref,
- NULL,
- kCFNotificationDeliverImmediately | kCFNotificationPostToAllSessions);
- CFRelease(ref);
- return noErr;
-error:
- driver->CloseAUHAL();
- break;
- }
- */
+ kill(JackTools::GetPID(), SIGINT);
+ return kAudioHardwareUnsupportedOperationError;
+ }
+
}
return noErr;
}
@@ -377,7 +338,7 @@ OSStatus JackCoreAudioDriver::GetDefaultDevice(AudioDeviceID* id)
jack_log("GetDefaultDevice: input = %ld output = %ld", inDefault, outDefault);
- // Get the device only if default input and ouput are the same
+ // Get the device only if default input and output are the same
if (inDefault == outDefault) {
*id = inDefault;
return noErr;
@@ -446,55 +407,136 @@ OSStatus JackCoreAudioDriver::GetTotalChannels(AudioDeviceID device, int& channe
}
JackCoreAudioDriver::JackCoreAudioDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table)
- : JackAudioDriver(name, alias, engine, table), fJackInputData(NULL), fDriverOutputData(NULL), fState(false), fIOUsage(1.f),fComputationGrain(-1.f)
+ : JackAudioDriver(name, alias, engine, table),
+ fJackInputData(NULL),
+ fDriverOutputData(NULL),
+ fPluginID(0),
+ fState(false),
+ fHogged(false),
+ fIOUsage(1.f),
+ fComputationGrain(-1.f)
{}
JackCoreAudioDriver::~JackCoreAudioDriver()
{}
-OSStatus JackCoreAudioDriver::CreateAggregateDevice(AudioDeviceID captureDeviceID, AudioDeviceID playbackDeviceID, AudioDeviceID* outAggregateDevice)
+OSStatus JackCoreAudioDriver::DestroyAggregateDevice()
+{
+ OSStatus osErr = noErr;
+ AudioObjectPropertyAddress pluginAOPA;
+ pluginAOPA.mSelector = kAudioPlugInDestroyAggregateDevice;
+ pluginAOPA.mScope = kAudioObjectPropertyScopeGlobal;
+ pluginAOPA.mElement = kAudioObjectPropertyElementMaster;
+ UInt32 outDataSize;
+
+ if (fPluginID > 0) {
+
+ osErr = AudioObjectGetPropertyDataSize(fPluginID, &pluginAOPA, 0, NULL, &outDataSize);
+ if (osErr != noErr) {
+ jack_error("JackCoreAudioDriver::DestroyAggregateDevice : AudioObjectGetPropertyDataSize error");
+ printError(osErr);
+ return osErr;
+ }
+
+ osErr = AudioObjectGetPropertyData(fPluginID, &pluginAOPA, 0, NULL, &outDataSize, &fDeviceID);
+ if (osErr != noErr) {
+ jack_error("JackCoreAudioDriver::DestroyAggregateDevice : AudioObjectGetPropertyData error");
+ printError(osErr);
+ return osErr;
+ }
+
+ }
+
+ return noErr;
+}
+
+OSStatus JackCoreAudioDriver::CreateAggregateDevice(AudioDeviceID captureDeviceID, AudioDeviceID playbackDeviceID, jack_nframes_t samplerate, AudioDeviceID* outAggregateDevice)
{
OSStatus osErr = noErr;
UInt32 outSize;
Boolean outWritable;
+
+ // Check devices... (TO IMPROVE)
+ if (IsAggregateDevice(captureDeviceID) || IsAggregateDevice(playbackDeviceID)) {
+ jack_error("JackCoreAudioDriver::CreateAggregateDevice : cannot agregate devices that are already aggregate devices...");
+ return -1;
+ }
+
+ //---------------------------------------------------------------------------
+ // Setup SR of both devices otherwise creating AD may fail...
+ //---------------------------------------------------------------------------
+ if (SetupSampleRateAux(captureDeviceID, samplerate) < 0) {
+ jack_error("JackCoreAudioDriver::CreateAggregateDevice : cannot set SR of input device");
+ }
+ if (SetupSampleRateAux(playbackDeviceID, samplerate) < 0) {
+ jack_error("JackCoreAudioDriver::CreateAggregateDevice : cannot set SR of output device");
+ }
- //-----------------------
+ //---------------------------------------------------------------------------
// Start to create a new aggregate by getting the base audio hardware plugin
- //-----------------------
-
+ //---------------------------------------------------------------------------
+
+ char capture_name[256];
+ char playback_name[256];
+ GetDeviceNameFromID(captureDeviceID, capture_name);
+ GetDeviceNameFromID(playbackDeviceID, playback_name);
+ jack_info("Separated input = '%s' and output = '%s' devices, create a private aggregate device to handle them...", capture_name, playback_name);
+
osErr = AudioHardwareGetPropertyInfo(kAudioHardwarePropertyPlugInForBundleID, &outSize, &outWritable);
- if (osErr != noErr)
+ if (osErr != noErr) {
+ jack_error("JackCoreAudioDriver::CreateAggregateDevice : AudioHardwareGetPropertyInfo kAudioHardwarePropertyPlugInForBundleID error");
+ printError(osErr);
return osErr;
+ }
AudioValueTranslation pluginAVT;
CFStringRef inBundleRef = CFSTR("com.apple.audio.CoreAudio");
- AudioObjectID pluginID;
-
+
pluginAVT.mInputData = &inBundleRef;
pluginAVT.mInputDataSize = sizeof(inBundleRef);
- pluginAVT.mOutputData = &pluginID;
- pluginAVT.mOutputDataSize = sizeof(pluginID);
+ pluginAVT.mOutputData = &fPluginID;
+ pluginAVT.mOutputDataSize = sizeof(fPluginID);
osErr = AudioHardwareGetProperty(kAudioHardwarePropertyPlugInForBundleID, &outSize, &pluginAVT);
- if (osErr != noErr)
+ if (osErr != noErr) {
+ jack_error("JackCoreAudioDriver::CreateAggregateDevice : AudioHardwareGetProperty kAudioHardwarePropertyPlugInForBundleID error");
+ printError(osErr);
return osErr;
+ }
- //-----------------------
+ //-------------------------------------------------
// Create a CFDictionary for our aggregate device
- //-----------------------
+ //-------------------------------------------------
CFMutableDictionaryRef aggDeviceDict = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CFStringRef AggregateDeviceNameRef = CFSTR("JackDuplex");
CFStringRef AggregateDeviceUIDRef = CFSTR("com.grame.JackDuplex");
-
+
// add the name of the device to the dictionary
CFDictionaryAddValue(aggDeviceDict, CFSTR(kAudioAggregateDeviceNameKey), AggregateDeviceNameRef);
// add our choice of UID for the aggregate device to the dictionary
CFDictionaryAddValue(aggDeviceDict, CFSTR(kAudioAggregateDeviceUIDKey), AggregateDeviceUIDRef);
-
+
+ // add a "private aggregate key" to the dictionary
+ int value = 1;
+ CFNumberRef AggregateDeviceNumberRef = CFNumberCreate(NULL, kCFNumberIntType, &value);
+
+ SInt32 system;
+ Gestalt(gestaltSystemVersion, &system);
+
+ jack_log("JackCoreAudioDriver::CreateAggregateDevice : system version = %x limit = %x", system, 0x00001054);
+
+ // Starting with 10.5.4 systems, the AD can be internal... (better)
+ if (system < 0x00001054) {
+ jack_log("JackCoreAudioDriver::CreateAggregateDevice : public aggregate device....");
+ } else {
+ jack_log("JackCoreAudioDriver::CreateAggregateDevice : private aggregate device....");
+ CFDictionaryAddValue(aggDeviceDict, CFSTR(kAudioAggregateDeviceIsPrivateKey), AggregateDeviceNumberRef);
+ }
+
//-------------------------------------------------
// Create a CFMutableArray for our sub-device list
//-------------------------------------------------
@@ -522,13 +564,19 @@ OSStatus JackCoreAudioDriver::CreateAggregateDevice(AudioDeviceID captureDeviceI
pluginAOPA.mElement = kAudioObjectPropertyElementMaster;
UInt32 outDataSize;
- osErr = AudioObjectGetPropertyDataSize(pluginID, &pluginAOPA, 0, NULL, &outDataSize);
- if (osErr != noErr)
- return osErr;
-
- osErr = AudioObjectGetPropertyData(pluginID, &pluginAOPA, sizeof(aggDeviceDict), &aggDeviceDict, &outDataSize, outAggregateDevice);
- if (osErr != noErr)
- return osErr;
+ osErr = AudioObjectGetPropertyDataSize(fPluginID, &pluginAOPA, 0, NULL, &outDataSize);
+ if (osErr != noErr) {
+ jack_error("JackCoreAudioDriver::CreateAggregateDevice : AudioObjectGetPropertyDataSize error");
+ printError(osErr);
+ goto error;
+ }
+
+ osErr = AudioObjectGetPropertyData(fPluginID, &pluginAOPA, sizeof(aggDeviceDict), &aggDeviceDict, &outDataSize, outAggregateDevice);
+ if (osErr != noErr) {
+ jack_error("JackCoreAudioDriver::CreateAggregateDevice : AudioObjectGetPropertyData error");
+ printError(osErr);
+ goto error;
+ }
// pause for a bit to make sure that everything completed correctly
// this is to work around a bug in the HAL where a new aggregate device seems to disappear briefly after it is created
@@ -543,9 +591,12 @@ OSStatus JackCoreAudioDriver::CreateAggregateDevice(AudioDeviceID captureDeviceI
pluginAOPA.mElement = kAudioObjectPropertyElementMaster;
outDataSize = sizeof(CFMutableArrayRef);
osErr = AudioObjectSetPropertyData(*outAggregateDevice, &pluginAOPA, 0, NULL, outDataSize, &subDevicesArray);
- if (osErr != noErr)
- return osErr;
-
+ if (osErr != noErr) {
+ jack_error("JackCoreAudioDriver::CreateAggregateDevice : AudioObjectSetPropertyData for sub-device list error");
+ printError(osErr);
+ goto error;
+ }
+
// pause again to give the changes time to take effect
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, false);
@@ -560,15 +611,21 @@ OSStatus JackCoreAudioDriver::CreateAggregateDevice(AudioDeviceID captureDeviceI
pluginAOPA.mElement = kAudioObjectPropertyElementMaster;
outDataSize = sizeof(CFStringRef);
osErr = AudioObjectSetPropertyData(*outAggregateDevice, &pluginAOPA, 0, NULL, outDataSize, &captureDeviceUID); // capture is master...
- if (osErr != noErr)
- return osErr;
-
+ if (osErr != noErr) {
+ jack_error("JackCoreAudioDriver::CreateAggregateDevice : AudioObjectSetPropertyData for master device error");
+ printError(osErr);
+ goto error;
+ }
+
// pause again to give the changes time to take effect
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, false);
//----------
// Clean up
//----------
+
+ // release the private AD key
+ CFRelease(AggregateDeviceNumberRef);
// release the CF objects we have created - we don't need them any more
CFRelease(aggDeviceDict);
@@ -580,9 +637,17 @@ OSStatus JackCoreAudioDriver::CreateAggregateDevice(AudioDeviceID captureDeviceI
jack_log("New aggregate device %ld", *outAggregateDevice);
return noErr;
+
+error:
+ DestroyAggregateDevice();
+ return -1;
}
-int JackCoreAudioDriver::SetupDevices(const char* capture_driver_uid, const char* playback_driver_uid, char* capture_driver_name, char* playback_driver_name)
+int JackCoreAudioDriver::SetupDevices(const char* capture_driver_uid,
+ const char* playback_driver_uid,
+ char* capture_driver_name,
+ char* playback_driver_name,
+ jack_nframes_t samplerate)
{
capture_driver_name[0] = 0;
playback_driver_name[0] = 0;
@@ -590,17 +655,7 @@ int JackCoreAudioDriver::SetupDevices(const char* capture_driver_uid, const char
// Duplex
if (strcmp(capture_driver_uid, "") != 0 && strcmp(playback_driver_uid, "") != 0) {
jack_log("JackCoreAudioDriver::Open duplex");
-
- /*
- AudioDeviceID captureID, playbackID;
- if (GetDeviceIDFromUID(capture_driver_uid, &captureID) != noErr)
- return -1;
- if (GetDeviceIDFromUID(playback_driver_uid, &playbackID) != noErr)
- return -1;
- if (CreateAggregateDevice(captureID, playbackID, &fDeviceID) != noErr)
- return -1;
- */
-
+
// Same device for capture and playback...
if (strcmp(capture_driver_uid, playback_driver_uid) == 0) {
@@ -618,17 +673,17 @@ int JackCoreAudioDriver::SetupDevices(const char* capture_driver_uid, const char
} else {
- // Creates agregate device
+ // Creates aggregate device
AudioDeviceID captureID, playbackID;
if (GetDeviceIDFromUID(capture_driver_uid, &captureID) != noErr)
return -1;
if (GetDeviceIDFromUID(playback_driver_uid, &playbackID) != noErr)
return -1;
- if (CreateAggregateDevice(captureID, playbackID, &fDeviceID) != noErr)
+ if (CreateAggregateDevice(captureID, playbackID, samplerate, &fDeviceID) != noErr)
return -1;
}
- // Capture only
+ // Capture only
} else if (strcmp(capture_driver_uid, "") != 0) {
jack_log("JackCoreAudioDriver::Open capture only");
if (GetDeviceIDFromUID(capture_driver_uid, &fDeviceID) != noErr) {
@@ -643,7 +698,7 @@ int JackCoreAudioDriver::SetupDevices(const char* capture_driver_uid, const char
return -1;
}
- // Playback only
+ // Playback only
} else if (strcmp(playback_driver_uid, "") != 0) {
jack_log("JackCoreAudioDriver::Open playback only");
if (GetDeviceIDFromUID(playback_driver_uid, &fDeviceID) != noErr) {
@@ -658,7 +713,7 @@ int JackCoreAudioDriver::SetupDevices(const char* capture_driver_uid, const char
return -1;
}
- // Use default driver in duplex mode
+ // Use default driver in duplex mode
} else {
jack_log("JackCoreAudioDriver::Open default driver");
if (GetDefaultDevice(&fDeviceID) != noErr) {
@@ -670,6 +725,14 @@ int JackCoreAudioDriver::SetupDevices(const char* capture_driver_uid, const char
return -1;
}
}
+
+ if (fHogged) {
+ if (TakeHog()) {
+ jack_info("Device = %ld has been hogged", fDeviceID);
+ } else {
+ jack_error("Cannot hog device = %ld", fDeviceID);
+ }
+ }
return 0;
}
@@ -704,48 +767,58 @@ int JackCoreAudioDriver::SetupChannels(bool capturing, bool playing, int& inchan
}
if (inchannels > in_nChannels) {
- jack_error("This device hasn't required input channels inchannels = %ld in_nChannels = %ld", inchannels, in_nChannels);
+ jack_error("This device hasn't required input channels inchannels = %d in_nChannels = %d", inchannels, in_nChannels);
if (strict)
return -1;
}
if (outchannels > out_nChannels) {
- jack_error("This device hasn't required output channels outchannels = %ld out_nChannels = %ld", outchannels, out_nChannels);
+ jack_error("This device hasn't required output channels outchannels = %d out_nChannels = %d", outchannels, out_nChannels);
if (strict)
return -1;
}
- if (inchannels == 0) {
- jack_log("Setup max in channels = %ld", in_nChannels);
+ if (inchannels == -1) {
+ jack_log("Setup max in channels = %d", in_nChannels);
inchannels = in_nChannels;
}
- if (outchannels == 0) {
- jack_log("Setup max out channels = %ld", out_nChannels);
+ if (outchannels == -1) {
+ jack_log("Setup max out channels = %d", out_nChannels);
outchannels = out_nChannels;
}
return 0;
}
-int JackCoreAudioDriver::SetupBufferSizeAndSampleRate(jack_nframes_t buffer_size, jack_nframes_t samplerate)
+int JackCoreAudioDriver::SetupBufferSize(jack_nframes_t buffer_size)
{
- OSStatus err = noErr;
- UInt32 outSize;
- Float64 sampleRate;
-
// Setting buffer size
- outSize = sizeof(UInt32);
- err = AudioDeviceSetProperty(fDeviceID, NULL, 0, false, kAudioDevicePropertyBufferFrameSize, outSize, &buffer_size);
+ UInt32 outSize = sizeof(UInt32);
+ OSStatus err = AudioDeviceSetProperty(fDeviceID, NULL, 0, false, kAudioDevicePropertyBufferFrameSize, outSize, &buffer_size);
if (err != noErr) {
jack_error("Cannot set buffer size %ld", buffer_size);
printError(err);
return -1;
}
+ return 0;
+}
+
+int JackCoreAudioDriver::SetupSampleRate(jack_nframes_t samplerate)
+{
+ return SetupSampleRateAux(fDeviceID, samplerate);
+}
+
+int JackCoreAudioDriver::SetupSampleRateAux(AudioDeviceID inDevice, jack_nframes_t samplerate)
+{
+ OSStatus err = noErr;
+ UInt32 outSize;
+ Float64 sampleRate;
+
// Get sample rate
outSize = sizeof(Float64);
- err = AudioDeviceGetProperty(fDeviceID, 0, kAudioDeviceSectionGlobal, kAudioDevicePropertyNominalSampleRate, &outSize, &sampleRate);
+ err = AudioDeviceGetProperty(inDevice, 0, kAudioDeviceSectionGlobal, kAudioDevicePropertyNominalSampleRate, &outSize, &sampleRate);
if (err != noErr) {
jack_error("Cannot get current sample rate");
printError(err);
@@ -757,13 +830,13 @@ int JackCoreAudioDriver::SetupBufferSizeAndSampleRate(jack_nframes_t buffer_size
sampleRate = (Float64)samplerate;
// To get SR change notification
- err = AudioDeviceAddPropertyListener(fDeviceID, 0, true, kAudioDevicePropertyNominalSampleRate, SRNotificationCallback, this);
+ err = AudioDeviceAddPropertyListener(inDevice, 0, true, kAudioDevicePropertyNominalSampleRate, SRNotificationCallback, this);
if (err != noErr) {
jack_error("Error calling AudioDeviceAddPropertyListener with kAudioDevicePropertyNominalSampleRate");
printError(err);
return -1;
}
- err = AudioDeviceSetProperty(fDeviceID, NULL, 0, kAudioDeviceSectionGlobal, kAudioDevicePropertyNominalSampleRate, outSize, &sampleRate);
+ err = AudioDeviceSetProperty(inDevice, NULL, 0, kAudioDeviceSectionGlobal, kAudioDevicePropertyNominalSampleRate, outSize, &sampleRate);
if (err != noErr) {
jack_error("Cannot set sample rate = %ld", samplerate);
printError(err);
@@ -772,13 +845,13 @@ int JackCoreAudioDriver::SetupBufferSizeAndSampleRate(jack_nframes_t buffer_size
// Waiting for SR change notification
int count = 0;
- while (!fState && count++ < 100) {
+ while (!fState && count++ < WAIT_COUNTER) {
usleep(100000);
- jack_log("Wait count = %ld", count);
+ jack_log("Wait count = %d", count);
}
// Remove SR change notification
- AudioDeviceRemovePropertyListener(fDeviceID, 0, true, kAudioDevicePropertyNominalSampleRate, SRNotificationCallback);
+ AudioDeviceRemovePropertyListener(inDevice, 0, true, kAudioDevicePropertyNominalSampleRate, SRNotificationCallback);
}
return 0;
@@ -791,14 +864,15 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
int in_nChannels,
int out_nChannels,
jack_nframes_t buffer_size,
- jack_nframes_t samplerate,
- bool strict)
+ jack_nframes_t samplerate)
{
ComponentResult err1;
UInt32 enableIO;
AudioStreamBasicDescription srcFormat, dstFormat;
+ AudioDeviceID currAudioDeviceID;
+ UInt32 size;
- jack_log("OpenAUHAL capturing = %ld playing = %ld inchannels = %ld outchannels = %ld in_nChannels = %ld out_nChannels = %ld ", capturing, playing, inchannels, outchannels, in_nChannels, out_nChannels);
+ jack_log("OpenAUHAL capturing = %d playing = %d inchannels = %d outchannels = %d in_nChannels = %d out_nChannels = %d", capturing, playing, inchannels, outchannels, in_nChannels, out_nChannels);
if (inchannels == 0 && outchannels == 0) {
jack_error("No input and output channels...");
@@ -813,14 +887,14 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling OpenAComponent");
printError(err1);
- return -1;
+ goto error;
}
err1 = AudioUnitInitialize(fAUHAL);
if (err1 != noErr) {
jack_error("Cannot initialize AUHAL unit");
printError(err1);
- return -1;
+ goto error;
}
// Start I/O
@@ -836,8 +910,7 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input");
printError(err1);
- if (strict)
- return -1;
+ goto error;
}
if (playing && outchannels > 0) {
@@ -852,18 +925,15 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_EnableIO,kAudioUnitScope_Output");
printError(err1);
- if (strict)
- return -1;
+ goto error;
}
- AudioDeviceID currAudioDeviceID;
- UInt32 size = sizeof(AudioDeviceID);
+ size = sizeof(AudioDeviceID);
err1 = AudioUnitGetProperty(fAUHAL, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &currAudioDeviceID, &size);
if (err1 != noErr) {
jack_error("Error calling AudioUnitGetProperty - kAudioOutputUnitProperty_CurrentDevice");
printError(err1);
- if (strict)
- return -1;
+ goto error;
} else {
jack_log("AudioUnitGetPropertyCurrentDevice = %d", currAudioDeviceID);
}
@@ -873,28 +943,16 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_CurrentDevice");
printError(err1);
- if (strict)
- return -1;
- }
-
- err1 = AudioUnitGetProperty(fAUHAL, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &currAudioDeviceID, &size);
- if (err1 != noErr) {
- jack_error("Error calling AudioUnitGetProperty - kAudioOutputUnitProperty_CurrentDevice");
- printError(err1);
- if (strict)
- return -1;
- } else {
- jack_log("AudioUnitGetPropertyCurrentDevice = %d", currAudioDeviceID);
+ goto error;
}
-
+
// Set buffer size
if (capturing && inchannels > 0) {
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);
- if (strict)
- return -1;
+ goto error;
}
}
@@ -903,8 +961,7 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_MaximumFramesPerSlice");
printError(err1);
- if (strict)
- return -1;
+ goto error;
}
}
@@ -921,6 +978,7 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_ChannelMap 1");
printError(err1);
+ goto error;
}
}
@@ -936,40 +994,71 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioOutputUnitProperty_ChannelMap 0");
printError(err1);
+ goto error;
}
}
// Setup stream converters
- jack_log("Setup AUHAL input stream converter SR = %ld", samplerate);
- srcFormat.mSampleRate = samplerate;
- srcFormat.mFormatID = kAudioFormatLinearPCM;
- srcFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kLinearPCMFormatFlagIsNonInterleaved;
- srcFormat.mBytesPerPacket = sizeof(float);
- srcFormat.mFramesPerPacket = 1;
- srcFormat.mBytesPerFrame = sizeof(float);
- srcFormat.mChannelsPerFrame = outchannels;
- srcFormat.mBitsPerChannel = 32;
-
- err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &srcFormat, sizeof(AudioStreamBasicDescription));
- if (err1 != noErr) {
- jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Input");
- printError(err1);
+ if (capturing && inchannels > 0) {
+
+ size = sizeof(AudioStreamBasicDescription);
+ err1 = AudioUnitGetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &srcFormat, &size);
+ if (err1 != noErr) {
+ jack_error("Error calling AudioUnitGetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Input");
+ printError(err1);
+ goto error;
+ }
+ PrintStreamDesc(&srcFormat);
+
+ jack_log("Setup AUHAL input stream converter SR = %ld", samplerate);
+ srcFormat.mSampleRate = samplerate;
+ srcFormat.mFormatID = kAudioFormatLinearPCM;
+ srcFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kLinearPCMFormatFlagIsNonInterleaved;
+ srcFormat.mBytesPerPacket = sizeof(float);
+ srcFormat.mFramesPerPacket = 1;
+ srcFormat.mBytesPerFrame = sizeof(float);
+ srcFormat.mChannelsPerFrame = inchannels;
+ srcFormat.mBitsPerChannel = 32;
+ PrintStreamDesc(&srcFormat);
+
+ err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 1, &srcFormat, sizeof(AudioStreamBasicDescription));
+
+ if (err1 != noErr) {
+ jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Input");
+ printError(err1);
+ goto error;
+ }
}
- jack_log("Setup AUHAL output stream converter SR = %ld", samplerate);
- dstFormat.mSampleRate = samplerate;
- dstFormat.mFormatID = kAudioFormatLinearPCM;
- dstFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kLinearPCMFormatFlagIsNonInterleaved;
- dstFormat.mBytesPerPacket = sizeof(float);
- dstFormat.mFramesPerPacket = 1;
- dstFormat.mBytesPerFrame = sizeof(float);
- dstFormat.mChannelsPerFrame = inchannels;
- dstFormat.mBitsPerChannel = 32;
-
- err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 1, &dstFormat, sizeof(AudioStreamBasicDescription));
- if (err1 != noErr) {
- jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Output");
- printError(err1);
+ if (playing && outchannels > 0) {
+
+ size = sizeof(AudioStreamBasicDescription);
+ err1 = AudioUnitGetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 1, &dstFormat, &size);
+ if (err1 != noErr) {
+ jack_error("Error calling AudioUnitGetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Output");
+ printError(err1);
+ goto error;
+ }
+ PrintStreamDesc(&dstFormat);
+
+ jack_log("Setup AUHAL output stream converter SR = %ld", samplerate);
+ dstFormat.mSampleRate = samplerate;
+ dstFormat.mFormatID = kAudioFormatLinearPCM;
+ dstFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kLinearPCMFormatFlagIsNonInterleaved;
+ dstFormat.mBytesPerPacket = sizeof(float);
+ dstFormat.mFramesPerPacket = 1;
+ dstFormat.mBytesPerFrame = sizeof(float);
+ dstFormat.mChannelsPerFrame = outchannels;
+ dstFormat.mBitsPerChannel = 32;
+ PrintStreamDesc(&dstFormat);
+
+ err1 = AudioUnitSetProperty(fAUHAL, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &dstFormat, sizeof(AudioStreamBasicDescription));
+
+ if (err1 != noErr) {
+ jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_StreamFormat kAudioUnitScope_Output");
+ printError(err1);
+ goto error;
+ }
}
// Setup callbacks
@@ -981,7 +1070,7 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_SetRenderCallback 1");
printError(err1);
- return -1;
+ goto error;
}
} else {
AURenderCallbackStruct output;
@@ -991,11 +1080,15 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
if (err1 != noErr) {
jack_error("Error calling AudioUnitSetProperty - kAudioUnitProperty_SetRenderCallback 0");
printError(err1);
- return -1;
+ goto error;
}
}
return 0;
+
+error:
+ CloseAUHAL();
+ return -1;
}
int JackCoreAudioDriver::SetupBuffers(int inchannels)
@@ -1109,7 +1202,8 @@ int JackCoreAudioDriver::Open(jack_nframes_t buffer_size,
jack_nframes_t capture_latency,
jack_nframes_t playback_latency,
int async_output_latency,
- int computation_grain)
+ int computation_grain,
+ bool hogged)
{
int in_nChannels = 0;
int out_nChannels = 0;
@@ -1128,21 +1222,40 @@ int JackCoreAudioDriver::Open(jack_nframes_t buffer_size,
fPlaybackLatency = playback_latency;
fIOUsage = float(async_output_latency) / 100.f;
fComputationGrain = float(computation_grain) / 100.f;
+ fHogged = hogged;
+
+ SInt32 major;
+ SInt32 minor;
+ Gestalt(gestaltSystemVersionMajor, &major);
+ Gestalt(gestaltSystemVersionMinor, &minor);
+
+ // Starting with 10.6 systems, the HAL notification thread is created internally
+ if (major == 10 && minor >= 6) {
+ CFRunLoopRef theRunLoop = NULL;
+ AudioObjectPropertyAddress theAddress = { kAudioHardwarePropertyRunLoop, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
+ OSStatus theError = AudioObjectSetPropertyData (kAudioObjectSystemObject, &theAddress, 0, NULL, sizeof(CFRunLoopRef), &theRunLoop);
+ if (theError != noErr) {
+ jack_error("JackCoreAudioDriver::Open kAudioHardwarePropertyRunLoop error");
+ }
+ }
- if (SetupDevices(capture_driver_uid, playback_driver_uid, capture_driver_name, playback_driver_name) < 0)
- return -1;
+ if (SetupDevices(capture_driver_uid, playback_driver_uid, capture_driver_name, playback_driver_name, samplerate) < 0)
+ goto error;
// Generic JackAudioDriver Open
if (JackAudioDriver::Open(buffer_size, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_name, playback_driver_name, capture_latency, playback_latency) != 0)
- return -1;
+ goto error;
if (SetupChannels(capturing, playing, inchannels, outchannels, in_nChannels, out_nChannels, true) < 0)
- return -1;
-
- if (SetupBufferSizeAndSampleRate(buffer_size, samplerate) < 0)
- return -1;
+ goto error;
- if (OpenAUHAL(capturing, playing, inchannels, outchannels, in_nChannels, out_nChannels, buffer_size, samplerate, true) < 0)
+ if (SetupBufferSize(buffer_size) < 0)
+ goto error;
+
+ if (SetupSampleRate(samplerate) < 0)
+ goto error;
+
+ if (OpenAUHAL(capturing, playing, inchannels, outchannels, in_nChannels, out_nChannels, buffer_size, samplerate) < 0)
goto error;
if (capturing && inchannels > 0)
@@ -1151,7 +1264,7 @@ int JackCoreAudioDriver::Open(jack_nframes_t buffer_size,
if (AddListeners() < 0)
goto error;
-
+
// Core driver may have changed the in/out values
fCaptureChannels = inchannels;
fPlaybackChannels = outchannels;
@@ -1170,6 +1283,7 @@ int JackCoreAudioDriver::Close()
RemoveListeners();
DisposeBuffers();
CloseAUHAL();
+ DestroyAggregateDevice();
return 0;
}
@@ -1312,8 +1426,22 @@ int JackCoreAudioDriver::Start()
printError(err);
return -1;
}
-
- return 0;
+
+ // Waiting for Measure callback to be called ( = driver has started)
+ fState = false;
+ int count = 0;
+ while (!fState && count++ < WAIT_COUNTER) {
+ usleep(100000);
+ jack_log("JackCoreAudioDriver::Start wait count = %d", count);
+ }
+
+ if (count < WAIT_COUNTER) {
+ jack_info("CoreAudio driver is running...");
+ return 0;
+ } else {
+ jack_error("CoreAudio driver cannot start...");
+ return -1;
+ }
}
int JackCoreAudioDriver::Stop()
@@ -1355,6 +1483,66 @@ int JackCoreAudioDriver::SetBufferSize(jack_nframes_t buffer_size)
return 0;
}
+bool JackCoreAudioDriver::TakeHogAux(AudioDeviceID deviceID, bool isInput)
+{
+ pid_t hog_pid;
+ OSStatus err;
+
+ UInt32 propSize = sizeof(hog_pid);
+ err = AudioDeviceGetProperty(deviceID, 0, isInput, kAudioDevicePropertyHogMode, &propSize, &hog_pid);
+ if (err) {
+ jack_error("Cannot read hog state...");
+ printError(err);
+ }
+
+ if (hog_pid != getpid()) {
+ hog_pid = getpid();
+ err = AudioDeviceSetProperty(deviceID, 0, 0, isInput, kAudioDevicePropertyHogMode, propSize, &hog_pid);
+ if (err != noErr) {
+ jack_error("Can't hog device = %d because it's being hogged by another program", deviceID);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool JackCoreAudioDriver::TakeHog()
+{
+ OSStatus err = noErr;
+ AudioObjectID sub_device[32];
+ UInt32 outSize = sizeof(sub_device);
+ err = AudioDeviceGetProperty(fDeviceID, 0, kAudioDeviceSectionGlobal, kAudioAggregateDevicePropertyActiveSubDeviceList, &outSize, sub_device);
+
+ if (err != noErr) {
+ jack_log("Device does not have subdevices");
+ return TakeHogAux(fDeviceID, true);
+ } else {
+ int num_devices = outSize / sizeof(AudioObjectID);
+ jack_log("Device does has %d subdevices", num_devices);
+ for (int i = 0; i < num_devices; i++) {
+ if (!TakeHogAux(sub_device[i], true)) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
+
+bool JackCoreAudioDriver::IsAggregateDevice(AudioDeviceID device)
+{
+ UInt32 deviceType, outSize = sizeof(UInt32);
+ OSStatus err = AudioDeviceGetProperty(device, 0, kAudioDeviceSectionGlobal, kAudioDevicePropertyTransportType, &outSize, &deviceType);
+
+ if (err != noErr) {
+ jack_log("JackCoreAudioDriver::IsAggregateDevice kAudioDevicePropertyTransportType error");
+ return false;
+ } else {
+ return (deviceType == kAudioDeviceTransportTypeAggregate);
+ }
+}
+
+
} // end of namespace
@@ -1372,32 +1560,32 @@ extern "C"
strcpy(desc->name, "coreaudio"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
strcpy(desc->desc, "Apple CoreAudio API based audio backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1
- desc->nparams = 15;
+ desc->nparams = 16;
desc->params = (jack_driver_param_desc_t*)calloc(desc->nparams, sizeof(jack_driver_param_desc_t));
i = 0;
strcpy(desc->params[i].name, "channels");
desc->params[i].character = 'c';
desc->params[i].type = JackDriverParamInt;
- desc->params[i].value.ui = 0;
+ desc->params[i].value.ui = -1;
strcpy(desc->params[i].short_desc, "Maximum number of channels");
- strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
+ strcpy(desc->params[i].long_desc, "Maximum number of channels. If -1, max possible number of channels will be used");
i++;
strcpy(desc->params[i].name, "inchannels");
desc->params[i].character = 'i';
desc->params[i].type = JackDriverParamInt;
- desc->params[i].value.ui = 0;
+ desc->params[i].value.ui = -1;
strcpy(desc->params[i].short_desc, "Maximum number of input channels");
- strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
+ strcpy(desc->params[i].long_desc, "Maximum number of input channels. If -1, max possible number of input channels will be used");
i++;
strcpy(desc->params[i].name, "outchannels");
desc->params[i].character = 'o';
desc->params[i].type = JackDriverParamInt;
- desc->params[i].value.ui = 0;
+ desc->params[i].value.ui = -1;
strcpy(desc->params[i].short_desc, "Maximum number of output channels");
- strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
+ strcpy(desc->params[i].long_desc, "Maximum number of output channels. If -1, max possible number of output channels will be used");
i++;
strcpy(desc->params[i].name, "capture");
@@ -1475,16 +1663,24 @@ extern "C"
strcpy(desc->params[i].name, "list-devices");
desc->params[i].character = 'l';
desc->params[i].type = JackDriverParamBool;
- desc->params[i].value.i = TRUE;
+ desc->params[i].value.i = FALSE;
strcpy(desc->params[i].short_desc, "Display available CoreAudio devices");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
i++;
+ strcpy(desc->params[i].name, "hog");
+ desc->params[i].character = 'H';
+ desc->params[i].type = JackDriverParamBool;
+ desc->params[i].value.i = FALSE;
+ strcpy(desc->params[i].short_desc, "Take exclusive access of the audio device");
+ strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
+
+ i++;
strcpy(desc->params[i].name, "async-latency");
desc->params[i].character = 'L';
desc->params[i].type = JackDriverParamUInt;
desc->params[i].value.i = 100;
- strcpy(desc->params[i].short_desc, "Extra output latency in aynchronous mode (percent)");
+ strcpy(desc->params[i].short_desc, "Extra output latency in asynchronous mode (percent)");
strcpy(desc->params[i].long_desc, desc->params[i].short_desc);
i++;
@@ -1502,10 +1698,10 @@ extern "C"
{
jack_nframes_t srate = 44100;
jack_nframes_t frames_per_interrupt = 128;
- int capture = FALSE;
- int playback = FALSE;
- int chan_in = 0;
- int chan_out = 0;
+ bool capture = false;
+ bool playback = false;
+ int chan_in = -1; // Default: if not explicitely set, then max possible will be used...
+ int chan_out = -1; // Default: ifà not explicitely set, then max possible will be used...
bool monitor = false;
const char* capture_driver_uid = "";
const char* playback_driver_uid = "";
@@ -1515,6 +1711,7 @@ extern "C"
jack_nframes_t systemic_output_latency = 0;
int async_output_latency = 100;
int computation_grain = -1;
+ bool hogged = false;
for (node = params; node; node = jack_slist_next(node)) {
param = (const jack_driver_param_t *) node->data;
@@ -1527,31 +1724,31 @@ extern "C"
break;
case 'D':
- capture = TRUE;
- playback = TRUE;
+ capture = true;
+ playback = true;
break;
case 'c':
- chan_in = chan_out = (int) param->value.ui;
+ chan_in = chan_out = (int)param->value.ui;
break;
case 'i':
- chan_in = (int) param->value.ui;
+ chan_in = (int)param->value.ui;
break;
case 'o':
- chan_out = (int) param->value.ui;
+ chan_out = (int)param->value.ui;
break;
case 'C':
- capture = TRUE;
+ capture = true;
if (strcmp(param->value.str, "none") != 0) {
capture_driver_uid = strdup(param->value.str);
}
break;
case 'P':
- playback = TRUE;
+ playback = true;
if (strcmp(param->value.str, "none") != 0) {
playback_driver_uid = strdup(param->value.str);
}
@@ -1566,7 +1763,7 @@ extern "C"
break;
case 'p':
- frames_per_interrupt = (unsigned int) param->value.ui;
+ frames_per_interrupt = (unsigned int)param->value.ui;
break;
case 'I':
@@ -1581,6 +1778,10 @@ extern "C"
Jack::DisplayDeviceNames();
break;
+ case 'H':
+ hogged = true;
+ break;
+
case 'L':
async_output_latency = param->value.ui;
break;
@@ -1593,13 +1794,13 @@ extern "C"
/* duplex is the default */
if (!capture && !playback) {
- capture = TRUE;
- playback = TRUE;
+ capture = true;
+ playback = true;
}
Jack::JackCoreAudioDriver* driver = new Jack::JackCoreAudioDriver("system", "coreaudio", engine, table);
if (driver->Open(frames_per_interrupt, srate, capture, playback, chan_in, chan_out, monitor, capture_driver_uid,
- playback_driver_uid, systemic_input_latency, systemic_output_latency, async_output_latency, computation_grain) == 0) {
+ playback_driver_uid, systemic_input_latency, systemic_output_latency, async_output_latency, computation_grain, hogged) == 0) {
return driver;
} else {
delete driver;
diff --git a/macosx/coreaudio/JackCoreAudioDriver.h b/macosx/coreaudio/JackCoreAudioDriver.h
index fb680b3f..f3d909d2 100644
--- a/macosx/coreaudio/JackCoreAudioDriver.h
+++ b/macosx/coreaudio/JackCoreAudioDriver.h
@@ -36,6 +36,8 @@ typedef UInt8 CAAudioHardwareDeviceSectionID;
#define kAudioDeviceSectionOutput ((CAAudioHardwareDeviceSectionID)0x00)
#define kAudioDeviceSectionGlobal ((CAAudioHardwareDeviceSectionID)0x00)
#define kAudioDeviceSectionWildcard ((CAAudioHardwareDeviceSectionID)0xFF)
+
+#define WAIT_COUNTER 60
/*!
\brief The CoreAudio driver.
@@ -53,12 +55,14 @@ class JackCoreAudioDriver : public JackAudioDriver
AudioBufferList* fJackInputData;
AudioBufferList* fDriverOutputData;
- AudioDeviceID fDeviceID;
+ AudioDeviceID fDeviceID; // Used "duplex" device
+ AudioObjectID fPluginID; // Used for aggregate device
AudioUnitRenderActionFlags* fActionFags;
AudioTimeStamp* fCurrentTime;
bool fState;
+ bool fHogged;
// Initial state
bool fCapturing;
@@ -101,7 +105,6 @@ class JackCoreAudioDriver : public JackAudioDriver
AudioDevicePropertyID inPropertyID,
void* inClientData);
-
static OSStatus SRNotificationCallback(AudioDeviceID inDevice,
UInt32 inChannel,
Boolean isInput,
@@ -116,11 +119,15 @@ class JackCoreAudioDriver : public JackAudioDriver
OSStatus GetTotalChannels(AudioDeviceID device, int& channelCount, bool isInput);
// Setup
- OSStatus CreateAggregateDevice(AudioDeviceID captureDeviceID, AudioDeviceID playbackDeviceID, AudioDeviceID* outAggregateDevice);
+ OSStatus CreateAggregateDevice(AudioDeviceID captureDeviceID, AudioDeviceID playbackDeviceID, jack_nframes_t samplerate, AudioDeviceID* outAggregateDevice);
+ OSStatus DestroyAggregateDevice();
+ bool IsAggregateDevice(AudioDeviceID device);
+
int SetupDevices(const char* capture_driver_uid,
const char* playback_driver_uid,
char* capture_driver_name,
- char* playback_driver_name);
+ char* playback_driver_name,
+ jack_nframes_t samplerate);
int SetupChannels(bool capturing,
bool playing,
@@ -133,7 +140,9 @@ class JackCoreAudioDriver : public JackAudioDriver
int SetupBuffers(int inchannels);
void DisposeBuffers();
- int SetupBufferSizeAndSampleRate(jack_nframes_t buffer_size, jack_nframes_t samplerate);
+ int SetupBufferSize(jack_nframes_t buffer_size);
+ int SetupSampleRate(jack_nframes_t samplerate);
+ int SetupSampleRateAux(AudioDeviceID inDevice, jack_nframes_t samplerate);
int OpenAUHAL(bool capturing,
bool playing,
@@ -142,12 +151,14 @@ class JackCoreAudioDriver : public JackAudioDriver
int in_nChannels,
int out_nChannels,
jack_nframes_t nframes,
- jack_nframes_t samplerate,
- bool strict);
+ jack_nframes_t samplerate);
void CloseAUHAL();
int AddListeners();
void RemoveListeners();
+
+ bool TakeHogAux(AudioDeviceID deviceID, bool isInput);
+ bool TakeHog();
public:
@@ -166,7 +177,8 @@ class JackCoreAudioDriver : public JackAudioDriver
jack_nframes_t capture_latency,
jack_nframes_t playback_latency,
int async_output_latency,
- int computation_grain);
+ int computation_grain,
+ bool hogged);
int Close();
int Attach();
diff --git a/posix/JackPosixMutex.h b/posix/JackPosixMutex.h
index 8fc6ea06..91d21132 100644
--- a/posix/JackPosixMutex.h
+++ b/posix/JackPosixMutex.h
@@ -33,6 +33,47 @@ namespace Jack
\brief Mutex abstraction.
*/
+
+class JackBasePosixMutex
+{
+
+ protected:
+
+ pthread_mutex_t fMutex;
+
+ public:
+
+ JackBasePosixMutex()
+ {
+ pthread_mutex_init(&fMutex, NULL);
+ }
+
+ virtual ~JackBasePosixMutex()
+ {
+ pthread_mutex_destroy(&fMutex);
+ }
+
+ void Lock()
+ {
+ int res = pthread_mutex_lock(&fMutex);
+ if (res != 0)
+ jack_error("JackBasePosixMutex::Lock res = %d", res);
+ }
+
+ bool Trylock()
+ {
+ return (pthread_mutex_trylock(&fMutex) == 0);
+ }
+
+ void Unlock()
+ {
+ int res = pthread_mutex_unlock(&fMutex);
+ if (res != 0)
+ jack_error("JackBasePosixMutex::Unlock res = %d", res);
+ }
+
+};
+
class JackPosixMutex
{
diff --git a/posix/JackPosixThread.cpp b/posix/JackPosixThread.cpp
index aa1d0fbd..d61eb932 100644
--- a/posix/JackPosixThread.cpp
+++ b/posix/JackPosixThread.cpp
@@ -25,8 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <string.h> // for memset
#include <unistd.h> // for _POSIX_PRIORITY_SCHEDULING check
-#define JACK_SCHED_POLICY SCHED_RR
-//#define JACK_SCHED_POLICY SCHED_FIFO
+//#define JACK_SCHED_POLICY SCHED_RR
+#define JACK_SCHED_POLICY SCHED_FIFO
namespace Jack
{
diff --git a/posix/JackProcessSync.cpp b/posix/JackProcessSync.cpp
index 7c0763b4..2daa49b7 100644
--- a/posix/JackProcessSync.cpp
+++ b/posix/JackProcessSync.cpp
@@ -104,6 +104,7 @@ bool JackProcessSync::TimedWait(long usec)
gettimeofday(&T1, 0);
jack_log("JackProcessSync::TimedWait finished delta = %5.1lf",
(1e6 * T1.tv_sec - 1e6 * T0.tv_sec + T1.tv_usec - T0.tv_usec));
+
return (res == 0);
}
@@ -112,11 +113,11 @@ bool JackProcessSync::LockedTimedWait(long usec)
struct timeval T0, T1;
timespec time;
struct timeval now;
- int res;
+ int res1, res2;
- res = pthread_mutex_lock(&fMutex);
- if (res != 0)
- jack_error("JackProcessSync::LockedTimedWait error err = %s", usec, strerror(res));
+ res1 = pthread_mutex_lock(&fMutex);
+ if (res1 != 0)
+ jack_error("JackProcessSync::LockedTimedWait error err = %s", usec, strerror(res1));
jack_log("JackProcessSync::TimedWait time out = %ld", usec);
gettimeofday(&T0, 0);
@@ -125,19 +126,19 @@ bool JackProcessSync::LockedTimedWait(long usec)
unsigned int next_date_usec = now.tv_usec + usec;
time.tv_sec = now.tv_sec + (next_date_usec / 1000000);
time.tv_nsec = (next_date_usec % 1000000) * 1000;
- res = pthread_cond_timedwait(&fCond, &fMutex, &time);
- if (res != 0)
- jack_error("JackProcessSync::LockedTimedWait error usec = %ld err = %s", usec, strerror(res));
+ res2 = pthread_cond_timedwait(&fCond, &fMutex, &time);
+ if (res2 != 0)
+ jack_error("JackProcessSync::LockedTimedWait error usec = %ld err = %s", usec, strerror(res2));
gettimeofday(&T1, 0);
-
- res = pthread_mutex_unlock(&fMutex);
- if (res != 0)
- jack_error("JackProcessSync::LockedTimedWait error err = %s", usec, strerror(res));
+ res1 = pthread_mutex_unlock(&fMutex);
+ if (res1 != 0)
+ jack_error("JackProcessSync::LockedTimedWait error err = %s", usec, strerror(res1));
jack_log("JackProcessSync::TimedWait finished delta = %5.1lf",
(1e6 * T1.tv_sec - 1e6 * T0.tv_sec + T1.tv_usec - T0.tv_usec));
- return (res == 0);
+
+ return (res2 == 0);
}
diff --git a/posix/JackProcessSync.h b/posix/JackProcessSync.h
index 4cf82850..5f45a01e 100644
--- a/posix/JackProcessSync.h
+++ b/posix/JackProcessSync.h
@@ -32,7 +32,7 @@ namespace Jack
\brief A synchronization primitive built using a condition variable.
*/
-class JackProcessSync : public JackPosixMutex
+class JackProcessSync : public JackBasePosixMutex
{
private:
@@ -41,12 +41,12 @@ class JackProcessSync : public JackPosixMutex
public:
- JackProcessSync():JackPosixMutex()
+ JackProcessSync():JackBasePosixMutex()
{
pthread_cond_init(&fCond, NULL);
}
- ~JackProcessSync()
+ virtual ~JackProcessSync()
{
pthread_cond_destroy(&fCond);
}
diff --git a/posix/JackSocketClientChannel.cpp b/posix/JackSocketClientChannel.cpp
index a14e4cc3..d2d4b676 100644
--- a/posix/JackSocketClientChannel.cpp
+++ b/posix/JackSocketClientChannel.cpp
@@ -168,9 +168,9 @@ void JackSocketClientChannel::ClientClose(int refnum, int* result)
ServerSyncCall(&req, &res, result);
}
-void JackSocketClientChannel::ClientActivate(int refnum, int state, int* result)
+void JackSocketClientChannel::ClientActivate(int refnum, int is_real_time, int* result)
{
- JackActivateRequest req(refnum, state);
+ JackActivateRequest req(refnum, is_real_time);
JackResult res;
ServerSyncCall(&req, &res, result);
}
@@ -320,7 +320,7 @@ bool JackSocketClientChannel::Execute()
goto error;
}
- res.fResult = fClient->ClientNotify(event.fRefNum, event.fName, event.fNotify, event.fSync, event.fValue1, event.fValue2);
+ res.fResult = fClient->ClientNotify(event.fRefNum, event.fName, event.fNotify, event.fSync, event.fMessage, event.fValue1, event.fValue2);
if (event.fSync) {
if (res.Write(fNotificationSocket) < 0) {
diff --git a/posix/JackSocketClientChannel.h b/posix/JackSocketClientChannel.h
index d51857d8..c9004293 100644
--- a/posix/JackSocketClientChannel.h
+++ b/posix/JackSocketClientChannel.h
@@ -66,7 +66,7 @@ class JackSocketClientChannel : public detail::JackClientChannelInterface, publi
{}
void ClientClose(int refnum, int* result);
- void ClientActivate(int refnum, int state, int* result);
+ void ClientActivate(int refnum, int is_real_time, int* result);
void ClientDeactivate(int refnum, int* result);
void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result);
diff --git a/posix/JackSocketNotifyChannel.cpp b/posix/JackSocketNotifyChannel.cpp
index b0c44867..35737b0d 100644
--- a/posix/JackSocketNotifyChannel.cpp
+++ b/posix/JackSocketNotifyChannel.cpp
@@ -47,9 +47,9 @@ void JackSocketNotifyChannel::Close()
fNotifySocket.Close();
}
-void JackSocketNotifyChannel::ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2, int* result)
+void JackSocketNotifyChannel::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2, int* result)
{
- JackClientNotification event(name, refnum, notify, sync, value1, value2);
+ JackClientNotification event(name, refnum, notify, sync, message, value1, value2);
JackResult res;
// Send notification
diff --git a/posix/JackSocketNotifyChannel.h b/posix/JackSocketNotifyChannel.h
index 9a40bbcb..5d532919 100644
--- a/posix/JackSocketNotifyChannel.h
+++ b/posix/JackSocketNotifyChannel.h
@@ -45,7 +45,7 @@ class JackSocketNotifyChannel
int Open(const char* name); // Open the Server/Client connection
void Close(); // Close the Server/Client connection
- void ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2, int* result);
+ void ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2, int* result);
};
} // end of namespace
diff --git a/posix/JackSocketServerChannel.cpp b/posix/JackSocketServerChannel.cpp
index b04fdb0a..eb988aef 100644
--- a/posix/JackSocketServerChannel.cpp
+++ b/posix/JackSocketServerChannel.cpp
@@ -22,7 +22,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "JackServer.h"
#include "JackLockedEngine.h"
#include "JackGlobals.h"
+#include "JackServerGlobals.h"
#include "JackClient.h"
+#include "JackTools.h"
#include "JackNotification.h"
#include <assert.h>
#include <signal.h>
@@ -46,9 +48,8 @@ JackSocketServerChannel::~JackSocketServerChannel()
int JackSocketServerChannel::Open(const char* server_name, JackServer* server)
{
- jack_log("JackSocketServerChannel::Open ");
- fServer = server;
-
+ jack_log("JackSocketServerChannel::Open");
+
// Prepare request socket
if (fRequestListenSocket.Bind(jack_server_dir, server_name, 0) < 0) {
jack_log("JackSocketServerChannel::Open : cannot create result listen socket");
@@ -57,18 +58,8 @@ int JackSocketServerChannel::Open(const char* server_name, JackServer* server)
// Prepare for poll
BuildPoolTable();
-
- // Start listening
- if (fThread.Start() != 0) {
- jack_error("Cannot start Jack server listener");
- goto error;
- }
-
+ fServer = server;
return 0;
-
-error:
- fRequestListenSocket.Close();
- return -1;
}
void JackSocketServerChannel::Close()
@@ -86,6 +77,16 @@ void JackSocketServerChannel::Close()
delete socket;
}
}
+
+int JackSocketServerChannel::Start()
+{
+ if (fThread.Start() != 0) {
+ jack_error("Cannot start Jack server listener");
+ return -1;
+ }
+
+ return 0;
+}
void JackSocketServerChannel::ClientCreate()
{
@@ -201,7 +202,7 @@ bool JackSocketServerChannel::HandleRequest(int fd)
JackResult res;
jack_log("JackRequest::ActivateClient");
if (req.Read(socket) == 0)
- res.fResult = fServer->GetEngine()->ClientActivate(req.fRefNum, req.fState);
+ res.fResult = fServer->GetEngine()->ClientActivate(req.fRefNum, req.fIsRealTime);
if (res.Write(socket) < 0)
jack_error("JackRequest::ActivateClient write error ref = %d", req.fRefNum);
break;
@@ -395,7 +396,12 @@ bool JackSocketServerChannel::HandleRequest(int fd)
jack_error("Unknown request %ld", header.fType);
break;
}
-
+
+ // Issued by JackEngine::ReleaseRefnum when temporary mode is used
+ if (JackServerGlobals::fKilled) {
+ kill(JackTools::GetPID(), SIGINT);
+ }
+
return true;
}
diff --git a/posix/JackSocketServerChannel.h b/posix/JackSocketServerChannel.h
index 98a812aa..60b86325 100644
--- a/posix/JackSocketServerChannel.h
+++ b/posix/JackSocketServerChannel.h
@@ -59,8 +59,10 @@ class JackSocketServerChannel : public JackRunnableInterface
JackSocketServerChannel();
~JackSocketServerChannel();
- int Open(const char* server_name, JackServer* server); // Open the Server/Client connection
- void Close(); // Close the Server/Client connection
+ int Open(const char* server_name, JackServer* server); // Open the Server/Client connection
+ void Close(); // Close the Server/Client connection
+
+ int Start();
// JackRunnableInterface interface
bool Init();
diff --git a/tests/test.cpp b/tests/test.cpp
index 2358a891..26d4eedf 100644
--- a/tests/test.cpp
+++ b/tests/test.cpp
@@ -220,6 +220,12 @@ void jack_shutdown(void *arg)
exit(1);
}
+void jack_info_shutdown(int code, const char* reason, void *arg)
+{
+ printf("JACK server failure : %s\n", reason);
+ exit(1);
+}
+
void Jack_Port_Register(jack_port_id_t port, int mode, void *arg)
{
port_callback_reg++;
@@ -679,6 +685,7 @@ int main (int argc, char *argv[])
}
jack_on_shutdown(client1, jack_shutdown, 0);
+ jack_on_info_shutdown(client1, jack_info_shutdown, 0);
if (jack_set_buffer_size_callback(client1, Jack_Update_Buffer_Size, 0) != 0) {
printf("Error when calling buffer_size_callback !\n");
diff --git a/windows/JackWinNamedPipeClientChannel.cpp b/windows/JackWinNamedPipeClientChannel.cpp
index b36f03e1..fedc1095 100644
--- a/windows/JackWinNamedPipeClientChannel.cpp
+++ b/windows/JackWinNamedPipeClientChannel.cpp
@@ -167,9 +167,9 @@ void JackWinNamedPipeClientChannel::ClientClose(int refnum, int* result)
ServerSyncCall(&req, &res, result);
}
-void JackWinNamedPipeClientChannel::ClientActivate(int refnum, int state, int* result)
+void JackWinNamedPipeClientChannel::ClientActivate(int refnum, int is_real_time, int* result)
{
- JackActivateRequest req(refnum, state);
+ JackActivateRequest req(refnum, is_real_time);
JackResult res;
ServerSyncCall(&req, &res, result);
}
@@ -315,7 +315,7 @@ bool JackWinNamedPipeClientChannel::Execute()
goto error;
}
- res.fResult = fClient->ClientNotify(event.fRefNum, event.fName, event.fNotify, event.fSync, event.fValue1, event.fValue2);
+ res.fResult = fClient->ClientNotify(event.fRefNum, event.fName, event.fNotify, event.fSync, event.fMessage, event.fValue1, event.fValue2);
if (event.fSync) {
if (res.Write(&fNotificationListenPipe) < 0) {
diff --git a/windows/JackWinNamedPipeClientChannel.h b/windows/JackWinNamedPipeClientChannel.h
index a2a3969b..32bf6a5d 100644
--- a/windows/JackWinNamedPipeClientChannel.h
+++ b/windows/JackWinNamedPipeClientChannel.h
@@ -64,7 +64,7 @@ class JackWinNamedPipeClientChannel : public detail::JackClientChannelInterface,
{}
void ClientClose(int refnum, int* result);
- void ClientActivate(int refnum, int state, int* result);
+ void ClientActivate(int refnum, int is_real_time, int* result);
void ClientDeactivate(int refnum, int* result);
void PortRegister(int refnum, const char* name, const char* type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index, int* result);
diff --git a/windows/JackWinNamedPipeNotifyChannel.cpp b/windows/JackWinNamedPipeNotifyChannel.cpp
index 991f260c..a7375085 100644
--- a/windows/JackWinNamedPipeNotifyChannel.cpp
+++ b/windows/JackWinNamedPipeNotifyChannel.cpp
@@ -46,9 +46,9 @@ void JackWinNamedPipeNotifyChannel::Close()
fNotifyPipe.Close();
}
-void JackWinNamedPipeNotifyChannel::ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2, int* result)
+void JackWinNamedPipeNotifyChannel::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2, int* result)
{
- JackClientNotification event(name, refnum, notify, sync, value1, value2);
+ JackClientNotification event(name, refnum, notify, sync, message, value1, value2);
JackResult res;
// Send notification
diff --git a/windows/JackWinNamedPipeNotifyChannel.h b/windows/JackWinNamedPipeNotifyChannel.h
index 0ade63d1..9d90e26b 100644
--- a/windows/JackWinNamedPipeNotifyChannel.h
+++ b/windows/JackWinNamedPipeNotifyChannel.h
@@ -44,7 +44,7 @@ class JackWinNamedPipeNotifyChannel
int Open(const char* name); // Open the Server/Client connection
void Close(); // Close the Server/Client connection
- void ClientNotify(int refnum, const char* name, int notify, int sync, int value1, int value2, int* result);
+ void ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2, int* result);
};
} // end of namespace
diff --git a/windows/JackWinNamedPipeServerChannel.cpp b/windows/JackWinNamedPipeServerChannel.cpp
index f3f2c288..03d9effc 100644
--- a/windows/JackWinNamedPipeServerChannel.cpp
+++ b/windows/JackWinNamedPipeServerChannel.cpp
@@ -31,15 +31,17 @@ using namespace std;
namespace Jack
{
-HANDLE JackClientPipeThread::fMutex = NULL; // never released....
+HANDLE JackClientPipeThread::fMutex = NULL; // Never released....
// fRefNum = -1 correspond to already removed client
JackClientPipeThread::JackClientPipeThread(JackWinNamedPipeClient* pipe)
- : fPipe(pipe), fServer(NULL), fThread(this), fRefNum(0)
+ :fPipe(pipe), fServer(NULL), fThread(this), fRefNum(0)
{
- if (fMutex == NULL)
+ // First one allocated the static fMutex
+ if (fMutex == NULL) {
fMutex = CreateMutex(NULL, FALSE, NULL);
+ }
}
JackClientPipeThread::~JackClientPipeThread()
@@ -50,15 +52,14 @@ JackClientPipeThread::~JackClientPipeThread()
int JackClientPipeThread::Open(JackServer* server) // Open the Server/Client connection
{
- fServer = server;
-
// Start listening
if (fThread.Start() != 0) {
jack_error("Cannot start Jack server listener\n");
return -1;
- } else {
- return 0;
}
+
+ fServer = server;
+ return 0;
}
void JackClientPipeThread::Close() // Close the Server/Client connection
@@ -74,7 +75,7 @@ void JackClientPipeThread::Close() // Close the Server/Client connection
fPipe->Close();
fRefNum = -1;
}
-
+
bool JackClientPipeThread::Execute()
{
jack_log("JackClientPipeThread::Execute");
@@ -138,7 +139,7 @@ bool JackClientPipeThread::HandleRequest()
JackResult res;
jack_log("JackRequest::ActivateClient");
if (req.Read(fPipe) == 0)
- res.fResult = fServer->GetEngine()->ClientActivate(req.fRefNum, req.fState);
+ res.fResult = fServer->GetEngine()->ClientActivate(req.fRefNum, req.fIsRealTime);
res.Write(fPipe);
break;
}
@@ -316,6 +317,13 @@ bool JackClientPipeThread::HandleRequest()
break;
}
}
+
+ /* TODO
+ // Issued by JackEngine::ReleaseRefnum when temporary mode is used
+ if (JackServerGlobals::fKilled) {
+ kill(JackTools::GetPID(), SIGINT);
+ }
+ */
// Unlock the global mutex
ReleaseMutex(fMutex);
@@ -371,29 +379,18 @@ JackWinNamedPipeServerChannel::~JackWinNamedPipeServerChannel()
int JackWinNamedPipeServerChannel::Open(const char* server_name, JackServer* server)
{
jack_log("JackWinNamedPipeServerChannel::Open ");
-
- fServer = server;
snprintf(fServerName, sizeof(fServerName), server_name);
-
+
// Needed for internal connection from JackWinNamedPipeServerNotifyChannel object
if (fRequestListenPipe.Bind(jack_server_dir, server_name, 0) < 0) {
jack_error("JackWinNamedPipeServerChannel::Open : cannot create result listen pipe");
- return false;
- }
-
- // Start listening
- if (fThread.Start() != 0) {
- jack_error("Cannot start Jack server listener\n");
- goto error;
+ return -1;
}
-
+
+ fServer = server;
return 0;
-
-error:
- fRequestListenPipe.Close();
- return -1;
}
-
+
void JackWinNamedPipeServerChannel::Close()
{
/* TODO : solve WIN32 thread Kill issue
@@ -408,6 +405,16 @@ void JackWinNamedPipeServerChannel::Close()
fRequestListenPipe.Close();
}
+int JackWinNamedPipeServerChannel::Start()
+{
+ if (fThread.Start() != 0) {
+ jack_error("Cannot start Jack server listener");
+ return -1;
+ }
+
+ return 0;
+}
+
bool JackWinNamedPipeServerChannel::Init()
{
jack_log("JackWinNamedPipeServerChannel::Init ");
diff --git a/windows/JackWinNamedPipeServerChannel.h b/windows/JackWinNamedPipeServerChannel.h
index 4026b541..7404f04d 100644
--- a/windows/JackWinNamedPipeServerChannel.h
+++ b/windows/JackWinNamedPipeServerChannel.h
@@ -50,9 +50,9 @@ class JackClientPipeThread : public JackRunnableInterface
JackClientPipeThread(JackWinNamedPipeClient* pipe);
virtual ~JackClientPipeThread();
- int Open(JackServer* server); // Open the Server/Client connection
- void Close(); // Close the Server/Client connection
-
+ int Open(JackServer* server); // Open the Server/Client connection
+ void Close(); // Close the Server/Client connection
+
bool HandleRequest();
// JackRunnableInterface interface
@@ -88,8 +88,10 @@ class JackWinNamedPipeServerChannel : public JackRunnableInterface
JackWinNamedPipeServerChannel();
~JackWinNamedPipeServerChannel();
- int Open(const char* server_name, JackServer* server); // Open the Server/Client connection
- void Close(); // Close the Server/Client connection
+ int Open(const char* server_name, JackServer* server); // Open the Server/Client connection
+ void Close(); // Close the Server/Client connection
+
+ int Start();
// JackRunnableInterface interface
bool Init();
diff --git a/windows/Setup/src/README b/windows/Setup/src/README
index e9424a26..a33ec512 100644
--- a/windows/Setup/src/README
+++ b/windows/Setup/src/README
@@ -20,9 +20,9 @@ It is compiled from the latest CVS version which is using QT4 framework. To uses
- in Setup/Misc, check the "Start JACK audio server at application startup" box
-- quit qjackctl.exe and start is again, it should now launch the jack server. Quitting the qjackctl.exe will now close the jack server.
+- quit QJACKCTL and start is again, it should now launch the jack server. Quitting QJACKCTL will now close the jack server.
-Starting the jack server with another audio device installed on the machine (like an ASIO card) can now be done directly in qjackctl.
+Starting the jack server with another audio device installed on the machine (like an ASIO card) can now be done directly in QJACKCTL.
A ">" button at the right of the interface button allows to list the name of all available devices, driven either by "MME", "DirectSound", or "ASIO".
Alternatively using the following command allows to display the names of available devices:
@@ -30,7 +30,7 @@ Alternatively using the following command allows to display the names of availab
Then start jackd with the device you want, by using its name, for example:
-- jackd -R -S -d portaudio -d "ASIO::MOTU Audio ASIO", then start qjackctl. qjackctl will see the jackd server already running and then can be used normally.
+- jackd -R -S -d portaudio -d "ASIO::MOTU Audio ASIO", then start QJACKCTL. QJACKCTL will see the jackd server already running and then can be used normally.
=============================================
@@ -47,9 +47,9 @@ QJACKCTL MIDI connection windows can then be used.
JackRouter JACK/ASIO driver
=============================================
-JackRouter is an ASIO driver that allows any ASIO compatible application to become a JACK client, thus exchange audio with any other "native" or "Jackified" application. This driver is registered in the system by the installer and becomes available in the list of ASIO drivers when the JACK server is running. A "JackRouter.ini" configuration file allows the application to confgiure how the JackRouter driver behaves.
+JackRouter is an ASIO driver that allows any ASIO compatible application to become a JACK client, thus exchange audio with any other "native" or "Jackified" application. This driver is registered in the system by the installer and becomes available in the list of ASIO drivers when the JACK server is running. A "JackRouter.ini" configuration file allows the application to configure how the JackRouter driver behaves.
- - [IO]: the application can obtain any number if JACK input/output ports (not necessarilly equal to the audio card input/output number). [Note that some applications force their input/output channel number].
+ - [IO]: the application can obtain any number if JACK input/output ports (not necessarily equal to the audio card input/output number). [Note that some applications force their input/output channel number].
- [AUTO_CONNECT] : when 1, the application JACK port will automatically be connected to the machine input/output JACK ports.
diff --git a/wscript b/wscript
index f5b69855..6fb5c88c 100644
--- a/wscript
+++ b/wscript
@@ -68,7 +68,7 @@ def set_options(opt):
opt.add_option('--profile', action='store_true', default=False, help='Build with engine profiling')
opt.add_option('--mixed', action='store_true', default=False, help='Build with 32/64 bits mixed mode')
opt.add_option('--clients', default=64, type="int", dest="clients", help='Maximum number of JACK clients')
- opt.add_option('--ports', default=1024, type="int", dest="ports", help='Maximum number of ports')
+ opt.add_option('--ports', default=2048, type="int", dest="ports", help='Maximum number of ports')
opt.add_option('--ports-per-application', default=512, type="int", dest="application_ports", help='Maximum number of ports per application')
opt.sub_options('dbus')