diff --git a/Makefile.am b/Makefile.am index fabd5a2..3c4cc6b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,7 @@ AM_CFLAGS = $(JACK_CFLAGS) -DADDON_DIR=\"$(ADDON_DIR)\" @GLIB_CFLAGS@ AM_CXXFLAGS = $(JACK_CFLAGS) -DADDON_DIR=\"$(ADDON_DIR)\" jackd_SOURCES = jackd.c engine.c -jackd_LDFLAGS = -ldl -lpthread $(GLIB_LIBS) +jackd_LDFLAGS = -lm -ldl -lpthread $(GLIB_LIBS) jackd_LDADD = libjack.la jack_simple_client_SOURCES = simple_client.c @@ -42,11 +42,11 @@ jack_impulse_grabber_LDADD = libjack.la lib_LTLIBRARIES = libjack.la jack_alsa.la libjack_la_SOURCES = client.c pool.c driver.c -libjack_la_LDFLAGS = $(GLIB_LIBS) +libjack_la_LDFLAGS = $(GLIB_LIBS) -lm jack_alsa_la_LDFLAGS = -module jack_alsa_la_SOURCES = alsa_driver.c hammerfall.c generic_hw.c memops.c -jack_alsa_la_LIBADD = -lasound $(GLIB_LIBS) +jack_alsa_la_LIBADD = -lasound $(GLIB_LIBS) -lm pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = jack.pc diff --git a/alsa_driver.c b/alsa_driver.c index 9986e5f..4993535 100644 --- a/alsa_driver.c +++ b/alsa_driver.c @@ -718,11 +718,6 @@ alsa_driver_wait (alsa_driver_t *driver) nfds += driver->capture_nfds; } - if (need_capture != need_playback) { - fprintf (stderr, "poll needs capture: %s playback: %s\n", need_capture ? "yes":"no", - need_playback ? "yes":"no"); - } - /* ALSA doesn't set POLLERR in some versions of 0.9.X */ for (i = 0; i < nfds; i++) { diff --git a/engine.c b/engine.c index 7783e85..fdd9efa 100644 --- a/engine.c +++ b/engine.c @@ -1150,10 +1150,12 @@ jack_become_real_time (pthread_t thread, int priority) if ((x = pthread_setschedparam (thread, SCHED_FIFO, &rtparam)) != 0) { jack_error ("cannot set thread to real-time priority (FIFO/%d) (%d: %s)", rtparam.sched_priority, x, strerror (errno)); + return -1; } if (mlockall (MCL_CURRENT | MCL_FUTURE) != 0) { jack_error ("cannot lock down memory for RT thread (%s)", strerror (errno)); + return -1; } return 0; @@ -1186,7 +1188,9 @@ jack_main_thread (void *arg) // unsigned long start, end; if (engine->control->real_time) { - jack_become_real_time (pthread_self(), engine->rtpriority); + if (jack_become_real_time (pthread_self(), engine->rtpriority)) { + engine->control->real_time = 0; + } } pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL);