Browse Source

rebase from trunk 3813:3899

git-svn-id: http://subversion.jackaudio.org/jack/jack2/branches/libjacknet@3900 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.8
sletz 14 years ago
parent
commit
5f68a6557a
100 changed files with 4973 additions and 943 deletions
  1. +65
    -2
      ChangeLog
  2. +110
    -86
      common/JackAPI.cpp
  3. +17
    -10
      common/JackAudioAdapterInterface.cpp
  4. +3
    -1
      common/JackClient.cpp
  5. +1
    -1
      common/JackConnectionManager.cpp
  6. +13
    -3
      common/JackConnectionManager.h
  7. +3
    -1
      common/JackConstants.h
  8. +26
    -2
      common/JackControlAPI.cpp
  9. +71
    -62
      common/JackDebugClient.cpp
  10. +2
    -2
      common/JackDebugClient.h
  11. +1
    -1
      common/JackDriver.cpp
  12. +10
    -3
      common/JackEngine.cpp
  13. +3
    -2
      common/JackEngine.h
  14. +190
    -150
      common/JackEngineProfiling.cpp
  15. +18
    -0
      common/JackException.h
  16. +9
    -0
      common/JackFilters.h
  17. +23
    -0
      common/JackGlobals.cpp
  18. +13
    -1
      common/JackGlobals.h
  19. +42
    -16
      common/JackGraphManager.cpp
  20. +7
    -3
      common/JackGraphManager.h
  21. +6
    -0
      common/JackLibAPI.cpp
  22. +3
    -0
      common/JackLibClient.cpp
  23. +1
    -7
      common/JackLibGlobals.h
  24. +29
    -10
      common/JackLockedEngine.h
  25. +25
    -1
      common/JackMessageBuffer.cpp
  26. +3
    -0
      common/JackMessageBuffer.h
  27. +31
    -6
      common/JackNetAPI.cpp
  28. +19
    -0
      common/JackNetInterface.cpp
  29. +0
    -2
      common/JackNetOneDriver.cpp
  30. +1
    -0
      common/JackNotification.h
  31. +287
    -0
      common/JackPhysicalMidiInput.cpp
  32. +146
    -0
      common/JackPhysicalMidiInput.h
  33. +320
    -0
      common/JackPhysicalMidiOutput.cpp
  34. +118
    -0
      common/JackPhysicalMidiOutput.h
  35. +4
    -9
      common/JackPort.cpp
  36. +5
    -4
      common/JackServer.cpp
  37. +1
    -1
      common/JackServer.h
  38. +6
    -0
      common/JackServerAPI.cpp
  39. +3
    -2
      common/JackServerGlobals.cpp
  40. +1
    -0
      common/JackServerGlobals.h
  41. +12
    -8
      common/Jackdmp.cpp
  42. +102
    -112
      common/jack/jack.h
  43. +11
    -11
      common/jack/midiport.h
  44. +9
    -8
      common/jack/thread.h
  45. +13
    -12
      common/jack/transport.h
  46. +1
    -1
      common/jack/types.h
  47. +52
    -0
      common/jack/weakjack.h
  48. +61
    -0
      common/jack/weakmacros.h
  49. +22
    -13
      common/netjack.c
  50. +6
    -2
      common/netjack_packet.c
  51. +4
    -3
      common/ringbuffer.c
  52. +82
    -41
      common/shm.c
  53. +11
    -11
      common/shm.h
  54. +2
    -1
      common/wscript
  55. +5
    -2
      dbus/controller_iface_control.c
  56. +105
    -0
      dbus/controller_iface_patchbay.c
  57. +28
    -0
      dbus/jackdbus.c
  58. +7
    -0
      dbus/jackdbus.h
  59. +9
    -7
      dbus/wscript
  60. +1
    -1
      doxyfile
  61. +2
    -2
      example-clients/alsa_in.c
  62. +2
    -2
      example-clients/alsa_out.c
  63. +2
    -2
      example-clients/jack_control
  64. +8
    -2
      example-clients/netmaster.c
  65. +6
    -1
      example-clients/netsource.c
  66. +4
    -3
      example-clients/wscript
  67. +82
    -78
      linux/alsa/JackAlsaDriver.cpp
  68. +31
    -92
      linux/firewire/JackFFADODriver.cpp
  69. +59
    -0
      linux/firewire/JackFFADOMidiInput.cpp
  70. +54
    -0
      linux/firewire/JackFFADOMidiInput.h
  71. +60
    -0
      linux/firewire/JackFFADOMidiOutput.cpp
  72. +57
    -0
      linux/firewire/JackFFADOMidiOutput.h
  73. +4
    -10
      linux/firewire/ffado_driver.h
  74. +9
    -2
      linux/wscript
  75. +2
    -2
      macosx/Jack-Info.plist
  76. +9
    -2
      macosx/JackMacEngineRPC.cpp
  77. +0
    -1
      macosx/JackMachClientChannel.cpp
  78. +17
    -5
      macosx/JackMachServerChannel.cpp
  79. +14
    -3
      macosx/JackMachServerNotifyChannel.cpp
  80. +2
    -1
      macosx/JackMachServerNotifyChannel.h
  81. +9
    -0
      macosx/JackMachThread.h
  82. +6
    -0
      macosx/JackPlatformPlug_os.h
  83. +446
    -2
      macosx/Jackdmp.xcodeproj/project.pbxproj
  84. +185
    -33
      macosx/coreaudio/JackAudioQueueAdapter.cpp
  85. +24
    -10
      macosx/coreaudio/JackAudioQueueAdapter.h
  86. +93
    -26
      macosx/coreaudio/JackCoreAudioDriver.cpp
  87. +9
    -11
      macosx/coremidi/JackCoreMidiDriver.cpp
  88. +1
    -1
      macosx/iphone/Info.plist
  89. +26
    -2
      macosx/iphone/freeverb.mm
  90. +279
    -0
      macosx/iphone/iPhoneNet.xcodeproj/project.pbxproj
  91. +43
    -28
      posix/JackSocketServerChannel.cpp
  92. +10
    -0
      posix/JackSocketServerNotifyChannel.cpp
  93. +1
    -0
      posix/JackSocketServerNotifyChannel.h
  94. +23
    -1
      tests/test.cpp
  95. +840
    -0
      windows/JackRouter/JackRouter.cpp
  96. +9
    -0
      windows/JackRouter/JackRouter.def
  97. +163
    -0
      windows/JackRouter/JackRouter.dsp
  98. +29
    -0
      windows/JackRouter/JackRouter.dsw
  99. +174
    -0
      windows/JackRouter/JackRouter.h
  100. BIN
      windows/JackRouter/Psapi.Lib

+ 65
- 2
ChangeLog View File

@@ -3,10 +3,10 @@
---------------------------
Dmitry Baikov
Gabriel M. Beddingfield
Steven Chamberlain
Thom Johansen
Thibault LeMeur
Pieter Palmers
Tom Szilagyi
Andrzej Szombierski
Kjetil S.Matheussen
@@ -19,12 +19,75 @@ Romain Moret
Florian Faber
Michael Voigt
Torben Hohn
Paul Davis
Paul Davis
Peter L Jones
Devin Anderson
Josh Green
Mario Lang
---------------------------
Jackdmp changes log
---------------------------

2010-01-29 Gabriel M. Beddingfield <gabriel@teuton.org>
* Change JackEngineProfiling and JackAudioAdapterInterface gnuplot scripts to output SVG instead of PDF.

2009-12-15 Stephane Letz <letz@grame.fr>
* Shared memory manager was calling abort in case of fatal error, now return an error in caller.

2009-12-13 Stephane Letz <letz@grame.fr>
* Mario Lang alsa_io time calculation overflow patch.

2009-12-10 Stephane Letz <letz@grame.fr>
* Use a QUIT notification to properly quit the server channel, the server channel thread can then be 'stopped' instead of 'canceled'.

2009-12-09 Stephane Letz <letz@grame.fr>
* When threads are cancelled, the exception has to be rethrown.

2009-12-08 Stephane Letz <letz@grame.fr>
* Josh Green ALSA driver capture only patch.

