From 5ef23d06c3f664e293cc5de1c82d09eec34651c2 Mon Sep 17 00:00:00 2001 From: sletz Date: Thu, 9 Jul 2009 10:05:42 +0000 Subject: [PATCH] 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)