diff options
-rw-r--r-- | config/cpu/generic/atomicity.h | 8 | ||||
-rw-r--r-- | config/cpu/generic/cycles.h | 7 | ||||
-rw-r--r-- | configure.ac | 18 | ||||
-rw-r--r-- | drivers/netjack/netjack_packet.c | 2 | ||||
-rw-r--r-- | jackd/engine.c | 17 | ||||
-rw-r--r-- | jackd/jackd.c | 2 | ||||
-rw-r--r-- | libjack/client.c | 15 | ||||
-rw-r--r-- | libjack/port.c | 4 |
8 files changed, 48 insertions, 25 deletions
diff --git a/config/cpu/generic/atomicity.h b/config/cpu/generic/atomicity.h index 655cc14..0b25100 100644 --- a/config/cpu/generic/atomicity.h +++ b/config/cpu/generic/atomicity.h @@ -20,24 +20,20 @@ #ifndef _ATOMICITY_H #define _ATOMICITY_H 1 -#warning "stub atomicity functions are not atomic on this platform" - typedef int _Atomic_word; static inline _Atomic_word __attribute__ ((__unused__)) __exchange_and_add(volatile _Atomic_word* mem, int val) { - int result = *mem; - *mem += val; - return result; + return __sync_fetch_and_add(mem, val); } static inline void __attribute__ ((__unused__)) __atomic_add(volatile _Atomic_word* mem, int val) { - *mem += val; + __sync_add_and_fetch(mem, val); } #endif /* atomicity.h */ diff --git a/config/cpu/generic/cycles.h b/config/cpu/generic/cycles.h index 8213a05..b05fb0e 100644 --- a/config/cpu/generic/cycles.h +++ b/config/cpu/generic/cycles.h @@ -22,17 +22,16 @@ /* generic solution that is not really a solution at all */ -#warning You are compiling JACK on a platform for which jack/config/sysdep/cycles.h needs work #include <sys/time.h> typedef long cycles_t; static inline cycles_t get_cycles(void) { - struct timeval tv; - gettimeofday (&tv, NULL); + struct timespec time; + clock_gettime(CLOCK_REALTIME, &time); - return ((cycles_t) tv.tv_sec * 1000000) + tv.tv_usec; + return ((cycles_t) time.tv_sec * 1000000) + time.tv_nsec*1000; } #endif /* __jack_cycles_h__ */ diff --git a/configure.ac b/configure.ac index 5c20236..8941873 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,11 @@ dnl dnl Check for existing JACK installs dnl +AC_ARG_ENABLE(force-install, + AC_HELP_STRING([--enable-force-install], + [force installation when another Jack is found]), + [FORCE_INSTALL=$enableval]) + AC_MSG_CHECKING([existing, conflicting JACK installs]) not_overwriting=0 installs= @@ -22,7 +27,7 @@ for dir in /usr/lib /usr/local/lib /opt/lib ; do fi done -if test $not_overwriting -gt 0 ; then +if test "x$FORCE_INSTALL" != "xyes" -a $not_overwriting -gt 0 ; then echo echo echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" @@ -37,15 +42,17 @@ if test $not_overwriting -gt 0 ; then echo "Before building, you should first remove the existing JACK" echo "installation(s). " echo - echo "Alternatively use ./configure --prefix=... to force overwriting" - echo "the existing install." + echo "Alternatively use ./configure --enable-force-install to force" + echo "overwriting the existing install." echo echo "WARNING: ON ANY DEBIAN-DERIVED DISTRIBUTION (Debian, Ubuntu etc)" echo "CHANGING THE INSTALLATION PREFIX WILL NOT PRODUCE A WORKING JACK" echo "INSTALL. Please contact the distribution packager for JACK and" echo "ask them to fix their packaging." echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - exit 1 + if test "x$FORCE_INSTALL" != "xyes"; then + exit 1 + fi fi AC_CONFIG_AUX_DIR(config) @@ -297,7 +304,7 @@ AC_DEFINE_UNQUOTED(JACK_SHM_TYPE, [$JACK_SHM_TYPE], AM_CONDITIONAL(USE_POSIX_SHM, $USE_POSIX_SHM) JACK_CORE_CFLAGS="-I\$(top_srcdir)/config -I\$(top_srcdir) \ --I\$(top_srcdir) -I\$(top_srcdir)/include \ +-I\$(top_srcdir)/include -I\$(top_builddir)/include \ -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall" JACK_LIBC_HELPER_FLAGS= @@ -714,6 +721,7 @@ case $build_os in ) ;; esac +AM_CONDITIONAL(HAVE_ZITA_ALSA_PCMI, $HAVE_ZITA_ALSA_PCMI) # Celt low-latency audio codec. netjack transmission via internet. HAVE_CELT=false diff --git a/drivers/netjack/netjack_packet.c b/drivers/netjack/netjack_packet.c index 950cf4c..35b2520 100644 --- a/drivers/netjack/netjack_packet.c +++ b/drivers/netjack/netjack_packet.c @@ -1268,7 +1268,7 @@ render_payload_to_jack_ports_8bit (void *packet_payload, jack_nframes_t net_peri { // midi port, decode midi events // convert the data buffer to a standard format (uint32_t based) - unsigned int buffer_size_uint32 = net_period_down / 2; + unsigned int buffer_size_uint32 = net_period_down / 4; uint32_t * buffer_uint32 = (uint32_t*) packet_bufX; decode_midi_buffer (buffer_uint32, buffer_size_uint32, buf); } diff --git a/jackd/engine.c b/jackd/engine.c index 26df2bd..b92051c 100644 --- a/jackd/engine.c +++ b/jackd/engine.c @@ -3038,6 +3038,7 @@ jack_deliver_event (jack_engine_t *engine, jack_client_internal_t *client, */ if (event->type == PropertyChange) { + if (keylen) { if (write (client->event_fd, key, keylen) != keylen) { jack_error ("cannot send property change key to client [%s] (%s)", client->control->name, @@ -3045,6 +3046,7 @@ jack_deliver_event (jack_engine_t *engine, jack_client_internal_t *client, client->error += JACK_ERROR_WITH_SOCKETS; jack_engine_signal_problems (engine); } + } } if (client->error) { @@ -4472,6 +4474,17 @@ next: req->x.port_info.port_id = port_id; + if (internal) { + /* set port order so clients can list ports in the proper order if + * there are more than 9 driver ports (since the lack of leading zeros + * breaks sorting by name) */ + char index_str[16]; + snprintf (index_str, sizeof(index_str), "%d", port_id); + jack_set_property (client, shared->uuid, + "http://jackaudio.org/metadata/order", index_str, + "http://www.w3.org/2001/XMLSchema#integer"); + } + return 0; } @@ -4670,8 +4683,8 @@ jack_port_rename_notify (jack_engine_t *engine, event.type = PortRename; event.y.other_id = port->shared->id; - snprintf (event.x.name, JACK_PORT_NAME_SIZE-1, old_name); - snprintf (event.z.other_name, JACK_PORT_NAME_SIZE-1, new_name); + snprintf (event.x.name, JACK_PORT_NAME_SIZE-1, "%s", old_name); + snprintf (event.z.other_name, JACK_PORT_NAME_SIZE-1, "%s", new_name); for (node = engine->clients; node; node = jack_slist_next (node)) { diff --git a/jackd/jackd.c b/jackd/jackd.c index df752ed..1a59b84 100644 --- a/jackd/jackd.c +++ b/jackd/jackd.c @@ -675,7 +675,7 @@ main (int argc, char *argv[]) #ifdef HAVE_ZITA_BRIDGE_DEPS const char *options = "A:d:P:uvshVrRZTFlI:t:mM:n:Np:c:X:C:"; #else - const char *options = "A:d:P:uvshVrRZTFlI:t:mM:n:Np:c:X:C:"; + const char *options = "d:P:uvshVrRZTFlI:t:mM:n:Np:c:X:C:"; #endif struct option long_options[] = { diff --git a/libjack/client.c b/libjack/client.c index f00dee9..39799de 100644 --- a/libjack/client.c +++ b/libjack/client.c @@ -295,10 +295,15 @@ jack_client_deliver_request (const jack_client_t *client, jack_request_t *req) { /* indirect through the function pointer that was set either * by jack_client_open() or by jack_new_client_request() in - * the server. + * the server. possibly NULL during driver port registration, + * in which case we don't care about request delivery. */ - return client->deliver_request (client->deliver_arg, req); + if (client->deliver_request) { + return client->deliver_request (client->deliver_arg, req); + } + + return 0; } #if JACK_USE_MACH_THREADS @@ -308,7 +313,7 @@ jack_client_alloc () { jack_client_t *client; - if ((client = (jack_client_t *) malloc (sizeof (jack_client_t))) == NULL) { + if ((client = (jack_client_t *) calloc (1, sizeof (jack_client_t))) == NULL) { return NULL; } @@ -348,7 +353,7 @@ jack_client_alloc () { jack_client_t *client; - if ((client = (jack_client_t *) malloc (sizeof (jack_client_t))) == NULL) { + if ((client = (jack_client_t *) calloc (1, sizeof (jack_client_t))) == NULL) { return NULL; } if ((client->pollfd = (struct pollfd *) malloc (sizeof (struct pollfd) * 2)) == NULL) { @@ -1777,6 +1782,7 @@ jack_client_process_events (jack_client_t* client) } if (event.type == PropertyChange) { + if (event.y.key_size) { key = (char *) malloc (event.y.key_size); if (read (client->event_fd, key, event.y.key_size) != event.y.key_size) { @@ -1784,6 +1790,7 @@ jack_client_process_events (jack_client_t* client) strerror (errno)); return -1; } + } } status = 0; diff --git a/libjack/port.c b/libjack/port.c index 16a11b9..5d42b9f 100644 --- a/libjack/port.c +++ b/libjack/port.c @@ -813,8 +813,8 @@ jack_port_rename (jack_client_t* client, jack_port_t *port, const char *new_name req.type = PortNameChanged; /* re-purpose an appropriate part of the request union to convey the names */ - snprintf ((char *) req.x.connect.source_port, JACK_PORT_NAME_SIZE-1, old_name); - snprintf ((char *) req.x.connect.destination_port, JACK_PORT_NAME_SIZE-1, new_name); + snprintf ((char *) req.x.connect.source_port, JACK_PORT_NAME_SIZE-1, "%s", old_name); + snprintf ((char *) req.x.connect.destination_port, JACK_PORT_NAME_SIZE-1, "%s", new_name); (void) jack_client_deliver_request (client, &req); } |