2009-12-03 Stephane Letz <letz@grame.fr>
* Fix JackCoreMidiDriver::ReadProcAux when ring buffer is full (thanks Devin Anderson).

2009-12-02 Stephane Letz <letz@grame.fr>
* Special code in JackCoreAudio driver to handle completely buggy Digidesign CoreAudio user-land driver.
* Ensure that client-side message buffer thread calls thread_init callback if/when it is set by the client (backport of JACK1 rev 3838).
* Check dynamic port-max value.

2009-12-01 Stephane Letz <letz@grame.fr>
* Fix port_rename callback : now both old name and new name are given as parameters.

2009-11-30 Stephane Letz <letz@grame.fr>
* Devin Anderson patch for Jack FFADO driver issues with lost MIDI bytes between periods (and more).

2009-11-29 Stephane Letz <letz@grame.fr>
* More robust sample rate change handling code in JackCoreAudioDriver.

2009-11-24 Stephane Letz <letz@grame.fr>
* Dynamic choice of maximum port number.

2009-11-23 Stephane Letz <letz@grame.fr>
* Peter L Jones patch for NetJack1 compilation on Windows.

2009-11-20 Stephane Letz <letz@grame.fr>
* Version 1.9.5 started.
* Client debugging code improved.

2009-11-18 Stephane Letz <letz@grame.fr>
* Sync JackCoreAudioAdapter code with JackCoreAudioDriver.


+ 110
- 86
common/JackAPI.cpp View File

@@ -251,7 +251,7 @@ extern "C"

static inline bool CheckPort(jack_port_id_t port_index)
{
return (port_index > 0 && port_index < PORT_NUM);
return (port_index > 0 && port_index < PORT_NUM_MAX);
}

static inline bool CheckBufferSize(jack_nframes_t buffer_size)
@@ -290,6 +290,9 @@ EXPORT void jack_set_info_function (print_function func)

