Browse Source

support OS X with new netjack code, plus a small netjack fix/improvement

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@3135 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.116.0
paul 17 years ago
parent
commit
ae0ea1f84a
6 changed files with 47 additions and 4 deletions
  1. +1
    -1
      Makefile.am
  2. +17
    -0
      configure.ac
  3. +3
    -0
      drivers/netjack/Makefile.am
  4. +4
    -2
      drivers/netjack/net_driver.c
  5. +19
    -1
      drivers/netjack/netjack_packet.c
  6. +3
    -0
      tools/Makefile.am

+ 1
- 1
Makefile.am View File

@@ -19,7 +19,7 @@ DIST_SUBDIRS = config jack libjack jackd drivers example-clients tools doc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = jack.pc

EXTRA_DIST = COPYING COPYING.GPL COPYING.LGPL libjack/simd.c
EXTRA_DIST = COPYING COPYING.GPL COPYING.LGPL libjack/simd.c jack.spec

AUTOMAKE_OPTIONS = foreign



+ 17
- 0
configure.ac View File

@@ -78,6 +78,7 @@ AC_PROG_CXX
AC_PROG_LD
AM_PROG_LIBTOOL
AC_PROG_LN_S
AM_PROG_CC_C_O
AC_C_BIGENDIAN

AC_MSG_CHECKING([platform dependencies])
@@ -170,6 +171,21 @@ AC_CHECK_FUNCS(on_exit atexit)
AC_CHECK_FUNCS(posix_memalign)
AC_CHECK_LIB(m, sin)

echo -n "Checking for ppoll()... "
AC_EGREP_CPP( ppoll,
[
#define _GNU_SOURCE
#include <poll.h>
], [
AC_DEFINE(HAVE_PPOLL,1,"Whether ppoll is available")
echo "yes"
],[
AC_DEFINE(HAVE_PPOLL,0,"Whether ppoll is available")
echo "no"
] )


AC_CHECK_FUNC(clock_gettime,
[
AC_DEFINE(HAVE_CLOCK_GETTIME,0,"Whether or not clock_gettime can be found in system libraries")
@@ -762,6 +778,7 @@ AM_CONDITIONAL(HAVE_READLINE, $HAVE_READLINE)
AM_CONDITIONAL(HAVE_DOXYGEN, $HAVE_DOXYGEN)
AM_CONDITIONAL(USE_CAPABILITIES, $USE_CAPABILITIES)
AM_CONDITIONAL(STRIPPED_JACKD, $STRIPPED_JACKD)
AM_CONDITIONAL(HAVE_PPOLL, $HAVE_PPOLL)

AC_OUTPUT(
Makefile


+ 3
- 0
drivers/netjack/Makefile.am View File

@@ -7,6 +7,9 @@ if HAVE_SAMPLERATE
if HAVE_CELT
AM_CFLAGS += -DHAVE_CELT
endif
if HAVE_PPOLL
AM_CFLAGS += -DHAVE_PPOLL
endif

plugindir = $(ADDON_DIR)



+ 4
- 2
drivers/netjack/net_driver.c View File

@@ -52,6 +52,8 @@ $Id: net_driver.c,v 1.17 2006/04/16 20:16:10 torbenh Exp $

#undef DEBUG_WAKEUP

#define MIN(x,y) ((x)<(y) ? (x) : (y))

static int sync_state = TRUE;
static jack_transport_state_t last_transport_state;

@@ -300,7 +302,7 @@ net_driver_read (net_driver_t* driver, jack_nframes_t nframes)
framecnt = pkthdr->framecnt;
driver->reply_port = pkthdr->reply_port;
driver->latency = pkthdr->latency;
driver->resync_threshold = pkthdr->latency-1;
driver->resync_threshold = MIN( 15, pkthdr->latency-1 );

// check whether, we should handle the transport sync stuff, or leave trnasports untouched.
if (driver->handle_transport_sync) {
@@ -704,7 +706,7 @@ net_driver_new (jack_client_t * client,
driver->num_lost_packets = 0;
driver->next_deadline_valid = 0;

driver->resync_threshold = driver->latency - 1;
driver->resync_threshold = MIN( 15, driver->latency-1 );
driver->running_free = 0;

jack_info ("netjack: period : up: %d / dn: %d", driver->net_period_up, driver->net_period_down);


+ 19
- 1
drivers/netjack/netjack_packet.c View File

@@ -26,6 +26,9 @@
*
*/

#ifdef HAVE_PPOLL
#define _GNU_SOURCE
#endif

#include <math.h>
#include <stdio.h>
@@ -323,15 +326,24 @@ netjack_poll_deadline (int sockfd, jack_time_t deadline)
{
struct pollfd fds;
int i, poll_err = 0;
sigset_t sigmask;
sigset_t sigmask, rsigmask;
struct sigaction action;
#ifdef HAVE_PPOLL
struct timespec timeout_spec = { 0, 0 };
#else
int timeout;
#endif


jack_time_t now = jack_get_microseconds();
if( now >= deadline )
return 0;

#ifdef HAVE_PPOLL
timeout_spec.tv_nsec = (deadline - now) * 1000;
#else
timeout = lrintf( (float)(deadline - now) / 1000.0 );
#endif

sigemptyset(&sigmask);
sigaddset(&sigmask, SIGHUP);
@@ -353,7 +365,13 @@ netjack_poll_deadline (int sockfd, jack_time_t deadline)
fds.fd = sockfd;
fds.events = POLLIN;

#ifdef HAVE_PPOLL
poll_err = ppoll (&fds, 1, &timeout_spec, &sigmask);
#else
sigprocmask (SIG_UNBLOCK, &sigmask, &rsigmask);
poll_err = poll (&fds, 1, timeout);
sigprocmask (SIG_SETMASK, &rsigmask, NULL);
#endif

if (poll_err == -1)
{


+ 3
- 0
tools/Makefile.am View File

@@ -127,6 +127,9 @@ jack_netsource_CFLAGS = -I$(top_srcdir)/drivers/netjack
if HAVE_CELT
jack_netsource_CFLAGS += -DHAVE_CELT
endif
if HAVE_PPOLL
jack_netsource_CFLAGS += -DHAVE_PPOLL
endif
jack_netsource_LDFLAGS = -lsamplerate @OS_LDFLAGS@
jack_netsource_LDADD = $(top_builddir)/libjack/libjack.la



Loading…
Cancel
Save