git-svn-id: svn+ssh://jackaudio.org/trunk/jack@372 0c269be4-1314-0410-8aa9-9f06e86f4224tags/0.109.0
| @@ -13,7 +13,7 @@ dnl micro version = incremented when implementation-only | |||||
| dnl changes are made | dnl changes are made | ||||
| dnl --- | dnl --- | ||||
| JACK_MAJOR_VERSION=0 | JACK_MAJOR_VERSION=0 | ||||
| JACK_MINOR_VERSION=68 | |||||
| JACK_MINOR_VERSION=69 | |||||
| JACK_MICRO_VERSION=0 | JACK_MICRO_VERSION=0 | ||||
| dnl --- | dnl --- | ||||
| @@ -41,7 +41,7 @@ dnl slacker than this, and closer to those for the JACK version | |||||
| dnl number. | dnl number. | ||||
| dnl --- | dnl --- | ||||
| JACK_API_CURRENT=0 | JACK_API_CURRENT=0 | ||||
| JACK_API_REVISION=18 | |||||
| JACK_API_REVISION=19 | |||||
| JACK_API_AGE=0 | JACK_API_AGE=0 | ||||
| AC_SUBST(JACK_MAJOR_VERSION) | AC_SUBST(JACK_MAJOR_VERSION) | ||||
| @@ -87,12 +87,19 @@ dnl look for system support for POSIX shm API | |||||
| dnl XXX this could probably be improved | dnl XXX this could probably be improved | ||||
| dnl | dnl | ||||
| AC_ARG_ENABLE(sysv-shm, [ --enable-sysv-shm use System V shm API even if POSIX API is supported ]) | |||||
| AC_MSG_CHECKING([POSIX shm support (compile time)]) | AC_MSG_CHECKING([POSIX shm support (compile time)]) | ||||
| df | grep -s /dev/shm >/dev/null 2>&1 | df | grep -s /dev/shm >/dev/null 2>&1 | ||||
| if test $? = 0 ; then | if test $? = 0 ; then | ||||
| SHM_FLAGS=-DUSE_POSIX_SHM | |||||
| AC_MSG_RESULT([found. | |||||
| JACK will use shm_open() and friends]) | |||||
| if test "x$enable-sysv-shm" = "xno" ; then | |||||
| SHM_FLAGS=-DUSE_POSIX_SHM | |||||
| AC_MSG_RESULT([found. | |||||
| JACK will use shm_open() and friends.]) | |||||
| else | |||||
| AC_MSG_RESULT([found. | |||||
| But JACK will use shmget() and friends because you asked for it.]) | |||||
| fi | |||||
| else | else | ||||
| AC_MSG_RESULT([not found. | AC_MSG_RESULT([not found. | ||||
| JACK will use System V shm API (shmget() and friends]) | JACK will use System V shm API (shmget() and friends]) | ||||
| @@ -127,7 +127,7 @@ disk_thread (void *arg) | |||||
| unsigned int chn; | unsigned int chn; | ||||
| jack_nframes_t total_captured = 0; | jack_nframes_t total_captured = 0; | ||||
| int done = 0; | int done = 0; | ||||
| double *fbuf; | |||||
| float *fbuf; | |||||
| pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL); | pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL); | ||||
| pthread_mutex_lock (&buffer_lock); | pthread_mutex_lock (&buffer_lock); | ||||
| @@ -147,11 +147,11 @@ disk_thread (void *arg) | |||||
| while ((buf = get_write_buffer ()) != 0) { | while ((buf = get_write_buffer ()) != 0) { | ||||
| pthread_mutex_unlock (&buffer_lock); | pthread_mutex_unlock (&buffer_lock); | ||||
| /* grrr ... libsndfile doesn't do float data yet, only double */ | |||||
| /* libsndfile requires interleaved data */ | |||||
| if (info->can_capture) { | if (info->can_capture) { | ||||
| fbuf = (double *) malloc (sizeof (double) * buf->nframes * info->channels); | |||||
| fbuf = (float *) malloc (sizeof (float) * buf->nframes * info->channels); | |||||
| for (chn = 0; chn < info->channels; chn++) { | for (chn = 0; chn < info->channels; chn++) { | ||||
| for (i = 0; i < buf->nframes; i++) { | for (i = 0; i < buf->nframes; i++) { | ||||
| @@ -159,7 +159,7 @@ disk_thread (void *arg) | |||||
| } | } | ||||
| } | } | ||||
| if (sf_writef_double (info->sf, fbuf, buf->nframes) != (sf_count_t)buf->nframes) { | |||||
| if (sf_writef_float (info->sf, fbuf, buf->nframes) != (sf_count_t)buf->nframes) { | |||||
| char errstr[256]; | char errstr[256]; | ||||
| sf_error_str (0, errstr, sizeof (errstr) - 1); | sf_error_str (0, errstr, sizeof (errstr) - 1); | ||||
| fprintf (stderr, "cannot write data to sndfile (%s)\n", errstr); | fprintf (stderr, "cannot write data to sndfile (%s)\n", errstr); | ||||
| @@ -55,7 +55,13 @@ | |||||
| * Time to wait for clients in msecs. Used when jackd is | * Time to wait for clients in msecs. Used when jackd is | ||||
| * run in non-ASIO mode and without realtime priority enabled. | * run in non-ASIO mode and without realtime priority enabled. | ||||
| */ | */ | ||||
| #define DEBUGGING_SLOW_CLIENTS | |||||
| #ifdef DEBUGGING_SLOW_CLIENTS | |||||
| #define JACKD_SOFT_MODE_TIMEOUT 5000 | |||||
| #else | |||||
| #define JACKD_SOFT_MODE_TIMEOUT 500 | #define JACKD_SOFT_MODE_TIMEOUT 500 | ||||
| #endif | |||||
| #define JACK_ERROR_WITH_SOCKETS 10000000 | #define JACK_ERROR_WITH_SOCKETS 10000000 | ||||
| @@ -64,6 +64,12 @@ jack_initialize_shm () | |||||
| void *addr; | void *addr; | ||||
| int id; | int id; | ||||
| #ifdef USE_POSIX_SHM | |||||
| fprintf (stderr, "JACK compiled with POSIX SHM support\n"); | |||||
| #else | |||||
| fprintf (stderr, "JACK compiled with System V SHM support\n"); | |||||
| #endif | |||||
| if (jack_shm_registry != NULL) { | if (jack_shm_registry != NULL) { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -82,7 +88,7 @@ jack_initialize_shm () | |||||
| jack_shm_registry = (jack_shm_registry_entry_t *) addr; | jack_shm_registry = (jack_shm_registry_entry_t *) addr; | ||||
| jack_shm_id_cnt = 0; | jack_shm_id_cnt = 0; | ||||
| jack_register_shm("/jack-shm-registry", addr, id); | |||||
| jack_register_shm ("/jack-shm-registry", addr, id); | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -264,23 +270,43 @@ jack_get_shm (const char *shm_name, size_t size, int perm, int mode, int prot, i | |||||
| unlink (path); | unlink (path); | ||||
| return MAP_FAILED; | return MAP_FAILED; | ||||
| } | } | ||||
| /* XXX need to figure out how to do this without causing the inode reallocation | |||||
| the next time this function is called resulting in ftok() returning non-unique | |||||
| keys. | |||||
| */ | |||||
| unlink (path); | |||||
| /* unlink (path); */ | |||||
| fprintf (stderr, "key for %s is 0x%x\n", path, key); | |||||
| shmflags = mode; | |||||
| shmflags = 0; | |||||
| if (perm & O_CREAT) { | |||||
| shmflags |= IPC_CREAT; | |||||
| } | |||||
| // if (mode & O_TRUNC) { | |||||
| // shmflags |= IPC_CREAT; | |||||
| // } | |||||
| if (perm & O_TRUNC) { | |||||
| shmflags |= IPC_EXCL; | |||||
| } | |||||
| if ((*shmid = shmget (key, size, shmflags)) < 0) { | if ((*shmid = shmget (key, size, shmflags)) < 0) { | ||||
| jack_error ("cannot create shm segment %s (%s)", shm_name, strerror (errno)); | |||||
| return MAP_FAILED; | |||||
| if (errno == EEXIST && (shmflags & IPC_EXCL)) { | |||||
| shmflags &= ~IPC_EXCL; | |||||
| if ((*shmid = shmget (key, size, shmflags)) < 0) { | |||||
| jack_error ("cannot get existing shm segment for %s (%s)", | |||||
| shm_name, strerror (errno)); | |||||
| return MAP_FAILED; | |||||
| } | |||||
| } else { | |||||
| jack_error ("cannot create shm segment %s (%s)", shm_name, strerror (errno)); | |||||
| return MAP_FAILED; | |||||
| } | |||||
| } | } | ||||
| if ((addr = shmat (*shmid, 0, 0)) != 0) { | |||||
| if ((addr = shmat (*shmid, 0, 0)) < 0) { | |||||
| jack_error ("cannot attach shm segment %s (%s)", shm_name, strerror (errno)); | jack_error ("cannot attach shm segment %s (%s)", shm_name, strerror (errno)); | ||||
| return MAP_FAILED; | return MAP_FAILED; | ||||
| } | } | ||||