EXPORT jack_client_t* jack_client_new(const char* client_name)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_client_new");
#endif
try {
assert(JackGlobals::fOpenMutex);
JackGlobals::fOpenMutex->Lock();
@@ -312,7 +315,7 @@ EXPORT jack_client_t* jack_client_new(const char* client_name)
EXPORT void* jack_port_get_buffer(jack_port_t* port, jack_nframes_t frames)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_get_buffer");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -332,7 +335,7 @@ EXPORT void* jack_port_get_buffer(jack_port_t* port, jack_nframes_t frames)
EXPORT const char* jack_port_name(const jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_name");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -352,7 +355,7 @@ EXPORT const char* jack_port_name(const jack_port_t* port)
EXPORT const char* jack_port_short_name(const jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_short_name");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -372,7 +375,7 @@ EXPORT const char* jack_port_short_name(const jack_port_t* port)
EXPORT int jack_port_flags(const jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_flags");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -392,7 +395,7 @@ EXPORT int jack_port_flags(const jack_port_t* port)
EXPORT const char* jack_port_type(const jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_type");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -412,7 +415,7 @@ EXPORT const char* jack_port_type(const jack_port_t* port)
EXPORT jack_port_type_id_t jack_port_type_id(const jack_port_t *port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_type_id");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -432,7 +435,7 @@ EXPORT jack_port_type_id_t jack_port_type_id(const jack_port_t *port)
EXPORT int jack_port_connected(const jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_connected");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -453,7 +456,7 @@ EXPORT int jack_port_connected(const jack_port_t* port)
EXPORT int jack_port_connected_to(const jack_port_t* port, const char* port_name)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_connected_to");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -483,7 +486,7 @@ EXPORT int jack_port_connected_to(const jack_port_t* port, const char* port_name
EXPORT int jack_port_tie(jack_port_t* src, jack_port_t* dst)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_tie");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t src_aux = (uint64_t)src;
@@ -517,7 +520,7 @@ EXPORT int jack_port_tie(jack_port_t* src, jack_port_t* dst)
EXPORT int jack_port_untie(jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_untie");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -537,7 +540,7 @@ EXPORT int jack_port_untie(jack_port_t* port)
EXPORT jack_nframes_t jack_port_get_latency(jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_get_latency");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -558,7 +561,7 @@ EXPORT jack_nframes_t jack_port_get_latency(jack_port_t* port)
EXPORT void jack_port_set_latency(jack_port_t* port, jack_nframes_t frames)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_set_latency");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -578,7 +581,7 @@ EXPORT void jack_port_set_latency(jack_port_t* port, jack_nframes_t frames)
EXPORT int jack_recompute_total_latency(jack_client_t* ext_client, jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_recompute_total_latency");
#endif

JackClient* client = (JackClient*)ext_client;
@@ -604,7 +607,7 @@ EXPORT int jack_recompute_total_latency(jack_client_t* ext_client, jack_port_t*
EXPORT int jack_recompute_total_latencies(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_recompute_total_latencies");
#endif

JackClient* client = (JackClient*)ext_client;
@@ -625,7 +628,7 @@ This is unsafe if case of concurrent access, and should be "serialized" doing a
EXPORT int jack_port_set_name(jack_port_t* port, const char* name)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_set_name");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -655,7 +658,7 @@ EXPORT int jack_port_set_name(jack_port_t* port, const char* name)
EXPORT int jack_port_set_alias(jack_port_t* port, const char* name)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_set_alias");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -678,7 +681,7 @@ EXPORT int jack_port_set_alias(jack_port_t* port, const char* name)
EXPORT int jack_port_unset_alias(jack_port_t* port, const char* name)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_unset_alias");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -701,7 +704,7 @@ EXPORT int jack_port_unset_alias(jack_port_t* port, const char* name)
EXPORT int jack_port_get_aliases(const jack_port_t* port, char* const aliases[2])
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_get_aliases");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -721,7 +724,7 @@ EXPORT int jack_port_get_aliases(const jack_port_t* port, char* const aliases[2]
EXPORT int jack_port_request_monitor(jack_port_t* port, int onoff)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_request_monitor");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -741,7 +744,7 @@ EXPORT int jack_port_request_monitor(jack_port_t* port, int onoff)
EXPORT int jack_port_request_monitor_by_name(jack_client_t* ext_client, const char* port_name, int onoff)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_request_monitor_by_name");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -764,7 +767,7 @@ EXPORT int jack_port_request_monitor_by_name(jack_client_t* ext_client, const ch
EXPORT int jack_port_ensure_monitor(jack_port_t* port, int onoff)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_ensure_monitor");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -784,7 +787,7 @@ EXPORT int jack_port_ensure_monitor(jack_port_t* port, int onoff)
EXPORT int jack_port_monitoring_input(jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_monitoring_input");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -804,7 +807,7 @@ EXPORT int jack_port_monitoring_input(jack_port_t* port)
EXPORT int jack_is_realtime(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_is_realtime");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -819,7 +822,7 @@ EXPORT int jack_is_realtime(jack_client_t* ext_client)
EXPORT void jack_on_shutdown(jack_client_t* ext_client, JackShutdownCallback callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_on_shutdown");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -832,7 +835,7 @@ 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();
JackGlobals::CheckContext("jack_on_info_shutdown");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -845,7 +848,7 @@ EXPORT void jack_on_info_shutdown(jack_client_t* ext_client, JackInfoShutdownCal
EXPORT int jack_set_process_callback(jack_client_t* ext_client, JackProcessCallback callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_process_callback");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -859,7 +862,7 @@ EXPORT int jack_set_process_callback(jack_client_t* ext_client, JackProcessCallb
EXPORT jack_nframes_t jack_thread_wait(jack_client_t* ext_client, int status)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_thread_wait");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -874,7 +877,7 @@ EXPORT jack_nframes_t jack_thread_wait(jack_client_t* ext_client, int status)
EXPORT jack_nframes_t jack_cycle_wait(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_cycle_wait");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -888,7 +891,7 @@ EXPORT jack_nframes_t jack_cycle_wait(jack_client_t* ext_client)
EXPORT void jack_cycle_signal(jack_client_t* ext_client, int status)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_cycle_signal");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -901,7 +904,7 @@ EXPORT void jack_cycle_signal(jack_client_t* ext_client, int status)
EXPORT int jack_set_process_thread(jack_client_t* ext_client, JackThreadCallback fun, void *arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_process_thread");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -915,7 +918,7 @@ EXPORT int jack_set_process_thread(jack_client_t* ext_client, JackThreadCallback
EXPORT int jack_set_freewheel_callback(jack_client_t* ext_client, JackFreewheelCallback freewheel_callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_freewheel_callback");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -929,7 +932,7 @@ EXPORT int jack_set_freewheel_callback(jack_client_t* ext_client, JackFreewheelC
EXPORT int jack_set_freewheel(jack_client_t* ext_client, int onoff)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_freewheel");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -943,7 +946,7 @@ EXPORT int jack_set_freewheel(jack_client_t* ext_client, int onoff)
EXPORT int jack_set_buffer_size(jack_client_t* ext_client, jack_nframes_t buffer_size)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_buffer_size");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -959,7 +962,7 @@ EXPORT int jack_set_buffer_size(jack_client_t* ext_client, jack_nframes_t buffer
EXPORT int jack_set_buffer_size_callback(jack_client_t* ext_client, JackBufferSizeCallback bufsize_callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_buffer_size_callback");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -973,7 +976,7 @@ EXPORT int jack_set_buffer_size_callback(jack_client_t* ext_client, JackBufferSi
EXPORT int jack_set_sample_rate_callback(jack_client_t* ext_client, JackSampleRateCallback srate_callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_sample_rate_callback");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -987,7 +990,7 @@ EXPORT int jack_set_sample_rate_callback(jack_client_t* ext_client, JackSampleRa
EXPORT int jack_set_client_registration_callback(jack_client_t* ext_client, JackClientRegistrationCallback registration_callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_client_registration_callback");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1001,7 +1004,7 @@ EXPORT int jack_set_client_registration_callback(jack_client_t* ext_client, Jack
EXPORT int jack_set_port_registration_callback(jack_client_t* ext_client, JackPortRegistrationCallback registration_callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_port_registration_callback");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1015,7 +1018,7 @@ EXPORT int jack_set_port_registration_callback(jack_client_t* ext_client, JackPo
EXPORT int jack_set_port_connect_callback(jack_client_t* ext_client, JackPortConnectCallback portconnect_callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_port_connect_callback");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1029,7 +1032,7 @@ EXPORT int jack_set_port_connect_callback(jack_client_t* ext_client, JackPortCon
EXPORT int jack_set_port_rename_callback(jack_client_t* ext_client, JackPortRenameCallback rename_callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_port_rename_callback");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1043,7 +1046,7 @@ EXPORT int jack_set_port_rename_callback(jack_client_t* ext_client, JackPortRena
EXPORT int jack_set_graph_order_callback(jack_client_t* ext_client, JackGraphOrderCallback graph_callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_graph_order_callback");
#endif
JackClient* client = (JackClient*)ext_client;
jack_log("jack_set_graph_order_callback ext_client %x client %x ", ext_client, client);
@@ -1058,7 +1061,7 @@ EXPORT int jack_set_graph_order_callback(jack_client_t* ext_client, JackGraphOrd
EXPORT int jack_set_xrun_callback(jack_client_t* ext_client, JackXRunCallback xrun_callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_xrun_callback");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1072,7 +1075,7 @@ EXPORT int jack_set_xrun_callback(jack_client_t* ext_client, JackXRunCallback xr
EXPORT int jack_set_thread_init_callback(jack_client_t* ext_client, JackThreadInitCallback init_callback, void *arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_thread_init_callback");
#endif
JackClient* client = (JackClient*)ext_client;
jack_log("jack_set_thread_init_callback ext_client %x client %x ", ext_client, client);
@@ -1087,7 +1090,7 @@ EXPORT int jack_set_thread_init_callback(jack_client_t* ext_client, JackThreadIn
EXPORT int jack_activate(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_activate");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1101,7 +1104,7 @@ EXPORT int jack_activate(jack_client_t* ext_client)
EXPORT int jack_deactivate(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_deactivate");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1115,7 +1118,7 @@ EXPORT int jack_deactivate(jack_client_t* ext_client)
EXPORT jack_port_t* jack_port_register(jack_client_t* ext_client, const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_register");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1136,7 +1139,7 @@ EXPORT jack_port_t* jack_port_register(jack_client_t* ext_client, const char* po
EXPORT int jack_port_unregister(jack_client_t* ext_client, jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_unregister");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1159,7 +1162,7 @@ EXPORT int jack_port_unregister(jack_client_t* ext_client, jack_port_t* port)
EXPORT int jack_port_is_mine(const jack_client_t* ext_client, const jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_is_mine");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1182,7 +1185,7 @@ EXPORT int jack_port_is_mine(const jack_client_t* ext_client, const jack_port_t*
EXPORT const char** jack_port_get_connections(const jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_get_connections");
#endif
#if defined(__x86_64__) || defined(__ppc64__)
uint64_t port_aux = (uint64_t)port;
@@ -1204,7 +1207,7 @@ EXPORT const char** jack_port_get_connections(const jack_port_t* port)
EXPORT const char** jack_port_get_all_connections(const jack_client_t* ext_client, const jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_get_all_connections");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1231,7 +1234,7 @@ EXPORT const char** jack_port_get_all_connections(const jack_client_t* ext_clien
EXPORT jack_nframes_t jack_port_get_total_latency(jack_client_t* ext_client, jack_port_t* port)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_get_total_latency");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1263,7 +1266,7 @@ EXPORT jack_nframes_t jack_port_get_total_latency(jack_client_t* ext_client, jac
EXPORT int jack_connect(jack_client_t* ext_client, const char* src, const char* dst)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_connect");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1280,7 +1283,7 @@ EXPORT int jack_connect(jack_client_t* ext_client, const char* src, const char*
EXPORT int jack_disconnect(jack_client_t* ext_client, const char* src, const char* dst)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_disconnect");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1297,7 +1300,7 @@ EXPORT int jack_disconnect(jack_client_t* ext_client, const char* src, const cha
EXPORT int jack_port_disconnect(jack_client_t* ext_client, jack_port_t* src)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_disconnect");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1320,7 +1323,7 @@ EXPORT int jack_port_disconnect(jack_client_t* ext_client, jack_port_t* src)
EXPORT jack_nframes_t jack_get_sample_rate(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_get_sample_rate");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1335,7 +1338,7 @@ EXPORT jack_nframes_t jack_get_sample_rate(jack_client_t* ext_client)
EXPORT jack_nframes_t jack_get_buffer_size(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_get_buffer_size");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1350,7 +1353,7 @@ EXPORT jack_nframes_t jack_get_buffer_size(jack_client_t* ext_client)
EXPORT const char** jack_get_ports(jack_client_t* ext_client, const char* port_name_pattern, const char* type_name_pattern, unsigned long flags)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_get_ports");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1364,7 +1367,7 @@ EXPORT const char** jack_get_ports(jack_client_t* ext_client, const char* port_n
EXPORT jack_port_t* jack_port_by_name(jack_client_t* ext_client, const char* portname)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_by_name");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1391,7 +1394,7 @@ EXPORT jack_port_t* jack_port_by_name(jack_client_t* ext_client, const char* por
EXPORT jack_port_t* jack_port_by_id(jack_client_t* ext_client, jack_port_id_t id)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_port_by_id");
#endif
/* jack_port_t* type is actually the port index */
#if defined(__x86_64__) || defined(__ppc64__)
@@ -1404,7 +1407,7 @@ EXPORT jack_port_t* jack_port_by_id(jack_client_t* ext_client, jack_port_id_t id
EXPORT int jack_engine_takeover_timebase(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_engine_takeover_timebase");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1419,7 +1422,7 @@ EXPORT int jack_engine_takeover_timebase(jack_client_t* ext_client)
EXPORT jack_nframes_t jack_frames_since_cycle_start(const jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_frames_since_cycle_start");
#endif
JackTimer timer;
JackEngineControl* control = GetEngineControl();
@@ -1433,13 +1436,16 @@ EXPORT jack_nframes_t jack_frames_since_cycle_start(const jack_client_t* ext_cli

EXPORT jack_time_t jack_get_time()
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_get_time");
#endif
return GetMicroSeconds();
}

EXPORT jack_time_t jack_frames_to_time(const jack_client_t* ext_client, jack_nframes_t frames)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_frames_to_time");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1460,7 +1466,7 @@ EXPORT jack_time_t jack_frames_to_time(const jack_client_t* ext_client, jack_nfr
EXPORT jack_nframes_t jack_time_to_frames(const jack_client_t* ext_client, jack_time_t time)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_time_to_frames");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1480,13 +1486,16 @@ EXPORT jack_nframes_t jack_time_to_frames(const jack_client_t* ext_client, jack_

EXPORT jack_nframes_t jack_frame_time(const jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_frame_time");
#endif
return jack_time_to_frames(ext_client, GetMicroSeconds());
}

EXPORT jack_nframes_t jack_last_frame_time(const jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_last_frame_time");
#endif
JackEngineControl* control = GetEngineControl();
return (control) ? control->fFrameTimer.ReadCurrentState()->CurFrame() : 0;
@@ -1495,7 +1504,7 @@ EXPORT jack_nframes_t jack_last_frame_time(const jack_client_t* ext_client)
EXPORT float jack_cpu_load(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_cpu_load");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1510,7 +1519,7 @@ EXPORT float jack_cpu_load(jack_client_t* ext_client)
EXPORT pthread_t jack_client_thread_id(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_client_thread_id");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1524,7 +1533,7 @@ EXPORT pthread_t jack_client_thread_id(jack_client_t* ext_client)
EXPORT char* jack_get_client_name(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_get_client_name");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1554,7 +1563,7 @@ EXPORT int jack_port_type_size(void)
EXPORT int jack_release_timebase(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_release_timebase");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1568,7 +1577,7 @@ EXPORT int jack_release_timebase(jack_client_t* ext_client)
EXPORT int jack_set_sync_callback(jack_client_t* ext_client, JackSyncCallback sync_callback, void *arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_sync_callback");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1582,7 +1591,7 @@ EXPORT int jack_set_sync_callback(jack_client_t* ext_client, JackSyncCallback sy
EXPORT int jack_set_sync_timeout(jack_client_t* ext_client, jack_time_t timeout)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_sync_timeout");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1596,7 +1605,7 @@ EXPORT int jack_set_sync_timeout(jack_client_t* ext_client, jack_time_t timeout)
EXPORT int jack_set_timebase_callback(jack_client_t* ext_client, int conditional, JackTimebaseCallback timebase_callback, void* arg)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_set_timebase_callback");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1610,7 +1619,7 @@ EXPORT int jack_set_timebase_callback(jack_client_t* ext_client, int conditional
EXPORT int jack_transport_locate(jack_client_t* ext_client, jack_nframes_t frame)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_transport_locate");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1625,7 +1634,7 @@ EXPORT int jack_transport_locate(jack_client_t* ext_client, jack_nframes_t frame
EXPORT jack_transport_state_t jack_transport_query(const jack_client_t* ext_client, jack_position_t* pos)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_transport_query");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1639,7 +1648,7 @@ EXPORT jack_transport_state_t jack_transport_query(const jack_client_t* ext_clie
EXPORT jack_nframes_t jack_get_current_transport_frame(const jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_get_current_transport_frame");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1653,7 +1662,7 @@ EXPORT jack_nframes_t jack_get_current_transport_frame(const jack_client_t* ext_
EXPORT int jack_transport_reposition(jack_client_t* ext_client, jack_position_t* pos)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_transport_reposition");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1668,7 +1677,7 @@ EXPORT int jack_transport_reposition(jack_client_t* ext_client, jack_position_t*
EXPORT void jack_transport_start(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_transport_start");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1681,7 +1690,7 @@ EXPORT void jack_transport_start(jack_client_t* ext_client)
EXPORT void jack_transport_stop(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_transport_stop");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1694,6 +1703,9 @@ EXPORT void jack_transport_stop(jack_client_t* ext_client)
// deprecated
EXPORT void jack_get_transport_info(jack_client_t* ext_client, jack_transport_info_t* tinfo)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_get_transport_info");
#endif
jack_error("jack_get_transport_info: deprecated");
if (tinfo)
memset(tinfo, 0, sizeof(jack_transport_info_t));
@@ -1701,6 +1713,9 @@ EXPORT void jack_get_transport_info(jack_client_t* ext_client, jack_transport_in

EXPORT void jack_set_transport_info(jack_client_t* ext_client, jack_transport_info_t* tinfo)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_set_transport_info");
#endif
jack_error("jack_set_transport_info: deprecated");
if (tinfo)
memset(tinfo, 0, sizeof(jack_transport_info_t));
@@ -1710,7 +1725,7 @@ EXPORT void jack_set_transport_info(jack_client_t* ext_client, jack_transport_in
EXPORT float jack_get_max_delayed_usecs(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_get_max_delayed_usecs");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1725,7 +1740,7 @@ EXPORT float jack_get_max_delayed_usecs(jack_client_t* ext_client)
EXPORT float jack_get_xrun_delayed_usecs(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_get_xrun_delayed_usecs");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1740,7 +1755,7 @@ EXPORT float jack_get_xrun_delayed_usecs(jack_client_t* ext_client)
EXPORT void jack_reset_max_delayed_usecs(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_reset_max_delayed_usecs");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1755,7 +1770,7 @@ EXPORT void jack_reset_max_delayed_usecs(jack_client_t* ext_client)
EXPORT int jack_client_real_time_priority(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_client_real_time_priority");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1770,7 +1785,7 @@ EXPORT int jack_client_real_time_priority(jack_client_t* ext_client)
EXPORT int jack_client_max_real_time_priority(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_client_max_real_time_priority");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1795,6 +1810,9 @@ EXPORT int jack_client_create_thread(jack_client_t* client,
thread_routine routine,
void *arg)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_client_create_thread");
#endif
return JackThread::StartImp(thread, priority, realtime, routine, arg);
}

@@ -1805,11 +1823,17 @@ EXPORT int jack_drop_real_time_scheduling(pthread_t thread)

EXPORT int jack_client_stop_thread(jack_client_t* client, pthread_t thread)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_client_stop_thread");
#endif
return JackThread::StopImp(thread);
}

EXPORT int jack_client_kill_thread(jack_client_t* client, pthread_t thread)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_client_kill_thread");
#endif
return JackThread::KillImp(thread);
}

@@ -1837,7 +1861,7 @@ EXPORT void jack_internal_client_close (const char *client_name)
EXPORT char* jack_get_internal_client_name(jack_client_t* ext_client, jack_intclient_t intclient)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_get_internal_client_name");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1854,7 +1878,7 @@ EXPORT char* jack_get_internal_client_name(jack_client_t* ext_client, jack_intcl
EXPORT jack_intclient_t jack_internal_client_handle(jack_client_t* ext_client, const char* client_name, jack_status_t* status)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_internal_client_handle");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1872,7 +1896,7 @@ EXPORT jack_intclient_t jack_internal_client_handle(jack_client_t* ext_client, c
EXPORT jack_intclient_t jack_internal_client_load_aux(jack_client_t* ext_client, const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_internal_client_load_aux");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {
@@ -1911,7 +1935,7 @@ EXPORT jack_intclient_t jack_internal_client_load(jack_client_t *client, const c
EXPORT jack_status_t jack_internal_client_unload(jack_client_t* ext_client, jack_intclient_t intclient)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
JackGlobals::CheckContext("jack_internal_client_load");
#endif
JackClient* client = (JackClient*)ext_client;
if (client == NULL) {


+ 17
- 10
common/JackAudioAdapterInterface.cpp View File

@@ -17,10 +17,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

#include "JackAudioAdapter.h"
#ifdef __APPLE__
#include <TargetConditionals.h>
#endif

#include "JackAudioAdapter.h"
#ifndef TARGET_OS_IPHONE
#include "JackLibSampleRateResampler.h"
#endif
@@ -73,8 +74,8 @@ namespace Jack
fprintf(file, buffer);
fprintf(file, "\n unset multiplot\n");
fprintf(file, "set output 'AdapterTiming1.pdf\n");
fprintf(file, "set terminal pdf\n");
fprintf(file, "set output 'AdapterTiming1.svg\n");
fprintf(file, "set terminal svg\n");
fprintf(file, "set multiplot\n");
fprintf(file, "set grid\n");
@@ -85,8 +86,10 @@ namespace Jack
fprintf(file, "plot ");
sprintf(buffer, "\"JackAudioAdapter.log\" using 2 title \"Consumer interrupt period\" with lines,");
fprintf(file, buffer);
sprintf(buffer, "\"JackAudioAdapter.log\" using 3 title \"Producer interrupt period\" with lines");
sprintf(buffer, "\"JackAudioAdapter.log\" using 3 title \"Producer interrupt period\" with lines\n");
fprintf(file, buffer);
fprintf(file, "unset multiplot\n");
fprintf(file, "unset output\n");
fclose(file);
@@ -105,8 +108,8 @@ namespace Jack
fprintf(file, buffer);
fprintf(file, "\n unset multiplot\n");
fprintf(file, "set output 'AdapterTiming2.pdf\n");
fprintf(file, "set terminal pdf\n");
fprintf(file, "set output 'AdapterTiming2.svg\n");
fprintf(file, "set terminal svg\n");
fprintf(file, "set multiplot\n");
fprintf(file, "set grid\n");
@@ -117,8 +120,10 @@ namespace Jack
fprintf(file, "plot ");
sprintf(buffer, "\"JackAudioAdapter.log\" using 4 title \"Ratio 1\" with lines,");
fprintf(file, buffer);
sprintf(buffer, "\"JackAudioAdapter.log\" using 5 title \"Ratio 2\" with lines");
sprintf(buffer, "\"JackAudioAdapter.log\" using 5 title \"Ratio 2\" with lines\n");
fprintf(file, buffer);
fprintf(file, "unset multiplot\n");
fprintf(file, "unset output\n");
fclose(file);

@@ -137,8 +142,8 @@ namespace Jack
fprintf(file, buffer);
fprintf(file, "\n unset multiplot\n");
fprintf(file, "set output 'AdapterTiming3.pdf\n");
fprintf(file, "set terminal pdf\n");
fprintf(file, "set output 'AdapterTiming3.svg\n");
fprintf(file, "set terminal svg\n");
fprintf(file, "set multiplot\n");
fprintf(file, "set grid\n");
@@ -149,8 +154,10 @@ namespace Jack
fprintf(file, "plot ");
sprintf(buffer, "\"JackAudioAdapter.log\" using 6 title \"Frames position in consumer ringbuffer\" with lines,");
fprintf(file, buffer);
sprintf(buffer, "\"JackAudioAdapter.log\" using 7 title \"Frames position in producer ringbuffer\" with lines");
sprintf(buffer, "\"JackAudioAdapter.log\" using 7 title \"Frames position in producer ringbuffer\" with lines\n");
fprintf(file, buffer);
fprintf(file, "unset multiplot\n");
fprintf(file, "unset output\n");
fclose(file);
}


+ 3
- 1
common/JackClient.cpp View File

@@ -254,7 +254,7 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
case kPortRenameCallback:
jack_log("JackClient::kPortRenameCallback port = %ld");
if (fPortRename) {
fPortRename(value1, GetGraphManager()->GetPort(value1)->GetName(), fPortRenameArg);
fPortRename(value1, message, GetGraphManager()->GetPort(value1)->GetName(), fPortRenameArg);
}
break;

@@ -848,6 +848,8 @@ int JackClient::SetInitCallback(JackThreadInitCallback callback, void *arg)
} else {
fInitArg = arg;
fInit = callback;
/* make sure that the message buffer thread is initialized too */
JackMessageBuffer::fInstance->SetInitCallback(callback, arg);
return 0;
}
}


+ 1
- 1
common/JackConnectionManager.cpp View File

@@ -33,7 +33,7 @@ JackConnectionManager::JackConnectionManager()
int i;
jack_log("JackConnectionManager::InitConnections size = %ld ", sizeof(JackConnectionManager));

for (i = 0; i < PORT_NUM; i++) {
for (i = 0; i < PORT_NUM_MAX; i++) {
fConnection[i].Init();
}



+ 13
- 3
common/JackConnectionManager.h View File

@@ -353,11 +353,21 @@ struct JackClientTiming
jack_time_t fFinishedAt;
jack_client_state_t fStatus;

JackClientTiming(): fSignaledAt(0), fAwakeAt(0), fFinishedAt(0), fStatus(NotTriggered)
{}
JackClientTiming()
{
Init();
}
~JackClientTiming()
{}
void Init()
{
fSignaledAt = 0;
fAwakeAt = 0;
fFinishedAt = 0;
fStatus = NotTriggered;
}
} POST_PACKED_STRUCTURE;

/*!
@@ -379,7 +389,7 @@ class SERVER_EXPORT JackConnectionManager

private:

JackFixedArray<CONNECTION_NUM_FOR_PORT> fConnection[PORT_NUM]; /*! Connection matrix: list of connected ports for a given port: needed to compute Mix buffer */
JackFixedArray<CONNECTION_NUM_FOR_PORT> fConnection[PORT_NUM_MAX]; /*! Connection matrix: list of connected ports for a given port: needed to compute Mix buffer */
JackFixedArray1<PORT_NUM_FOR_CLIENT> fInputPort[CLIENT_NUM]; /*! Table of input port per refnum : to find a refnum for a given port */
JackFixedArray<PORT_NUM_FOR_CLIENT> fOutputPort[CLIENT_NUM]; /*! Table of output port per refnum : to find a refnum for a given port */
JackFixedMatrix<CLIENT_NUM> fConnectionRef; /*! Table of port connections by (refnum , refnum) */


+ 3
- 1
common/JackConstants.h View File

@@ -24,7 +24,7 @@
#include "config.h"
#endif

#define VERSION "1.9.4"
#define VERSION "1.9.5"

#define BUFFER_SIZE_MAX 8192

@@ -38,6 +38,8 @@
#define PORT_NUM 2048
#endif

#define PORT_NUM_MAX 4096 // The "max" value for ports used in connection manager, although port number in graph manager is dynamic

#define DRIVER_PORT_NUM 256

#ifndef PORT_NUM_FOR_CLIENT


+ 26
- 2
common/JackControlAPI.cpp View File

@@ -82,7 +82,11 @@ struct jackctl_server
/* uint32_t, clock source type */
union jackctl_parameter_value clock_source;
union jackctl_parameter_value default_clock_source;

/* uint32_t, max port number */
union jackctl_parameter_value port_max;
union jackctl_parameter_value default_port_max;
/* bool */
union jackctl_parameter_value replace_registry;
union jackctl_parameter_value default_replace_registry;
@@ -741,6 +745,20 @@ EXPORT jackctl_server_t * jackctl_server_create(
{
goto fail_free_parameters;
}
value.ui = PORT_NUM;
if (jackctl_add_parameter(
&server_ptr->parameters,
"port-max",
"Maximum number of ports.",
"",
JackParamUInt,
&server_ptr->port_max,
&server_ptr->default_port_max,
value) == NULL)
{
goto fail_free_parameters;
}

value.b = false;
if (jackctl_add_parameter(
@@ -864,15 +882,21 @@ jackctl_server_start(

if (!server_ptr->realtime.b && server_ptr->client_timeout.i == 0)
server_ptr->client_timeout.i = 500; /* 0.5 sec; usable when non realtime. */
/* check port max value before allocating server */
if (server_ptr->port_max.ui > PORT_NUM_MAX) {
jack_error("JACK server started with too much ports %d (when port max can be %d)", server_ptr->port_max.ui, PORT_NUM_MAX);
goto fail;
}

/* get the engine/driver started */

server_ptr->engine = new JackServer(
server_ptr->sync.b,
server_ptr->temporary.b,
server_ptr->client_timeout.i,
server_ptr->realtime.b,
server_ptr->realtime_priority.i,
server_ptr->port_max.ui,
server_ptr->verbose.b,
(jack_timer_type_t)server_ptr->clock_source.ui,
server_ptr->name.str);


+ 71
- 62
common/JackDebugClient.cpp View File

@@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#include "JackDebugClient.h"
#include "JackEngineControl.h"
#include "JackException.h"
#include "JackError.h"
#include "JackTime.h"
#include <iostream>
@@ -55,9 +56,9 @@ JackDebugClient::~JackDebugClient()
*fStream << setw(5) << "- Total number of instantiated port : " << fTotalPortNumber << endl;
*fStream << setw(5) << "- Number of port remaining open when exiting client : " << fOpenPortNumber << endl;
if (fOpenPortNumber != 0)
*fStream << "!!! WARNING !!! Some ports have not been unregistrated ! Incorrect exiting !" << endl;
*fStream << "!!! WARNING !!! Some ports have not been unregistered ! Incorrect exiting !" << endl;
if (fIsDeactivated != fIsActivated)
*fStream << "!!! ERROR !!! Client seem do not perform symetric activation-deactivation ! (not the same number of activate and deactivate)" << endl;
*fStream << "!!! ERROR !!! Client seem to not perform symetric activation-deactivation ! (not the same number of activate and deactivate)" << endl;
if (fIsClosed == 0)
*fStream << "!!! ERROR !!! Client have not been closed with jack_client_close() !" << endl;

@@ -68,9 +69,9 @@ JackDebugClient::~JackDebugClient()
*fStream << setw(5) << "- Name : " << fPortList[i].name << endl;
*fStream << setw(5) << "- idport : " << fPortList[i].idport << endl;
*fStream << setw(5) << "- IsConnected : " << fPortList[i].IsConnected << endl;
*fStream << setw(5) << "- IsUnregistrated : " << fPortList[i].IsUnregistrated << endl;
if (fPortList[i].IsUnregistrated == 0)
*fStream << "!!! WARNING !!! Port have not been unregistrated ! Incorrect exiting !" << endl;
*fStream << setw(5) << "- IsUnregistered : " << fPortList[i].IsUnregistered << endl;
if (fPortList[i].IsUnregistered == 0)
*fStream << "!!! WARNING !!! Port have not been unregistered ! Incorrect exiting !" << endl;
}
*fStream << "delete object JackDebugClient : end of tracing" << endl;
delete fStream;
@@ -106,33 +107,39 @@ int JackDebugClient::Open(const char* server_name, const char* name, jack_option

int JackDebugClient::Close()
{
fIsClosed++;
*fStream << "Client '" << fClientName << "' was closed" << endl;
return fClient->Close();
int res = fClient->Close();
fIsClosed++;
return res;
}

void JackDebugClient::CheckClient() const
void JackDebugClient::CheckClient(const char* function_name) const
{
*fStream << "CheckClient : " << function_name << ", calling thread : " << pthread_self() << endl;
if (fIsClosed > 0) {
*fStream << "!!! ERROR !!! : Accessing a client '" << fClientName << "' already closed !" << endl;
*fStream << "!!! ERROR !!! : Accessing a client '" << fClientName << "' already closed " << "from " << function_name << endl;
*fStream << "This is likely to cause crash !'" << endl;
#ifdef __APPLE__
// Debugger();
#endif
}
}

pthread_t JackDebugClient::GetThreadID()
{
CheckClient();
CheckClient("GetThreadID");
return fClient->GetThreadID();
}

JackGraphManager* JackDebugClient::GetGraphManager() const
{
CheckClient();
CheckClient("GetGraphManager");
return fClient->GetGraphManager();
}
JackEngineControl* JackDebugClient::GetEngineControl() const
{
CheckClient();
CheckClient("GetEngineControl");
return fClient->GetEngineControl();
}
/*!
@@ -141,13 +148,13 @@ JackEngineControl* JackDebugClient::GetEngineControl() const

int JackDebugClient::ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2)
{
CheckClient();
CheckClient("ClientNotify");
return fClient->ClientNotify( refnum, name, notify, sync, message, value1, value2);
}

int JackDebugClient::Activate()
{
CheckClient();
CheckClient("Activate");
int res = fClient->Activate();
fIsActivated++;
if (fIsDeactivated)
@@ -160,7 +167,7 @@ int JackDebugClient::Activate()

int JackDebugClient::Deactivate()
{
CheckClient();
CheckClient("Deactivate");
int res = fClient->Deactivate();
fIsDeactivated++;
if (fIsActivated == 0)
@@ -177,7 +184,7 @@ int JackDebugClient::Deactivate()

int JackDebugClient::PortRegister(const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size)
{
CheckClient();
CheckClient("PortRegister");
int res = fClient->PortRegister(port_name, port_type, flags, buffer_size);
if (res <= 0) {
*fStream << "Client '" << fClientName << "' try port register ('" << port_name << "') and server return error " << res << " ." << endl;
@@ -186,7 +193,7 @@ int JackDebugClient::PortRegister(const char* port_name, const char* port_type,
fPortList[fTotalPortNumber].idport = res;
strcpy(fPortList[fTotalPortNumber].name, port_name);
fPortList[fTotalPortNumber].IsConnected = 0;
fPortList[fTotalPortNumber].IsUnregistrated = 0;
fPortList[fTotalPortNumber].IsUnregistered = 0;
} else {
*fStream << "!!! WARNING !!! History is full : no more port history will be recorded." << endl;
}
@@ -199,42 +206,42 @@ int JackDebugClient::PortRegister(const char* port_name, const char* port_type,

int JackDebugClient::PortUnRegister(jack_port_id_t port_index)
{
CheckClient();
CheckClient("PortUnRegister");
int res = fClient->PortUnRegister(port_index);
fOpenPortNumber--;
int i;
for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history
if (fPortList[i].idport == port_index) { // We found the last record
if (fPortList[i].IsUnregistrated != 0)
if (fPortList[i].IsUnregistered != 0)
*fStream << "!!! ERROR !!! : '" << fClientName << "' id deregistering port '" << fPortList[i].name << "' that have already been unregistered !" << endl;
fPortList[i].IsUnregistrated++;
fPortList[i].IsUnregistered++;
break;
}
}
if (i == 0) // Port is not found
*fStream << "JackClientDebug : PortUnregister : port " << port_index << " was not previously registered !" << endl;
if (res != 0)
*fStream << "Client '" << fClientName << "' try to do PortUnregister and server return " << res << " )." << endl;
*fStream << "Client '" << fClientName << "' try to do PortUnregister and server return " << res << endl;
*fStream << "Client '" << fClientName << "' unregister port '" << port_index << "'." << endl;
return res;
}

int JackDebugClient::PortConnect(const char* src, const char* dst)
{
CheckClient();
CheckClient("PortConnect");
if (!fIsActivated)
*fStream << "!!! ERROR !!! Trying to connect a port ( " << src << " to " << dst << ") while the client has not been activated !" << endl;
int i;
int res = fClient->PortConnect( src, dst);
for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history
if (strcmp(fPortList[i].name, src) == 0) { // We found the last record in sources
if (fPortList[i].IsUnregistrated != 0)
if (fPortList[i].IsUnregistered != 0)
*fStream << "!!! ERROR !!! Connecting port " << src << " previoulsy unregistered !" << endl;
fPortList[i].IsConnected++;
*fStream << "Connecting port " << src << " to " << dst << ". ";
break;
} else if (strcmp(fPortList[i].name, dst) == 0 ) { // We found the record in dest
if (fPortList[i].IsUnregistrated != 0)
if (fPortList[i].IsUnregistered != 0)
*fStream << "!!! ERROR !!! Connecting port " << dst << " previoulsy unregistered !" << endl;
fPortList[i].IsConnected++;
*fStream << "Connecting port " << src << " to " << dst << ". ";
@@ -251,20 +258,20 @@ int JackDebugClient::PortConnect(const char* src, const char* dst)

int JackDebugClient::PortDisconnect(const char* src, const char* dst)
{
CheckClient();
CheckClient("PortDisconnect");
if (!fIsActivated)
*fStream << "!!! ERROR !!! Trying to disconnect a port ( " << src << " to " << dst << ") while the client has not been activated !" << endl;
int res = fClient->PortDisconnect( src, dst);
int i;
for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history
if (strcmp(fPortList[i].name, src) == 0) { // We found the record in sources
if (fPortList[i].IsUnregistrated != 0)
if (fPortList[i].IsUnregistered != 0)
*fStream << "!!! ERROR !!! : Disconnecting port " << src << " previoulsy unregistered !" << endl;
fPortList[i].IsConnected--;
*fStream << "disconnecting port " << src << ". ";
break;
} else if (strcmp(fPortList[i].name, dst) == 0 ) { // We found the record in dest
if (fPortList[i].IsUnregistrated != 0)
if (fPortList[i].IsUnregistered != 0)
*fStream << "!!! ERROR !!! : Disonnecting port " << dst << " previoulsy unregistered !" << endl;
fPortList[i].IsConnected--;
*fStream << "disconnecting port " << dst << ". ";
@@ -281,14 +288,14 @@ int JackDebugClient::PortDisconnect(const char* src, const char* dst)

int JackDebugClient::PortDisconnect(jack_port_id_t src)
{
CheckClient();
CheckClient("PortDisconnect");
if (!fIsActivated)
*fStream << "!!! ERROR !!! : Trying to disconnect port " << src << " while that client has not been activated !" << endl;
int res = fClient->PortDisconnect(src);
int i;
for (i = (fTotalPortNumber - 1); i >= 0; i--) { // We search the record into the history
if (fPortList[i].idport == src) { // We found the record in sources
if (fPortList[i].IsUnregistrated != 0)
if (fPortList[i].IsUnregistered != 0)
*fStream << "!!! ERROR !!! : Disconnecting port " << src << " previoulsy unregistered !" << endl;
fPortList[i].IsConnected--;
*fStream << "Disconnecting port " << src << ". " << endl;
@@ -305,7 +312,7 @@ int JackDebugClient::PortDisconnect(jack_port_id_t src)

int JackDebugClient::PortIsMine(jack_port_id_t port_index)
{
CheckClient();
CheckClient("PortIsMine");
return fClient->PortIsMine(port_index);
}

@@ -315,13 +322,13 @@ int JackDebugClient::PortIsMine(jack_port_id_t port_index)

int JackDebugClient::SetBufferSize(jack_nframes_t buffer_size)
{
CheckClient();
CheckClient("SetBufferSize");
return fClient->SetBufferSize(buffer_size);
}

int JackDebugClient::SetFreeWheel(int onoff)
{
CheckClient();
CheckClient("SetFreeWheel");
if (onoff && fFreewheel)
*fStream << "!!! ERROR !!! : Freewheel setup seems incorrect : set = ON while FW is already ON " << endl;
if (!onoff && !fFreewheel)
@@ -348,61 +355,61 @@ void JackDebugClient::ShutDown()

int JackDebugClient::ReleaseTimebase()
{
CheckClient();
CheckClient("ReleaseTimebase");
return fClient->ReleaseTimebase();
}

int JackDebugClient::SetSyncCallback(JackSyncCallback sync_callback, void* arg)
{
CheckClient();
CheckClient("SetSyncCallback");
return fClient->SetSyncCallback(sync_callback, arg);
}

int JackDebugClient::SetSyncTimeout(jack_time_t timeout)
{
CheckClient();
CheckClient("SetSyncTimeout");
return fClient->SetSyncTimeout(timeout);
}

int JackDebugClient::SetTimebaseCallback(int conditional, JackTimebaseCallback timebase_callback, void* arg)
{
CheckClient();
CheckClient("SetTimebaseCallback");
return fClient->SetTimebaseCallback( conditional, timebase_callback, arg);
}

void JackDebugClient::TransportLocate(jack_nframes_t frame)
{
CheckClient();
CheckClient("TransportLocate");
fClient->TransportLocate(frame);
}

jack_transport_state_t JackDebugClient::TransportQuery(jack_position_t* pos)
{
CheckClient();
CheckClient("TransportQuery");
return fClient->TransportQuery(pos);
}

jack_nframes_t JackDebugClient::GetCurrentTransportFrame()
{
CheckClient();
CheckClient("GetCurrentTransportFrame");
return fClient->GetCurrentTransportFrame();
}

int JackDebugClient::TransportReposition(jack_position_t* pos)
{
CheckClient();
CheckClient("TransportReposition");
return fClient->TransportReposition(pos);
}

void JackDebugClient::TransportStart()
{
CheckClient();
CheckClient("TransportStart");
fClient->TransportStart();
}

void JackDebugClient::TransportStop()
{
CheckClient();
CheckClient("TransportStop");
fClient->TransportStop();
}

@@ -412,13 +419,13 @@ void JackDebugClient::TransportStop()

void JackDebugClient::OnShutdown(JackShutdownCallback callback, void *arg)
{
CheckClient();
CheckClient("OnShutdown");
fClient->OnShutdown(callback, arg);
}

void JackDebugClient::OnInfoShutdown(JackInfoShutdownCallback callback, void *arg)
{
CheckClient();
CheckClient("OnInfoShutdown");
fClient->OnInfoShutdown(callback, arg);
}
@@ -427,16 +434,18 @@ int JackDebugClient::TimeCallback(jack_nframes_t nframes, void *arg)
JackDebugClient* client = (JackDebugClient*)arg;
jack_time_t t1 = GetMicroSeconds();
int res = client->fProcessTimeCallback(nframes, client->fProcessTimeCallbackArg);
if (res == 0) {
jack_time_t t2 = GetMicroSeconds();
long delta = long((t2 - t1) - client->GetEngineControl()->fPeriodUsecs);
if (delta > 0 && !client->fFreewheel)
*client->fStream << "!!! ERROR !!! : Process overload of " << delta << " us" << endl;
long delta = long((t2 - t1) - client->GetEngineControl()->fPeriodUsecs);
if (delta > 0 && !client->fFreewheel)
*client->fStream << "!!! ERROR !!! : Process overload of " << delta << " us" << endl;
}
return res;
}

int JackDebugClient::SetProcessCallback(JackProcessCallback callback, void *arg)
{
CheckClient();
CheckClient("SetProcessCallback");
fProcessTimeCallback = callback;
fProcessTimeCallbackArg = arg;
return fClient->SetProcessCallback(TimeCallback, this);
@@ -444,86 +453,86 @@ int JackDebugClient::SetProcessCallback(JackProcessCallback callback, void *arg)

int JackDebugClient::SetXRunCallback(JackXRunCallback callback, void *arg)
{
CheckClient();
CheckClient("SetXRunCallback");
return fClient->SetXRunCallback(callback, arg);
}

int JackDebugClient::SetInitCallback(JackThreadInitCallback callback, void *arg)
{
CheckClient();
CheckClient("SetInitCallback");
return fClient->SetInitCallback(callback, arg);
}

int JackDebugClient::SetGraphOrderCallback(JackGraphOrderCallback callback, void *arg)
{
CheckClient();
CheckClient("SetGraphOrderCallback");
return fClient->SetGraphOrderCallback(callback, arg);
}

int JackDebugClient::SetBufferSizeCallback(JackBufferSizeCallback callback, void *arg)
{
CheckClient();
CheckClient("SetBufferSizeCallback");
return fClient->SetBufferSizeCallback(callback, arg);
}

int JackDebugClient::SetClientRegistrationCallback(JackClientRegistrationCallback callback, void* arg)
{
CheckClient();
CheckClient("SetClientRegistrationCallback");
return fClient->SetClientRegistrationCallback(callback, arg);
}

int JackDebugClient::SetFreewheelCallback(JackFreewheelCallback callback, void *arg)
{
CheckClient();
CheckClient("SetFreewheelCallback");
return fClient->SetFreewheelCallback(callback, arg);
}

int JackDebugClient::SetPortRegistrationCallback(JackPortRegistrationCallback callback, void *arg)
{
CheckClient();
CheckClient("SetPortRegistrationCallback");
return fClient->SetPortRegistrationCallback(callback, arg);
}

int JackDebugClient::SetPortConnectCallback(JackPortConnectCallback callback, void *arg)
{
CheckClient();
CheckClient("SetPortConnectCallback");
return fClient->SetPortConnectCallback(callback, arg);
}

int JackDebugClient::SetPortRenameCallback(JackPortRenameCallback callback, void *arg)
{
CheckClient();
CheckClient("SetPortRenameCallback");
return fClient->SetPortRenameCallback(callback, arg);
}

JackClientControl* JackDebugClient::GetClientControl() const
{
CheckClient();
CheckClient("GetClientControl");
return fClient->GetClientControl();
}

// Internal clients
char* JackDebugClient::GetInternalClientName(int ref)
{
CheckClient();
CheckClient("GetInternalClientName");
return fClient->GetInternalClientName(ref);
}

int JackDebugClient::InternalClientHandle(const char* client_name, jack_status_t* status)
{
CheckClient();
CheckClient("InternalClientHandle");
return fClient->InternalClientHandle(client_name, status);
}

int JackDebugClient::InternalClientLoad(const char* client_name, jack_options_t options, jack_status_t* status, jack_varargs_t* va)
{
CheckClient();
CheckClient("InternalClientLoad");
return fClient->InternalClientLoad(client_name, options, status, va);
}

void JackDebugClient::InternalClientUnload(int ref, jack_status_t* status)
{
CheckClient();
CheckClient("InternalClientUnload");
fClient->InternalClientUnload(ref, status);
}



+ 2
- 2
common/JackDebugClient.h View File

@@ -38,7 +38,7 @@ typedef struct
jack_port_id_t idport;
char name[JACK_PORT_NAME_SIZE]; //portname
int IsConnected;
int IsUnregistrated;
int IsUnregistered;
}
PortFollower;

@@ -129,7 +129,7 @@ class JackDebugClient : public JackClient
void InternalClientUnload(int ref, jack_status_t* status);

JackClientControl* GetClientControl() const;
void CheckClient() const;
void CheckClient(const char* function_name) const;

static int TimeCallback(jack_nframes_t nframes, void *arg);
};


+ 1
- 1
common/JackDriver.cpp View File

@@ -167,7 +167,7 @@ int JackDriver::Open(jack_nframes_t buffer_size,

int JackDriver::Close()
{
if (fClientControl.fRefNum > 0) {
if (fClientControl.fRefNum >= 0) {
jack_log("JackDriver::Close");
fGraphManager->DirectDisconnect(fClientControl.fRefNum, fClientControl.fRefNum); // Disconnect driver from itself for sync
fClientControl.fActive = false;


+ 10
- 3
common/JackEngine.cpp View File

@@ -89,6 +89,11 @@ int JackEngine::Close()

return 0;
}
void JackEngine::NotifyQuit()
{
fChannel.NotifyQuit();
}

//-----------------------------
// Client ressource management
@@ -322,9 +327,9 @@ void JackEngine::NotifyPortRegistation(jack_port_id_t port_index, bool onoff)
NotifyClients((onoff ? kPortRegistrationOnCallback : kPortRegistrationOffCallback), false, "", port_index, 0);
}

void JackEngine::NotifyPortRename(jack_port_id_t port)
void JackEngine::NotifyPortRename(jack_port_id_t port, const char* old_name)
{
NotifyClients(kPortRenameCallback, false, "", port, 0);
NotifyClients(kPortRenameCallback, false, old_name, port, 0);
}

void JackEngine::NotifyPortConnect(jack_port_id_t src, jack_port_id_t dst, bool onoff)
@@ -846,8 +851,10 @@ int JackEngine::PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t ds
int JackEngine::PortRename(int refnum, jack_port_id_t port, const char* name)
{
AssertRefnum(refnum);
char old_name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
strcpy(old_name, fGraphManager->GetPort(port)->GetName());
fGraphManager->GetPort(port)->SetName(name);
NotifyPortRename(port);
NotifyPortRename(port, old_name);
return 0;
}



+ 3
- 2
common/JackEngine.h View File

@@ -69,7 +69,7 @@ class SERVER_EXPORT JackEngine
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);
void NotifyPortRename(jack_port_id_t src, const char* old_name);
void NotifyActivate(int refnum);

public:
@@ -79,7 +79,7 @@ class SERVER_EXPORT JackEngine

int Open();
int Close();
// Client management
int ClientCheck(const char* name, char* name_res, int protocol, int options, int* status);
int ClientExternalOpen(const char* name, int pid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager);
@@ -122,6 +122,7 @@ class SERVER_EXPORT JackEngine
void NotifyBufferSize(jack_nframes_t buffer_size);
void NotifySampleRate(jack_nframes_t sample_rate);
void NotifyFreewheel(bool onoff);
void NotifyQuit();
};




+ 190
- 150
common/JackEngineProfiling.cpp View File

@@ -25,6 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "JackGlobals.h"
#include "JackTime.h"

#include <iostream>
#include <fstream>

namespace Jack
{

@@ -38,12 +41,10 @@ JackEngineProfiling::JackEngineProfiling():fAudioCycle(0),fMeasuredClient(0)

JackEngineProfiling::~JackEngineProfiling()
{
FILE* file = fopen("JackEngineProfiling.log", "w");
char buffer[1024];
std::ofstream fStream("JackEngineProfiling.log", std::ios_base::ate);
jack_info("Write server and clients timing data...");

if (file == NULL) {
if (!fStream.is_open()) {
jack_error("JackEngineProfiling::Save cannot open JackEngineProfiling.log file");
} else {
@@ -58,7 +59,7 @@ JackEngineProfiling::~JackEngineProfiling()
continue; // Skip non valid cycles
// Print driver delta and end cycle
fprintf(file, "%ld \t %ld \t", d1, d2);
fStream << d1 << "\t" << d2 << "\t";
// For each measured client
for (unsigned int j = 0; j < fMeasuredClient; j++) {
@@ -71,222 +72,261 @@ JackEngineProfiling::~JackEngineProfiling()
long d5 = long(fProfileTable[i].fClientTable[ref].fSignaledAt - fProfileTable[i - 1].fCurCycleBegin);
long d6 = long(fProfileTable[i].fClientTable[ref].fAwakeAt - fProfileTable[i - 1].fCurCycleBegin);
long d7 = long(fProfileTable[i].fClientTable[ref].fFinishedAt - fProfileTable[i - 1].fCurCycleBegin);
// Print ref, signal, start, end, scheduling, duration, status
fprintf(file, "%d \t %ld \t %ld \t %ld \t %ld \t %ld \t %d \t",
ref,
((d5 > 0) ? d5 : 0),
((d6 > 0) ? d6 : 0),
((d7 > 0) ? d7 : 0),
((d6 > 0 && d5 > 0) ? (d6 - d5) : 0),
((d7 > 0 && d6 > 0) ? (d7 - d6) : 0),
fProfileTable[i].fClientTable[ref].fStatus);
} else { // Print tabs
fprintf(file, "\t \t \t \t \t \t \t");
fStream << ref << "\t" ;
fStream << ((d5 > 0) ? d5 : 0) << "\t";
fStream << ((d6 > 0) ? d6 : 0) << "\t" ;
fStream << ((d7 > 0) ? d7 : 0) << "\t";
fStream << ((d6 > 0 && d5 > 0) ? (d6 - d5) : 0) << "\t" ;
fStream << ((d7 > 0 && d6 > 0) ? (d7 - d6) : 0) << "\t" ;
fStream << fProfileTable[i].fClientTable[ref].fStatus << "\t" ;;
} else { // Print tabs
fStream << "\t \t \t \t \t \t \t";
}
}
// Terminate line
fprintf(file, "\n");
fStream << std::endl;
}
}
// Driver period
file = fopen("Timing1.plot", "w");
if (file == NULL) {
jack_error("JackEngineProfiling::Save cannot open Timing1.log file");
std::ofstream fStream1("Timing1.plot", std::ios_base::ate);
if (!fStream1.is_open()) {
jack_error("JackEngineProfiling::Save cannot open Timing1.plot file");
} else {
fprintf(file, "set grid\n");
fprintf(file, "set title \"Audio driver timing\"\n");