diff --git a/.cvsignore b/.cvsignore index e69de29..b80256d 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +jack-audio-connection-kit-0.101.1.tar.gz diff --git a/jack-audio-connection-kit-README.Fedora b/jack-audio-connection-kit-README.Fedora new file mode 100644 index 0000000..0da075c --- /dev/null +++ b/jack-audio-connection-kit-README.Fedora @@ -0,0 +1,63 @@ +Running JACK server in realtime mode. + +The JACK server jackd has the capability to run in a real-time mode +which greatly decreases the chance of audio glitches. The real-time mode +is enabled by passing the -R or --realtime option to jackd when starting +the server. It is only possible to run jackd in real-time mode as a +non-root user by modifying your PAM configuration, PAM stands for +Pluggable Authentication Modules and is the primary authentification +mechanism used on Fedora. The primary source of PAM documentation can be +found at the following at http://www.kernel.org/pub/linux/libs/pam/ + +The specific PAM configuration file that needs to be modified is +/etc/security/limits.conf and it controls the system resource limits. It +is important to understand that modifying the resource limits +configuration files can decrease the security of your system. +Documentation specific to the resource limits PAM module can be found at +http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/pam-6.html#ss6.12 + +The resource limits that need to be changed to allow jackd to run in +realtime mode are named rtprio and memlock. To increase the limits for a +specific user named fred you would add the following to +/etc/security/limits.conf + +fred - rtprio 20 +fred - memlock 50000 + +The value of rtprio can be set in the range 0 - 99 where any value +greater that 0 will allow the user to change the scheduling policy to +"real-time". By default the JACK server requires a minimum rtprio +setting of 20 but jackd will accept a command line parameter -P or +--realtime-priority which will change the minimum required value of +rtprio that is needed, but the default of 20 is nearly always +sufficient. + +The appropriate value for memlock is dependent on the amount of memory +present in the system but a minimum value of 50000(50MB) and a maximum +value of half the available memory can be used as a rough guideline. + +To verify that the resource limits have been modified you can use the +bash built-in ulimit command, for example: + +$ulimit -a +core file size (blocks, -c) 0 +data seg size (kbytes, -d) unlimited +max nice (-e) 0 +file size (blocks, -f) unlimited +pending signals (-i) 8191 +max locked memory (kbytes, -l) 50000 +max memory size (kbytes, -m) unlimited +open files (-n) 1024 +pipe size (512 bytes, -p) 8 +POSIX message queues (bytes, -q) 819200 +max rt priority (-r) 20 +stack size (kbytes, -s) 10240 +cpu time (seconds, -t) unlimited +max user processes (-u) 8191 +virtual memory (kbytes, -v) unlimited +file locks (-x) unlimited +file locks (-x) unlimited + +Keep in mind that you may have to re-login before changes to limits.conf +take effect. + diff --git a/jack-audio-connection-kit.spec b/jack-audio-connection-kit.spec new file mode 100644 index 0000000..a29e026 --- /dev/null +++ b/jack-audio-connection-kit.spec @@ -0,0 +1,187 @@ +Summary: The Jack Audio Connection Kit +Name: jack-audio-connection-kit +Version: 0.101.1 +Release: 8%{?dist} +License: GPL/LGPL +Group: System Environment/Daemons +Source0: http://dl.sourceforge.net/sourceforge/jackit/%{name}-%{version}.tar.gz +Source1: %{name}-README.Fedora +Patch0: http://lalists.stanford.edu/lad/2006/01/att-0167/jack-clock3.patch +URL: http://jackit.sourceforge.net +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: alsa-lib-devel +BuildRequires: libsndfile-devel >= 1.0.0 +BuildRequires: pkgconfig +BuildRequires: doxygen +BuildRequires: readline-devel, libtermcap-devel, ncurses-devel + +%description +JACK is a low-latency audio server, written primarily for the Linux +operating system. It can connect a number of different applications to +an audio device, as well as allowing them to share audio between +themselves. Its clients can run in their own processes (ie. as a +normal application), or can they can run within a JACK server (ie. a +"plugin"). + +JACK is different from other audio server efforts in that it has been +designed from the ground up to be suitable for professional audio +work. This means that it focuses on two key areas: synchronous +execution of all clients, and low latency operation. + +%package devel +Summary: Header files for Jack +Group: Development/Libraries +Requires: %{name} = %{version} +Requires: pkgconfig + +%description devel +Header files for the Jack Audio Connection Kit. + +%package example-clients +Summary: Example clients that use Jack +Group: Applications/Multimedia +Requires: %{name} = %{version} + +%description example-clients +Small example clients that use the Jack Audio Connection Kit. + +%prep +%setup -q +%patch0 -p1 -b .clock3 + +%build +# x86_64 issue reported by Rudolf Kastl (not checked, but not bad). +# Also patch0 touches configure.ac. +autoreconf --force --install + +%configure --enable-stripped-jackd \ + --with-html-dir=%{_docdir} \ +%ifarch i386 + --enable-sse=no --enable-mmx=no \ +%endif + --disable-oss \ + --disable-portaudio \ + --enable-optimize \ + --with-default-tmpdir=/dev/shm +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT + +# can't use the makeinstall macro, jack needs DESTDIR and prefix gets +# added to it and messes up part of the install +make install DESTDIR=$RPM_BUILD_ROOT + +# prepare README.Fedora for documentation including +cp -p %{SOURCE1} README.Fedora + +# remove extra install of the documentation +rm -fr $RPM_BUILD_ROOT%{_docdir} + +# remove *.la files +rm -f $RPM_BUILD_ROOT%{_libdir}/jack/*.la +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%doc AUTHORS TODO COPYING* +%doc README.Fedora +%{_bindir}/jackd +%{_bindir}/jack_load +%{_bindir}/jack_unload +%{_bindir}/jack_bufsize +%{_bindir}/jack_freewheel +%{_bindir}/jack_transport +%{_libdir}/jack/ +%{_mandir}/man1/jack*.1* +%{_libdir}/libjack.so.* + +%files devel +%defattr(-,root,root) +%doc doc/reference +%{_includedir}/jack/ +%{_libdir}/libjack.so +%{_libdir}/pkgconfig/jack.pc + +%files example-clients +%defattr(-,root,root) +%{_bindir}/jackrec +%{_bindir}/jack_connect +%{_bindir}/jack_disconnect +%{_bindir}/jack_impulse_grabber +%{_bindir}/jack_lsp +%{_bindir}/jack_metro +%{_bindir}/jack_showtime +%{_bindir}/jack_monitor_client +%{_bindir}/jack_simple_client + +%changelog +* Fri May 19 2006 Andy Shevchenko 0.101.1-8 +- uniform directories items at %files section + +* Wed May 17 2006 Andy Shevchenko 0.101.1-7 +- change License tag to GPL/LGPL +- remove --enable-shared (it should be default) +- add a -p flag to the line that copies README.Fedora + +* Wed May 10 2006 Andy Shevchenko 0.101.1-6 +- apply clock fix for AMD X2 CPUs (please, refer to + http://sourceforge.net/mailarchive/forum.php?thread_id=8085535&forum_id=3040) + +* Wed May 03 2006 Andy Shevchenko 0.101.1-5 +- adjust spec after reviewing + +* Thu Apr 27 2006 Andy Shevchenko 0.101.1-4 +- reformatting README.Fedora to 72 symbols width + +* Wed Apr 26 2006 Andy Shevchenko 0.101.1-3 +- add README.Fedora +- remove useless BRs + +* Mon Apr 24 2006 Andy Shevchenko 0.101.1-2 +- disable oss and portaudio engines +- use /dev/shm as jack tmpdir +- remove capabilities stuff + +* Tue Apr 04 2006 Andy Shevchenko 0.101.1-1 +- update to 0.101.1 + +* Mon Mar 27 2006 Andy Shevchenko +- update to 0.100.7 (#183912) +- adjust BR (add versions) +- replace files between examples and main packages +- own jack tmpdir + +* Fri Mar 17 2006 Andy Shevchenko +- no libs subpackage +- From Fernando Lopez-Lezcano : + - added configuration variable to build with/without capabilities + - added --enable-optimize flag to configure script + - disabled sse/mmx instructions in i386 build + - create temporary directory as /var/lib/jack/tmp + - create and erase tmp directory at install or uninstall + - try to umount the temporary directory before uninstalling the package + +* Fri Mar 03 2006 Andy Shevchenko +- fix spec for extras injection + +* Fri Nov 18 2005 Andy Shevchenko +- exclude *.la files +- use dist tag + +* Fri Oct 14 2005 Andy Shevchenko +- 0.100.0 +- no optimization + +* Tue Sep 28 2004 Andy Shevchenko +- 0.99.1 + +* Fri Aug 20 2004 Andy Shevchenko +- rebuild from Mandrake diff --git a/jack-clock3.patch b/jack-clock3.patch new file mode 100644 index 0000000..ffad0e6 --- /dev/null +++ b/jack-clock3.patch @@ -0,0 +1,268 @@ +diff -ur jack-audio-connection-kit-0.100.7/config/os/generic/time.h jack/config/os/generic/time.h +--- jack-audio-connection-kit-0.100.7/config/os/generic/time.h 2004-04-07 07:52:58.000000000 +0300 ++++ jack/config/os/generic/time.h 2005-12-06 12:24:03.000000000 +0200 +@@ -1,5 +1,6 @@ + /* + Copyright (C) 2001-2004 Paul Davis, Tilman Linneweh ++ Copyright (C) 2005 Jussi Laako + + Generic version, overridden by OS-specific definition when needed. + +@@ -23,48 +24,24 @@ + #define __jack_time_h__ + + #include ++#include + #include +-#include +- +-/* This is a kludge. We need one global instantiation of this +- * variable in each address space. So, libjack/client.c declares the +- * actual storage. Other source files will see it as an extern. */ +-#define JACK_TIME_GLOBAL_DECL jack_time_t __jack_cpu_mhz +-extern JACK_TIME_GLOBAL_DECL; + + static inline jack_time_t + jack_get_microseconds (void) { +- return get_cycles() / __jack_cpu_mhz; +-} ++ jack_time_t jackTime; ++ struct timeval time; + +-/* This function is inspired by similar code in MPLayer. +- * It should be quite portable +- */ +-static inline jack_time_t +-jack_get_mhz (void) +-{ +- jack_time_t tsc_start, tsc_end; +- struct timeval tv_start, tv_end; +- long usec_delay; +- jack_time_t mhz; +- +- tsc_start = get_cycles(); +- gettimeofday(&tv_start, NULL); +- usleep(100000); +- tsc_end = get_cycles(); +- gettimeofday(&tv_end, NULL); +- +- usec_delay = 1000000 * (tv_end.tv_sec - tv_start.tv_sec) +- + (tv_end.tv_usec - tv_start.tv_usec); +- mhz = (tsc_end - tsc_start) / usec_delay; +- return mhz; ++ gettimeofday(&time, NULL); ++ jackTime = (jack_time_t) time.tv_sec * 1e6 + ++ (jack_time_t) time.tv_usec; ++ return jackTime; + } + + /* This should only be called ONCE per process. */ + static inline void + jack_init_time () + { +- __jack_cpu_mhz = jack_get_mhz (); + } + + #endif /* __jack_time_h__ */ +diff -ur jack-audio-connection-kit-0.100.7/config/os/gnu-linux/time.h jack/config/os/gnu-linux/time.h +--- jack-audio-connection-kit-0.100.7/config/os/gnu-linux/time.h 2004-03-25 21:31:44.000000000 +0200 ++++ jack/config/os/gnu-linux/time.h 2005-12-06 16:30:20.000000000 +0200 +@@ -1,5 +1,6 @@ + /* + Copyright (C) 2001-2003 Paul Davis ++ Copyright (C) 2005 Jussi Laako + + This is the GNU/Linux version. + +@@ -23,18 +24,35 @@ + #define __jack_time_h__ + + #include ++#include ++#include + #include + #include + +-/* This is a kludge. We need one global instantiation of this +- * variable in each address space. So, libjack/client.c declares the +- * actual storage. Other source files will see it as an extern. */ ++/* This is a kludge. We need one global instantiation of these ++ * variables in each address space. So, libjack/client.c declares the ++ * actual storage. Other source files will see those as an externs. */ + #define JACK_TIME_GLOBAL_DECL jack_time_t __jack_cpu_mhz ++#define JACK_TIME_SOURCE_DECL int __jack_clock_source ++#define JACK_TIME_FUNC_DECL jack_time_t (*jack_get_microseconds) (void) + extern JACK_TIME_GLOBAL_DECL; ++extern JACK_TIME_SOURCE_DECL; ++extern JACK_TIME_FUNC_DECL; + +-static inline jack_time_t +-jack_get_microseconds (void) { +- return get_cycles() / __jack_cpu_mhz; ++static jack_time_t ++jack_get_microseconds0 (void) { ++ jack_time_t jackTime; ++ struct timespec time; ++ ++ clock_gettime(CLOCK_MONOTONIC, &time); ++ jackTime = (jack_time_t) time.tv_sec * 1e6 + ++ (jack_time_t) time.tv_nsec / 1e3; ++ return jackTime; ++} ++ ++static jack_time_t ++jack_get_microseconds1 (void) { ++ return get_cycles() / __jack_cpu_mhz; + } + + /* +@@ -94,4 +112,21 @@ + __jack_cpu_mhz = jack_get_mhz (); + } + ++/* Set time function. */ ++static inline void ++jack_set_clock_source (int clocksrc) ++{ ++ __jack_clock_source = clocksrc; ++ switch (__jack_clock_source) ++ { ++ case 1: ++ jack_get_microseconds = jack_get_microseconds1; ++ break; ++ case 0: ++ default: ++ jack_get_microseconds = jack_get_microseconds0; ++ break; ++ } ++} ++ + #endif /* __jack_time_h__ */ +diff -ur jack-audio-connection-kit-0.100.7/configure.ac jack/configure.ac +--- jack-audio-connection-kit-0.100.7/configure.ac 2005-10-30 13:01:31.000000000 +0200 ++++ jack/configure.ac 2005-12-06 14:13:09.000000000 +0200 +@@ -126,6 +126,7 @@ + AC_CHECK_FUNCS(on_exit atexit) + AC_CHECK_FUNCS(posix_memalign) + AC_CHECK_LIB(m, sin) ++AC_CHECK_FUNC(clock_gettime, [], AC_CHECK_LIB(rt, clock_gettime)) + + # should we use mlockall() on this platform? + if test "x$JACK_DO_NOT_MLOCK" = "x"; then +diff -ur jack-audio-connection-kit-0.100.7/jack/engine.h jack/jack/engine.h +--- jack-audio-connection-kit-0.100.7/jack/engine.h 2004-12-19 20:41:28.000000000 +0200 ++++ jack/jack/engine.h 2005-12-06 13:47:39.000000000 +0200 +@@ -169,6 +169,8 @@ + int jack_get_fifo_fd (jack_engine_t *engine, + unsigned int which_fifo); + ++extern int clock_source; ++ + extern jack_client_internal_t * + jack_client_internal_by_id (jack_engine_t *engine, jack_client_id_t id); + +diff -ur jack-audio-connection-kit-0.100.7/jack/internal.h jack/jack/internal.h +--- jack-audio-connection-kit-0.100.7/jack/internal.h 2005-08-22 23:48:24.000000000 +0300 ++++ jack/jack/internal.h 2005-12-06 13:50:48.000000000 +0200 +@@ -130,6 +130,7 @@ + jack_time_t sync_time_left; + jack_frame_timer_t frame_timer; + int32_t internal; ++ int clock_source; + pid_t engine_pid; + jack_nframes_t buffer_size; + int8_t real_time; +diff -ur jack-audio-connection-kit-0.100.7/jackd/engine.c jack/jackd/engine.c +--- jack-audio-connection-kit-0.100.7/jackd/engine.c 2005-06-15 12:18:40.000000000 +0300 ++++ jack/jackd/engine.c 2005-12-06 16:21:50.000000000 +0200 +@@ -78,6 +78,8 @@ + dlhandle handle; + } jack_driver_info_t; + ++int clock_source = 0; ++ + static int jack_port_assign_buffer (jack_engine_t *, + jack_port_internal_t *); + static jack_port_internal_t *jack_get_port_by_name (jack_engine_t *, +@@ -1679,6 +1681,13 @@ + engine->control->xrun_delayed_usecs = 0; + engine->control->max_delayed_usecs = 0; + ++#ifdef JACK_TIME_FUNC_DECL ++ jack_set_clock_source(clock_source); ++#else ++ __jack_clock_source = clock_source; ++#endif ++ engine->control->clock_source = clock_source; ++ + engine->control->frame_timer.frames = 0; + engine->control->frame_timer.reset_pending = 0; + engine->control->frame_timer.current_wakeup = 0; +diff -ur jack-audio-connection-kit-0.100.7/jackd/jackd.c jack/jackd/jackd.c +--- jack-audio-connection-kit-0.100.7/jackd/jackd.c 2005-06-15 12:18:40.000000000 +0300 ++++ jack/jackd/jackd.c 2005-12-06 13:52:15.000000000 +0200 +@@ -368,6 +368,7 @@ + " [ --verbose OR -v ]\n" + " [ --silent OR -s ]\n" + " [ --version OR -V ]\n" ++" [ --clock-source OR -c ]\n" + " -d driver [ ... driver args ... ]\n" + " where driver can be `alsa', `coreaudio', `dummy',\n" + " `oss' or `portaudio'\n\n" +@@ -463,7 +464,7 @@ + + { + jack_driver_desc_t * desc; +- const char *options = "-ad:P:uvshVRTFl:t:mn:p:"; ++ const char *options = "-ad:P:uvshVRTFl:t:mn:p:c:"; + struct option long_options[] = + { + { "driver", 1, 0, 'd' }, +@@ -479,6 +480,7 @@ + { "temporary", 0, 0, 'T' }, + { "version", 0, 0, 'V' }, + { "silent", 0, 0, 's' }, ++ { "clock-source", 1, 0, 'c' }, + { 0, 0, 0, 0 } + }; + int opt = 0; +@@ -586,6 +588,10 @@ + show_version = 1; + break; + ++ case 'c': ++ clock_source = atoi (optarg); ++ break; ++ + default: + fprintf (stderr, "unknown option character %c\n", + optopt); +diff -ur jack-audio-connection-kit-0.100.7/libjack/client.c jack/libjack/client.c +--- jack-audio-connection-kit-0.100.7/libjack/client.c 2005-09-11 02:58:43.000000000 +0300 ++++ jack/libjack/client.c 2005-12-06 16:21:12.000000000 +0200 +@@ -51,6 +51,10 @@ + + #include + JACK_TIME_GLOBAL_DECL; /* One instance per process. */ ++JACK_TIME_SOURCE_DECL; /* One instance per process. */ ++#ifdef JACK_TIME_FUNC_DECL ++JACK_TIME_FUNC_DECL; ++#endif + + #include "local.h" + +@@ -959,6 +963,13 @@ + + client->engine = (jack_control_t *) jack_shm_addr (&client->engine_shm); + ++ /* initialize clock source as early as possible */ ++#ifdef JACK_TIME_FUNC_DECL ++ jack_set_clock_source(client->engine->clock_source); ++#else ++ __jack_clock_source = client->engine->clock_source; ++#endif ++ + /* now attach the client control block */ + client->control_shm = res.client_shm; + if (jack_attach_shm (&client->control_shm)) { + diff --git a/sources b/sources index e69de29..892af0e 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +bb25f7c1da5d488b70edcf39ff5a39b2 jack-audio-connection-kit-0.101.1.tar.gz