From 347c6b874b5ecd45013f563046f96e77a4d06de4 Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 8 Jul 2009 13:14:44 +0000 Subject: [PATCH 01/35] Correct 64/32 mixed compilation again. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3582 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/JackAtomicArrayState.h | 5 +++-- common/JackAtomicState.h | 8 ++++---- common/JackTransportEngine.h | 1 - common/jack/types.h | 4 ++-- macosx/Jackdmp.xcodeproj/project.pbxproj | 14 -------------- posix/JackCompilerDeps_os.h | 3 +-- 6 files changed, 10 insertions(+), 25 deletions(-) diff --git a/common/JackAtomicArrayState.h b/common/JackAtomicArrayState.h index 29adc592..8a0daf08 100644 --- a/common/JackAtomicArrayState.h +++ b/common/JackAtomicArrayState.h @@ -21,6 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define __JackAtomicArrayState__ #include "JackAtomic.h" +#include "JackCompilerDeps.h" #include // for memcpy namespace Jack @@ -67,7 +68,7 @@ struct AtomicArrayCounter return *this; } -}; +} POST_PACKED_STRUCTURE; #define Counter1(e) (e).info.fLongVal #define GetIndex1(e, state) ((e).info.scounter.fByteVal[state]) @@ -247,7 +248,7 @@ class JackAtomicArrayState WriteNextStateStopAux(state); } -}; +} POST_PACKED_STRUCTURE; } // end of namespace diff --git a/common/JackAtomicState.h b/common/JackAtomicState.h index 5dbd1366..eaf164ee 100644 --- a/common/JackAtomicState.h +++ b/common/JackAtomicState.h @@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define __JackAtomicState__ #include "JackAtomic.h" +#include "JackCompilerDeps.h" #include // for memcpy namespace Jack @@ -68,7 +69,7 @@ struct AtomicCounter return *this; } -}; +} POST_PACKED_STRUCTURE; #define Counter(e) (e).info.fLongVal #define CurIndex(e) (e).info.scounter.fShortVal1 @@ -250,11 +251,10 @@ class JackAtomicState } while (cur_index != next_index); } */ -}; - + +} POST_PACKED_STRUCTURE; } // end of namespace - #endif diff --git a/common/JackTransportEngine.h b/common/JackTransportEngine.h index 2adac8b1..a1ff2b97 100644 --- a/common/JackTransportEngine.h +++ b/common/JackTransportEngine.h @@ -195,7 +195,6 @@ class SERVER_EXPORT JackTransportEngine : public JackAtomicArrayState Date: Wed, 8 Jul 2009 15:03:08 +0000 Subject: [PATCH 02/35] Fix JackWinMMEDriver::Write. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3583 0c269be4-1314-0410-8aa9-9f06e86f4224 --- windows/winmme/JackWinMMEDriver.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/windows/winmme/JackWinMMEDriver.cpp b/windows/winmme/JackWinMMEDriver.cpp index e40fe5d7..65a7de65 100644 --- a/windows/winmme/JackWinMMEDriver.cpp +++ b/windows/winmme/JackWinMMEDriver.cpp @@ -392,6 +392,7 @@ int JackWinMMEDriver::Write() for (unsigned int j = 0; j < midi_buffer->event_count; j++) { JackMidiEvent* ev = &midi_buffer->events[j]; if (ev->size <= 3) { + jack_midi_data_t *d = ev->GetData(midi_buffer); DWORD winev = 0; if (ev->size > 0) winev |= d[0]; if (ev->size > 1) winev |= (d[1] << 8); From 68386706a1f81e5117203e841860320e6d2eca9d Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 8 Jul 2009 15:11:36 +0000 Subject: [PATCH 03/35] Update JackRouter.dll on Windows. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3584 0c269be4-1314-0410-8aa9-9f06e86f4224 --- windows/Setup/JackRouter.dll | Bin 32768 -> 32768 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/windows/Setup/JackRouter.dll b/windows/Setup/JackRouter.dll index 92e743e05a03509a61eafd2bf65531633377cdf5..df435bed0c3e6d756bf89dea9b8fbf3f2c66ead3 100644 GIT binary patch delta 159 zcmZo@U}|V!n(%@7+18MapMToho?u{T_zlGSf%qa2-vnZ2Muvu+K>8yPGXmLvfb2?KztsEuLCh7BSXV>ApIVQ{{!(aAU*`d kazJq&Aif48JSStvAOr|WMvkZU$?_wh6a0I-iVX8-^I From cddaebdad589716bfd0c128a683174ab03300697 Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 8 Jul 2009 16:30:49 +0000 Subject: [PATCH 04/35] Correct documentation generation and readme files. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3585 0c269be4-1314-0410-8aa9-9f06e86f4224 --- README | 12 ------------ common/jack/jack.h | 6 +++--- doxyfile | 2 +- windows/Setup/src/README | 7 +------ 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/README b/README index f11e26f9..a15b3d66 100644 --- a/README +++ b/README @@ -137,8 +137,6 @@ The binary elements are : - JackRouter.dll : an ASIO/JACK driver that allows ASIO compatible applications to become JACK clients and access the JACK server. ASIO "jackified" applications appear with their names. Ableton Live, Samplitude, Reason, Arturia applications have been successfully tested. To install it, use "regsvr32 JackRouter.dll" in a terminal (use regsvr32 /u JackRouter.dll to uninstall). [VISTA special note: regsvr32 has to be used with "administrator" priviledges to properly register JackRouter.dll (Start Menu -> All Programs -> Accessories -> Right Click on Command Prompt -> Run As Administrator)]. A JackRouter.ini file is used by the driver to read parameters : an [IO] section allows to setup the number of input/output jack ports for the application and a [AUTO_CONNECT] section allows to setup jack ports autoconnection mode to machine input/output. -All dll are compiled in "release" mode. The "Debug" folder contains debug version of all dlls and libraries. MSVCRTD.dll and MSVCP60D.dll debug dll are also included. - WARNING !! WARNING !! Depending of the used interface and driver settings, the PortAudio layer may add additionnal buffering between the real card interrupt and the jack server callback. This usually result in *unregular* calls of the jack server callback (for example if jack server used a 256 frames buffer and the card used a 512 frames, the jack server callback will be called twice every card interrupt). For proper functionning of jack server and clients in this case, the jack server has to be started in "synchronous" mode, using the "-S" parameter. @@ -156,16 +154,6 @@ Automatic server launch Starting from the 0.64 version, automatic server launch from client is implemented : when the server is not yet running, and if the client uses the "jack_client_open" API, the server will be started automatically. The server configuration is saved in a ".jackdrc" file located in the user home folder. The Qjackctl tool allows to save its configuration in this . jackdrc (setting can be done in Qjackctl Setup/Misc). If no configuration file is found, a default setup will be used. WARNING : automatic server launch is not implemented on Windows - ----------------- -Loopback driver ----------------- - -An experimental loopback driver allows to manually "pipeline" applications connected in sequence, and thus parallelize sequential sub-graph. Lets say we have A ==> B graph, by using the loopback driver, it can be rewritten as : A ==> loopback driver ==> B. At each cycle, the loopback driver copy buffers received on its input ports (at the previous cycle) to its output ports. The resulting graph become parallel and thus can take profit of multi-processors machines, at each cycle A and B can be activated in parallel. Note that the loopback driver add a one buffer delay in the connection, which may be relevant in more complex graphs when having global synchronicity between clients is a desirable property. - -To activate loopback driver, use : - -- jackd (jackdmp) ... -L n ... where n is the number of input/output ports. ------------------ Validations tools diff --git a/common/jack/jack.h b/common/jack/jack.h index 2a31cbaf..1a904476 100644 --- a/common/jack/jack.h +++ b/common/jack/jack.h @@ -108,6 +108,7 @@ jack_client_t * jack_client_open (const char *client_name, * \bold THIS FUNCTION IS DEPRECATED AND SHOULD NOT BE USED IN * NEW JACK CLIENTS * +* @deprecated Please use jack_client_open(). */ jack_client_t * jack_client_new (const char *client_name); @@ -212,8 +213,7 @@ int jack_is_realtime (jack_client_t *client); * \bold THIS FUNCTION IS DEPRECATED AND SHOULD NOT BE USED IN * NEW JACK CLIENTS. * - * It should be replace by use of @ jack_cycle_wait and @ jack_cycle_signal functions. - * + * @deprecated Please use jack_cycle_wait() and jack_cycle_signal() functions. */ jack_nframes_t jack_thread_wait (jack_client_t*, int status); @@ -835,7 +835,7 @@ int jack_port_set_alias (jack_port_t *port, const char *alias); */ int jack_port_unset_alias (jack_port_t *port, const char *alias); -/* +/** * Get any aliases known for @port. * * @return the number of aliases discovered for the port diff --git a/doxyfile b/doxyfile index 84f79166..930b9eaf 100644 --- a/doxyfile +++ b/doxyfile @@ -304,7 +304,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = common posix macosx macosx/coreaudio/ linux linux/alsa windows windows/portaudio common/jack/control.h +INPUT = common posix macosx macosx/coreaudio/ linux linux/alsa windows windows/portaudio common/jack/ # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp diff --git a/windows/Setup/src/README b/windows/Setup/src/README index 5ba3bc3a..2a474287 100644 --- a/windows/Setup/src/README +++ b/windows/Setup/src/README @@ -3,12 +3,7 @@ JACK on Windows ============================================= This installer will install everything to use Jack Audio Connection Kit (JACK) (www.jackaudio.org) on Windows. - -============================================= -Microsoft Runtime Libraries -============================================= - -In order to use this software, you will need the Microsoft Visual C++ 2008 redistributable package. This package is freely available on the Microsoft download center. Please be sure you install the correct version (2008). This package is required by portaudio to run windows specific audio drivers (MME, DSound and ASIO). + ============================================= QJACKCTL on Windows From 3e3506bcd4b3da70cb1af28d6744e48a190e0403 Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 8 Jul 2009 20:18:46 +0000 Subject: [PATCH 05/35] Update Windows readme file. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3586 0c269be4-1314-0410-8aa9-9f06e86f4224 --- windows/Setup/src/README | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/windows/Setup/src/README b/windows/Setup/src/README index 2a474287..5421e5e7 100644 --- a/windows/Setup/src/README +++ b/windows/Setup/src/README @@ -30,7 +30,14 @@ 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. + + +============================================= +Jack MIDI +============================================= + +A first version of a JACK MIDI <==> Windows MIDI bridge (using Windows MME API) is available. If can be activated using the -X parameter in jackd command line. So add "-X winmme" in QJACKCTL settings (somathing like "jackd -S -X winmme"). The WinMME driver will scan MIDI input/output ports, open corresponding JACK MIDI ports and convert MIDI in/out into JACK MIDI messages. QJACKCTL MIDI connection windows can then be used. ============================================= @@ -48,7 +55,7 @@ JackRouter is an ASIO driver that allows any ASIO compatible application to beco Known problems ============================================= -- starting/stopping the server several times in QJACKCTL does not work correctly. You'll have to quit qjackctl and launch it again. +- starting/stopping the server several times in QJACKCTL may not work correctly. You may have to quit QJACKCTL and launch it again. ============================================= From 5ef23d06c3f664e293cc5de1c82d09eec34651c2 Mon Sep 17 00:00:00 2001 From: sletz Date: Thu, 9 Jul 2009 10:05:42 +0000 Subject: [PATCH 06/35] Use __attribute__((__packed__)) again, more fixes for 64/32 mixed mode. Torben Hohn changes for 64/32 mixed mode in wscripts. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3587 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 5 +++++ README | 1 + common/JackActivationCount.h | 2 +- common/JackConnectionManager.h | 12 +++++++----- common/JackConstants.h | 2 +- common/JackFilters.h | 8 ++++---- common/jack/jack.h | 2 +- common/jack/midiport.h | 2 +- common/wscript | 4 ++++ wscript | 16 ++++++++++++++++ 10 files changed, 41 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2e4f540..f0ac6d67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,11 @@ Paul Davis Jackdmp changes log --------------------------- +2009-07-09 Stephane Letz + + * Use __attribute__((__packed__)) again, more fixes for 64/32 mixed mode. + * Torben Hohn changes for 64/32 mixed mode in wscripts. + 2009-07-07 Stephane Letz * Use __attribute__((__aligned__(32))) instead of __attribute__((__packed__)) for 64/32 mixed mode. diff --git a/README b/README index a15b3d66..bb0e7898 100644 --- a/README +++ b/README @@ -213,6 +213,7 @@ Note : To experiment with the -S option, jackdmp must be launched in a console. 1.9.0 : Waf based build system : Nedko Arnaudov, Grame for preliminary OSX support. Control API, dbus based server control access : Nedko Arnaudov, Grame. NetJack2 components (in progress) : jack_net backend, netmanager, audioadapter, netadapter : Romain Moret, Grame. Code restructuring to help port on other architectures : Michael Voigt. Code cleanup/optimization : Tim Blechmann. Improve handling of server internal clients that can now be loaded/unloaded using the new server control API : Grame. A lot of bug fix and improvements. 1.9.1 : Fix jackctl_server_unload_internal. Filter SIGPIPE to avoid having client get a SIGPIPE when trying to access a died server. Libjack shutdown handler does not "deactivate" (fActive = false) the client anymore, so that jack_deactivate correctly does the job later on. Better isolation of server and clients system resources to allow starting the server in several user account at the same time. Report ringbuffer.c fixes from jack1. Client and library global context cleanup in case of incorrect shutdown handling (that is applications not correctly closing client after server has shutdown). Use JACK_DRIVER_DIR variable in internal clients loader. For ALSA driver, synchronize with latest jack1 memops functions. Synchronize jack2 public headers with jack1 ones. Implement jack_client_real_time_priority and jack_client_max_real_time_priority API. Use up to BUFFER_SIZE_MAX frames in midi ports, fix for ticket #117. Cleanup server starting code for clients directly linked with libjackserver.so. JackMessageBuffer was using thread "Stop" scheme in destructor, now use the safer thread "Kill" way. Synchronize ALSA backend code with JACK1 one. Set default mode to 'slow' in JackNetDriver and JackNetAdapter. Simplify audio packet order verification. Fix JackNetInterface::SetNetBufferSize for socket buffer size computation and JackNetMasterInterface::DataRecv if synch packet is received, various cleanup. Better recovery of network overload situations, now "resynchronize" by skipping cycles.". Support for BIG_ENDIAN machines in NetJack2. Support for BIG_ENDIAN machines in NetJack2 for MIDI ports. Support for "-h" option in internal clients to print the parameters. In NetJack2, fix a bug when capture or playback only channels are used. Add a JACK_INTERNAL_DIR environment variable to be used for internal clients. Add a resample quality parameter in audioadapter. Now correctly return an error if JackServer::SetBufferSize could not change the buffer size (and was just restoring the current one). Use PRIu32 kind of macro in JackAlsaDriver again. Add a resample quality parameter in netadapter. 1.9.2 : Solaris version. New "profiling" tools. Rework the mutex/signal classes. Support for BIG_ENDIAN machines in NetJack2. D-BUS based device reservation to better coexist with PulseAudio on Linux. Add auto_connect parameter in netmanager and netadapter. Use Torben Hohn PI controler code for adapters. Client incorrect re-naming fixed : now done at socket and fifo level. Virtualize and allow overriding of thread creation function, to allow Wine support (from JACK1). +1.9.3 : New JackBoomerDriver class for Boomer driver on Solaris. Add mixed 32/64 bits mode (off by default). Native MIDI backend (JackCoreMidiDriver, JackWinMMEDriver). In ALSA audio card reservation code, tries to open the card even if reservation fails. Clock source setting on Linux. Add jackctl_server_switch_master API. Fix transport callback (timebase master, sync) issue when used after jack_activate (RT thread was not running). D-Bus access for jackctl_server_add_slave/jackctl_server_remove_slave API. Cleanup "loopback" stuff in server. Torben Hohn fix for InitTime and GetMicroSeconds in JackWinTime.c. New jack_free function added in jack.h. Reworked Torben Hohn fix for server restart issue on Windows. Correct jack_set_error_function, jack_set_info_function and jack_set_thread_creator functions. Correct JackFifo::TimedWait for EINTR handling. Move DBus based audio device reservation code in ALSA backend compilation. Correct JackTransportEngine::MakeAllLocating, sync callback has to be called in this case also. NetJack2 code : better error checkout, method renaming. Tim Bechmann patch : hammerfall, only release monitor thread, if it has been created. Tim Bechmann memops.c optimization patches. This is a work in progress but the implementation is now stable enough to be tested. jackdmp has been used successfully with the following applications : Ardour, Hydrogen, Jamin, Qjackctl, Jack-Rack, SooperLooper, AlsaPlayer... diff --git a/common/JackActivationCount.h b/common/JackActivationCount.h index c9824937..8a22bc67 100644 --- a/common/JackActivationCount.h +++ b/common/JackActivationCount.h @@ -73,7 +73,7 @@ class JackActivationCount return fValue; } -}; +} POST_PACKED_STRUCTURE; } // end of namespace diff --git a/common/JackConnectionManager.h b/common/JackConnectionManager.h index bb972e31..47543038 100644 --- a/common/JackConnectionManager.h +++ b/common/JackConnectionManager.h @@ -116,7 +116,7 @@ class JackFixedArray return fCounter; } -}; +} POST_PACKED_STRUCTURE; /*! \brief Utility class. @@ -151,7 +151,8 @@ class JackFixedArray1 : public JackFixedArray return true; } } -}; + +} POST_PACKED_STRUCTURE; /*! \brief Utility class. @@ -226,7 +227,7 @@ class JackFixedMatrix return false; } -}; +} POST_PACKED_STRUCTURE; /*! \brief Utility class. @@ -339,7 +340,7 @@ class JackLoopFeedback return -1; } -}; +} POST_PACKED_STRUCTURE; /*! \brief For client timing measurements. @@ -356,6 +357,7 @@ struct JackClientTiming {} ~JackClientTiming() {} + } POST_PACKED_STRUCTURE; /*! @@ -450,7 +452,7 @@ class SERVER_EXPORT JackConnectionManager int ResumeRefNum(JackClientControl* control, JackSynchro* table, JackClientTiming* timing); int SuspendRefNum(JackClientControl* control, JackSynchro* table, JackClientTiming* timing, long time_out_usec); -}; +} POST_PACKED_STRUCTURE; } // end of namespace diff --git a/common/JackConstants.h b/common/JackConstants.h index 0e05c058..37a6724e 100644 --- a/common/JackConstants.h +++ b/common/JackConstants.h @@ -38,7 +38,7 @@ #endif #define DRIVER_PORT_NUM 256 -#define PORT_NUM_FOR_CLIENT 256 +#define PORT_NUM_FOR_CLIENT 512 #define FIRST_AVAILABLE_PORT 1 #define CONNECTION_NUM_FOR_PORT 256 diff --git a/common/JackFilters.h b/common/JackFilters.h index 2af946d2..76bf7ecd 100644 --- a/common/JackFilters.h +++ b/common/JackFilters.h @@ -54,7 +54,8 @@ namespace Jack mean += fTable[i]; return mean / MAX_SIZE; } - }; + + } POST_PACKED_STRUCTURE; class JackDelayLockedLoop { @@ -136,7 +137,7 @@ namespace Jack return fCurrentWakeup; } - }; + } POST_PACKED_STRUCTURE; class JackAtomicDelayLockedLoop : public JackAtomicState { @@ -201,7 +202,7 @@ namespace Jack return res; } - }; + } POST_PACKED_STRUCTURE; /* Torben Hohn PI controler from JACK1 @@ -301,7 +302,6 @@ namespace Jack } */ - double GetRatio(int error) { double smooth_offset = error; diff --git a/common/jack/jack.h b/common/jack/jack.h index 1a904476..d1bdd96f 100644 --- a/common/jack/jack.h +++ b/common/jack/jack.h @@ -236,7 +236,7 @@ void jack_cycle_signal (jack_client_t* client, int status); /** * Tell the Jack server to call @a thread_callback in the RT thread. - * Typical use are in conjunction with @a jack_cycle_wait and @ jack_cycle_signal functions. + * Typical use are in conjunction with @a jack_cycle_wait and @a jack_cycle_signal functions. * The code in the supplied function must be suitable for real-time * execution. That means that it cannot call functions that might * block for a long time. This includes malloc, free, printf, diff --git a/common/jack/midiport.h b/common/jack/midiport.h index 68841ccd..da0b940d 100644 --- a/common/jack/midiport.h +++ b/common/jack/midiport.h @@ -47,7 +47,7 @@ typedef struct _jack_midi_event * @{ */ -/* Get number of events in a port buffer. +/** Get number of events in a port buffer. * * @param port_buffer Port buffer from which to retrieve event. * @return number of events inside @a port_buffer diff --git a/common/wscript b/common/wscript index 2d2f4250..2b1a1927 100644 --- a/common/wscript +++ b/common/wscript @@ -226,6 +226,10 @@ def build(bld): if bld.env['IS_SUN']: clientlib.env.append_value("LINKFLAGS", "-lnsl -lsocket") + if bld.env['BUILD_WITH_32_64']: + print "create 32bit lib..." + clientlib32bit = clientlib.clone('lib32') + create_jack_process_obj(bld, 'netmanager', 'JackNetManager.cpp', serverlib) create_jack_process_obj(bld, 'profiler', 'JackProfiler.cpp', serverlib) diff --git a/wscript b/wscript index 32bbccef..aad43548 100644 --- a/wscript +++ b/wscript @@ -61,6 +61,7 @@ def set_options(opt): opt.tool_options('compiler_cc') opt.add_option('--libdir', type='string', help="Library directory [Default: /lib]") + opt.add_option('--libdir32', type='string', help="32bit Library directory [Default: /lib32]") opt.add_option('--dbus', action='store_true', default=False, help='Enable D-Bus JACK (jackdbus)') opt.add_option('--classic', action='store_true', default=False, help='Force enable standard JACK (jackd) even if D-Bus JACK (jackdbus) is enabled too') opt.add_option('--doxygen', action='store_true', default=False, help='Enable build of doxygen documentation') @@ -206,7 +207,22 @@ def configure(conf): print Logs.colors.NORMAL, print + if Options.options.mixed == True: + env_variant2 = conf.env.copy() + conf.set_env_name('lib32', env_variant2) + env_variant2.set_variant('lib32') + conf.setenv('lib32') + conf.env.append_unique('CXXFLAGS', '-m32') + conf.env.append_unique('CCFLAGS', '-m32') + conf.env.append_unique('LINKFLAGS', '-m32') + conf.write_config_header('config.h') + if Options.options.libdir32: + conf.env['LIBDIR'] = Options.options.libdir32 + else: + conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib32/' + def build(bld): + print ("make[1]: Entering directory `" + os.getcwd() + "/" + blddir + "'" ) if not os.access('svnversion.h', os.R_OK): create_svnversion_task(bld) From 418e268f466fea3654e24943f13c9902e74feefc Mon Sep 17 00:00:00 2001 From: sletz Date: Thu, 9 Jul 2009 10:34:32 +0000 Subject: [PATCH 07/35] Add compile time option for maximum ports per application. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3588 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 1 + common/JackConstants.h | 6 +++++- wscript | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0ac6d67..132a9e88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,7 @@ Paul Davis * Use __attribute__((__packed__)) again, more fixes for 64/32 mixed mode. * Torben Hohn changes for 64/32 mixed mode in wscripts. + * Add compile time option for maximum ports per application. 2009-07-07 Stephane Letz diff --git a/common/JackConstants.h b/common/JackConstants.h index 37a6724e..a8861d9a 100644 --- a/common/JackConstants.h +++ b/common/JackConstants.h @@ -38,10 +38,14 @@ #endif #define DRIVER_PORT_NUM 256 + +#ifndef PORT_NUM_FOR_CLIENT #define PORT_NUM_FOR_CLIENT 512 +#endif + #define FIRST_AVAILABLE_PORT 1 -#define CONNECTION_NUM_FOR_PORT 256 +#define CONNECTION_NUM_FOR_PORT PORT_NUM_FOR_CLIENT #ifndef CLIENT_NUM #define CLIENT_NUM 64 diff --git a/wscript b/wscript index aad43548..8c01c384 100644 --- a/wscript +++ b/wscript @@ -69,6 +69,7 @@ def set_options(opt): 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-per-application', default=512, type="int", dest="application_ports", help='Maximum number of ports per application') opt.sub_options('dbus') def configure(conf): @@ -136,7 +137,8 @@ def configure(conf): conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib/' conf.define('CLIENT_NUM', Options.options.clients) - conf.define('PORT_NUM', Options.options. ports) + conf.define('PORT_NUM', Options.options.ports) + conf.define('PORT_NUM_FOR_CLIENT', Options.options.application_ports) conf.define('ADDON_DIR', os.path.normpath(os.path.join(conf.env['LIBDIR'], 'jack'))) conf.define('JACK_LOCATION', os.path.normpath(os.path.join(conf.env['PREFIX'], 'bin'))) @@ -170,6 +172,7 @@ def configure(conf): print "Build with a maximum of %d JACK clients" % conf.env['CLIENT_NUM'] print "Build with a maximum of %d ports" % conf.env['PORT_NUM'] + print "Build with a maximum of %d ports per application" % conf.env['PORT_NUM_FOR_CLIENT'] display_msg("Install prefix", conf.env['PREFIX'], 'CYAN') display_msg("Library directory", conf.env['LIBDIR'], 'CYAN') From 5bd0d7711f9f753bbbe5f6cb5bfc5af73225e293 Mon Sep 17 00:00:00 2001 From: sletz Date: Fri, 10 Jul 2009 10:17:34 +0000 Subject: [PATCH 08/35] Fix wscripts when --libdir is used. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3593 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/wscript | 2 +- dbus/wscript | 6 ++++-- wscript | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/common/wscript b/common/wscript index 2b1a1927..d63eab72 100644 --- a/common/wscript +++ b/common/wscript @@ -229,7 +229,7 @@ def build(bld): if bld.env['BUILD_WITH_32_64']: print "create 32bit lib..." clientlib32bit = clientlib.clone('lib32') - + create_jack_process_obj(bld, 'netmanager', 'JackNetManager.cpp', serverlib) create_jack_process_obj(bld, 'profiler', 'JackProfiler.cpp', serverlib) diff --git a/dbus/wscript b/dbus/wscript index f33c51a2..e23e67b0 100644 --- a/dbus/wscript +++ b/dbus/wscript @@ -32,10 +32,12 @@ def configure(conf): if conf.is_defined('HAVE_EXPAT'): conf.env['LIB_EXPAT'] = ['expat'] - conf.env['BUILD_JACKDBUS'] = conf.is_defined('HAVE_EXPAT') and conf.is_defined('HAVE_DBUS_1') + conf.env['BUILD_JACKDBUS1'] = conf.is_defined('HAVE_EXPAT') and conf.is_defined('HAVE_DBUS_1') + def build(bld): - if bld.env["BUILD_JACKDBUS"] != True: + + if bld.env['BUILD_JACKDBUS1'] != True: return obj = bld.new_task_gen('cc', 'program') diff --git a/wscript b/wscript index 8c01c384..917208d0 100644 --- a/wscript +++ b/wscript @@ -132,9 +132,9 @@ def configure(conf): conf.env['BUILD_JACKD'] = True if Options.options.libdir: - conf.env['LIBDIR'] = Options.options.libdir + conf.env['LIBDIR'] = conf.env['PREFIX'] + Options.options.libdir else: - conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib/' + conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib' conf.define('CLIENT_NUM', Options.options.clients) conf.define('PORT_NUM', Options.options.ports) @@ -220,9 +220,9 @@ def configure(conf): conf.env.append_unique('LINKFLAGS', '-m32') conf.write_config_header('config.h') if Options.options.libdir32: - conf.env['LIBDIR'] = Options.options.libdir32 + conf.env['LIBDIR'] = conf.env['PREFIX'] + Options.options.libdir32 else: - conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib32/' + conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib32' def build(bld): print ("make[1]: Entering directory `" + os.getcwd() + "/" + blddir + "'" ) From 373c91126b2945b6e2817d169c39e8671b96fb22 Mon Sep 17 00:00:00 2001 From: sletz Date: Fri, 10 Jul 2009 11:31:15 +0000 Subject: [PATCH 09/35] Remove JackLoopbackDriver file from wscript. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3594 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/wscript | 1 - 1 file changed, 1 deletion(-) diff --git a/common/wscript b/common/wscript index d63eab72..6089ff81 100644 --- a/common/wscript +++ b/common/wscript @@ -119,7 +119,6 @@ def build(bld): 'JackExternalClient.cpp', 'JackFreewheelDriver.cpp', 'JackInternalClient.cpp', - 'JackLoopbackDriver.cpp', 'JackServer.cpp', 'JackThreadedDriver.cpp', 'JackRestartThreadedDriver.cpp', From 05c58839e1144e8f77e9dd26c15d7c75e00b317c Mon Sep 17 00:00:00 2001 From: sletz Date: Fri, 10 Jul 2009 14:55:14 +0000 Subject: [PATCH 10/35] Update XCode project. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3595 0c269be4-1314-0410-8aa9-9f06e86f4224 --- macosx/Jack-Info.plist | 2 +- macosx/Jackdmp.xcodeproj/project.pbxproj | 155 ----------------------- 2 files changed, 1 insertion(+), 156 deletions(-) diff --git a/macosx/Jack-Info.plist b/macosx/Jack-Info.plist index ea2a9e42..924e644a 100644 --- a/macosx/Jack-Info.plist +++ b/macosx/Jack-Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.9.2 + 1.9.3 diff --git a/macosx/Jackdmp.xcodeproj/project.pbxproj b/macosx/Jackdmp.xcodeproj/project.pbxproj index f3071671..c5a75585 100644 --- a/macosx/Jackdmp.xcodeproj/project.pbxproj +++ b/macosx/Jackdmp.xcodeproj/project.pbxproj @@ -34,8 +34,6 @@ 4B35C6940D4733B9000DE7AE /* PBXTargetDependency */, 4B35C6960D4733B9000DE7AE /* PBXTargetDependency */, 4B0A29300D5210C4002EFF74 /* PBXTargetDependency */, - 4B35C6980D4733B9000DE7AE /* PBXTargetDependency */, - 4B35C69A0D4733B9000DE7AE /* PBXTargetDependency */, 4B35C69C0D4733B9000DE7AE /* PBXTargetDependency */, 4B35C69E0D4733B9000DE7AE /* PBXTargetDependency */, 4B35C6A00D4733B9000DE7AE /* PBXTargetDependency */, @@ -46,9 +44,6 @@ 4BFA83380DF6AB540087B4E1 /* PBXTargetDependency */, 4BFA833A0DF6AB540087B4E1 /* PBXTargetDependency */, 4BFA833C0DF6AB540087B4E1 /* PBXTargetDependency */, - 4B35C6A60D4733B9000DE7AE /* PBXTargetDependency */, - 4B35C6A80D4733B9000DE7AE /* PBXTargetDependency */, - 4B35C6AA0D4733B9000DE7AE /* PBXTargetDependency */, ); name = "All Universal 32/64 bits"; productName = All; @@ -86,13 +81,7 @@ 4B0A28F40D520D11002EFF74 /* PBXTargetDependency */, 4B363DE50DEB037F001F72D9 /* PBXTargetDependency */, 4BFA99AC0AAAF41D009E916C /* PBXTargetDependency */, - 4BFA99500AAAED90009E916C /* PBXTargetDependency */, - 4BFA99520AAAED90009E916C /* PBXTargetDependency */, - 4B5F25B30DEEA2430041E486 /* PBXTargetDependency */, 4BFA99540AAAED90009E916C /* PBXTargetDependency */, - 4BFA99580AAAED90009E916C /* PBXTargetDependency */, - 4BFA995A0AAAED90009E916C /* PBXTargetDependency */, - 4BFA995C0AAAED90009E916C /* PBXTargetDependency */, 4B363E750DEB0838001F72D9 /* PBXTargetDependency */, 4B363E770DEB0838001F72D9 /* PBXTargetDependency */, 4B363EF20DEB0965001F72D9 /* PBXTargetDependency */, @@ -215,7 +204,6 @@ 4B35C4AE0D4731D1000DE7AE /* JackMachNotifyChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB298908AF450200D450D4 /* JackMachNotifyChannel.h */; }; 4B35C4AF0D4731D1000DE7AE /* JackMachServerChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB297808AF44ED00D450D4 /* JackMachServerChannel.h */; }; 4B35C4B00D4731D1000DE7AE /* JackMachServerNotifyChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB297A08AF44ED00D450D4 /* JackMachServerNotifyChannel.h */; }; - 4B35C4B10D4731D1000DE7AE /* JackLoopbackDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF70ACB0908EE95008B75AD /* JackLoopbackDriver.h */; }; 4B35C4B20D4731D1000DE7AE /* JackConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B66A8580934964500A89560 /* JackConstants.h */; }; 4B35C4B30D4731D1000DE7AE /* JackTransportEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD4B4D409BACD9600750C0F /* JackTransportEngine.h */; }; 4B35C4B40D4731D1000DE7AE /* JackServerGlobals.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC2168D0A444BED00BDA09F /* JackServerGlobals.h */; }; @@ -260,7 +248,6 @@ 4B35C4E70D4731D1000DE7AE /* JackMachNotifyChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB298808AF450200D450D4 /* JackMachNotifyChannel.cpp */; }; 4B35C4E80D4731D1000DE7AE /* JackMachServerChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB297908AF44ED00D450D4 /* JackMachServerChannel.cpp */; }; 4B35C4E90D4731D1000DE7AE /* JackMachServerNotifyChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB297708AF44ED00D450D4 /* JackMachServerNotifyChannel.cpp */; }; - 4B35C4EA0D4731D1000DE7AE /* JackLoopbackDriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF70ACA0908EE95008B75AD /* JackLoopbackDriver.cpp */; }; 4B35C4EB0D4731D1000DE7AE /* JackTransportEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BD4B4D509BACD9600750C0F /* JackTransportEngine.cpp */; }; 4B35C4EC0D4731D1000DE7AE /* JackServerAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1F50834EFB000C94B91 /* JackServerAPI.cpp */; }; 4B35C4ED0D4731D1000DE7AE /* JackServerGlobals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC216880A444BDE00BDA09F /* JackServerGlobals.cpp */; }; @@ -420,7 +407,6 @@ 4B699C77097D421600A18468 /* JackMachNotifyChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB298908AF450200D450D4 /* JackMachNotifyChannel.h */; }; 4B699C78097D421600A18468 /* JackMachServerChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB297808AF44ED00D450D4 /* JackMachServerChannel.h */; }; 4B699C79097D421600A18468 /* JackMachServerNotifyChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFB297A08AF44ED00D450D4 /* JackMachServerNotifyChannel.h */; }; - 4B699C7A097D421600A18468 /* JackLoopbackDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF70ACB0908EE95008B75AD /* JackLoopbackDriver.h */; }; 4B699C7B097D421600A18468 /* JackConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B66A8580934964500A89560 /* JackConstants.h */; }; 4B699C7E097D421600A18468 /* JackMachPort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B799AD607899652003F3F15 /* JackMachPort.cpp */; }; 4B699C7F097D421600A18468 /* JackShmMem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1880834EE7900C94B91 /* JackShmMem.cpp */; }; @@ -450,7 +436,6 @@ 4B699CA2097D421600A18468 /* JackMachNotifyChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB298808AF450200D450D4 /* JackMachNotifyChannel.cpp */; }; 4B699CA3097D421600A18468 /* JackMachServerChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB297908AF44ED00D450D4 /* JackMachServerChannel.cpp */; }; 4B699CA4097D421600A18468 /* JackMachServerNotifyChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB297708AF44ED00D450D4 /* JackMachServerNotifyChannel.cpp */; }; - 4B699CA5097D421600A18468 /* JackLoopbackDriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF70ACA0908EE95008B75AD /* JackLoopbackDriver.cpp */; }; 4B699CB4097D421600A18468 /* metro.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D16B0834EDF000C94B91 /* metro.c */; }; 4B699CC4097D421600A18468 /* lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1690834EDE600C94B91 /* lsp.c */; }; 4B699CF6097D421600A18468 /* freewheel.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1710834EE0F00C94B91 /* freewheel.c */; }; @@ -777,20 +762,6 @@ remoteGlobalIDString = 4B35C56C0D4731D2000DE7AE; remoteInfo = "jack_external_metro 64 bits"; }; - 4B35C6970D4733B9000DE7AE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B35C5780D4731D2000DE7AE; - remoteInfo = "testAtomic 64 bits"; - }; - 4B35C6990D4733B9000DE7AE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B35C5880D4731D2000DE7AE; - remoteInfo = "testSem 64 bits"; - }; 4B35C69B0D4733B9000DE7AE /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; @@ -826,27 +797,6 @@ remoteGlobalIDString = 4B35C5CC0D4731D2000DE7AE; remoteInfo = "jack_unload 64 bits"; }; - 4B35C6A50D4733B9000DE7AE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B35C5D80D4731D2000DE7AE; - remoteInfo = "synchroServer 64 bits"; - }; - 4B35C6A70D4733B9000DE7AE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B35C5EC0D4731D2000DE7AE; - remoteInfo = "synchroClient 64 bits"; - }; - 4B35C6A90D4733B9000DE7AE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B35C6000D4731D2000DE7AE; - remoteInfo = "synchroServerClient 64 bits"; - }; 4B35C6AB0D4733B9000DE7AE /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; @@ -931,13 +881,6 @@ remoteGlobalIDString = 4B5A1BD00CD1CCE10005BF74; remoteInfo = jack_midisine; }; - 4B5F25B20DEEA2430041E486 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4BFA5E8B0DEC4D9C00FA4CDB; - remoteInfo = "testMutex Universal"; - }; 4B699DB3097D421700A18468 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; @@ -1134,20 +1077,6 @@ remoteGlobalIDString = 4B699D03097D421600A18468; remoteInfo = "jack_external_metro Universal"; }; - 4BFA994F0AAAED90009E916C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B699D13097D421600A18468; - remoteInfo = "testAtomic Universal"; - }; - 4BFA99510AAAED90009E916C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B699D27097D421600A18468; - remoteInfo = "testSem Universal"; - }; 4BFA99530AAAED90009E916C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; @@ -1162,27 +1091,6 @@ remoteGlobalIDString = 4BE6C6910A3E096F005A203A; remoteInfo = "jack_test Universal"; }; - 4BFA99570AAAED90009E916C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B699D4F097D421600A18468; - remoteInfo = "synchroServer Universal"; - }; - 4BFA99590AAAED90009E916C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B699D67097D421600A18468; - remoteInfo = "synchroClient Universal"; - }; - 4BFA995B0AAAED90009E916C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B699D7F097D421700A18468; - remoteInfo = "synchroServerClient Universal"; - }; 4BFA99AB0AAAF41D009E916C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; @@ -1456,8 +1364,6 @@ 4BF5FBC80E878D24003D2374 /* JackMachTime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = JackMachTime.c; sourceTree = SOURCE_ROOT; }; 4BF6C1D508ACE64C001E2013 /* JackMachSemaphore.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JackMachSemaphore.cpp; sourceTree = SOURCE_ROOT; }; 4BF6C1D608ACE64C001E2013 /* JackMachSemaphore.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JackMachSemaphore.h; sourceTree = SOURCE_ROOT; }; - 4BF70ACA0908EE95008B75AD /* JackLoopbackDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackLoopbackDriver.cpp; path = ../common/JackLoopbackDriver.cpp; sourceTree = SOURCE_ROOT; }; - 4BF70ACB0908EE95008B75AD /* JackLoopbackDriver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackLoopbackDriver.h; path = ../common/JackLoopbackDriver.h; sourceTree = SOURCE_ROOT; }; 4BF772FD08B3330F00149912 /* JackAtomic.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackAtomic.h; path = ../common/JackAtomic.h; sourceTree = SOURCE_ROOT; }; 4BF8D1670834EDD900C94B91 /* zombie.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = zombie.c; path = "../example-clients/zombie.c"; sourceTree = SOURCE_ROOT; }; 4BF8D1690834EDE600C94B91 /* lsp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lsp.c; path = "..//example-clients/lsp.c"; sourceTree = SOURCE_ROOT; }; @@ -2538,8 +2444,6 @@ 4B869D7F08C9CB00001CF041 /* JackDriverLoader.cpp */, 4BF8D1B50834EEE400C94B91 /* JackDriver.h */, 4BF8D1B60834EEE400C94B91 /* JackDriver.cpp */, - 4BF70ACB0908EE95008B75AD /* JackLoopbackDriver.h */, - 4BF70ACA0908EE95008B75AD /* JackLoopbackDriver.cpp */, 4BC3988A08B3CF6C00B6F371 /* JackDummyDriver.h */, 4BC3988908B3CF6C00B6F371 /* JackDummyDriver.cpp */, 4BF3390D0F8B86AF0080FB5B /* MIDI */, @@ -2879,7 +2783,6 @@ 4B35C4AE0D4731D1000DE7AE /* JackMachNotifyChannel.h in Headers */, 4B35C4AF0D4731D1000DE7AE /* JackMachServerChannel.h in Headers */, 4B35C4B00D4731D1000DE7AE /* JackMachServerNotifyChannel.h in Headers */, - 4B35C4B10D4731D1000DE7AE /* JackLoopbackDriver.h in Headers */, 4B35C4B20D4731D1000DE7AE /* JackConstants.h in Headers */, 4B35C4B30D4731D1000DE7AE /* JackTransportEngine.h in Headers */, 4B35C4B40D4731D1000DE7AE /* JackServerGlobals.h in Headers */, @@ -3245,7 +3148,6 @@ 4B699C77097D421600A18468 /* JackMachNotifyChannel.h in Headers */, 4B699C78097D421600A18468 /* JackMachServerChannel.h in Headers */, 4B699C79097D421600A18468 /* JackMachServerNotifyChannel.h in Headers */, - 4B699C7A097D421600A18468 /* JackLoopbackDriver.h in Headers */, 4B699C7B097D421600A18468 /* JackConstants.h in Headers */, 4BD4B4D809BACD9600750C0F /* JackTransportEngine.h in Headers */, 4BC2168E0A444BED00BDA09F /* JackServerGlobals.h in Headers */, @@ -5709,7 +5611,6 @@ 4B35C4E70D4731D1000DE7AE /* JackMachNotifyChannel.cpp in Sources */, 4B35C4E80D4731D1000DE7AE /* JackMachServerChannel.cpp in Sources */, 4B35C4E90D4731D1000DE7AE /* JackMachServerNotifyChannel.cpp in Sources */, - 4B35C4EA0D4731D1000DE7AE /* JackLoopbackDriver.cpp in Sources */, 4B35C4EB0D4731D1000DE7AE /* JackTransportEngine.cpp in Sources */, 4B35C4EC0D4731D1000DE7AE /* JackServerAPI.cpp in Sources */, 4B35C4ED0D4731D1000DE7AE /* JackServerGlobals.cpp in Sources */, @@ -6089,7 +5990,6 @@ 4B699CA2097D421600A18468 /* JackMachNotifyChannel.cpp in Sources */, 4B699CA3097D421600A18468 /* JackMachServerChannel.cpp in Sources */, 4B699CA4097D421600A18468 /* JackMachServerNotifyChannel.cpp in Sources */, - 4B699CA5097D421600A18468 /* JackLoopbackDriver.cpp in Sources */, 4BD4B4D909BACD9600750C0F /* JackTransportEngine.cpp in Sources */, 4BC216850A444BAD00BDA09F /* JackServerAPI.cpp in Sources */, 4BC216890A444BDE00BDA09F /* JackServerGlobals.cpp in Sources */, @@ -6523,16 +6423,6 @@ target = 4B35C56C0D4731D2000DE7AE /* jack_external_metro 64 bits */; targetProxy = 4B35C6950D4733B9000DE7AE /* PBXContainerItemProxy */; }; - 4B35C6980D4733B9000DE7AE /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B35C5780D4731D2000DE7AE /* testAtomic 64 bits */; - targetProxy = 4B35C6970D4733B9000DE7AE /* PBXContainerItemProxy */; - }; - 4B35C69A0D4733B9000DE7AE /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B35C5880D4731D2000DE7AE /* testSem 64 bits */; - targetProxy = 4B35C6990D4733B9000DE7AE /* PBXContainerItemProxy */; - }; 4B35C69C0D4733B9000DE7AE /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 4B35C59C0D4731D2000DE7AE /* zombie 64 bits */; @@ -6558,21 +6448,6 @@ target = 4B35C5CC0D4731D2000DE7AE /* jack_unload 64 bits */; targetProxy = 4B35C6A30D4733B9000DE7AE /* PBXContainerItemProxy */; }; - 4B35C6A60D4733B9000DE7AE /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B35C5D80D4731D2000DE7AE /* synchroServer 64 bits */; - targetProxy = 4B35C6A50D4733B9000DE7AE /* PBXContainerItemProxy */; - }; - 4B35C6A80D4733B9000DE7AE /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B35C5EC0D4731D2000DE7AE /* synchroClient 64 bits */; - targetProxy = 4B35C6A70D4733B9000DE7AE /* PBXContainerItemProxy */; - }; - 4B35C6AA0D4733B9000DE7AE /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B35C6000D4731D2000DE7AE /* synchroServerClient 64 bits */; - targetProxy = 4B35C6A90D4733B9000DE7AE /* PBXContainerItemProxy */; - }; 4B35C6AC0D4733B9000DE7AE /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 4B35C6140D4731D2000DE7AE /* jack_coreaudio 64 bits */; @@ -6633,11 +6508,6 @@ target = 4B5A1BD00CD1CCE10005BF74 /* jack_midisine Universal */; targetProxy = 4B5A1BE10CD1CD730005BF74 /* PBXContainerItemProxy */; }; - 4B5F25B30DEEA2430041E486 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4BFA5E8B0DEC4D9C00FA4CDB /* testMutex Universal */; - targetProxy = 4B5F25B20DEEA2430041E486 /* PBXContainerItemProxy */; - }; 4B699DB4097D421700A18468 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 4B699C4C097D421600A18468 /* Jackservermp.framework Universal */; @@ -6778,16 +6648,6 @@ target = 4B699D03097D421600A18468 /* jack_external_metro Universal */; targetProxy = 4BFA994D0AAAED90009E916C /* PBXContainerItemProxy */; }; - 4BFA99500AAAED90009E916C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B699D13097D421600A18468 /* testAtomic Universal */; - targetProxy = 4BFA994F0AAAED90009E916C /* PBXContainerItemProxy */; - }; - 4BFA99520AAAED90009E916C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B699D27097D421600A18468 /* testSem Universal */; - targetProxy = 4BFA99510AAAED90009E916C /* PBXContainerItemProxy */; - }; 4BFA99540AAAED90009E916C /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 4B699D3F097D421600A18468 /* zombie Universal */; @@ -6798,21 +6658,6 @@ target = 4BE6C6910A3E096F005A203A /* jack_test Universal */; targetProxy = 4BFA99550AAAED90009E916C /* PBXContainerItemProxy */; }; - 4BFA99580AAAED90009E916C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B699D4F097D421600A18468 /* synchroServer Universal */; - targetProxy = 4BFA99570AAAED90009E916C /* PBXContainerItemProxy */; - }; - 4BFA995A0AAAED90009E916C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B699D67097D421600A18468 /* synchroClient Universal */; - targetProxy = 4BFA99590AAAED90009E916C /* PBXContainerItemProxy */; - }; - 4BFA995C0AAAED90009E916C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B699D7F097D421700A18468 /* synchroServerClient Universal */; - targetProxy = 4BFA995B0AAAED90009E916C /* PBXContainerItemProxy */; - }; 4BFA99AC0AAAF41D009E916C /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 4BFA99980AAAF3B0009E916C /* jdelay Universal */; From 1eef95890badf0d60b2965e755291e7e08e5e67b Mon Sep 17 00:00:00 2001 From: sletz Date: Sat, 11 Jul 2009 13:43:05 +0000 Subject: [PATCH 11/35] Raise drivers time out used in synchronous mode. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3596 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 4 ++++ common/JackAudioDriver.cpp | 2 +- common/JackConstants.h | 1 + common/JackFreewheelDriver.cpp | 2 +- macosx/JackMachSemaphore.h | 2 +- macosx/JackPlatformPlug_os.h | 4 +--- posix/JackFifo.h | 2 +- posix/JackPosixSemaphore.h | 2 +- windows/JackWinSemaphore.h | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 132a9e88..da1a02b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,10 @@ Paul Davis Jackdmp changes log --------------------------- +2009-07-11 Stephane Letz + + * Raise drivers time out used in synchronous mode. + 2009-07-09 Stephane Letz * Use __attribute__((__packed__)) again, more fixes for 64/32 mixed mode. diff --git a/common/JackAudioDriver.cpp b/common/JackAudioDriver.cpp index fc753123..85634e34 100644 --- a/common/JackAudioDriver.cpp +++ b/common/JackAudioDriver.cpp @@ -269,7 +269,7 @@ void JackAudioDriver::ProcessGraphSync() fGraphManager->ResumeRefNum(&fClientControl, fSynchroTable); if (ProcessSlaves() < 0) jack_error("JackAudioDriver::ProcessSync ProcessSlaves error, engine may now behave abnormally!!"); - if (fGraphManager->SuspendRefNum(&fClientControl, fSynchroTable, fEngineControl->fTimeOutUsecs) < 0) + if (fGraphManager->SuspendRefNum(&fClientControl, fSynchroTable, DRIVER_TIMEOUT_FACTOR * fEngineControl->fTimeOutUsecs) < 0) jack_error("JackAudioDriver::ProcessSync SuspendRefNum error, engine may now behave abnormally!!"); } else { // Graph not finished: do not activate it jack_error("JackAudioDriver::ProcessSync: error"); diff --git a/common/JackConstants.h b/common/JackConstants.h index a8861d9a..f5355afc 100644 --- a/common/JackConstants.h +++ b/common/JackConstants.h @@ -90,6 +90,7 @@ #define SOCKET_TIME_OUT 5 // in sec #define DRIVER_OPEN_TIMEOUT 5 // in sec #define FREEWHEEL_DRIVER_TIMEOUT 10 // in sec +#define DRIVER_TIMEOUT_FACTOR 10 #define NO_PORT 0xFFFE diff --git a/common/JackFreewheelDriver.cpp b/common/JackFreewheelDriver.cpp index 161c3897..c28e30c3 100644 --- a/common/JackFreewheelDriver.cpp +++ b/common/JackFreewheelDriver.cpp @@ -41,7 +41,7 @@ int JackFreewheelDriver::Process() } else { fGraphManager->ResumeRefNum(&fClientControl, fSynchroTable); // Signal all clients if (fEngineControl->fSyncMode) { - if (fGraphManager->SuspendRefNum(&fClientControl, fSynchroTable, fEngineControl->fTimeOutUsecs) < 0) { + if (fGraphManager->SuspendRefNum(&fClientControl, fSynchroTable, DRIVER_TIMEOUT_FACTOR * fEngineControl->fTimeOutUsecs) < 0) { jack_error("JackFreewheelDriver::ProcessSync SuspendRefNum error"); return -1; } diff --git a/macosx/JackMachSemaphore.h b/macosx/JackMachSemaphore.h index c82fa8d5..e87f0c5c 100644 --- a/macosx/JackMachSemaphore.h +++ b/macosx/JackMachSemaphore.h @@ -47,7 +47,7 @@ class SERVER_EXPORT JackMachSemaphore : public detail::JackSynchro public: - JackMachSemaphore(): fSemaphore(0) + JackMachSemaphore():JackSynchro(), fSemaphore(0) {} bool Signal(); diff --git a/macosx/JackPlatformPlug_os.h b/macosx/JackPlatformPlug_os.h index 24d94252..c52a259f 100644 --- a/macosx/JackPlatformPlug_os.h +++ b/macosx/JackPlatformPlug_os.h @@ -35,7 +35,7 @@ namespace Jack /* __JackPlatformMutex__ */ #include "JackPosixMutex.h" -namespace Jack {typedef JackPosixMutex JackMutex; } +namespace Jack { typedef JackPosixMutex JackMutex; } /* __JackPlatformThread__ */ #include "JackMachThread.h" @@ -47,8 +47,6 @@ namespace Jack { typedef JackMachSemaphore JackSynchro; } /* __JackPlatformProcessSync__ */ #include "JackProcessSync.h" -//#include "JackMachProcessSync.h" -//namespace Jack { typedef JackMachProcessSync JackProcessSync; } /* Only on windows a special JackProcessSync is used. It is directly defined by including JackProcessSync.h here */ /* __JackPlatformServerChannel__ */ diff --git a/posix/JackFifo.h b/posix/JackFifo.h index be7d9b8a..8ac72591 100644 --- a/posix/JackFifo.h +++ b/posix/JackFifo.h @@ -48,7 +48,7 @@ class SERVER_EXPORT JackFifo : public detail::JackSynchro public: - JackFifo(): fFifo( -1) + JackFifo():JackSynchro(), fFifo(-1) {} bool Signal(); diff --git a/posix/JackPosixSemaphore.h b/posix/JackPosixSemaphore.h index 2052ff1c..226db2a1 100644 --- a/posix/JackPosixSemaphore.h +++ b/posix/JackPosixSemaphore.h @@ -46,7 +46,7 @@ class SERVER_EXPORT JackPosixSemaphore : public detail::JackSynchro public: - JackPosixSemaphore(): fSemaphore(NULL) + JackPosixSemaphore():JackSynchro(), fSemaphore(NULL) {} bool Signal(); diff --git a/windows/JackWinSemaphore.h b/windows/JackWinSemaphore.h index 45b84e08..d4330e5f 100644 --- a/windows/JackWinSemaphore.h +++ b/windows/JackWinSemaphore.h @@ -44,7 +44,7 @@ class JackWinSemaphore : public detail::JackSynchro public: - JackWinSemaphore(): fSemaphore(NULL) + JackWinSemaphore():JackSynchro(), fSemaphore(NULL) {} bool Signal(); From cbc5f4f26550523aecaeedfff00aea5733325f75 Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 15 Jul 2009 08:07:14 +0000 Subject: [PATCH 12/35] Include Microsoft Visual C++ 2008 Redistributable Package in Windows installer. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3597 0c269be4-1314-0410-8aa9-9f06e86f4224 --- windows/Setup/README | 6 +++++- windows/Setup/jack.ci | 9 ++++++--- windows/Setup/src/README | 15 +++++++++------ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/windows/Setup/README b/windows/Setup/README index d7f7eaf4..78588ece 100644 --- a/windows/Setup/README +++ b/windows/Setup/README @@ -1,7 +1,11 @@ This folder contains a script to create an installer for windows. It uses 'CreateInstall Free'(http://www.createinstall.com), a little software allowing to make simple installers. -You can use the 'jack.ci' script to make the installer. For that, you need to build the Code::Blocks workspace in order to have '.exe' and libraries. You also need 'qjackctl' binaries and libraries ('qjackctl.exe', 'mingwm10.dll', 'QtCore4.dll', 'QtGui.dll' and 'QtXml4.dll'). You can recompile qjackctl with qt4 or directly get the binaries. The five files are expected in the 'qjackctl' folder. +You can use the 'jack.ci' script to make the installer. For that, you need to build the Code::Blocks workspace in order to have '.exe' and libraries. +You also need 'qjackctl' binaries and libraries ('qjackctl.exe', 'mingwm10.dll', 'QtCore4.dll', 'QtGui.dll' and 'QtXml4.dll'). +You can recompile qjackctl with qt4 or directly get the binaries. The five files are expected in the 'qjackctl' folder. + +You also need the Microsoft Visual C++ 2008 Redistributable Package (x86) (the vcrdist_x86.exe file) to be in src folder. If you need libjack.lib and libjackserver.lib to link with in MS Visual Studio, you can use the MS Tool lib.exe to create the .lib file from de .def. Just use : 'lib /DEF:libjackserver.def /OUT:libjackserver.lib' and 'lib /DEF:libjack.def /OUT:libjack.lib' to create the lib file. diff --git a/windows/Setup/jack.ci b/windows/Setup/jack.ci index 213bcc82..b37f4deb 100644 --- a/windows/Setup/jack.ci +++ b/windows/Setup/jack.ci @@ -1,5 +1,5 @@ <*project - version = 4 civer = "Free v4.14.3" winver = "2.6/5.1.2600" > + version = 4 civer = "Free v4.14.5" winver = "2.6/5.1.2600" > . Jack_v1.9.3_setup.exe @@ -38,7 +38,7 @@ over - 0 + 1 1 Uninstall - 2 1 @@ -54,6 +54,7 @@ <_>..\Release\bin\libjack.ainstlibovernewer0 +<_>.\src\vcredist_x86.exeinstovernewer0 <_>..\Release\bin\libjack.libinstlibovernewer0 <_>..\Release\bin\libjack.definstlibovernewer0 <_>..\Release\bin\libjackserver.ainstlibovernewer0 @@ -72,6 +73,7 @@ <_>..\Release\bin\portaudio_x86.dllinstovernewer0 <_>..\Release\bin\jack\jack_net.dllinstjackovernewer0 <_>..\Release\bin\jack\jack_dummy.dllinstjackovernewer0 +<_>..\Release\bin\jack\jack_winmme.dllinstjackovernewer0 <_>..\Release\bin\jack\jack_portaudio.dllinstjackovernewer0 <_>..\Release\bin\jack\netmanager.dllinstjackovernewer0 <_>..\Release\bin\jack\audioadapter.dllinstjackovernewer0 @@ -99,7 +101,8 @@ - + <_>appinstvcredist_x86.exe1instend + diff --git a/windows/Setup/src/README b/windows/Setup/src/README index 5421e5e7..e9424a26 100644 --- a/windows/Setup/src/README +++ b/windows/Setup/src/README @@ -3,7 +3,7 @@ JACK on Windows ============================================= This installer will install everything to use Jack Audio Connection Kit (JACK) (www.jackaudio.org) on Windows. - + ============================================= QJACKCTL on Windows @@ -30,14 +30,17 @@ 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. + + ============================================= Jack MIDI ============================================= - -A first version of a JACK MIDI <==> Windows MIDI bridge (using Windows MME API) is available. If can be activated using the -X parameter in jackd command line. So add "-X winmme" in QJACKCTL settings (somathing like "jackd -S -X winmme"). The WinMME driver will scan MIDI input/output ports, open corresponding JACK MIDI ports and convert MIDI in/out into JACK MIDI messages. QJACKCTL MIDI connection windows can then be used. + +A first version of a JACK MIDI <==> Windows MIDI bridge (using Windows MME API) is available. +If can be activated using the -X parameter in jackd command line. So add "-X winmme" in QJACKCTL settings (something like "jackd -S -X winmme"). +The WinMME driver will scan MIDI input/output ports, open corresponding JACK MIDI ports and convert MIDI in/out into JACK MIDI messages. +QJACKCTL MIDI connection windows can then be used. ============================================= From 1f357b86f4b52c15481d85a8c1a5ad2fadd71aff Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 15 Jul 2009 13:33:22 +0000 Subject: [PATCH 13/35] Correct jackd.h for doxygen groups definition. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3598 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/jack/jack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/jack/jack.h b/common/jack/jack.h index d1bdd96f..6ee8320a 100644 --- a/common/jack/jack.h +++ b/common/jack/jack.h @@ -483,7 +483,7 @@ int jack_set_xrun_callback (jack_client_t *, /*@}*/ /** - * @defgroup ServerControl Controlling & querying JACK server operation + * @defgroup ServerClientControl Controlling & querying JACK server operation * @{ */ From 9066f85ba0a7186a904c2ac5ec02326acce4db10 Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 15 Jul 2009 14:34:45 +0000 Subject: [PATCH 14/35] Rename JackDriver::Init method to JackDriver::Initialize (to avoid confusion with JackThread::Init method). git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3599 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 4 ++++ common/JackDriver.cpp | 2 +- common/JackDriver.h | 2 +- common/JackNetDriver.cpp | 6 +++--- common/JackNetDriver.h | 2 +- common/JackThreadedDriver.cpp | 2 +- common/JackWaitThreadedDriver.h | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index da1a02b7..8d2f2089 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,10 @@ Paul Davis Jackdmp changes log --------------------------- +2009-07-16 Stephane Letz + + * Rename JackDriver::Init method to JackDriver::Initialize (to avoid confusion with JackThread::Init method). + 2009-07-11 Stephane Letz * Raise drivers time out used in synchronous mode. diff --git a/common/JackDriver.cpp b/common/JackDriver.cpp index 609952dc..9fde4917 100644 --- a/common/JackDriver.cpp +++ b/common/JackDriver.cpp @@ -339,7 +339,7 @@ int JackDriver::SetSampleRate(jack_nframes_t sample_rate) return 0; } -bool JackDriver::Init() +bool JackDriver::Initialize() { return true; } diff --git a/common/JackDriver.h b/common/JackDriver.h index c7e9ff72..6b80dc33 100644 --- a/common/JackDriver.h +++ b/common/JackDriver.h @@ -203,7 +203,7 @@ class SERVER_EXPORT JackDriver : public JackDriverClientInterface virtual JackClientControl* GetClientControl() const; virtual bool IsRealTime() const; - virtual bool Init(); // To be called by the wrapping thread Init method when the driver is a "blocking" one + virtual bool Initialize(); // To be called by the wrapping thread Init method when the driver is a "blocking" one }; diff --git a/common/JackNetDriver.cpp b/common/JackNetDriver.cpp index c949001d..641c95c4 100644 --- a/common/JackNetDriver.cpp +++ b/common/JackNetDriver.cpp @@ -121,13 +121,13 @@ namespace Jack as a "dummy driver, until Init method returns. */ - bool JackNetDriver::Init() + bool JackNetDriver::Initialize() { - jack_log ( "JackNetDriver::Init()" ); + jack_log("JackNetDriver::Initialize()"); //new loading, but existing socket, restart the driver if (fSocket.IsSocket()) { - jack_info( "Restarting driver..." ); + jack_info("Restarting driver..."); FreeAll(); } diff --git a/common/JackNetDriver.h b/common/JackNetDriver.h index 058489a1..d8fb0bb2 100644 --- a/common/JackNetDriver.h +++ b/common/JackNetDriver.h @@ -50,7 +50,7 @@ namespace Jack JackGnuPlotMonitor* fNetTimeMon; #endif - bool Init(); + bool Initialize(); void FreeAll(); int AllocPorts(); diff --git a/common/JackThreadedDriver.cpp b/common/JackThreadedDriver.cpp index a1e16556..0ab139eb 100644 --- a/common/JackThreadedDriver.cpp +++ b/common/JackThreadedDriver.cpp @@ -209,7 +209,7 @@ bool JackThreadedDriver::Execute() bool JackThreadedDriver::Init() { - if (fDriver->Init()) { + if (fDriver->Initialize()) { if (fDriver->IsRealTime()) { jack_log("JackThreadedDriver::Init IsRealTime"); // Will do "something" on OSX only... diff --git a/common/JackWaitThreadedDriver.h b/common/JackWaitThreadedDriver.h index 876b6551..f81db20c 100644 --- a/common/JackWaitThreadedDriver.h +++ b/common/JackWaitThreadedDriver.h @@ -65,7 +65,7 @@ class SERVER_EXPORT JackWaitThreadedDriver : public JackThreadedDriver bool Execute() { // Blocks until decorated driver is started (that is when it's Init method returns). - fDriver->Init(); + fDriver->Initialize(); fRunning = true; return false; } From e57b17f67f928c7b86ec694cc58e33c9f39bb3ab Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 15 Jul 2009 14:56:00 +0000 Subject: [PATCH 15/35] Update Solaris boomer driver. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3600 0c269be4-1314-0410-8aa9-9f06e86f4224 --- solaris/oss/JackBoomerDriver.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/solaris/oss/JackBoomerDriver.cpp b/solaris/oss/JackBoomerDriver.cpp index b77e7747..9c1f9b32 100644 --- a/solaris/oss/JackBoomerDriver.cpp +++ b/solaris/oss/JackBoomerDriver.cpp @@ -395,11 +395,12 @@ int JackBoomerDriver::Open(jack_nframes_t nframes, return -1; } else { +/* if (fEngineControl->fSyncMode) { jack_error("Cannot run in synchronous mode, remove the -S parameter for jackd"); return -1; } - +*/ fRWMode |= ((capturing) ? kRead : 0); fRWMode |= ((playing) ? kWrite : 0); fBits = bits; @@ -491,7 +492,7 @@ int JackBoomerDriver::OpenAux() if (fPlaybackChannels > 0) { fRingBuffer = new jack_ringbuffer_t*[fPlaybackChannels]; for (int i = 0; i < fPlaybackChannels; i++) { - fRingBuffer[i] = jack_ringbuffer_create(fOutputBufferSize * 2); + fRingBuffer[i] = jack_ringbuffer_create(fOutputBufferSize * 8); jack_ringbuffer_read_advance(fRingBuffer[i], fOutputBufferSize); } } @@ -530,6 +531,7 @@ void JackBoomerDriver::CloseAux() fRingBuffer = NULL; } + int JackBoomerDriver::Start() { jack_log("JackBoomerDriver::Start"); @@ -620,7 +622,7 @@ int JackBoomerDriver::Write() for (int i = 0; i < fPlaybackChannels; i++) { if (fGraphManager->GetConnectionsNum(fPlaybackPortList[i]) > 0) { if (jack_ringbuffer_write(fRingBuffer[i], (char*)GetOutputBuffer(i), fOutputBufferSize) < fOutputBufferSize) { - jack_log("JackBoomerDriver::Write ringbuffer full"); + jack_error("JackBoomerDriver::Write ringbuffer full"); } } } @@ -666,7 +668,7 @@ bool JackBoomerDriver::Init() bool JackBoomerDriver::Execute() { memset(fOutputBuffer, 0, fOutputBufferSize); - + for (int i = 0; i < fPlaybackChannels; i++) { if (fGraphManager->GetConnectionsNum(fPlaybackPortList[i]) > 0) { @@ -678,7 +680,7 @@ bool JackBoomerDriver::Execute() unsigned int needed_bytes = fOutputBufferSize; float* output = (float*)fOutputBuffer; - + for (int j = 0; j < 2; j++) { unsigned int consumed_bytes = std::min(needed_bytes, ring_buffer_data[j].len); CopyAndConvertOut(output, (float*)ring_buffer_data[j].buf, consumed_bytes / sizeof(float), i, fPlaybackChannels, fBits); @@ -687,7 +689,7 @@ bool JackBoomerDriver::Execute() } if (needed_bytes > 0) { - jack_error("JackBoomerDriver::Execute missing frames = %ld", needed_bytes / sizeof(float)); + jack_error("JackBoomerDriver::Execute missing bytes = %ld", needed_bytes); } jack_ringbuffer_read_advance(fRingBuffer[i], fOutputBufferSize - needed_bytes); @@ -700,7 +702,7 @@ bool JackBoomerDriver::Execute() // Keep end cycle time JackDriver::CycleTakeEndTime(); - ssize_t count = ::write(fOutFD, fOutputBuffer, fOutputBufferSize); + ssize_t count = ::write(fOutFD, fOutputBuffer, fOutputBufferSize); #ifdef JACK_MONITOR if (count > 0 && count != (int)fOutputBufferSize) @@ -987,7 +989,7 @@ EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine Jack::JackBoomerDriver* boomer_driver = new Jack::JackBoomerDriver("system", "boomer", engine, table); Jack::JackDriverClientInterface* threaded_driver = new Jack::JackThreadedDriver(boomer_driver); - // Special open for OSS driver... + // Special open for Boomer driver... if (boomer_driver->Open(frames_per_interrupt, nperiods, srate, capture, playback, chan_in, chan_out, excl, monitor, capture_pcm_name, playback_pcm_name, systemic_input_latency, systemic_output_latency, bits, ignorehwbuf) == 0) { return threaded_driver; From ab3520d6599531638a930ebba9288f07bad7d41e Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 15 Jul 2009 16:04:05 +0000 Subject: [PATCH 16/35] Correct timing (for CPU load) in Solaris boomer driver. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3601 0c269be4-1314-0410-8aa9-9f06e86f4224 --- solaris/oss/JackBoomerDriver.cpp | 57 ++++++++++---------------------- solaris/oss/JackBoomerDriver.h | 3 -- solaris/oss/JackOSSDriver.cpp | 2 +- 3 files changed, 19 insertions(+), 43 deletions(-) diff --git a/solaris/oss/JackBoomerDriver.cpp b/solaris/oss/JackBoomerDriver.cpp index 9c1f9b32..99123e80 100644 --- a/solaris/oss/JackBoomerDriver.cpp +++ b/solaris/oss/JackBoomerDriver.cpp @@ -61,7 +61,8 @@ struct OSSCycleTable { }; OSSCycleTable gCycleTable; -int gCycleCount = 0; +int gCycleReadCount = 0; +int gCycleWriteCount = 0; #endif @@ -395,12 +396,11 @@ int JackBoomerDriver::Open(jack_nframes_t nframes, return -1; } else { -/* - if (fEngineControl->fSyncMode) { - jack_error("Cannot run in synchronous mode, remove the -S parameter for jackd"); + if (!fEngineControl->fSyncMode) { + jack_error("Cannot run in asynchronous mode, use the -S parameter for jackd"); return -1; } -*/ + fRWMode |= ((capturing) ? kRead : 0); fRWMode |= ((playing) ? kWrite : 0); fBits = bits; @@ -429,7 +429,7 @@ int JackBoomerDriver::Close() if (file) { jack_info("Writing OSS driver timing data...."); - for (int i = 1; i < gCycleCount; i++) { + for (int i = 1; i < std::min(gCycleReadCount, gCycleWriteCount); i++) { int d1 = gCycleTable.fTable[i].fAfterRead - gCycleTable.fTable[i].fBeforeRead; int d2 = gCycleTable.fTable[i].fAfterReadConvert - gCycleTable.fTable[i].fAfterRead; int d3 = gCycleTable.fTable[i].fAfterWrite - gCycleTable.fTable[i].fBeforeWrite; @@ -492,7 +492,7 @@ int JackBoomerDriver::OpenAux() if (fPlaybackChannels > 0) { fRingBuffer = new jack_ringbuffer_t*[fPlaybackChannels]; for (int i = 0; i < fPlaybackChannels; i++) { - fRingBuffer[i] = jack_ringbuffer_create(fOutputBufferSize * 8); + fRingBuffer[i] = jack_ringbuffer_create(fOutputBufferSize * 2); jack_ringbuffer_read_advance(fRingBuffer[i], fOutputBufferSize); } } @@ -567,7 +567,7 @@ int JackBoomerDriver::Read() } #ifdef JACK_MONITOR - gCycleTable.fTable[gCycleCount].fBeforeRead = GetMicroSeconds(); + gCycleTable.fTable[gCycleReadCount].fBeforeRead = GetMicroSeconds(); #endif audio_errinfo ei_in; @@ -576,7 +576,7 @@ int JackBoomerDriver::Read() #ifdef JACK_MONITOR if (count > 0 && count != (int)fInputBufferSize) jack_log("JackBoomerDriver::Read count = %ld", count / (fSampleSize * fCaptureChannels)); - gCycleTable.fTable[gCycleCount].fAfterRead = GetMicroSeconds(); + gCycleTable.fTable[gCycleReadCount].fAfterRead = GetMicroSeconds(); #endif // XRun detection @@ -610,7 +610,8 @@ int JackBoomerDriver::Read() } #ifdef JACK_MONITOR - gCycleTable.fTable[gCycleCount].fAfterReadConvert = GetMicroSeconds(); + gCycleTable.fTable[gCycleReadCount].fAfterReadConvert = GetMicroSeconds(); + gCycleReadCount = (gCycleReadCount == CYCLE_POINTS - 1) ? gCycleReadCount: gCycleReadCount + 1; #endif return 0; @@ -668,6 +669,10 @@ bool JackBoomerDriver::Init() bool JackBoomerDriver::Execute() { memset(fOutputBuffer, 0, fOutputBufferSize); + +#ifdef JACK_MONITOR + gCycleTable.fTable[gCycleWriteCount].fBeforeWriteConvert = GetMicroSeconds(); +#endif for (int i = 0; i < fPlaybackChannels; i++) { if (fGraphManager->GetConnectionsNum(fPlaybackPortList[i]) > 0) { @@ -697,18 +702,16 @@ bool JackBoomerDriver::Execute() } #ifdef JACK_MONITOR - gCycleTable.fTable[gCycleCount].fBeforeWrite = GetMicroSeconds(); + gCycleTable.fTable[gCycleWriteCount].fBeforeWrite = GetMicroSeconds(); #endif - // Keep end cycle time - JackDriver::CycleTakeEndTime(); ssize_t count = ::write(fOutFD, fOutputBuffer, fOutputBufferSize); #ifdef JACK_MONITOR if (count > 0 && count != (int)fOutputBufferSize) jack_log("JackBoomerDriver::Execute count = %ld", count / (fSampleSize * fPlaybackChannels)); - gCycleTable.fTable[gCycleCount].fAfterWrite = GetMicroSeconds(); - gCycleCount = (gCycleCount == CYCLE_POINTS - 1) ? gCycleCount: gCycleCount + 1; + gCycleTable.fTable[gCycleWriteCount].fAfterWrite = GetMicroSeconds(); + gCycleWriteCount = (gCycleWriteCount == CYCLE_POINTS - 1) ? gCycleWriteCount: gCycleWriteCount + 1; #endif // XRun detection @@ -742,30 +745,6 @@ int JackBoomerDriver::SetBufferSize(jack_nframes_t buffer_size) return OpenAux(); } -int JackBoomerDriver::ProcessAsync() -{ - // Read input buffers for the current cycle - if (Read() < 0) { - jack_error("JackBoomerDriver::ProcessAsync: read error, skip cycle"); - return 0; // Skip cycle, but continue processing... - } - - // Write output buffers from the previous cycle - if (Write() < 0) { - jack_error("JackBoomerDriver::ProcessAsync: write error, skip cycle"); - return 0; // Skip cycle, but continue processing... - } - - if (fIsMaster) { - ProcessGraphAsync(); - } else { - fGraphManager->ResumeRefNum(&fClientControl, fSynchroTable); - } - - // Keep end cycle time - JackDriver::CycleTakeEndTime(); - return 0; -} } // end of namespace diff --git a/solaris/oss/JackBoomerDriver.h b/solaris/oss/JackBoomerDriver.h index 1861e8d8..3bf2d1a1 100644 --- a/solaris/oss/JackBoomerDriver.h +++ b/solaris/oss/JackBoomerDriver.h @@ -76,9 +76,6 @@ class JackBoomerDriver : public JackAudioDriver, public JackRunnableInterface void SetSampleFormat(); void DisplayDeviceInfo(); - // Redefining since timing for CPU load is specific - int ProcessAsync(); - public: JackBoomerDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table) diff --git a/solaris/oss/JackOSSDriver.cpp b/solaris/oss/JackOSSDriver.cpp index ad44a43c..f4d8507c 100644 --- a/solaris/oss/JackOSSDriver.cpp +++ b/solaris/oss/JackOSSDriver.cpp @@ -558,7 +558,7 @@ int JackOSSDriver::Read() ssize_t count; #ifdef JACK_MONITOR - gCycleTable.fTable[gCycleCount].fBeforeRead = GetMicroSeconds(); + gCycleTable.fTable[gCycleCount].fBeforeRead = GetMicroSeconds(); #endif audio_errinfo ei_in; From 9fb3dfbfb25e48185236aca4c23920cd0b79ea63 Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 15 Jul 2009 16:45:17 +0000 Subject: [PATCH 17/35] Report some cleanup and documentation improvements done on JACK1 timing functions. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3602 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 2 ++ common/JackAPI.cpp | 8 +------- common/jack/jack.h | 42 ++++++++++++++++++++++++++---------------- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d2f2089..5bcf2031 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,8 @@ Paul Davis 2009-07-16 Stephane Letz * Rename JackDriver::Init method to JackDriver::Initialize (to avoid confusion with JackThread::Init method). + * Update Solaris boomer driver. + * Report some cleanup and documentation improvements done on JACK1 timing functions. 2009-07-11 Stephane Letz diff --git a/common/JackAPI.cpp b/common/JackAPI.cpp index 4eadc797..d609a915 100644 --- a/common/JackAPI.cpp +++ b/common/JackAPI.cpp @@ -1465,14 +1465,8 @@ EXPORT jack_nframes_t jack_last_frame_time(const jack_client_t* ext_client) #ifdef __CLIENTDEBUG__ JackLibGlobals::CheckContext(); #endif - JackTimer timer; JackEngineControl* control = GetEngineControl(); - if (control) { - control->ReadFrameTime(&timer); - return timer.CurFrame(); - } else { - return 0; - } + return (control) ? control->fFrameTimer.ReadCurrentState()->CurFrame() : 0; } EXPORT float jack_cpu_load(jack_client_t* ext_client) diff --git a/common/jack/jack.h b/common/jack/jack.h index 6ee8320a..5dc6290e 100644 --- a/common/jack/jack.h +++ b/common/jack/jack.h @@ -984,47 +984,57 @@ jack_port_t * jack_port_by_id (jack_client_t *client, /** * @defgroup TimeFunctions Handling time * @{ - */ + * + * JACK time is in units of 'frames', according to the current sample rate. + * The absolute value of frame times is meaningless, frame times have meaning + * only relative to each other. + */ /** - * @return the time in frames that has passed since the JACK server - * began the current process cycle. + * @return the estimated time in frames that has passed since the JACK + * server began the current process cycle. */ jack_nframes_t jack_frames_since_cycle_start (const jack_client_t *); /** - * @return an estimate of the current time in frames. This is a - * running counter, no significance should be attached to its value, - * but it can be compared to a previously returned value. + * @return the estimated current time in frames. + * This function is intended for use in other threads (not the process + * callback). The return value can be compared with the value of + * jack_last_frame_time to relate time in other threads to JACK time. */ jack_nframes_t jack_frame_time (const jack_client_t *); /** - * @return the frame_time after the last processing of the graph - * this is only to be used from the process callback. - * - * This function can be used to put timestamps generated by - * jack_frame_time() in correlation to the current process cycle. + * @return the precise time at the start of the current process cycle. + * This function may only be used from the process callback, and can + * be used to interpret timestamps generated by jack_frame_time() in + * other threads with respect to the current process cycle. + * + * This is the only jack time function that returns exact time: + * when used during the process callback it always returns the same + * value (until the next process callback, where it will return + * that value + nframes, etc). The return value is guaranteed to be + * monotonic and linear in this fashion unless an xrun occurs. + * If an xrun occurs, clients must check this value again, as time + * may have advanced in a non-linear way (e.g. cycles may have been skipped). */ jack_nframes_t jack_last_frame_time (const jack_client_t *client); /** - * @return estimated time in microseconds of the specified frame time + * @return the estimated time in microseconds of the specified frame time */ jack_time_t jack_frames_to_time(const jack_client_t *client, jack_nframes_t); /** - * @return estimated time in frames for the specified system time. + * @return the estimated time in frames for the specified system time. */ jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t); /** * @return return JACK's current system time in microseconds, - * using JACK clock source. + * using the JACK clock source. * * The value returned is guaranteed to be monotonic, but not linear. - * - * This function is a client version of @function jack_get_microseconds(). */ jack_time_t jack_get_time(); From 56f4d13ecb2b1cd9f8fd5786b769c9788c2b1b7f Mon Sep 17 00:00:00 2001 From: sletz Date: Thu, 16 Jul 2009 10:32:15 +0000 Subject: [PATCH 18/35] In combined --dbus and --classic compilation ode, use PulseAudio acquire/release code. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3603 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 44 +++++++++++--------- common/Jackdmp.cpp | 10 ++++- dbus/audio_reserve.c | 97 +++++++++++++++++++++++++++++--------------- dbus/audio_reserve.h | 5 ++- dbus/controller.c | 48 +++++++++++++--------- dbus/reserve.c | 18 ++++---- dbus/reserve.h | 15 +++++++ linux/wscript | 8 +++- 8 files changed, 160 insertions(+), 85 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5bcf2031..721bd42f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,43 +23,47 @@ Paul Davis --------------------------- Jackdmp changes log ---------------------------- - +--------------------------- + +2009-07-17 Stephane Letz + + * In combined --dbus and --classic compilation ode, use PulseAudio acquire/release code. + 2009-07-16 Stephane Letz - * Rename JackDriver::Init method to JackDriver::Initialize (to avoid confusion with JackThread::Init method). - * Update Solaris boomer driver. - * Report some cleanup and documentation improvements done on JACK1 timing functions. - + * Rename JackDriver::Init method to JackDriver::Initialize (to avoid confusion with JackThread::Init method). + * Update Solaris boomer driver. + * Report some cleanup and documentation improvements done on JACK1 timing functions. + 2009-07-11 Stephane Letz - * Raise drivers time out used in synchronous mode. - + * Raise drivers time out used in synchronous mode. + 2009-07-09 Stephane Letz - * Use __attribute__((__packed__)) again, more fixes for 64/32 mixed mode. - * Torben Hohn changes for 64/32 mixed mode in wscripts. - * Add compile time option for maximum ports per application. - + * Use __attribute__((__packed__)) again, more fixes for 64/32 mixed mode. + * Torben Hohn changes for 64/32 mixed mode in wscripts. + * Add compile time option for maximum ports per application. + 2009-07-07 Stephane Letz - * Use __attribute__((__aligned__(32))) instead of __attribute__((__packed__)) for 64/32 mixed mode. - + * Use __attribute__((__aligned__(32))) instead of __attribute__((__packed__)) for 64/32 mixed mode. + 2009-07-03 Stephane Letz - * Another Tim Bechmann memops.c optimization patch. - + * Another Tim Bechmann memops.c optimization patch. + 2009-07-01 Stephane Letz - * Tim Bechmann memops.c optimization patch. - + * Tim Bechmann memops.c optimization patch. + 2009-06-30 Stephane Letz - * Tim Bechmann patch : hammerfall, only release monitor thread, if it has been created. + * Tim Bechmann patch : hammerfall, only release monitor thread, if it has been created. 2009-06-19 Stephane Letz - * Correct JackTransportEngine::MakeAllLocating, sync callback has to be called in this case also. + * Correct JackTransportEngine::MakeAllLocating, sync callback has to be called in this case also. * NetJack2 code : better error checkout, method renaming. 2009-06-17 Stephane Letz diff --git a/common/Jackdmp.cpp b/common/Jackdmp.cpp index a73878c5..7b7859b1 100644 --- a/common/Jackdmp.cpp +++ b/common/Jackdmp.cpp @@ -32,6 +32,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "JackConstants.h" #include "JackDriverLoader.h" +#if defined(JACK_DBUS) && defined(__linux__) +#include +#include "audio_reserve.h" +#endif + /* This is a simple port of the old jackdmp.cpp file to use the new Jack 2.0 control API. Available options for the server are "hard-coded" in the source. A much better approach would be to use the control API to: @@ -206,8 +211,11 @@ int main(int argc, char* argv[]) union jackctl_parameter_value value; copyright(stdout); - +#if defined(JACK_DBUS) && defined(__linux__) + server_ctl = jackctl_server_create(audio_acquire, audio_release); +#else server_ctl = jackctl_server_create(NULL, NULL); +#endif if (server_ctl == NULL) { fprintf(stderr, "Failed to create server object\n"); return -1; diff --git a/dbus/audio_reserve.c b/dbus/audio_reserve.c index 00412130..120db64f 100644 --- a/dbus/audio_reserve.c +++ b/dbus/audio_reserve.c @@ -22,74 +22,107 @@ #include #include #include +#include #include "reserve.h" #include "audio_reserve.h" #include "JackError.h" -static DBusConnection* connection = NULL; +#define DEVICE_MAX 2 + +typedef struct reserved_audio_device { + + char device_name[64]; + rd_device * reserved_device; + +} reserved_audio_device; + +static DBusConnection* gConnection = NULL; +static reserved_audio_device gReservedDevice[DEVICE_MAX]; +static int gReserveCount = 0; SERVER_EXPORT int audio_reservation_init() { DBusError error; - dbus_error_init(&error); - if (!(connection = dbus_bus_get(DBUS_BUS_SESSION, &error))) { + if (!(gConnection = dbus_bus_get(DBUS_BUS_SESSION, &error))) { jack_error("Failed to connect to session bus for device reservation %s\n", error.message); return -1; } + jack_info("audio_reservation_init"); return 0; } SERVER_EXPORT int audio_reservation_finish() { - if (connection) - dbus_connection_unref(connection); + if (gConnection) { + dbus_connection_unref(gConnection); + gConnection = NULL; + jack_info("audio_reservation_finish"); + } return 0; } -SERVER_EXPORT void* audio_acquire(int num) +SERVER_EXPORT bool audio_acquire(const char * device_name) { - DBusError error; - rd_device* device; - char audio_name[32]; - int e; - - snprintf(audio_name, sizeof(audio_name) - 1, "Audio%d", num); - if ((e = rd_acquire( - &device, - connection, - audio_name, + DBusError error; + int ret; + + // Open DBus connection first time + if (gReserveCount == 0) + audio_reservation_init(); + + assert(gReserveCount < DEVICE_MAX); + + if ((ret= rd_acquire( + &gReservedDevice[gReserveCount].reserved_device, + gConnection, + device_name, "Jack audio server", INT32_MAX, NULL, &error)) < 0) { - jack_error("Failed to acquire device name : %s error : %s", audio_name, (error.message ? error.message : strerror(-e))); - return NULL; + jack_error("Failed to acquire device name : %s error : %s", device_name, (error.message ? error.message : strerror(-ret))); + return false; } - jack_info("Acquire audio card %s", audio_name); - return (void*)device; + strcpy(gReservedDevice[gReserveCount].device_name, device_name); + gReserveCount++; + jack_info("Acquire audio card %s", device_name); + return true; } -SERVER_EXPORT void audio_reserve_loop() +SERVER_EXPORT void audio_release(const char * device_name) { - if (connection) { - while (dbus_connection_read_write_dispatch (connection, -1)) - ; // empty loop body + int i; + + // Look for corresponding reserved device + for (i = 0; i < DEVICE_MAX; i++) { + if (strcmp(gReservedDevice[i].device_name, device_name) == 0) + break; + } + + if (i < DEVICE_MAX) { + jack_info("Released audio card %s", device_name); + rd_release(gReservedDevice[i].reserved_device); + } else { + jack_error("Audio card %s not found!!", device_name); } + + // Close DBus connection last time + gReserveCount--; + if (gReserveCount == 0) + audio_reservation_finish(); } -SERVER_EXPORT void audio_release(void* dev) +SERVER_EXPORT void audio_reserve_loop() { - rd_device* device = (rd_device*)dev; - if (device) { - jack_info("Release audio card"); - rd_release(device); - } else { - jack_info("No audio card to release..."); - } + if (gConnection != NULL) { + while (dbus_connection_read_write_dispatch (gConnection, -1)) + ; // empty loop body + } } + diff --git a/dbus/audio_reserve.h b/dbus/audio_reserve.h index 9a5c34c5..db01f1ab 100644 --- a/dbus/audio_reserve.h +++ b/dbus/audio_reserve.h @@ -20,6 +20,7 @@ #define __audio_reserve__ #include "JackCompilerDeps.h" +#include #ifdef __cplusplus extern "C" { @@ -28,8 +29,8 @@ extern "C" { SERVER_EXPORT int audio_reservation_init(); SERVER_EXPORT int audio_reservation_finish(); -SERVER_EXPORT void* audio_acquire(int num); -SERVER_EXPORT void audio_release(void* dev); +SERVER_EXPORT bool audio_acquire(const char * device_name); +SERVER_EXPORT void audio_release(const char * device_name); SERVER_EXPORT void audio_reserve_loop(); #ifdef __cplusplus diff --git a/dbus/controller.c b/dbus/controller.c index 2a4bea77..17b51fdf 100644 --- a/dbus/controller.c +++ b/dbus/controller.c @@ -280,9 +280,18 @@ jack_controller_switch_master( return TRUE; } -/* TODO: use contianer with unique entries (dict) */ -bool g_reserved_device_valid = false; -static rd_device * g_reserved_device; +#define DEVICE_MAX 2 + +typedef struct reserved_audio_device { + + char device_name[64]; + rd_device * reserved_device; + +} reserved_audio_device; + + +int g_device_count = 0; +static reserved_audio_device g_reserved_device[DEVICE_MAX]; static bool @@ -291,13 +300,8 @@ on_device_acquire(const char * device_name) int ret; DBusError error; - if (g_reserved_device_valid) { - jack_error("Ignoring reservation for more than one device (acquire)"); - return false; - } - ret = rd_acquire( - &g_reserved_device, + &g_reserved_device[g_device_count].reserved_device, g_connection, device_name, "Jack audio server", @@ -310,10 +314,9 @@ on_device_acquire(const char * device_name) return false; } - g_reserved_device_valid = true; - + strcpy(g_reserved_device[g_device_count].device_name, device_name); + g_device_count++; jack_info("Acquired audio card %s", device_name); - return true; } @@ -321,15 +324,22 @@ static void on_device_release(const char * device_name) { - if (!g_reserved_device_valid) { - jack_error("Ignoring reservation for more than one device(release)"); - } + int i; - rd_release(g_reserved_device); - - g_reserved_device_valid = false; + // Look for corresponding reserved device + for (i = 0; i < DEVICE_MAX; i++) { + if (strcmp(g_reserved_device[i].device_name, device_name) == 0) + break; + } + + if (i < DEVICE_MAX) { + jack_info("Released audio card %s", device_name); + rd_release(g_reserved_device[i].reserved_device); + } else { + jack_error("Audio card %s not found!!", device_name); + } - jack_info("Released audio card %s", device_name); + g_device_count--; } void * diff --git a/dbus/reserve.c b/dbus/reserve.c index 9a9591d2..bc698a6a 100644 --- a/dbus/reserve.c +++ b/dbus/reserve.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "reserve.h" @@ -120,7 +121,7 @@ static DBusHandlerResult object_handler( dbus_error_init(&error); - d = userdata; + d = (rd_device*)userdata; assert(d->ref >= 1); if (dbus_message_is_method_call( @@ -296,7 +297,7 @@ static DBusHandlerResult filter_handler( dbus_error_init(&error); - d = userdata; + d = (rd_device*)userdata; if (dbus_message_is_signal(m, "org.freedesktop.DBus", "NameLost")) { const char *name; @@ -352,10 +353,7 @@ oom: return DBUS_HANDLER_RESULT_NEED_MEMORY; } - -static const struct DBusObjectPathVTable vtable ={ - .message_function = object_handler -}; +static DBusObjectPathVTable vtable; int rd_acquire( rd_device **_d, @@ -372,6 +370,8 @@ int rd_acquire( DBusMessage *m = NULL, *reply = NULL; dbus_bool_t good; + vtable.message_function = object_handler; + if (!error) error = &_error; @@ -389,7 +389,7 @@ int rd_acquire( if (!request_cb && priority != INT32_MAX) return -EINVAL; - if (!(d = calloc(sizeof(rd_device), 1))) + if (!(d = (rd_device *)calloc(sizeof(rd_device), 1))) return -ENOMEM; d->ref = 1; @@ -408,13 +408,13 @@ int rd_acquire( d->connection = dbus_connection_ref(connection); d->request_cb = request_cb; - if (!(d->service_name = malloc(sizeof(SERVICE_PREFIX) + strlen(device_name)))) { + if (!(d->service_name = (char*)malloc(sizeof(SERVICE_PREFIX) + strlen(device_name)))) { r = -ENOMEM; goto fail; } sprintf(d->service_name, SERVICE_PREFIX "%s", d->device_name); - if (!(d->object_path = malloc(sizeof(OBJECT_PREFIX) + strlen(device_name)))) { + if (!(d->object_path = (char*)malloc(sizeof(OBJECT_PREFIX) + strlen(device_name)))) { r = -ENOMEM; goto fail; } diff --git a/dbus/reserve.h b/dbus/reserve.h index b315a08c..6e16a07d 100644 --- a/dbus/reserve.h +++ b/dbus/reserve.h @@ -28,6 +28,13 @@ #include #include +# ifndef INT32_MIN +# define INT32_MIN (-2147483647-1) +# endif +# ifndef INT32_MAX +# define INT32_MAX (2147483647) +# endif + typedef struct rd_device rd_device; /* Prototype for a function that is called whenever someone else wants @@ -40,6 +47,10 @@ typedef int (*rd_request_cb_t)( rd_device *d, int forced); /* Non-zero if an application forcibly took the lock away without asking. If this is the case then the return value of this call is ignored. */ +#ifdef __cplusplus +extern "C" { +#endif + /* Try to lock the device. Returns 0 on success, a negative errno * style return value on error. The DBus error might be set as well if * the error was caused D-Bus. */ @@ -66,4 +77,8 @@ void rd_set_userdata(rd_device *d, void *userdata); * userdata was set. */ void* rd_get_userdata(rd_device *d); +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif diff --git a/linux/wscript b/linux/wscript index 087a3165..a181c223 100644 --- a/linux/wscript +++ b/linux/wscript @@ -31,10 +31,14 @@ def build(bld): jackd.includes = ['../linux', '../posix', '../common/jack', '../common', '../dbus'] jackd.defines = 'HAVE_CONFIG_H' jackd.source = ['../common/Jackdmp.cpp'] - jackd.uselib = 'PTHREAD DL RT' + if bld.env['IS_LINUX'] and bld.env['BUILD_JACKDBUS']: + jackd.source += ['../dbus/reserve.c', '../dbus/audio_reserve.c'] + jackd.uselib = 'PTHREAD DL RT DBUS-1' + else: + jackd.uselib = 'PTHREAD DL RT' jackd.uselib_local = 'serverlib' jackd.target = 'jackd' - + create_jack_driver_obj(bld, 'dummy', '../common/JackDummyDriver.cpp') alsa_driver_src = ['alsa/JackAlsaDriver.cpp', From bfecb007bdc0e79bf68ca88d5d6d8141eeb34803 Mon Sep 17 00:00:00 2001 From: sletz Date: Fri, 17 Jul 2009 15:07:30 +0000 Subject: [PATCH 19/35] Big rewrite of Solaris boomer driver, seems to work in duplex mode at least. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3604 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 6 +- solaris/oss/JackBoomerDriver.cpp | 236 +++++++++++++++++-------------- solaris/oss/JackBoomerDriver.h | 66 ++++++--- 3 files changed, 186 insertions(+), 122 deletions(-) diff --git a/ChangeLog b/ChangeLog index 721bd42f..0f1e92e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,10 +24,14 @@ Paul Davis --------------------------- Jackdmp changes log --------------------------- + +2009-07-17 Stephane Letz + + * Big rewrite of Solaris boomer driver, seems to work in duplex mode at least. 2009-07-17 Stephane Letz - * In combined --dbus and --classic compilation ode, use PulseAudio acquire/release code. + * In combined --dbus and --classic compilation code, use PulseAudio acquire/release code. 2009-07-16 Stephane Letz diff --git a/solaris/oss/JackBoomerDriver.cpp b/solaris/oss/JackBoomerDriver.cpp index 99123e80..96dc0a6a 100644 --- a/solaris/oss/JackBoomerDriver.cpp +++ b/solaris/oss/JackBoomerDriver.cpp @@ -230,6 +230,26 @@ void JackBoomerDriver::DisplayDeviceInfo() } } +JackBoomerDriver::JackBoomerDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table) + : JackAudioDriver(name, alias, engine, table), + fInFD(-1), fOutFD(-1), fBits(0), + fSampleFormat(0), fNperiods(0), fRWMode(0), fExcl(false), fIgnoreHW(true), + fInputBufferSize(0), fOutputBufferSize(0), + fInputBuffer(NULL), fOutputBuffer(NULL), + fInputThread(&fInputHandler), fOutputThread(&fOutputHandler), + fInputHandler(this), fOutputHandler(this) + +{ + sem_init(&fReadSema, 0, 0); + sem_init(&fWriteSema, 0, 0); +} + +JackBoomerDriver::~JackBoomerDriver() +{ + sem_destroy(&fReadSema); + sem_destroy(&fWriteSema); +} + int JackBoomerDriver::OpenInput() { int flags = 0; @@ -488,15 +508,6 @@ int JackBoomerDriver::OpenAux() return -1; } - // Prepare ringbuffers used for output - if (fPlaybackChannels > 0) { - fRingBuffer = new jack_ringbuffer_t*[fPlaybackChannels]; - for (int i = 0; i < fPlaybackChannels; i++) { - fRingBuffer[i] = jack_ringbuffer_create(fOutputBufferSize * 2); - jack_ringbuffer_read_advance(fRingBuffer[i], fOutputBufferSize); - } - } - DisplayDeviceInfo(); return 0; } @@ -520,27 +531,25 @@ void JackBoomerDriver::CloseAux() if (fOutputBuffer) free(fOutputBuffer); fOutputBuffer = NULL; - - for (int i = 0; i < fPlaybackChannels; i++) { - if (fRingBuffer[i]) - jack_ringbuffer_free(fRingBuffer[i]); - fRingBuffer[i] = NULL; - } - - delete [] fRingBuffer; - fRingBuffer = NULL; } - int JackBoomerDriver::Start() { jack_log("JackBoomerDriver::Start"); JackAudioDriver::Start(); + // Start input thread only when needed + if (fInFD > 0) { + if (fInputThread.StartSync() < 0) { + jack_error("Cannot start input thread"); + return -1; + } + } + // Start output thread only when needed if (fOutFD > 0) { - if (fThread.StartSync() < 0) { - jack_error("Cannot start thread"); + if (fOutputThread.StartSync() < 0) { + jack_error("Cannot start output thread"); return -1; } } @@ -550,20 +559,59 @@ int JackBoomerDriver::Start() int JackBoomerDriver::Stop() { + // Stop input thread only when needed + if (fInFD > 0) { + fInputThread.Kill(); + } + // Stop output thread only when needed if (fOutFD > 0) { - return fThread.Kill(); - } else { - return 0; + fOutputThread.Kill(); } + + return 0; } int JackBoomerDriver::Read() { - if (fInFD < 0) { +/* + // Keep begin cycle time + JackDriver::CycleTakeBeginTime(); +*/ + + return 0; +} + +int JackBoomerDriver::Write() +{ +/* + // Keep begin cycle time + JackDriver::CycleTakeEndTime(); +*/ + + return 0; +} + +bool JackBoomerDriver::JackBoomerDriverInput::Init() +{ + if (fDriver->IsRealTime()) { + jack_log("JackBoomerDriverInput::Init IsRealTime"); + if (fDriver->fInputThread.AcquireRealTime(GetEngineControl()->fServerPriority) < 0) { + jack_error("AcquireRealTime error"); + } else { + set_threaded_log_function(); + } + } + + return true; +} + +bool JackBoomerDriver::JackBoomerDriverInput::Execute() +{ + if (fDriver->fInFD < 0) { // Keep begin cycle time - JackDriver::CycleTakeBeginTime(); - return 0; + fDriver->CycleTakeBeginTime(); + return true; } #ifdef JACK_MONITOR @@ -571,21 +619,21 @@ int JackBoomerDriver::Read() #endif audio_errinfo ei_in; - ssize_t count = ::read(fInFD, fInputBuffer, fInputBufferSize); + ssize_t count = ::read(fDriver->fInFD, fDriver->fInputBuffer, fDriver->fInputBufferSize); #ifdef JACK_MONITOR - if (count > 0 && count != (int)fInputBufferSize) - jack_log("JackBoomerDriver::Read count = %ld", count / (fSampleSize * fCaptureChannels)); + if (count > 0 && count != (int)fDriver->fInputBufferSize) + jack_log("JackBoomerDriverInput::Execute count = %ld", count / (fDriver->fSampleSize * fDriver->fCaptureChannels)); gCycleTable.fTable[gCycleReadCount].fAfterRead = GetMicroSeconds(); #endif // XRun detection - if (ioctl(fInFD, SNDCTL_DSP_GETERROR, &ei_in) == 0) { + if (ioctl(fDriver->fInFD, SNDCTL_DSP_GETERROR, &ei_in) == 0) { if (ei_in.rec_overruns > 0 ) { - jack_error("JackBoomerDriver::Read overruns"); + jack_error("JackBoomerDriverInput::Execute overruns"); jack_time_t cur_time = GetMicroSeconds(); - NotifyXRun(cur_time, float(cur_time - fBeginDateUst)); // Better this value than nothing... + fDriver->NotifyXRun(cur_time, float(cur_time - fDriver->fBeginDateUst)); // Better this value than nothing... } if (ei_in.rec_errorcount > 0 && ei_in.rec_lasterror != 0) { @@ -594,18 +642,16 @@ int JackBoomerDriver::Read() } if (count < 0) { - jack_log("JackBoomerDriver::Read error = %s", strerror(errno)); - return -1; - } else if (count < (int)fInputBufferSize) { - jack_error("JackBoomerDriver::Read error bytes read = %ld", count); - return -1; + jack_log("JackBoomerDriverInput::Execute error = %s", strerror(errno)); + } else if (count < (int)fDriver->fInputBufferSize) { + jack_error("JackBoomerDriverInput::Execute error bytes read = %ld", count); } else { // Keep begin cycle time - JackDriver::CycleTakeBeginTime(); - for (int i = 0; i < fCaptureChannels; i++) { - if (fGraphManager->GetConnectionsNum(fCapturePortList[i]) > 0) { - CopyAndConvertIn(GetInputBuffer(i), fInputBuffer, fEngineControl->fBufferSize, i, fCaptureChannels, fBits); + fDriver->CycleTakeBeginTime(); + for (int i = 0; i < fDriver->fCaptureChannels; i++) { + if (fDriver->fGraphManager->GetConnectionsNum(fDriver->fCapturePortList[i]) > 0) { + CopyAndConvertIn(fDriver->GetInputBuffer(i), fDriver->fInputBuffer, fDriver->fEngineControl->fBufferSize, i, fDriver->fCaptureChannels, fDriver->fBits); } } @@ -613,29 +659,17 @@ int JackBoomerDriver::Read() gCycleTable.fTable[gCycleReadCount].fAfterReadConvert = GetMicroSeconds(); gCycleReadCount = (gCycleReadCount == CYCLE_POINTS - 1) ? gCycleReadCount: gCycleReadCount + 1; #endif - - return 0; } -} -int JackBoomerDriver::Write() -{ - for (int i = 0; i < fPlaybackChannels; i++) { - if (fGraphManager->GetConnectionsNum(fPlaybackPortList[i]) > 0) { - if (jack_ringbuffer_write(fRingBuffer[i], (char*)GetOutputBuffer(i), fOutputBufferSize) < fOutputBufferSize) { - jack_error("JackBoomerDriver::Write ringbuffer full"); - } - } - } - - return 0; + fDriver->SynchronizeRead(); + return true; } -bool JackBoomerDriver::Init() +bool JackBoomerDriver::JackBoomerDriverOutput::Init() { - if (IsRealTime()) { - jack_log("JackBoomerDriver::Init IsRealTime"); - if (fThread.AcquireRealTime(GetEngineControl()->fServerPriority) < 0) { + if (fDriver->IsRealTime()) { + jack_log("JackBoomerDriverOutput::Init IsRealTime"); + if (fDriver->fOutputThread.AcquireRealTime(GetEngineControl()->fServerPriority) < 0) { jack_error("AcquireRealTime error"); } else { set_threaded_log_function(); @@ -643,61 +677,40 @@ bool JackBoomerDriver::Init() } // Maybe necessary to write an empty output buffer first time : see http://manuals.opensound.com/developer/fulldup.c.html - memset(fOutputBuffer, 0, fOutputBufferSize); + memset(fDriver->fOutputBuffer, 0, fDriver->fOutputBufferSize); // Prefill ouput buffer - if (fOutFD > 0) { - for (int i = 0; i < fNperiods; i++) { - ssize_t count = ::write(fOutFD, fOutputBuffer, fOutputBufferSize); - if (count < (int)fOutputBufferSize) { + if (fDriver->fOutFD > 0) { + for (int i = 0; i < fDriver->fNperiods; i++) { + ssize_t count = ::write(fDriver->fOutFD, fDriver->fOutputBuffer, fDriver->fOutputBufferSize); + if (count < (int)fDriver->fOutputBufferSize) { jack_error("JackBoomerDriver::Write error bytes written = %ld", count); } } int delay; - if (ioctl(fOutFD, SNDCTL_DSP_GETODELAY, &delay) == -1) { + if (ioctl(fDriver->fOutFD, SNDCTL_DSP_GETODELAY, &delay) == -1) { jack_error("JackBoomerDriver::Write error get out delay : %s@%i, errno = %d", __FILE__, __LINE__, errno); } - delay /= fSampleSize * fPlaybackChannels; + delay /= fDriver->fSampleSize * fDriver->fPlaybackChannels; jack_info("JackBoomerDriver::Write output latency frames = %ld", delay); } return true; } -bool JackBoomerDriver::Execute() +bool JackBoomerDriver::JackBoomerDriverOutput::Execute() { - memset(fOutputBuffer, 0, fOutputBufferSize); + memset(fDriver->fOutputBuffer, 0, fDriver->fOutputBufferSize); #ifdef JACK_MONITOR gCycleTable.fTable[gCycleWriteCount].fBeforeWriteConvert = GetMicroSeconds(); #endif - for (int i = 0; i < fPlaybackChannels; i++) { - if (fGraphManager->GetConnectionsNum(fPlaybackPortList[i]) > 0) { - - jack_ringbuffer_data_t ring_buffer_data[2]; - jack_ringbuffer_get_read_vector(fRingBuffer[i], ring_buffer_data); - - unsigned int available_frames = (ring_buffer_data[0].len + ring_buffer_data[1].len) / sizeof(float); - jack_log("Output available = %ld", available_frames); - - unsigned int needed_bytes = fOutputBufferSize; - float* output = (float*)fOutputBuffer; - - for (int j = 0; j < 2; j++) { - unsigned int consumed_bytes = std::min(needed_bytes, ring_buffer_data[j].len); - CopyAndConvertOut(output, (float*)ring_buffer_data[j].buf, consumed_bytes / sizeof(float), i, fPlaybackChannels, fBits); - output += consumed_bytes / sizeof(float); - needed_bytes -= consumed_bytes; - } - - if (needed_bytes > 0) { - jack_error("JackBoomerDriver::Execute missing bytes = %ld", needed_bytes); - } - - jack_ringbuffer_read_advance(fRingBuffer[i], fOutputBufferSize - needed_bytes); + for (int i = 0; i < fDriver->fPlaybackChannels; i++) { + if (fDriver->fGraphManager->GetConnectionsNum(fDriver->fPlaybackPortList[i]) > 0) { + CopyAndConvertOut(fDriver->fOutputBuffer, fDriver->GetOutputBuffer(i), fDriver->fEngineControl->fBufferSize, i, fDriver->fPlaybackChannels, fDriver->fBits); } } @@ -705,23 +718,23 @@ bool JackBoomerDriver::Execute() gCycleTable.fTable[gCycleWriteCount].fBeforeWrite = GetMicroSeconds(); #endif - ssize_t count = ::write(fOutFD, fOutputBuffer, fOutputBufferSize); + ssize_t count = ::write(fDriver->fOutFD, fDriver->fOutputBuffer, fDriver->fOutputBufferSize); #ifdef JACK_MONITOR - if (count > 0 && count != (int)fOutputBufferSize) - jack_log("JackBoomerDriver::Execute count = %ld", count / (fSampleSize * fPlaybackChannels)); + if (count > 0 && count != (int)fDriver->fOutputBufferSize) + jack_log("JackBoomerDriverOutput::Execute count = %ld", count / (fDriver->fSampleSize * fDriver->fPlaybackChannels)); gCycleTable.fTable[gCycleWriteCount].fAfterWrite = GetMicroSeconds(); gCycleWriteCount = (gCycleWriteCount == CYCLE_POINTS - 1) ? gCycleWriteCount: gCycleWriteCount + 1; #endif // XRun detection audio_errinfo ei_out; - if (ioctl(fOutFD, SNDCTL_DSP_GETERROR, &ei_out) == 0) { + if (ioctl(fDriver->fOutFD, SNDCTL_DSP_GETERROR, &ei_out) == 0) { if (ei_out.play_underruns > 0) { - jack_error("JackBoomerDriver::Execute underruns"); + jack_error("JackBoomerDriverOutput::Execute underruns"); jack_time_t cur_time = GetMicroSeconds(); - NotifyXRun(cur_time, float(cur_time - fBeginDateUst)); // Better this value than nothing... + fDriver->NotifyXRun(cur_time, float(cur_time - fDriver->fBeginDateUst)); // Better this value than nothing... } if (ei_out.play_errorcount > 0 && ei_out.play_lasterror != 0) { @@ -730,14 +743,28 @@ bool JackBoomerDriver::Execute() } if (count < 0) { - jack_log("JackBoomerDriver::Execute error = %s", strerror(errno)); - } else if (count < (int)fOutputBufferSize) { - jack_error("JackBoomerDriver::Execute error bytes written = %ld", count); + jack_log("JackBoomerDriverOutput::Execute error = %s", strerror(errno)); + } else if (count < (int)fDriver->fOutputBufferSize) { + jack_error("JackBoomerDriverOutput::Execute error bytes written = %ld", count); } + fDriver->SynchronizeWrite(); return true; } +void JackBoomerDriver::SynchronizeRead() +{ + sem_wait(&fWriteSema); + Process(); + sem_post(&fReadSema); +} + +void JackBoomerDriver::SynchronizeWrite() +{ + sem_post(&fWriteSema); + sem_wait(&fReadSema); +} + int JackBoomerDriver::SetBufferSize(jack_nframes_t buffer_size) { CloseAux(); @@ -966,14 +993,13 @@ EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine } Jack::JackBoomerDriver* boomer_driver = new Jack::JackBoomerDriver("system", "boomer", engine, table); - Jack::JackDriverClientInterface* threaded_driver = new Jack::JackThreadedDriver(boomer_driver); // Special open for Boomer driver... if (boomer_driver->Open(frames_per_interrupt, nperiods, srate, capture, playback, chan_in, chan_out, excl, monitor, capture_pcm_name, playback_pcm_name, systemic_input_latency, systemic_output_latency, bits, ignorehwbuf) == 0) { - return threaded_driver; + return boomer_driver; } else { - delete threaded_driver; // Delete the decorated driver + delete boomer_driver; // Delete the driver return NULL; } } diff --git a/solaris/oss/JackBoomerDriver.h b/solaris/oss/JackBoomerDriver.h index 3bf2d1a1..f688c7e1 100644 --- a/solaris/oss/JackBoomerDriver.h +++ b/solaris/oss/JackBoomerDriver.h @@ -23,7 +23,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "JackAudioDriver.h" #include "JackPlatformPlug.h" #include "ringbuffer.h" -//#include "JackThread.h" +#include namespace Jack { @@ -43,13 +43,47 @@ typedef jack_default_audio_sample_t jack_sample_t; \brief The Boomer driver. */ -class JackBoomerDriver : public JackAudioDriver, public JackRunnableInterface +class JackBoomerDriver : public JackAudioDriver { enum { kRead = 1, kWrite = 2, kReadWrite = 3 }; private: + + class JackBoomerDriverInput : public JackRunnableInterface { + + private: + + JackBoomerDriver* fDriver; + + public: + + JackBoomerDriverInput(JackBoomerDriver* driver): fDriver(driver) + {} + ~JackBoomerDriverInput() + {} + + bool Init(); + bool Execute(); + }; + + class JackBoomerDriverOutput : public JackRunnableInterface { + + private: + JackBoomerDriver* fDriver; + + public: + + JackBoomerDriverOutput(JackBoomerDriver* driver): fDriver(driver) + {} + ~JackBoomerDriverOutput() + {} + + bool Init(); + bool Execute(); + }; + int fInFD; int fOutFD; @@ -66,8 +100,15 @@ class JackBoomerDriver : public JackAudioDriver, public JackRunnableInterface void* fInputBuffer; void* fOutputBuffer; - jack_ringbuffer_t** fRingBuffer; - JackThread fThread; + + sem_t fReadSema; + sem_t fWriteSema; + + JackThread fInputThread; + JackThread fOutputThread; + + JackBoomerDriverInput fInputHandler; + JackBoomerDriverOutput fOutputHandler; int OpenInput(); int OpenOutput(); @@ -75,21 +116,14 @@ class JackBoomerDriver : public JackAudioDriver, public JackRunnableInterface void CloseAux(); void SetSampleFormat(); void DisplayDeviceInfo(); + void SynchronizeRead(); + void SynchronizeWrite(); public: - JackBoomerDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table) - : JackAudioDriver(name, alias, engine, table), - fInFD(-1), fOutFD(-1), fBits(0), - fSampleFormat(0), fNperiods(0), fRWMode(0), fExcl(false), fIgnoreHW(true), - fInputBufferSize(0), fOutputBufferSize(0), - fInputBuffer(NULL), fOutputBuffer(NULL), - fRingBuffer(NULL), fThread(this) - {} - - virtual ~JackBoomerDriver() - {} - + JackBoomerDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table); + virtual ~JackBoomerDriver(); + int Open(jack_nframes_t frames_per_cycle, int user_nperiods, jack_nframes_t rate, From c970e7e0fe57d6879afaec55220c24b04bef33d7 Mon Sep 17 00:00:00 2001 From: sletz Date: Sat, 18 Jul 2009 07:54:18 +0000 Subject: [PATCH 20/35] JackLoopbackDriver reborn as a dynamicalled loadable separated backend. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3605 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 8 +++- common/JackLoopbackDriver.cpp | 69 +++++++++++++++++++++++++++++++++-- macosx/wscript | 2 + 3 files changed, 74 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f1e92e6..d1c41b8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,15 +25,19 @@ Paul Davis Jackdmp changes log --------------------------- +2009-07-17 Stephane Letz + + * JackLoopbackDriver reborn as a dynamicalled loadable separated backend. + 2009-07-17 Stephane Letz * Big rewrite of Solaris boomer driver, seems to work in duplex mode at least. -2009-07-17 Stephane Letz +2009-07-16 Stephane Letz * In combined --dbus and --classic compilation code, use PulseAudio acquire/release code. -2009-07-16 Stephane Letz +2009-07-15 Stephane Letz * Rename JackDriver::Init method to JackDriver::Initialize (to avoid confusion with JackThread::Init method). * Update Solaris boomer driver. diff --git a/common/JackLoopbackDriver.cpp b/common/JackLoopbackDriver.cpp index 3c9df5b0..38cba8ea 100644 --- a/common/JackLoopbackDriver.cpp +++ b/common/JackLoopbackDriver.cpp @@ -19,7 +19,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "JackSystemDeps.h" +#include "JackServerGlobals.h" #include "JackLoopbackDriver.h" +#include "JackDriverLoader.h" #include "JackEngineControl.h" #include "JackGraphManager.h" #include "JackError.h" @@ -31,8 +33,6 @@ namespace Jack int JackLoopbackDriver::Process() { - assert(fCaptureChannels == fPlaybackChannels); - // Loopback copy for (int i = 0; i < fCaptureChannels; i++) { memcpy(GetInputBuffer(i), GetOutputBuffer(i), sizeof(float) * fEngineControl->fBufferSize); @@ -40,7 +40,7 @@ int JackLoopbackDriver::Process() fGraphManager->ResumeRefNum(&fClientControl, fSynchroTable); // Signal all clients if (fEngineControl->fSyncMode) { - if (fGraphManager->SuspendRefNum(&fClientControl, fSynchroTable, fEngineControl->fTimeOutUsecs) < 0) { + if (fGraphManager->SuspendRefNum(&fClientControl, fSynchroTable, DRIVER_TIMEOUT_FACTOR * fEngineControl->fTimeOutUsecs) < 0) { jack_error("JackLoopbackDriver::ProcessSync SuspendRefNum error"); return -1; } @@ -49,3 +49,66 @@ int JackLoopbackDriver::Process() } } // end of namespace + +#ifdef __cplusplus +extern "C" +{ +#endif + + SERVER_EXPORT jack_driver_desc_t * driver_get_descriptor() + { + jack_driver_desc_t * desc; + unsigned int i; + + desc = (jack_driver_desc_t*)calloc (1, sizeof (jack_driver_desc_t)); + strcpy(desc->name, "loopback"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1 + strcpy(desc->desc, "Loppback backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1 + + desc->nparams = 1; + 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; + strcpy(desc->params[i].short_desc, "Loopback ports"); + strcpy(desc->params[i].long_desc, desc->params[i].short_desc); + + return desc; + } + + SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine* engine, Jack::JackSynchro* table, const JSList* params) + { + const JSList * node; + const jack_driver_param_t * param; + int channels = 2; + + for (node = params; node; node = jack_slist_next (node)) { + param = (const jack_driver_param_t *) node->data; + + switch (param->character) { + + case 'c': + channels = param->value.ui; + break; + } + } + + Jack::JackDriverClientInterface* driver = new Jack::JackLoopbackDriver(engine, table); + if (driver->Open(Jack::JackServerGlobals::fInstance->GetEngineControl()->fBufferSize, + Jack::JackServerGlobals::fInstance->GetEngineControl()->fSampleRate, + 1, 1, + channels, channels, + false, + "loopback", "loopback", 0, 0) == 0) { + return driver; + } else { + delete driver; + return NULL; + } + } + +#ifdef __cplusplus +} +#endif diff --git a/macosx/wscript b/macosx/wscript index ade18b4a..843874bc 100644 --- a/macosx/wscript +++ b/macosx/wscript @@ -58,6 +58,8 @@ def build(bld): create_jack_driver_obj(bld, 'dummy', '../common/JackDummyDriver.cpp') + create_jack_driver_obj(bld, 'loopback', '../common/JackLoopbackDriver.cpp') + create_jack_audio_driver_obj(bld, 'coreaudio', 'coreaudio/JackCoreAudioDriver.cpp') create_jack_midi_driver_obj(bld, 'coremidi', 'coremidi/JackCoreMidiDriver.cpp') From e3b0f6783521bd90e0ddc3295fc55c40dc05be85 Mon Sep 17 00:00:00 2001 From: sletz Date: Sat, 18 Jul 2009 09:33:49 +0000 Subject: [PATCH 21/35] -L paramater for loopback backend activated again in jackd. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3606 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 3 ++- common/JackLoopbackDriver.cpp | 4 ++-- common/Jackdmp.cpp | 34 ++++++++++++++++++++++++---------- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index d1c41b8d..892bee00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,7 +27,8 @@ Paul Davis 2009-07-17 Stephane Letz - * JackLoopbackDriver reborn as a dynamicalled loadable separated backend. + * JackLoopbackDriver reborn as a dynamicalled loadable separated backend. + * -L paramater for loopback backend activated again in jackd. 2009-07-17 Stephane Letz diff --git a/common/JackLoopbackDriver.cpp b/common/JackLoopbackDriver.cpp index 38cba8ea..7d3337c9 100644 --- a/common/JackLoopbackDriver.cpp +++ b/common/JackLoopbackDriver.cpp @@ -62,7 +62,7 @@ extern "C" desc = (jack_driver_desc_t*)calloc (1, sizeof (jack_driver_desc_t)); strcpy(desc->name, "loopback"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1 - strcpy(desc->desc, "Loppback backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1 + strcpy(desc->desc, "Loopback backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1 desc->nparams = 1; desc->params = (jack_driver_param_desc_t*)calloc (desc->nparams, sizeof (jack_driver_param_desc_t)); @@ -72,7 +72,7 @@ extern "C" desc->params[i].character = 'c'; desc->params[i].type = JackDriverParamInt; desc->params[i].value.ui = 0; - strcpy(desc->params[i].short_desc, "Loopback ports"); + strcpy(desc->params[i].short_desc, "Maximum number of loopback ports"); strcpy(desc->params[i].long_desc, desc->params[i].short_desc); return desc; diff --git a/common/Jackdmp.cpp b/common/Jackdmp.cpp index 7b7859b1..53a10bb0 100644 --- a/common/Jackdmp.cpp +++ b/common/Jackdmp.cpp @@ -97,6 +97,7 @@ static void usage(FILE* file) "usage: jackdmp [ --realtime OR -R [ --realtime-priority OR -P priority ] ]\n" " [ --name OR -n server-name ]\n" " [ --timeout OR -t client-timeout-in-msecs ]\n" + " [ --loopback OR -L loopback-port-number ]\n" " [ --midi OR -X midi-driver ]\n" " [ --verbose OR -v ]\n" #ifdef __linux__ @@ -161,17 +162,19 @@ int main(int argc, char* argv[]) const char* server_name = "default"; jackctl_driver_t * audio_driver_ctl; jackctl_driver_t * midi_driver_ctl; + jackctl_driver_t * loopback_driver_ctl; #ifdef __linux__ - const char *options = "-ad:X:P:uvrshVRL:STFl:t:mn:p:c:"; + const char *options = "-ad:X:P:uvrshVRL:STFl:t:mn:p:c:L:"; #else - const char *options = "-ad:X:P:uvrshVRL:STFl:t:mn:p:"; + const char *options = "-ad:X:P:uvrshVRL:STFl:t:mn:p:L:"; #endif struct option long_options[] = { #ifdef __linux__ { "clock-source", 1, 0, 'c' }, #endif + { "loopback-driver", 1, 0, 'L' }, { "audio-driver", 1, 0, 'd' }, { "midi-driver", 1, 0, 'X' }, { "verbose", 0, 0, 'v' }, @@ -205,6 +208,7 @@ int main(int argc, char* argv[]) int port_max = 512; int do_mlock = 1; int do_unlock = 0; + int loopback = 0; bool show_version = false; sigset_t signals; jackctl_parameter_t* param; @@ -253,6 +257,10 @@ int main(int argc, char* argv[]) seen_audio_driver = true; audio_driver_name = optarg; break; + + case 'L': + loopback = atoi(optarg); + break; case 'X': seen_midi_driver = true; @@ -324,14 +332,6 @@ int main(int argc, char* argv[]) } break; - case 'L': - param = jackctl_get_parameter(server_parameters, "loopback-ports"); - if (param != NULL) { - value.ui = atoi(optarg); - jackctl_parameter_set_value(param, &value); - } - break; - case 'T': param = jackctl_get_parameter(server_parameters, "temporary"); if (param != NULL) { @@ -422,6 +422,20 @@ int main(int argc, char* argv[]) jackctl_server_add_slave(server_ctl, midi_driver_ctl); } + + // Loopback driver + if (loopback > 0) { + loopback_driver_ctl = jackctl_server_get_driver(server_ctl, "loopback"); + if (loopback_driver_ctl != NULL) { + const JSList * loopback_parameters = jackctl_driver_get_parameters(loopback_driver_ctl); + param = jackctl_get_parameter(loopback_parameters, "channels"); + if (param != NULL) { + value.ui = loopback; + jackctl_parameter_set_value(param, &value); + } + jackctl_server_add_slave(server_ctl, loopback_driver_ctl); + } + } notify_server_start(server_name); From 4fa9498426a53938ef2cb8a4474729ad84df0db5 Mon Sep 17 00:00:00 2001 From: sletz Date: Sun, 19 Jul 2009 08:25:32 +0000 Subject: [PATCH 22/35] Complete JackWeakAPI.cpp git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3607 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/JackWeakAPI.cpp | 96 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 85 insertions(+), 11 deletions(-) diff --git a/common/JackWeakAPI.cpp b/common/JackWeakAPI.cpp index 2715922b..4888a92a 100644 --- a/common/JackWeakAPI.cpp +++ b/common/JackWeakAPI.cpp @@ -152,17 +152,91 @@ DECL_FUNCTION(const char**, jack_port_get_connections, (const jack_port_t *port) DECL_FUNCTION(const char**, jack_port_get_all_connections, (const jack_port_t *port), (port)); DECL_FUNCTION(int, jack_port_tie, (jack_port_t *src, jack_port_t *dst), (src, dst)); DECL_FUNCTION(int, jack_port_untie, (jack_port_t *port), (port)); - - -DECL_FUNCTION(jack_nframes_t, jack_get_buffer_size, (jack_client_t *client), (client)); +DECL_FUNCTION(jack_nframes_t, jack_port_get_latency, (jack_port_t *port)); +DECL_FUNCTION(jack_nframes_t, jack_port_get_total_latency ,(jack_client_t *), (jack_port_t *port)); +DECL_VOID_FUNCTION(jack_port_set_latency, (jack_port_t *), (jack_nframes_t)); +DECL_FUNCTION(int, jack_recompute_total_latency, (jack_client_t*), (jack_port_t* port)); +DECL_FUNCTION(int, jack_recompute_total_latencies, (jack_client_t*)); + +DECL_FUNCTION(int, jack_port_set_name, (jack_port_t *port), (const char *port_name)); +DECL_FUNCTION(int, jack_port_set_alias, (jack_port_t *port), (const char *alias)); +DECL_FUNCTION(int, jack_port_unset_alias, (jack_port_t *port), (const char *alias)); +DECL_FUNCTION(int, jack_port_get_aliases, (const jack_port_t *port), (char* const aliases[2])); +DECL_FUNCTION(int, jack_port_request_monitor, (jack_port_t *port), (int onoff)); +DECL_FUNCTION(int, jack_port_request_monitor_by_name, (jack_client_t *client), (const char *port_name), (int onoff)); +DECL_FUNCTION(int, jack_port_ensure_monitor, (jack_port_t *port), (int onoff)); +DECL_FUNCTION(int, jack_port_monitoring_input, (jack_port_t *port)); +DECL_FUNCTION(int, jack_connect, (jack_client_t *), (const char *source_port), (const char *destination_port)); +DECL_FUNCTION(int, jack_disconnect, (jack_client_t *), (const char *source_port), (const char *destination_port)); +DECL_FUNCTION(int, jack_port_disconnect, (jack_client_t *), (jack_port_t *)); +DECL_FUNCTION(int, jack_port_name_size,(void)); +DECL_FUNCTION(int, jack_port_type_size,(void)); + DECL_FUNCTION(jack_nframes_t, jack_get_sample_rate, (jack_client_t *client), (client)); -DECL_FUNCTION(jack_nframes_t, jack_port_get_total_latency, (jack_client_t *client, jack_port_t *port), (client, port)); -DECL_VOID_FUNCTION(jack_set_error_function, (void (*func)(const char *)), (func)); - - +DECL_FUNCTION(jack_nframes_t, jack_get_buffer_size, (jack_client_t *client), (client)); DECL_FUNCTION(const char**, jack_get_ports, (jack_client_t *client, const char *port_name_pattern, const char * type_name_pattern, unsigned long flags), (client, port_name_pattern, type_name_pattern, flags)); -DECL_FUNCTION(int, jack_connect, (jack_client_t *client, const char *source_port, const char *destination_port), (client, source_port, destination_port)); -DECL_FUNCTION(int, jack_set_port_connect_callback, (jack_client_t *client, JackPortConnectCallback connect_callback, void *arg), - (client, connect_callback, arg)); -DECL_FUNCTION(jack_port_t *, jack_port_by_id, (jack_client_t *client, jack_port_id_t port_id), (client, port_id)); +DECL_FUNCTION(jack_port_t *, jack_port_by_name, (jack_client_t *), (const char *port_name)); +DECL_FUNCTION(jack_port_t *, jack_port_by_id, (jack_client_t *client), (jack_port_id_t port_id)); + +DECL_FUNCTION(int, jack_engine_takeover_timebase, (jack_client_t *)); +DECL_FUNCTION(jack_nframes_t, jack_frames_since_cycle_start, (const jack_client_t *)); +DECL_FUNCTION(jack_time_t, jack_get_time()); +DECL_FUNCTION(jack_nframes_t, jack_time_to_frames, (const jack_client_t *client), (jack_time_t time)); +DECL_FUNCTION(jack_time_t, jack_frames_to_time, (const jack_client_t *client), (jack_nframes_t frames)); +DECL_FUNCTION(jack_nframes_t, jack_frame_time, (const jack_client_t *)); +DECL_FUNCTION(jack_nframes_t, jack_last_frame_time, (const jack_client_t *client)); +DECL_FUNCTION(float, jack_cpu_load, (jack_client_t *client)); +DECL_FUNCTION(pthread_t, jack_client_thread_id, (jack_client_t *)); +DECL_VOID_FUNCTION(jack_set_error_function, (print_function)); +DECL_VOID_FUNCTION(jack_set_info_function, (print_function)); + +DECL_FUNCTION(float, jack_get_max_delayed_usecs, (jack_client_t *client)); +DECL_FUNCTION(float, jack_get_xrun_delayed_usecs, (jack_client_t *client)); +DECL_VOID_FUNCTION(jack_reset_max_delayed_usecs, (jack_client_t *client)); + +DECL_FUNCTION(int, jack_release_timebase, (jack_client_t *client)); +DECL_FUNCTION(int, jack_set_sync_callback, (jack_client_t *client, (JackSyncCallback sync_callback), (void *arg)); +DECL_FUNCTION(int, jack_set_sync_timeout, (jack_client_t *client), (jack_time_t timeout)); +DECL_FUNCTION(int, jack_set_timebase_callback, (jack_client_t *client), (int conditional), (JackTimebaseCallback timebase_callback), (void *arg)); +DECL_FUNCTION(int, jack_transport_locate, (jack_client_t *client), (jack_nframes_t frame)); +DECL_FUNCTION(jack_transport_state_t, jack_transport_query, (const jack_client_t *client), (jack_position_t *pos)); +DECL_FUNCTION(jack_nframes_t, jack_get_current_transport_frame, (const jack_client_t *client)); +DECL_FUNCTION(int, jack_transport_reposition, (jack_client_t *client), (jack_position_t *pos)); +DECL_VOID_FUNCTION(jack_transport_start, (jack_client_t *client)); +DECL_VOID_FUNCTION(jack_transport_stop, (jack_client_t *client)); +DECL_VOID_FUNCTION(jack_get_transport_info, (jack_client_t *client), (jack_transport_info_t *tinfo)); +DECL_VOID_FUNCTION(jack_set_transport_info, (jack_client_t *client), (jack_transport_info_t *tinfo)); + +DECL_FUNCTION(int, jack_client_real_time_priority, (jack_client_t*)); +DECL_FUNCTION(int, jack_client_max_real_time_priority, (jack_client_t*)); +DECL_FUNCTION(int, jack_acquire_real_time_scheduling, (pthread_t thread), (int priority)); +DECL_FUNCTION(int, jack_client_create_thread, (jack_client_t* client), + (pthread_t *thread), + (int priority), + (int realtime), // boolean + (thread_routine routine), + (void *arg)); +DECL_FUNCTION(int, jack_drop_real_time_scheduling, (pthread_t thread)); + +DECL_FUNCTION(int, jack_client_stop_thread, (jack_client_t* client), (pthread_t thread)); +DECL_FUNCTION(int, jack_client_kill_thread, (jack_client_t* client), (pthread_t thread)); +#ifndef WIN32 +DECL_VOID_FUNCTION(jack_set_thread_creator, (jack_thread_creator_t jtc)); +#endif +DECL_FUNCTION(char *, jack_get_internal_client_name, (jack_client_t *client, (jack_intclient_t intclient)); +DECL_FUNCTION(jack_intclient_t, jack_internal_client_handle, (jack_client_t *client), (const char *client_name), (jack_status_t *status)); +DECL_FUNCTION(jack_intclient_t, jack_internal_client_load, (jack_client_t *client), (const char *client_name), (jack_options_t options), (jack_status_t *status), ...)); + +DECL_FUNCTION(jack_status_t, jack_internal_client_unload, (jack_client_t *client), jack_intclient_t intclient)); +DECL_VOID_FUNCTION(jack_free, (void* ptr)); + +// MIDI + +DECL_FUNCTION(jack_nframes_t, jack_midi_get_event_count, (void* port_buffer)); +DECL_FUNCTION(int jack_midi_event_get(jack_midi_event_t* event, void* port_buffer, jack_nframes_t event_index); +DECL_VOID_FUNCTION(jack_midi_clear_buffer, (void* port_buffer)); +DECL_FUNCTION(size_t, jack_midi_max_event_size, (void* port_buffer)); +DECL_FUNCTION(jack_midi_data_t*, jack_midi_event_reserve, (void* port_buffer), (jack_nframes_t time), (size_t data_size)); +DECL_FUNCTIO(int jack_midi_event_write, (void* port_buffer), (jack_nframes_t time), (const jack_midi_data_t* data), (size_t data_size)); +DECL_FUNCTION(jack_nframes_t, jack_midi_get_lost_event_count, (void* port_buffer)); From e4c2f68f1bf456abf80381495442e05746882372 Mon Sep 17 00:00:00 2001 From: sletz Date: Mon, 20 Jul 2009 09:44:20 +0000 Subject: [PATCH 23/35] Compile loopback backend in Linux and Solaris versions, update OSX project. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3608 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/JackLoopbackDriver.cpp | 11 +- linux/wscript | 1 + macosx/Jackdmp.xcodeproj/project.pbxproj | 436 ++++++++++++++++++++++- macosx/install_jackdmp | 1 + solaris/wscript | 1 + 5 files changed, 425 insertions(+), 25 deletions(-) diff --git a/common/JackLoopbackDriver.cpp b/common/JackLoopbackDriver.cpp index 7d3337c9..c91c355a 100644 --- a/common/JackLoopbackDriver.cpp +++ b/common/JackLoopbackDriver.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "JackSystemDeps.h" -#include "JackServerGlobals.h" +#include "JackGlobals.h" #include "JackLoopbackDriver.h" #include "JackDriverLoader.h" #include "JackEngineControl.h" @@ -94,14 +94,9 @@ extern "C" break; } } - + Jack::JackDriverClientInterface* driver = new Jack::JackLoopbackDriver(engine, table); - if (driver->Open(Jack::JackServerGlobals::fInstance->GetEngineControl()->fBufferSize, - Jack::JackServerGlobals::fInstance->GetEngineControl()->fSampleRate, - 1, 1, - channels, channels, - false, - "loopback", "loopback", 0, 0) == 0) { + if (driver->Open(Jack::GetEngineControl()->fBufferSize, Jack::GetEngineControl()->fSampleRate, 1, 1, channels, channels, false, "loopback", "loopback", 0, 0) == 0) { return driver; } else { delete driver; diff --git a/linux/wscript b/linux/wscript index a181c223..8e12b8ad 100644 --- a/linux/wscript +++ b/linux/wscript @@ -63,3 +63,4 @@ def build(bld): create_jack_driver_obj(bld, 'net', '../common/JackNetDriver.cpp') + create_jack_driver_obj(bld, 'loopback', '../common/JackLoopbackDriver.cpp') diff --git a/macosx/Jackdmp.xcodeproj/project.pbxproj b/macosx/Jackdmp.xcodeproj/project.pbxproj index c5a75585..7744d2ec 100644 --- a/macosx/Jackdmp.xcodeproj/project.pbxproj +++ b/macosx/Jackdmp.xcodeproj/project.pbxproj @@ -44,6 +44,7 @@ 4BFA83380DF6AB540087B4E1 /* PBXTargetDependency */, 4BFA833A0DF6AB540087B4E1 /* PBXTargetDependency */, 4BFA833C0DF6AB540087B4E1 /* PBXTargetDependency */, + 4B43A8E91014618D00E52943 /* PBXTargetDependency */, ); name = "All Universal 32/64 bits"; productName = All; @@ -61,6 +62,7 @@ 4BF339280F8B87800080FB5B /* PBXTargetDependency */, 4B699DBC097D421700A18468 /* PBXTargetDependency */, BA222AF20DC883F3001A17F4 /* PBXTargetDependency */, + 4B43A8CD1014607100E52943 /* PBXTargetDependency */, 4BD624D30CBCF55700DE782F /* PBXTargetDependency */, BA222AF00DC883EF001A17F4 /* PBXTargetDependency */, 4B19B32C0E23636E00DD4A82 /* PBXTargetDependency */, @@ -292,6 +294,10 @@ 4B363F3E0DEB0C31001F72D9 /* showtime.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B363F3D0DEB0C31001F72D9 /* showtime.c */; }; 4B363F760DEB0D7D001F72D9 /* impulse_grabber.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B363F750DEB0D7D001F72D9 /* impulse_grabber.c */; }; 4B3F49080AD8503300491C6E /* cpu.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B3F49070AD8503300491C6E /* cpu.c */; }; + 4B43A8CA1014605000E52943 /* JackLoopbackDriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B43A8C81014605000E52943 /* JackLoopbackDriver.cpp */; }; + 4B43A8CB1014605000E52943 /* JackLoopbackDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B43A8C91014605000E52943 /* JackLoopbackDriver.h */; }; + 4B43A8DF1014615800E52943 /* JackLoopbackDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B43A8C91014605000E52943 /* JackLoopbackDriver.h */; }; + 4B43A8E11014615800E52943 /* JackLoopbackDriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B43A8C81014605000E52943 /* JackLoopbackDriver.cpp */; }; 4B4CA9750E02CF9600F4BFDA /* JackRestartThreadedDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B4CA9730E02CF9600F4BFDA /* JackRestartThreadedDriver.h */; }; 4B4CA9760E02CF9600F4BFDA /* JackRestartThreadedDriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B4CA9740E02CF9600F4BFDA /* JackRestartThreadedDriver.cpp */; }; 4B4CA9770E02CF9600F4BFDA /* JackRestartThreadedDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B4CA9730E02CF9600F4BFDA /* JackRestartThreadedDriver.h */; }; @@ -867,6 +873,20 @@ remoteGlobalIDString = 4B363F680DEB0D4E001F72D9; remoteInfo = "jack_impulse_grabber Universal"; }; + 4B43A8CC1014607100E52943 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4B43A8B010145F6F00E52943; + remoteInfo = "jack_loopback Universal"; + }; + 4B43A8E81014618D00E52943 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4B43A8DD1014615800E52943; + remoteInfo = "jack_loopback 64 bits"; + }; 4B5A1BCE0CD1CCC80005BF74 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; @@ -1222,6 +1242,10 @@ 4B37C20906DF1FE20016E567 /* latency.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = latency.c; path = /Developer/Examples/CoreAudio/PublicUtility/latency.c; sourceTree = ""; }; 4B3F49070AD8503300491C6E /* cpu.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = cpu.c; path = ../tests/cpu.c; sourceTree = SOURCE_ROOT; }; 4B4259E5076B635E00C1ECE1 /* JackMacEngineRPC.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JackMacEngineRPC.cpp; sourceTree = SOURCE_ROOT; }; + 4B43A8BA10145F6F00E52943 /* jack_loopback.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = jack_loopback.so; sourceTree = BUILT_PRODUCTS_DIR; }; + 4B43A8C81014605000E52943 /* JackLoopbackDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackLoopbackDriver.cpp; path = ../common/JackLoopbackDriver.cpp; sourceTree = SOURCE_ROOT; }; + 4B43A8C91014605000E52943 /* JackLoopbackDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackLoopbackDriver.h; path = ../common/JackLoopbackDriver.h; sourceTree = SOURCE_ROOT; }; + 4B43A8E71014615800E52943 /* jack_loopback.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = jack_loopback.so; sourceTree = BUILT_PRODUCTS_DIR; }; 4B464301076CAC7700E5077C /* Jack-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "Jack-Info.plist"; sourceTree = SOURCE_ROOT; }; 4B4CA9730E02CF9600F4BFDA /* JackRestartThreadedDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JackRestartThreadedDriver.h; path = ../common/JackRestartThreadedDriver.h; sourceTree = SOURCE_ROOT; }; 4B4CA9740E02CF9600F4BFDA /* JackRestartThreadedDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JackRestartThreadedDriver.cpp; path = ../common/JackRestartThreadedDriver.cpp; sourceTree = SOURCE_ROOT; }; @@ -1712,6 +1736,20 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 4B43A8B510145F6F00E52943 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4B43A8E21014615800E52943 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 4B5A1BB50CD1CB9E0005BF74 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -2144,6 +2182,8 @@ 4BDCDBE81001FD2D00B15929 /* netmanager.so */, 4BDCDBFF1001FD7300B15929 /* audioadapter.so */, 4BDCDC251001FDE300B15929 /* netadapter.so */, + 4B43A8BA10145F6F00E52943 /* jack_loopback.so */, + 4B43A8E71014615800E52943 /* jack_loopback.so */, ); name = Products; sourceTree = ""; @@ -2440,6 +2480,8 @@ isa = PBXGroup; children = ( 4B869B3D08C8D21C001CF041 /* driver_interface.h */, + 4B43A8C91014605000E52943 /* JackLoopbackDriver.h */, + 4B43A8C81014605000E52943 /* JackLoopbackDriver.cpp */, 4B869B4208C8D22F001CF041 /* JackDriverLoader.h */, 4B869D7F08C9CB00001CF041 /* JackDriverLoader.cpp */, 4BF8D1B50834EEE400C94B91 /* JackDriver.h */, @@ -3028,6 +3070,22 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 4B43A8B110145F6F00E52943 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 4B43A8CB1014605000E52943 /* JackLoopbackDriver.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4B43A8DE1014615800E52943 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 4B43A8DF1014615800E52943 /* JackLoopbackDriver.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 4B5A1BB20CD1CB9E0005BF74 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -4150,6 +4208,40 @@ productReference = 4B363F720DEB0D4E001F72D9 /* jack_impulse_grabber */; productType = "com.apple.product-type.tool"; }; + 4B43A8B010145F6F00E52943 /* jack_loopback Universal */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4B43A8B610145F6F00E52943 /* Build configuration list for PBXNativeTarget "jack_loopback Universal" */; + buildPhases = ( + 4B43A8B110145F6F00E52943 /* Headers */, + 4B43A8B310145F6F00E52943 /* Sources */, + 4B43A8B510145F6F00E52943 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "jack_loopback Universal"; + productName = jack_coreaudio; + productReference = 4B43A8BA10145F6F00E52943 /* jack_loopback.so */; + productType = "com.apple.product-type.library.dynamic"; + }; + 4B43A8DD1014615800E52943 /* jack_loopback 64 bits */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4B43A8E31014615800E52943 /* Build configuration list for PBXNativeTarget "jack_loopback 64 bits" */; + buildPhases = ( + 4B43A8DE1014615800E52943 /* Headers */, + 4B43A8E01014615800E52943 /* Sources */, + 4B43A8E21014615800E52943 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "jack_loopback 64 bits"; + productName = jack_coreaudio; + productReference = 4B43A8E71014615800E52943 /* jack_loopback.so */; + productType = "com.apple.product-type.library.dynamic"; + }; 4B5A1BB10CD1CB9E0005BF74 /* jack_midiseq Universal */ = { isa = PBXNativeTarget; buildConfigurationList = 4B5A1BB70CD1CB9E0005BF74 /* Build configuration list for PBXNativeTarget "jack_midiseq Universal" */; @@ -4991,6 +5083,7 @@ 4B699D97097D421700A18468 /* jack_coreaudio Universal */, 4B978DB10A31CF4A009E2DD1 /* jack_portaudio Universal */, 4BF339020F8B864B0080FB5B /* jack_coremidi Universal */, + 4B43A8B010145F6F00E52943 /* jack_loopback Universal */, 4B699DA6097D421700A18468 /* jack_dummy Universal */, BA222AC50DC88132001A17F4 /* jack_net Universal */, 4BD623ED0CBCF0F000DE782F /* inprocess Universal */, @@ -5029,12 +5122,13 @@ 4B35C6140D4731D2000DE7AE /* jack_coreaudio 64 bits */, 4B35C61F0D4731D2000DE7AE /* jack_portaudio 64 bits */, 4B35C62A0D4731D2000DE7AE /* jack_dummy 64 bits */, - 4B35C6350D4731D3000DE7AE /* inprocess 64 bits */, + 4B43A8DD1014615800E52943 /* jack_loopback 64 bits */, 4BDCDB931001FB9C00B15929 /* jack_coremidi 64 bits */, 4BDCDBB71001FCC000B15929 /* jack_net 64 bits */, 4BDCDBD71001FD2D00B15929 /* netmanager 64 bits */, 4BDCDBEC1001FD7300B15929 /* audioadapter 64 bits */, 4BDCDC0F1001FDE300B15929 /* netadapter 64 bits */, + 4B35C6350D4731D3000DE7AE /* inprocess 64 bits */, ); }; /* End PBXProject section */ @@ -5879,6 +5973,22 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 4B43A8B310145F6F00E52943 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4B43A8CA1014605000E52943 /* JackLoopbackDriver.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4B43A8E01014615800E52943 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4B43A8E11014615800E52943 /* JackLoopbackDriver.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 4B5A1BB30CD1CB9E0005BF74 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -6498,6 +6608,16 @@ target = 4B363F680DEB0D4E001F72D9 /* jack_impulse_grabber Universal */; targetProxy = 4B363F770DEB0D85001F72D9 /* PBXContainerItemProxy */; }; + 4B43A8CD1014607100E52943 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 4B43A8B010145F6F00E52943 /* jack_loopback Universal */; + targetProxy = 4B43A8CC1014607100E52943 /* PBXContainerItemProxy */; + }; + 4B43A8E91014618D00E52943 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 4B43A8DD1014615800E52943 /* jack_loopback 64 bits */; + targetProxy = 4B43A8E81014618D00E52943 /* PBXContainerItemProxy */; + }; 4B5A1BCF0CD1CCC80005BF74 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 4B5A1BB10CD1CB9E0005BF74 /* jack_midiseq Universal */; @@ -9946,11 +10066,7 @@ "-framework", Jackservermp, "-framework", - CoreAudio, - "-framework", CoreServices, - "-framework", - AudioUnit, ); OTHER_REZFLAGS = ""; PREBINDING = NO; @@ -10904,6 +11020,284 @@ }; name = Default; }; + 4B43A8B710145F6F00E52943 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + i386, + ppc, + ); + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + EXECUTABLE_EXTENSION = so; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = G4; + GCC_OPTIMIZATION_LEVEL = 0; + HEADER_SEARCH_PATHS = ( + ../common, + ../common/jack, + ., + ../posix, + ); + INSTALL_PATH = /usr/local/lib; + LIBRARY_STYLE = DYNAMIC; + MACH_O_TYPE = mh_dylib; + OTHER_CFLAGS = ""; + OTHER_CPLUSPLUSFLAGS = "-DMACH_RPC_MACH_SEMA"; + OTHER_LDFLAGS = ( + "-framework", + Jackservermp, + "-framework", + CoreAudio, + "-framework", + CoreServices, + "-framework", + AudioUnit, + ); + OTHER_REZFLAGS = ""; + PREBINDING = NO; + PRODUCT_NAME = jack_dummy; + SDKROOT = ""; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + ZERO_LINK = YES; + }; + name = Development; + }; + 4B43A8B810145F6F00E52943 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + i386, + ppc, + ); + COPY_PHASE_STRIP = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + EXECUTABLE_EXTENSION = so; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G4; + HEADER_SEARCH_PATHS = ( + ../common, + ../common/jack, + ., + ../posix, + ); + INSTALL_PATH = /usr/local/lib; + LIBRARY_STYLE = DYNAMIC; + MACH_O_TYPE = mh_dylib; + MACOSX_DEPLOYMENT_TARGET = 10.4; + OTHER_CFLAGS = ""; + OTHER_CPLUSPLUSFLAGS = "-DMACH_RPC_MACH_SEMA"; + OTHER_LDFLAGS = ( + "-framework", + Jackservermp, + "-framework", + CoreServices, + ); + OTHER_REZFLAGS = ""; + PREBINDING = NO; + PRODUCT_NAME = jack_loopback; + SDKROOT = ""; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + ZERO_LINK = NO; + }; + name = Deployment; + }; + 4B43A8B910145F6F00E52943 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + i386, + ppc, + ); + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + EXECUTABLE_EXTENSION = so; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G4; + INSTALL_PATH = /usr/local/lib; + LIBRARY_STYLE = DYNAMIC; + MACH_O_TYPE = mh_dylib; + OTHER_CFLAGS = ""; + OTHER_CPLUSPLUSFLAGS = "-DMACH_RPC_MACH_SEMA"; + OTHER_LDFLAGS = ( + "-framework", + Jackdmp, + "-framework", + AudioToolBox, + "-framework", + CoreAudio, + "-framework", + CoreServices, + "-framework", + AudioUnit, + ); + OTHER_REZFLAGS = ""; + PREBINDING = NO; + PRODUCT_NAME = jack_dummy; + SDKROOT = ""; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + }; + name = Default; + }; + 4B43A8E41014615800E52943 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + i386, + ppc, + ); + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + EXECUTABLE_EXTENSION = so; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = G4; + GCC_OPTIMIZATION_LEVEL = 0; + HEADER_SEARCH_PATHS = ( + ../common, + ../common/jack, + ., + ../posix, + ); + INSTALL_PATH = /usr/local/lib; + LIBRARY_STYLE = DYNAMIC; + MACH_O_TYPE = mh_dylib; + OTHER_CFLAGS = ""; + OTHER_CPLUSPLUSFLAGS = "-DMACH_RPC_MACH_SEMA"; + OTHER_LDFLAGS = ( + "-framework", + Jackservermp, + "-framework", + CoreAudio, + "-framework", + CoreServices, + "-framework", + AudioUnit, + ); + OTHER_REZFLAGS = ""; + PREBINDING = NO; + PRODUCT_NAME = jack_dummy; + SDKROOT = ""; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + ZERO_LINK = YES; + }; + name = Development; + }; + 4B43A8E51014615800E52943 /* Deployment */ = { + 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"; + COPY_PHASE_STRIP = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + EXECUTABLE_EXTENSION = so; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G4; + HEADER_SEARCH_PATHS = ( + ../common, + ../common/jack, + ., + ../posix, + ); + INSTALL_PATH = /usr/local/lib; + LIBRARY_STYLE = DYNAMIC; + MACH_O_TYPE = mh_dylib; + MACOSX_DEPLOYMENT_TARGET = 10.4; + OTHER_CFLAGS = ""; + OTHER_CPLUSPLUSFLAGS = "-DMACH_RPC_MACH_SEMA"; + OTHER_LDFLAGS = ( + "-framework", + Jackservermp, + "-framework", + CoreServices, + ); + OTHER_REZFLAGS = ""; + PREBINDING = NO; + PRODUCT_NAME = jack_loopback; + SDKROOT = ""; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + ZERO_LINK = NO; + }; + name = Deployment; + }; + 4B43A8E61014615800E52943 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + i386, + ppc, + ); + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + EXECUTABLE_EXTENSION = so; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G4; + INSTALL_PATH = /usr/local/lib; + LIBRARY_STYLE = DYNAMIC; + MACH_O_TYPE = mh_dylib; + OTHER_CFLAGS = ""; + OTHER_CPLUSPLUSFLAGS = "-DMACH_RPC_MACH_SEMA"; + OTHER_LDFLAGS = ( + "-framework", + Jackdmp, + "-framework", + AudioToolBox, + "-framework", + CoreAudio, + "-framework", + CoreServices, + "-framework", + AudioUnit, + ); + OTHER_REZFLAGS = ""; + PREBINDING = NO; + PRODUCT_NAME = jack_dummy; + SDKROOT = ""; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + }; + name = Default; + }; 4B5A1BB80CD1CB9E0005BF74 /* Development */ = { isa = XCBuildConfiguration; buildSettings = { @@ -13335,11 +13729,7 @@ "-framework", Jackservermp, "-framework", - CoreAudio, - "-framework", CoreServices, - "-framework", - AudioUnit, ); OTHER_REZFLAGS = ""; PREBINDING = NO; @@ -14201,11 +14591,7 @@ "-framework", Jackservermp, "-framework", - CoreAudio, - "-framework", CoreServices, - "-framework", - AudioUnit, ); OTHER_REZFLAGS = ""; PREBINDING = NO; @@ -15939,11 +16325,7 @@ "-framework", Jackservermp, "-framework", - CoreAudio, - "-framework", CoreServices, - "-framework", - AudioUnit, ); OTHER_REZFLAGS = ""; PREBINDING = NO; @@ -16522,6 +16904,26 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Default; }; + 4B43A8B610145F6F00E52943 /* Build configuration list for PBXNativeTarget "jack_loopback Universal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4B43A8B710145F6F00E52943 /* Development */, + 4B43A8B810145F6F00E52943 /* Deployment */, + 4B43A8B910145F6F00E52943 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 4B43A8E31014615800E52943 /* Build configuration list for PBXNativeTarget "jack_loopback 64 bits" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4B43A8E41014615800E52943 /* Development */, + 4B43A8E51014615800E52943 /* Deployment */, + 4B43A8E61014615800E52943 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; 4B5A1BB70CD1CB9E0005BF74 /* Build configuration list for PBXNativeTarget "jack_midiseq Universal" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/macosx/install_jackdmp b/macosx/install_jackdmp index 8ee9dd7c..aba603f0 100755 --- a/macosx/install_jackdmp +++ b/macosx/install_jackdmp @@ -16,6 +16,7 @@ sudo cp jackdmp /usr/local/bin sudo install -d /usr/local/lib/jackmp sudo cp jack_coreaudio.so /usr/local/lib/jackmp sudo cp jack_dummy.so /usr/local/lib/jackmp +sudo cp jack_loopback.so /usr/local/lib/jackmp [ -f jack_net.so ] && sudo cp jack_net.so /usr/local/lib/jackmp # Copy tools diff --git a/solaris/wscript b/solaris/wscript index 9e7ce920..77838cf1 100644 --- a/solaris/wscript +++ b/solaris/wscript @@ -34,3 +34,4 @@ def build(bld): create_jack_driver_obj(bld, 'net', '../common/JackNetDriver.cpp') + create_jack_driver_obj(bld, 'loopback', '../common/JackLoopbackDriver.cpp') From f9a3555fc3c49836e286796b839f979cae616c3c Mon Sep 17 00:00:00 2001 From: sletz Date: Mon, 20 Jul 2009 12:13:09 +0000 Subject: [PATCH 24/35] Add loopback backend in Windows git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3609 0c269be4-1314-0410-8aa9-9f06e86f4224 --- windows/Setup/jack.ci | 1 + windows/jack_loopback.cbp | 95 +++++++++++++++++++++++++++++++++++++++ windows/jackd.workspace | 3 +- 3 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 windows/jack_loopback.cbp diff --git a/windows/Setup/jack.ci b/windows/Setup/jack.ci index b37f4deb..a0ae1a66 100644 --- a/windows/Setup/jack.ci +++ b/windows/Setup/jack.ci @@ -73,6 +73,7 @@ <_>..\Release\bin\portaudio_x86.dllinstovernewer0 <_>..\Release\bin\jack\jack_net.dllinstjackovernewer0 <_>..\Release\bin\jack\jack_dummy.dllinstjackovernewer0 +<_>..\Release\bin\jack\jack_loopback.dllinstjackovernewer0 <_>..\Release\bin\jack\jack_winmme.dllinstjackovernewer0 <_>..\Release\bin\jack\jack_portaudio.dllinstjackovernewer0 <_>..\Release\bin\jack\netmanager.dllinstjackovernewer0 diff --git a/windows/jack_loopback.cbp b/windows/jack_loopback.cbp new file mode 100644 index 00000000..87edea4f --- /dev/null +++ b/windows/jack_loopback.cbp @@ -0,0 +1,95 @@ + + + + + + diff --git a/windows/jackd.workspace b/windows/jackd.workspace index f8291cd2..5db2880f 100644 --- a/windows/jackd.workspace +++ b/windows/jackd.workspace @@ -1,7 +1,7 @@ - + @@ -47,5 +47,6 @@ + From 3f6990c0c0ce65eefffb61ce84eb9333ca7a3725 Mon Sep 17 00:00:00 2001 From: sletz Date: Mon, 20 Jul 2009 16:27:32 +0000 Subject: [PATCH 25/35] Cleanup loopback backend. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3610 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/JackAudioDriver.cpp | 16 ++++++++++++++++ common/JackAudioDriver.h | 10 ++++++++++ common/JackLoopbackDriver.cpp | 5 ++--- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/common/JackAudioDriver.cpp b/common/JackAudioDriver.cpp index 85634e34..505db38e 100644 --- a/common/JackAudioDriver.cpp +++ b/common/JackAudioDriver.cpp @@ -79,6 +79,22 @@ int JackAudioDriver::Open(jack_nframes_t buffer_size, return JackDriver::Open(buffer_size, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_name, playback_driver_name, capture_latency, playback_latency); } +int JackAudioDriver::Open(bool capturing, + bool playing, + int inchannels, + int outchannels, + bool monitor, + const char* capture_driver_name, + const char* playback_driver_name, + jack_nframes_t capture_latency, + jack_nframes_t playback_latency) +{ + fCaptureChannels = inchannels; + fPlaybackChannels = outchannels; + fWithMonitorPorts = monitor; + return JackDriver::Open(capturing, playing, inchannels, outchannels, monitor, capture_driver_name, playback_driver_name, capture_latency, playback_latency); +} + int JackAudioDriver::Attach() { JackPort* port; diff --git a/common/JackAudioDriver.h b/common/JackAudioDriver.h index 93d6830d..6fb64e64 100644 --- a/common/JackAudioDriver.h +++ b/common/JackAudioDriver.h @@ -74,6 +74,16 @@ class SERVER_EXPORT JackAudioDriver : public JackDriver jack_nframes_t capture_latency, jack_nframes_t playback_latency); + virtual int Open(bool capturing, + bool playing, + int inchannels, + int outchannels, + bool monitor, + const char* capture_driver_name, + const char* playback_driver_name, + jack_nframes_t capture_latency, + jack_nframes_t playback_latency); + virtual int Process(); virtual int ProcessNull(); diff --git a/common/JackLoopbackDriver.cpp b/common/JackLoopbackDriver.cpp index c91c355a..48a9d253 100644 --- a/common/JackLoopbackDriver.cpp +++ b/common/JackLoopbackDriver.cpp @@ -19,7 +19,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "JackSystemDeps.h" -#include "JackGlobals.h" #include "JackLoopbackDriver.h" #include "JackDriverLoader.h" #include "JackEngineControl.h" @@ -94,9 +93,9 @@ extern "C" break; } } - + Jack::JackDriverClientInterface* driver = new Jack::JackLoopbackDriver(engine, table); - if (driver->Open(Jack::GetEngineControl()->fBufferSize, Jack::GetEngineControl()->fSampleRate, 1, 1, channels, channels, false, "loopback", "loopback", 0, 0) == 0) { + if (driver->Open(1, 1, channels, channels, false, "loopback", "loopback", 0, 0) == 0) { return driver; } else { delete driver; From b51f2a52b304d8f97aa5322297f985de6904506b Mon Sep 17 00:00:00 2001 From: sletz Date: Mon, 20 Jul 2009 16:38:17 +0000 Subject: [PATCH 26/35] Correct XCode project for loopback target. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3611 0c269be4-1314-0410-8aa9-9f06e86f4224 --- macosx/Jackdmp.xcodeproj/project.pbxproj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/macosx/Jackdmp.xcodeproj/project.pbxproj b/macosx/Jackdmp.xcodeproj/project.pbxproj index 7744d2ec..53eb7be7 100644 --- a/macosx/Jackdmp.xcodeproj/project.pbxproj +++ b/macosx/Jackdmp.xcodeproj/project.pbxproj @@ -11234,8 +11234,11 @@ LIBRARY_STYLE = DYNAMIC; MACH_O_TYPE = mh_dylib; MACOSX_DEPLOYMENT_TARGET = 10.4; - OTHER_CFLAGS = ""; - OTHER_CPLUSPLUSFLAGS = "-DMACH_RPC_MACH_SEMA"; + OTHER_CFLAGS = "-DJACK_32_64"; + OTHER_CPLUSPLUSFLAGS = ( + "-DMACH_RPC_MACH_SEMA", + "-DJACK_32_64", + ); OTHER_LDFLAGS = ( "-framework", Jackservermp, From edc973c3d2b73ad74c242ee5500dc78d52fad683 Mon Sep 17 00:00:00 2001 From: sletz Date: Tue, 21 Jul 2009 08:29:34 +0000 Subject: [PATCH 27/35] Update readme. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3612 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 4 ++-- README | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 892bee00..d9813f2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,8 +27,8 @@ Paul Davis 2009-07-17 Stephane Letz - * JackLoopbackDriver reborn as a dynamicalled loadable separated backend. - * -L paramater for loopback backend activated again in jackd. + * Loopback backend reborn as a dynamically loadable separated backend. + * -L parameter for loopback backend activated again in jackd. 2009-07-17 Stephane Letz diff --git a/README b/README index bb0e7898..5e746d3d 100644 --- a/README +++ b/README @@ -213,7 +213,7 @@ Note : To experiment with the -S option, jackdmp must be launched in a console. 1.9.0 : Waf based build system : Nedko Arnaudov, Grame for preliminary OSX support. Control API, dbus based server control access : Nedko Arnaudov, Grame. NetJack2 components (in progress) : jack_net backend, netmanager, audioadapter, netadapter : Romain Moret, Grame. Code restructuring to help port on other architectures : Michael Voigt. Code cleanup/optimization : Tim Blechmann. Improve handling of server internal clients that can now be loaded/unloaded using the new server control API : Grame. A lot of bug fix and improvements. 1.9.1 : Fix jackctl_server_unload_internal. Filter SIGPIPE to avoid having client get a SIGPIPE when trying to access a died server. Libjack shutdown handler does not "deactivate" (fActive = false) the client anymore, so that jack_deactivate correctly does the job later on. Better isolation of server and clients system resources to allow starting the server in several user account at the same time. Report ringbuffer.c fixes from jack1. Client and library global context cleanup in case of incorrect shutdown handling (that is applications not correctly closing client after server has shutdown). Use JACK_DRIVER_DIR variable in internal clients loader. For ALSA driver, synchronize with latest jack1 memops functions. Synchronize jack2 public headers with jack1 ones. Implement jack_client_real_time_priority and jack_client_max_real_time_priority API. Use up to BUFFER_SIZE_MAX frames in midi ports, fix for ticket #117. Cleanup server starting code for clients directly linked with libjackserver.so. JackMessageBuffer was using thread "Stop" scheme in destructor, now use the safer thread "Kill" way. Synchronize ALSA backend code with JACK1 one. Set default mode to 'slow' in JackNetDriver and JackNetAdapter. Simplify audio packet order verification. Fix JackNetInterface::SetNetBufferSize for socket buffer size computation and JackNetMasterInterface::DataRecv if synch packet is received, various cleanup. Better recovery of network overload situations, now "resynchronize" by skipping cycles.". Support for BIG_ENDIAN machines in NetJack2. Support for BIG_ENDIAN machines in NetJack2 for MIDI ports. Support for "-h" option in internal clients to print the parameters. In NetJack2, fix a bug when capture or playback only channels are used. Add a JACK_INTERNAL_DIR environment variable to be used for internal clients. Add a resample quality parameter in audioadapter. Now correctly return an error if JackServer::SetBufferSize could not change the buffer size (and was just restoring the current one). Use PRIu32 kind of macro in JackAlsaDriver again. Add a resample quality parameter in netadapter. 1.9.2 : Solaris version. New "profiling" tools. Rework the mutex/signal classes. Support for BIG_ENDIAN machines in NetJack2. D-BUS based device reservation to better coexist with PulseAudio on Linux. Add auto_connect parameter in netmanager and netadapter. Use Torben Hohn PI controler code for adapters. Client incorrect re-naming fixed : now done at socket and fifo level. Virtualize and allow overriding of thread creation function, to allow Wine support (from JACK1). -1.9.3 : New JackBoomerDriver class for Boomer driver on Solaris. Add mixed 32/64 bits mode (off by default). Native MIDI backend (JackCoreMidiDriver, JackWinMMEDriver). In ALSA audio card reservation code, tries to open the card even if reservation fails. Clock source setting on Linux. Add jackctl_server_switch_master API. Fix transport callback (timebase master, sync) issue when used after jack_activate (RT thread was not running). D-Bus access for jackctl_server_add_slave/jackctl_server_remove_slave API. Cleanup "loopback" stuff in server. Torben Hohn fix for InitTime and GetMicroSeconds in JackWinTime.c. New jack_free function added in jack.h. Reworked Torben Hohn fix for server restart issue on Windows. Correct jack_set_error_function, jack_set_info_function and jack_set_thread_creator functions. Correct JackFifo::TimedWait for EINTR handling. Move DBus based audio device reservation code in ALSA backend compilation. Correct JackTransportEngine::MakeAllLocating, sync callback has to be called in this case also. NetJack2 code : better error checkout, method renaming. Tim Bechmann patch : hammerfall, only release monitor thread, if it has been created. Tim Bechmann memops.c optimization patches. +1.9.3 : New JackBoomerDriver class for Boomer driver on Solaris. Add mixed 32/64 bits mode (off by default). Native MIDI backend (JackCoreMidiDriver, JackWinMMEDriver). In ALSA audio card reservation code, tries to open the card even if reservation fails. Clock source setting on Linux. Add jackctl_server_switch_master API. Fix transport callback (timebase master, sync) issue when used after jack_activate (RT thread was not running). D-Bus access for jackctl_server_add_slave/jackctl_server_remove_slave API. Cleanup "loopback" stuff in server. Torben Hohn fix for InitTime and GetMicroSeconds in JackWinTime.c. New jack_free function added in jack.h. Reworked Torben Hohn fix for server restart issue on Windows. Correct jack_set_error_function, jack_set_info_function and jack_set_thread_creator functions. Correct JackFifo::TimedWait for EINTR handling. Move DBus based audio device reservation code in ALSA backend compilation. Correct JackTransportEngine::MakeAllLocating, sync callback has to be called in this case also. NetJack2 code : better error checkout, method renaming. Tim Bechmann patch : hammerfall, only release monitor thread, if it has been created. Tim Bechmann memops.c optimization patches. In combined --dbus and --classic compilation code, use PulseAudio acquire/release code. Big rewrite of Solaris boomer driver, seems to work in duplex mode at least. Loopback backend reborn as a dynamically loadable separated backend. This is a work in progress but the implementation is now stable enough to be tested. jackdmp has been used successfully with the following applications : Ardour, Hydrogen, Jamin, Qjackctl, Jack-Rack, SooperLooper, AlsaPlayer... From 15958b1bd8349f091155cc9be3edcaa218de82ca Mon Sep 17 00:00:00 2001 From: sletz Date: Tue, 21 Jul 2009 08:42:59 +0000 Subject: [PATCH 28/35] Update OSX install script. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3613 0c269be4-1314-0410-8aa9-9f06e86f4224 --- macosx/install_jackdmp | 1 + 1 file changed, 1 insertion(+) diff --git a/macosx/install_jackdmp b/macosx/install_jackdmp index aba603f0..7e171b76 100755 --- a/macosx/install_jackdmp +++ b/macosx/install_jackdmp @@ -15,6 +15,7 @@ sudo cp jackdmp /usr/local/bin # Copy drivers sudo install -d /usr/local/lib/jackmp sudo cp jack_coreaudio.so /usr/local/lib/jackmp +sudo cp jack_coremidi.so /usr/local/lib/jackmp sudo cp jack_dummy.so /usr/local/lib/jackmp sudo cp jack_loopback.so /usr/local/lib/jackmp [ -f jack_net.so ] && sudo cp jack_net.so /usr/local/lib/jackmp From 148764a207d9571a243def0c731a451369c9a165 Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 22 Jul 2009 15:34:27 +0000 Subject: [PATCH 29/35] Version 1.9.4 started. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3617 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 6 +++++- common/JackConstants.h | 2 +- doxyfile | 2 +- macosx/Jack-Info.plist | 4 ++-- windows/jackaudioadapter.rc | 8 ++++---- windows/jackd.rc | 8 ++++---- windows/jacknetadapter.rc | 8 ++++---- windows/jacknetdriver.rc | 8 ++++---- windows/jacknetmanager.rc | 8 ++++---- windows/jackportaudio.rc | 8 ++++---- windows/jackwinmme.rc | 8 ++++---- windows/libjack.rc | 8 ++++---- windows/libjackserver.rc | 8 ++++---- windows/resource.rc | 8 ++++---- wscript | 2 +- 15 files changed, 50 insertions(+), 46 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9813f2a..561474fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,7 +23,11 @@ Paul Davis --------------------------- Jackdmp changes log ---------------------------- +--------------------------- + +2009-07-22 Stephane Letz + + * Version 1.9.4 started. 2009-07-17 Stephane Letz diff --git a/common/JackConstants.h b/common/JackConstants.h index f5355afc..709aa364 100644 --- a/common/JackConstants.h +++ b/common/JackConstants.h @@ -24,7 +24,7 @@ #include "config.h" #endif -#define VERSION "1.9.3" +#define VERSION "1.9.4" #define BUFFER_SIZE_MAX 8192 diff --git a/doxyfile b/doxyfile index 930b9eaf..0ba53fc0 100644 --- a/doxyfile +++ b/doxyfile @@ -23,7 +23,7 @@ PROJECT_NAME = "Jack2" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.9.3 +PROJECT_NUMBER = 1.9.4 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/macosx/Jack-Info.plist b/macosx/Jack-Info.plist index 924e644a..1e5eb07e 100644 --- a/macosx/Jack-Info.plist +++ b/macosx/Jack-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable Jackservermp CFBundleGetInfoString - Jackdmp 1.9.3, @03-09 Paul Davis, Grame + Jackdmp 1.9.4, @03-09 Paul Davis, Grame CFBundleIdentifier com.grame.Jackmp CFBundleInfoDictionaryVersion @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.9.3 + 1.9.4 diff --git a/windows/jackaudioadapter.rc b/windows/jackaudioadapter.rc index 31718f12..02d66940 100644 --- a/windows/jackaudioadapter.rc +++ b/windows/jackaudioadapter.rc @@ -11,8 +11,8 @@ // LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT 1 VERSIONINFO - FILEVERSION 1,9,3,0 - PRODUCTVERSION 1,9,3,0 + FILEVERSION 1,9,4,0 + PRODUCTVERSION 1,9,4,0 FILEOS VOS_UNKNOWN FILETYPE VFT_DLL BEGIN @@ -23,14 +23,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Grame\0" VALUE "FileDescription", "Jackmp Audio Adapter for Windows\0" - VALUE "FileVersion", "1, 9, 3, 0\0" + VALUE "FileVersion", "1, 9, 4, 0\0" VALUE "InternalName", "audioadapter\0" VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "audioadapter.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "audioadapter\0" - VALUE "ProductVersion", "1, 9, 3, 0\0" + VALUE "ProductVersion", "1, 9, 4, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/windows/jackd.rc b/windows/jackd.rc index 0208994a..5f909413 100644 --- a/windows/jackd.rc +++ b/windows/jackd.rc @@ -11,8 +11,8 @@ // LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT 1 VERSIONINFO - FILEVERSION 1,9,3,0 - PRODUCTVERSION 1,9,3,0 + FILEVERSION 1,9,4,0 + PRODUCTVERSION 1,9,4,0 FILEOS VOS_UNKNOWN FILETYPE VFT_APP BEGIN @@ -23,14 +23,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Grame\0" VALUE "FileDescription", "Jack server for Windows\0" - VALUE "FileVersion", "1, 9, 3, 0\0" + VALUE "FileVersion", "1, 9, 4, 0\0" VALUE "InternalName", "jackd\0" VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "jackd.exe\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "jackd\0" - VALUE "ProductVersion", "1, 9, 3, 0\0" + VALUE "ProductVersion", "1, 9, 4, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/windows/jacknetadapter.rc b/windows/jacknetadapter.rc index cdfb78e9..62a7a3c0 100644 --- a/windows/jacknetadapter.rc +++ b/windows/jacknetadapter.rc @@ -11,8 +11,8 @@ // LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT 1 VERSIONINFO - FILEVERSION 1,9,3,0 - PRODUCTVERSION 1,9,3,0 + FILEVERSION 1,9,4,0 + PRODUCTVERSION 1,9,4,0 FILEOS VOS_UNKNOWN FILETYPE VFT_DLL BEGIN @@ -23,14 +23,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Grame\0" VALUE "FileDescription", "Jackmp Net Adapter for Windows\0" - VALUE "FileVersion", "1, 9, 3, 0\0" + VALUE "FileVersion", "1, 9, 4, 0\0" VALUE "InternalName", "netadapter\0" VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "netadapter.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "netadapter\0" - VALUE "ProductVersion", "1, 9, 3, 0\0" + VALUE "ProductVersion", "1, 9, 4, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/windows/jacknetdriver.rc b/windows/jacknetdriver.rc index 40e7ab94..8a7a1806 100644 --- a/windows/jacknetdriver.rc +++ b/windows/jacknetdriver.rc @@ -11,8 +11,8 @@ // LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT 1 VERSIONINFO - FILEVERSION 1,9,3,0 - PRODUCTVERSION 1,9,3,0 + FILEVERSION 1,9,4,0 + PRODUCTVERSION 1,9,4,0 FILEOS VOS_UNKNOWN FILETYPE VFT_DLL BEGIN @@ -23,14 +23,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Grame\0" VALUE "FileDescription", "Jackmp Net Driver for Windows\0" - VALUE "FileVersion", "1, 9, 3, 0\0" + VALUE "FileVersion", "1, 9, 4, 0\0" VALUE "InternalName", "jack_netdriver\0" VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "jack_netdriver.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "jack_netdriver\0" - VALUE "ProductVersion", "1, 9, 3, 0\0" + VALUE "ProductVersion", "1, 9, 4, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/windows/jacknetmanager.rc b/windows/jacknetmanager.rc index b9c35e01..ffc1dde8 100644 --- a/windows/jacknetmanager.rc +++ b/windows/jacknetmanager.rc @@ -11,8 +11,8 @@ // LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT 1 VERSIONINFO - FILEVERSION 1,9,3,0 - PRODUCTVERSION 1,9,3,0 + FILEVERSION 1,9,4,0 + PRODUCTVERSION 1,9,4,0 FILEOS VOS_UNKNOWN FILETYPE VFT_DLL BEGIN @@ -23,14 +23,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Grame\0" VALUE "FileDescription", "Jackmp Net Manager for Windows\0" - VALUE "FileVersion", "1, 9, 3, 0\0" + VALUE "FileVersion", "1, 9, 4, 0\0" VALUE "InternalName", "netmanager\0" VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "netmanager.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "netmanager\0" - VALUE "ProductVersion", "1, 9, 3, 0\0" + VALUE "ProductVersion", "1, 9, 4, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/windows/jackportaudio.rc b/windows/jackportaudio.rc index 03ad53fd..7e8429a0 100644 --- a/windows/jackportaudio.rc +++ b/windows/jackportaudio.rc @@ -11,8 +11,8 @@ // LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT 1 VERSIONINFO - FILEVERSION 1,9,3,0 - PRODUCTVERSION 1,9,3,0 + FILEVERSION 1,9,4,0 + PRODUCTVERSION 1,9,4,0 FILEOS VOS_UNKNOWN FILETYPE VFT_DLL BEGIN @@ -23,14 +23,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Grame\0" VALUE "FileDescription", "Jackmp PortAudio Driver for Windows\0" - VALUE "FileVersion", "1, 9, 3, 0\0" + VALUE "FileVersion", "1, 9, 4, 0\0" VALUE "InternalName", "jack_portaudio\0" VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "jack_portaudio.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "jack_portaudio\0" - VALUE "ProductVersion", "1, 9, 3, 0\0" + VALUE "ProductVersion", "1, 9, 4, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/windows/jackwinmme.rc b/windows/jackwinmme.rc index 57187d6c..5a38e821 100644 --- a/windows/jackwinmme.rc +++ b/windows/jackwinmme.rc @@ -11,8 +11,8 @@ // LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT 1 VERSIONINFO - FILEVERSION 1,9,3,0 - PRODUCTVERSION 1,9,3,0 + FILEVERSION 1,9,4,0 + PRODUCTVERSION 1,9,4,0 FILEOS VOS_UNKNOWN FILETYPE VFT_DLL BEGIN @@ -23,14 +23,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Grame\0" VALUE "FileDescription", "Jackmp WinMMEo Driver for Windows\0" - VALUE "FileVersion", "1, 9, 3, 0\0" + VALUE "FileVersion", "1, 9, 4, 0\0" VALUE "InternalName", "jack_portaudio\0" VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "jack_winmme.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "jack_winmme\0" - VALUE "ProductVersion", "1, 9, 3, 0\0" + VALUE "ProductVersion", "1, 9, 4, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/windows/libjack.rc b/windows/libjack.rc index 200ad086..b4e79369 100644 --- a/windows/libjack.rc +++ b/windows/libjack.rc @@ -11,8 +11,8 @@ // LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT 1 VERSIONINFO - FILEVERSION 1,9,3,0 - PRODUCTVERSION 1,9,3,0 + FILEVERSION 1,9,4,0 + PRODUCTVERSION 1,9,4,0 FILEOS VOS_UNKNOWN FILETYPE VFT_DLL BEGIN @@ -23,14 +23,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Grame\0" VALUE "FileDescription", "Jack client library for Windows\0" - VALUE "FileVersion", "1, 9, 3, 0\0" + VALUE "FileVersion", "1, 9, 4, 0\0" VALUE "InternalName", "libjack\0" VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "libjack.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "libjack\0" - VALUE "ProductVersion", "1, 9, 3, 0\0" + VALUE "ProductVersion", "1, 9, 4, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/windows/libjackserver.rc b/windows/libjackserver.rc index 3b38efcc..dc0bbb6b 100644 --- a/windows/libjackserver.rc +++ b/windows/libjackserver.rc @@ -11,8 +11,8 @@ // LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT 1 VERSIONINFO - FILEVERSION 1,9,3,0 - PRODUCTVERSION 1,9,3,0 + FILEVERSION 1,9,4,0 + PRODUCTVERSION 1,9,4,0 FILEOS VOS_UNKNOWN FILETYPE VFT_DLL BEGIN @@ -23,14 +23,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Grame\0" VALUE "FileDescription", "Jack server library for Windows\0" - VALUE "FileVersion", "1, 9, 3, 0\0" + VALUE "FileVersion", "1, 9, 4, 0\0" VALUE "InternalName", "libjackserver\0" VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "libjackserver.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "libjackserver\0" - VALUE "ProductVersion", "1, 9, 3, 0\0" + VALUE "ProductVersion", "1, 9, 4, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/windows/resource.rc b/windows/resource.rc index 0ea97e52..51ba4994 100644 --- a/windows/resource.rc +++ b/windows/resource.rc @@ -14,8 +14,8 @@ LANGUAGE LANG_FRENCH, SUBLANG_FRENCH #ifndef _MAC VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,9,3,0 - PRODUCTVERSION 1,9,3,0 + FILEVERSION 1,9,4,0 + PRODUCTVERSION 1,9,4,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -33,14 +33,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Grame\0" VALUE "FileDescription", "Jackmp for Windows\0" - VALUE "FileVersion", "1, 9, 3, 0\0" + VALUE "FileVersion", "1, 9, 4, 0\0" VALUE "InternalName", "libjackmp\0" VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "libjackmp.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "libjackmp\0" - VALUE "ProductVersion", "1, 9, 3, 0\0" + VALUE "ProductVersion", "1, 9, 4, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/wscript b/wscript index 917208d0..f5b69855 100644 --- a/wscript +++ b/wscript @@ -11,7 +11,7 @@ import Task import re import Logs -VERSION='1.9.3' +VERSION='1.9.4' APPNAME='jack' JACK_API_VERSION = '0.1.0' From 37715e00b8740e9b0fc10a7fe6eb2ce60abedb94 Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 22 Jul 2009 15:37:19 +0000 Subject: [PATCH 30/35] Solaris boomer backend now working in capture or playback only mode. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3618 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 3 +- solaris/oss/JackBoomerDriver.cpp | 50 ++++++++++---------------------- solaris/oss/JackBoomerDriver.h | 3 -- 3 files changed, 18 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index 561474fa..9ff3a1b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,7 +27,8 @@ Paul Davis 2009-07-22 Stephane Letz - * Version 1.9.4 started. + * Version 1.9.4 started. + * Solaris boomer backend now working in capture or playback only mode. 2009-07-17 Stephane Letz diff --git a/solaris/oss/JackBoomerDriver.cpp b/solaris/oss/JackBoomerDriver.cpp index 96dc0a6a..c5eeaf7d 100644 --- a/solaris/oss/JackBoomerDriver.cpp +++ b/solaris/oss/JackBoomerDriver.cpp @@ -404,12 +404,6 @@ int JackBoomerDriver::Open(jack_nframes_t nframes, int bits, bool ignorehwbuf) { - - if (playing && !capturing) { - jack_error("Playback only mode is not yet supported, use duplex instead"); - return -1; - } - // Generic JackAudioDriver Open if (JackAudioDriver::Open(nframes, samplerate, capturing, playing, inchannels, outchannels, monitor, capture_driver_uid, playback_driver_uid, capture_latency, playback_latency) != 0) { @@ -572,26 +566,6 @@ int JackBoomerDriver::Stop() return 0; } -int JackBoomerDriver::Read() -{ -/* - // Keep begin cycle time - JackDriver::CycleTakeBeginTime(); -*/ - - return 0; -} - -int JackBoomerDriver::Write() -{ -/* - // Keep begin cycle time - JackDriver::CycleTakeEndTime(); -*/ - - return 0; -} - bool JackBoomerDriver::JackBoomerDriverInput::Init() { if (fDriver->IsRealTime()) { @@ -608,12 +582,7 @@ bool JackBoomerDriver::JackBoomerDriverInput::Init() bool JackBoomerDriver::JackBoomerDriverInput::Execute() { - if (fDriver->fInFD < 0) { - // Keep begin cycle time - fDriver->CycleTakeBeginTime(); - return true; - } - + #ifdef JACK_MONITOR gCycleTable.fTable[gCycleReadCount].fBeforeRead = GetMicroSeconds(); #endif @@ -661,7 +630,13 @@ bool JackBoomerDriver::JackBoomerDriverInput::Execute() #endif } - fDriver->SynchronizeRead(); + // Duplex : sync with write thread + if (fDriver->fInFD > 0 && fDriver->fOutFD > 0) { + fDriver->SynchronizeRead(); + } else { + // Otherwise direct process + fDriver->Process(); + } return true; } @@ -748,7 +723,14 @@ bool JackBoomerDriver::JackBoomerDriverOutput::Execute() jack_error("JackBoomerDriverOutput::Execute error bytes written = %ld", count); } - fDriver->SynchronizeWrite(); + // Duplex : sync with read thread + if (fDriver->fInFD > 0 && fDriver->fOutFD > 0) { + fDriver->SynchronizeWrite(); + } else { + // Otherwise direct process + fDriver->CycleTakeBeginTime(); + fDriver->Process(); + } return true; } diff --git a/solaris/oss/JackBoomerDriver.h b/solaris/oss/JackBoomerDriver.h index f688c7e1..2b9c4c1a 100644 --- a/solaris/oss/JackBoomerDriver.h +++ b/solaris/oss/JackBoomerDriver.h @@ -145,9 +145,6 @@ class JackBoomerDriver : public JackAudioDriver int Start(); int Stop(); - int Read(); - int Write(); - // BufferSize can be changed bool IsFixedBufferSize() { From fc5ba1689b055f7327114ad8d3f8f03c4a0352be Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 22 Jul 2009 16:02:54 +0000 Subject: [PATCH 31/35] Fix control.h for proper compilation on Solaris. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3619 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 3 ++- common/jack/control.h | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ff3a1b7..77cb2eb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,7 +28,8 @@ Paul Davis 2009-07-22 Stephane Letz * Version 1.9.4 started. - * Solaris boomer backend now working in capture or playback only mode. + * Solaris boomer backend now working in capture or playback only mode. + * Fix control.h for proper compilation on Solaris. 2009-07-17 Stephane Letz diff --git a/common/jack/control.h b/common/jack/control.h index 263af1d1..2aa05420 100644 --- a/common/jack/control.h +++ b/common/jack/control.h @@ -31,7 +31,14 @@ #include #include -#include +#if __STDC_VERSION__ >= 199901L +# include +#else +# define TRUE 1 +# define FALSE 0 +# define bool int +# define __bool_true_false_are_defined +#endif /** Parameter types, intentionally similar to jack_driver_param_type_t */ typedef enum From a689e5aacbb5fade6fe16d3ed7cc8988b77a326b Mon Sep 17 00:00:00 2001 From: sletz Date: Thu, 23 Jul 2009 18:26:11 +0000 Subject: [PATCH 32/35] Cleanup uneeded parameters in Solaris boomer backend. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3623 0c269be4-1314-0410-8aa9-9f06e86f4224 --- README | 1 - solaris/oss/JackBoomerDriver.cpp | 58 ++++---------------------------- solaris/oss/JackBoomerDriver.h | 8 ++--- solaris/oss/JackOSSAdapter.cpp | 7 ---- 4 files changed, 9 insertions(+), 65 deletions(-) diff --git a/README b/README index 5e746d3d..88278c31 100644 --- a/README +++ b/README @@ -42,7 +42,6 @@ Known problems, limitations - use of POSIX named semaphore is currently unstable and not recommended yet. - ---------------- Solaris version ---------------- diff --git a/solaris/oss/JackBoomerDriver.cpp b/solaris/oss/JackBoomerDriver.cpp index c5eeaf7d..14cb7b98 100644 --- a/solaris/oss/JackBoomerDriver.cpp +++ b/solaris/oss/JackBoomerDriver.cpp @@ -233,7 +233,7 @@ void JackBoomerDriver::DisplayDeviceInfo() JackBoomerDriver::JackBoomerDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table) : JackAudioDriver(name, alias, engine, table), fInFD(-1), fOutFD(-1), fBits(0), - fSampleFormat(0), fNperiods(0), fRWMode(0), fExcl(false), fIgnoreHW(true), + fSampleFormat(0), fNperiods(0), fRWMode(0) fInputBufferSize(0), fOutputBufferSize(0), fInputBuffer(NULL), fOutputBuffer(NULL), fInputThread(&fInputHandler), fOutputThread(&fOutputHandler), @@ -260,20 +260,13 @@ int JackBoomerDriver::OpenInput() if (fCaptureChannels == 0) fCaptureChannels = 2; - if ((fInFD = open(fCaptureDriverName, O_RDONLY | ((fExcl) ? O_EXCL : 0))) < 0) { + if ((fInFD = open(fCaptureDriverName, O_RDONLY)) < 0) { jack_error("JackBoomerDriver::OpenInput failed to open device : %s@%i, errno = %d", __FILE__, __LINE__, errno); return -1; } jack_log("JackBoomerDriver::OpenInput input fInFD = %d", fInFD); - if (fExcl) { - if (ioctl(fInFD, SNDCTL_DSP_COOKEDMODE, &flags) == -1) { - jack_error("JackBoomerDriver::OpenInput failed to set cooked mode : %s@%i, errno = %d", __FILE__, __LINE__, errno); - goto error; - } - } - gFragFormat = (2 << 16) + int2pow2(fEngineControl->fBufferSize * fSampleSize * fCaptureChannels); if (ioctl(fInFD, SNDCTL_DSP_SETFRAGMENT, &gFragFormat) == -1) { jack_error("JackBoomerDriver::OpenInput failed to set fragments : %s@%i, errno = %d", __FILE__, __LINE__, errno); @@ -329,19 +322,12 @@ int JackBoomerDriver::OpenOutput() if (fPlaybackChannels == 0) fPlaybackChannels = 2; - if ((fOutFD = open(fPlaybackDriverName, O_WRONLY | ((fExcl) ? O_EXCL : 0))) < 0) { + if ((fOutFD = open(fPlaybackDriverName, O_WRONLY)) < 0) { jack_error("JackBoomerDriver::OpenOutput failed to open device : %s@%i, errno = %d", __FILE__, __LINE__, errno); return -1; } jack_log("JackBoomerDriver::OpenOutput output fOutFD = %d", fOutFD); - - if (fExcl) { - if (ioctl(fOutFD, SNDCTL_DSP_COOKEDMODE, &flags) == -1) { - jack_error("JackBoomerDriver::OpenOutput failed to set cooked mode : %s@%i, errno = %d", __FILE__, __LINE__, errno); - goto error; - } - } gFragFormat = (2 << 16) + int2pow2(fEngineControl->fBufferSize * fSampleSize * fPlaybackChannels); if (ioctl(fOutFD, SNDCTL_DSP_SETFRAGMENT, &gFragFormat) == -1) { @@ -395,14 +381,12 @@ int JackBoomerDriver::Open(jack_nframes_t nframes, bool playing, int inchannels, int outchannels, - bool excl, bool monitor, const char* capture_driver_uid, const char* playback_driver_uid, jack_nframes_t capture_latency, jack_nframes_t playback_latency, - int bits, - bool ignorehwbuf) + int bits) { // Generic JackAudioDriver Open if (JackAudioDriver::Open(nframes, samplerate, capturing, playing, inchannels, outchannels, monitor, @@ -418,10 +402,8 @@ int JackBoomerDriver::Open(jack_nframes_t nframes, fRWMode |= ((capturing) ? kRead : 0); fRWMode |= ((playing) ? kWrite : 0); fBits = bits; - fIgnoreHW = ignorehwbuf; fNperiods = user_nperiods; - fExcl = excl; - + #ifdef JACK_MONITOR // Force memory page in memset(&gCycleTable, 0, sizeof(gCycleTable)); @@ -822,14 +804,6 @@ SERVER_EXPORT jack_driver_desc_t* driver_get_descriptor() strcpy(desc->params[i].short_desc, "Playback channels"); strcpy(desc->params[i].long_desc, desc->params[i].short_desc); - i++; - strcpy(desc->params[i].name, "excl"); - desc->params[i].character = 'e'; - desc->params[i].type = JackDriverParamBool; - desc->params[i].value.i = false; - strcpy(desc->params[i].short_desc, "Exclusif (O_EXCL) access mode"); - strcpy(desc->params[i].long_desc, desc->params[i].short_desc); - i++; strcpy(desc->params[i].name, "capture"); desc->params[i].character = 'C'; @@ -853,15 +827,7 @@ SERVER_EXPORT jack_driver_desc_t* driver_get_descriptor() strcpy(desc->params[i].value.str, OSS_DRIVER_DEF_DEV); strcpy(desc->params[i].short_desc, "OSS device name"); strcpy(desc->params[i].long_desc, desc->params[i].short_desc); - - i++; - strcpy(desc->params[i].name, "ignorehwbuf"); - desc->params[i].character = 'b'; - desc->params[i].type = JackDriverParamBool; - desc->params[i].value.i = false; - strcpy(desc->params[i].short_desc, "Ignore hardware period size"); - strcpy(desc->params[i].long_desc, desc->params[i].short_desc); - + i++; strcpy(desc->params[i].name, "input-latency"); desc->params[i].character = 'I'; @@ -893,11 +859,9 @@ EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine int chan_in = 0; int chan_out = 0; bool monitor = false; - bool excl = false; unsigned int nperiods = OSS_DRIVER_DEF_NPERIODS; const JSList *node; const jack_driver_param_t *param; - bool ignorehwbuf = false; jack_nframes_t systemic_input_latency = 0; jack_nframes_t systemic_output_latency = 0; @@ -949,14 +913,6 @@ EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine playback_pcm_name = strdup (param->value.str); capture_pcm_name = strdup (param->value.str); break; - - case 'b': - ignorehwbuf = true; - break; - - case 'e': - excl = true; - break; case 'I': systemic_input_latency = param->value.ui; @@ -978,7 +934,7 @@ EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine // Special open for Boomer driver... if (boomer_driver->Open(frames_per_interrupt, nperiods, srate, capture, playback, chan_in, chan_out, - excl, monitor, capture_pcm_name, playback_pcm_name, systemic_input_latency, systemic_output_latency, bits, ignorehwbuf) == 0) { + monitor, capture_pcm_name, playback_pcm_name, systemic_input_latency, systemic_output_latency, bits) == 0) { return boomer_driver; } else { delete boomer_driver; // Delete the driver diff --git a/solaris/oss/JackBoomerDriver.h b/solaris/oss/JackBoomerDriver.h index 2b9c4c1a..e488ec69 100644 --- a/solaris/oss/JackBoomerDriver.h +++ b/solaris/oss/JackBoomerDriver.h @@ -30,7 +30,7 @@ namespace Jack typedef jack_default_audio_sample_t jack_sample_t; -#define OSS_DRIVER_N_PARAMS 13 +#define OSS_DRIVER_N_PARAMS 11 #define OSS_DRIVER_DEF_DEV "/dev/dsp" #define OSS_DRIVER_DEF_FS 48000 #define OSS_DRIVER_DEF_BLKSIZE 1024 @@ -92,8 +92,6 @@ class JackBoomerDriver : public JackAudioDriver int fNperiods; unsigned int fSampleSize; int fRWMode; - bool fExcl; - bool fIgnoreHW; unsigned int fInputBufferSize; unsigned int fOutputBufferSize; @@ -131,14 +129,12 @@ class JackBoomerDriver : public JackAudioDriver bool playing, int chan_in, int chan_out, - bool vmix, bool monitor, const char* capture_driver_name, const char* playback_driver_name, jack_nframes_t capture_latency, jack_nframes_t playback_latency, - int bits, - bool ignorehwbuf); + int bits); int Close(); diff --git a/solaris/oss/JackOSSAdapter.cpp b/solaris/oss/JackOSSAdapter.cpp index 7bdfec96..3fffe425 100644 --- a/solaris/oss/JackOSSAdapter.cpp +++ b/solaris/oss/JackOSSAdapter.cpp @@ -309,8 +309,6 @@ int JackOSSAdapter::OpenInput() return -1; } -jack_log("JackOSSAdapter::OpenInput input fInFD = %d", fInFD); - if (fExcl) { if (ioctl(fInFD, SNDCTL_DSP_COOKEDMODE, &flags) == -1) { jack_error("JackOSSAdapter::OpenInput failed to set cooked mode : %s@%i, errno = %d", __FILE__, __LINE__, errno); @@ -318,8 +316,6 @@ jack_log("JackOSSAdapter::OpenInput input fInFD = %d", fInFD); } } -printf("fAdaptedBufferSize %d %d %d %d %s\n", fExcl, fAdaptedBufferSize, fSampleSize, fCaptureChannels, fCaptureDriverName); - gFragFormat = (2 << 16) + int2pow2(fAdaptedBufferSize * fSampleSize * fCaptureChannels); if (ioctl(fInFD, SNDCTL_DSP_SETFRAGMENT, &gFragFormat) == -1) { jack_error("JackOSSAdapter::OpenInput failed to set fragments : %s@%i, errno = %d", __FILE__, __LINE__, errno); @@ -406,9 +402,6 @@ int JackOSSAdapter::OpenOutput() } } -printf("fAdaptedBufferSize %d %d %d %d %s\n", fExcl, fAdaptedBufferSize, fSampleSize, fPlaybackChannels, fPlaybackDriverName); - - gFragFormat = (2 << 16) + int2pow2(fAdaptedBufferSize * fSampleSize * fPlaybackChannels); if (ioctl(fOutFD, SNDCTL_DSP_SETFRAGMENT, &gFragFormat) == -1) { jack_error("JackOSSAdapter::OpenOutput failed to set fragments : %s@%i, errno = %d", __FILE__, __LINE__, errno); From f831229b5dcdc9a0c083904a7d75d03c8a91e455 Mon Sep 17 00:00:00 2001 From: sletz Date: Fri, 24 Jul 2009 06:38:50 +0000 Subject: [PATCH 33/35] O_EXCL has to stay in Solaris boomer driver. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3624 0c269be4-1314-0410-8aa9-9f06e86f4224 --- solaris/oss/JackBoomerDriver.cpp | 35 ++++++++++++++++++++++++++++---- solaris/oss/JackBoomerDriver.h | 4 +++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/solaris/oss/JackBoomerDriver.cpp b/solaris/oss/JackBoomerDriver.cpp index 14cb7b98..11dfb86d 100644 --- a/solaris/oss/JackBoomerDriver.cpp +++ b/solaris/oss/JackBoomerDriver.cpp @@ -233,7 +233,7 @@ void JackBoomerDriver::DisplayDeviceInfo() JackBoomerDriver::JackBoomerDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table) : JackAudioDriver(name, alias, engine, table), fInFD(-1), fOutFD(-1), fBits(0), - fSampleFormat(0), fNperiods(0), fRWMode(0) + fSampleFormat(0), fNperiods(0), fRWMode(0), fExcl(false), fInputBufferSize(0), fOutputBufferSize(0), fInputBuffer(NULL), fOutputBuffer(NULL), fInputThread(&fInputHandler), fOutputThread(&fOutputHandler), @@ -260,13 +260,20 @@ int JackBoomerDriver::OpenInput() if (fCaptureChannels == 0) fCaptureChannels = 2; - if ((fInFD = open(fCaptureDriverName, O_RDONLY)) < 0) { + if ((fInFD = open(fCaptureDriverName, O_RDONLY | ((fExcl) ? O_EXCL : 0))) < 0) { jack_error("JackBoomerDriver::OpenInput failed to open device : %s@%i, errno = %d", __FILE__, __LINE__, errno); return -1; } jack_log("JackBoomerDriver::OpenInput input fInFD = %d", fInFD); + if (fExcl) { + if (ioctl(fInFD, SNDCTL_DSP_COOKEDMODE, &flags) == -1) { + jack_error("JackBoomerDriver::OpenInput failed to set cooked mode : %s@%i, errno = %d", __FILE__, __LINE__, errno); + goto error; + } + } + gFragFormat = (2 << 16) + int2pow2(fEngineControl->fBufferSize * fSampleSize * fCaptureChannels); if (ioctl(fInFD, SNDCTL_DSP_SETFRAGMENT, &gFragFormat) == -1) { jack_error("JackBoomerDriver::OpenInput failed to set fragments : %s@%i, errno = %d", __FILE__, __LINE__, errno); @@ -322,12 +329,19 @@ int JackBoomerDriver::OpenOutput() if (fPlaybackChannels == 0) fPlaybackChannels = 2; - if ((fOutFD = open(fPlaybackDriverName, O_WRONLY)) < 0) { + if ((fOutFD = open(fPlaybackDriverName, O_WRONLY | ((fExcl) ? O_EXCL : 0))) < 0) { jack_error("JackBoomerDriver::OpenOutput failed to open device : %s@%i, errno = %d", __FILE__, __LINE__, errno); return -1; } jack_log("JackBoomerDriver::OpenOutput output fOutFD = %d", fOutFD); + + if (fExcl) { + if (ioctl(fOutFD, SNDCTL_DSP_COOKEDMODE, &flags) == -1) { + jack_error("JackBoomerDriver::OpenOutput failed to set cooked mode : %s@%i, errno = %d", __FILE__, __LINE__, errno); + goto error; + } + } gFragFormat = (2 << 16) + int2pow2(fEngineControl->fBufferSize * fSampleSize * fPlaybackChannels); if (ioctl(fOutFD, SNDCTL_DSP_SETFRAGMENT, &gFragFormat) == -1) { @@ -803,6 +817,14 @@ SERVER_EXPORT jack_driver_desc_t* driver_get_descriptor() desc->params[i].value.ui = OSS_DRIVER_DEF_OUTS; strcpy(desc->params[i].short_desc, "Playback channels"); strcpy(desc->params[i].long_desc, desc->params[i].short_desc); + + i++; + strcpy(desc->params[i].name, "excl"); + desc->params[i].character = 'e'; + desc->params[i].type = JackDriverParamBool; + desc->params[i].value.i = false; + strcpy(desc->params[i].short_desc, "Exclusif (O_EXCL) access mode"); + strcpy(desc->params[i].long_desc, desc->params[i].short_desc); i++; strcpy(desc->params[i].name, "capture"); @@ -859,6 +881,7 @@ EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine int chan_in = 0; int chan_out = 0; bool monitor = false; + bool excl = false; unsigned int nperiods = OSS_DRIVER_DEF_NPERIODS; const JSList *node; const jack_driver_param_t *param; @@ -913,6 +936,10 @@ EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine playback_pcm_name = strdup (param->value.str); capture_pcm_name = strdup (param->value.str); break; + + case 'e': + excl = true; + break; case 'I': systemic_input_latency = param->value.ui; @@ -933,7 +960,7 @@ EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine Jack::JackBoomerDriver* boomer_driver = new Jack::JackBoomerDriver("system", "boomer", engine, table); // Special open for Boomer driver... - if (boomer_driver->Open(frames_per_interrupt, nperiods, srate, capture, playback, chan_in, chan_out, + if (boomer_driver->Open(frames_per_interrupt, nperiods, srate, capture, playback, chan_in, chan_out, excl, monitor, capture_pcm_name, playback_pcm_name, systemic_input_latency, systemic_output_latency, bits) == 0) { return boomer_driver; } else { diff --git a/solaris/oss/JackBoomerDriver.h b/solaris/oss/JackBoomerDriver.h index e488ec69..c3281e1f 100644 --- a/solaris/oss/JackBoomerDriver.h +++ b/solaris/oss/JackBoomerDriver.h @@ -30,7 +30,7 @@ namespace Jack typedef jack_default_audio_sample_t jack_sample_t; -#define OSS_DRIVER_N_PARAMS 11 +#define OSS_DRIVER_N_PARAMS 12 #define OSS_DRIVER_DEF_DEV "/dev/dsp" #define OSS_DRIVER_DEF_FS 48000 #define OSS_DRIVER_DEF_BLKSIZE 1024 @@ -92,6 +92,7 @@ class JackBoomerDriver : public JackAudioDriver int fNperiods; unsigned int fSampleSize; int fRWMode; + bool fExcl; unsigned int fInputBufferSize; unsigned int fOutputBufferSize; @@ -129,6 +130,7 @@ class JackBoomerDriver : public JackAudioDriver bool playing, int chan_in, int chan_out, + bool excl, bool monitor, const char* capture_driver_name, const char* playback_driver_name, From 46b9d442823a795c4b410a4e3cbad2922f4196b1 Mon Sep 17 00:00:00 2001 From: sletz Date: Fri, 24 Jul 2009 07:52:40 +0000 Subject: [PATCH 34/35] Typo. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3625 0c269be4-1314-0410-8aa9-9f06e86f4224 --- solaris/oss/JackBoomerDriver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solaris/oss/JackBoomerDriver.cpp b/solaris/oss/JackBoomerDriver.cpp index 11dfb86d..12c4fdaa 100644 --- a/solaris/oss/JackBoomerDriver.cpp +++ b/solaris/oss/JackBoomerDriver.cpp @@ -395,6 +395,7 @@ int JackBoomerDriver::Open(jack_nframes_t nframes, bool playing, int inchannels, int outchannels, + bool excl, bool monitor, const char* capture_driver_uid, const char* playback_driver_uid, @@ -416,6 +417,7 @@ int JackBoomerDriver::Open(jack_nframes_t nframes, fRWMode |= ((capturing) ? kRead : 0); fRWMode |= ((playing) ? kWrite : 0); fBits = bits; + fExcl = excl; fNperiods = user_nperiods; #ifdef JACK_MONITOR From 4d64f8e232e0163d3bb10727baa80df3328ba3e5 Mon Sep 17 00:00:00 2001 From: sletz Date: Fri, 24 Jul 2009 08:19:38 +0000 Subject: [PATCH 35/35] Correct control.h again. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3626 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/jack/control.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/common/jack/control.h b/common/jack/control.h index 2aa05420..6360d30a 100644 --- a/common/jack/control.h +++ b/common/jack/control.h @@ -31,13 +31,8 @@ #include #include -#if __STDC_VERSION__ >= 199901L -# include -#else -# define TRUE 1 -# define FALSE 0 -# define bool int -# define __bool_true_false_are_defined +#if !defined (__sun__) +#include #endif /** Parameter types, intentionally similar to jack_driver_param_type_t */