summaryrefslogtreecommitdiffstats
path: root/audio-drivers/jack
diff options
context:
space:
mode:
authorJuuso Alasuutari2007-03-25 19:14:14 +0000
committerJuuso Alasuutari2007-03-25 19:14:14 +0000
commita05b6a45f666aa3264c86a47fadcb6a2e85cf386 (patch)
tree1dbd7596476fcf77999de56bc93a48484a6bcc6f /audio-drivers/jack
parent48c27d9c2da613b75f21392dbdc817faf7dac8da (diff)
jack: added optional patch & sub-dependency for jackmidi_alsaseq
compatibility, made temp dir default value depend on SHM setting (/dev/shm with JACK_SHM and /tmp without it)
Diffstat (limited to 'audio-drivers/jack')
-rwxr-xr-xaudio-drivers/jack/CONFIGURE13
-rw-r--r--audio-drivers/jack/HISTORY6
-rwxr-xr-xaudio-drivers/jack/PRE_BUILD7
-rwxr-xr-xaudio-drivers/jack/PRE_SUB_DEPENDS4
-rwxr-xr-xaudio-drivers/jack/SUB_DEPENDS8
-rw-r--r--audio-drivers/jack/jack_time.patch111
6 files changed, 148 insertions, 1 deletions
diff --git a/audio-drivers/jack/CONFIGURE b/audio-drivers/jack/CONFIGURE
index 4c7510b799..ba64ee3cf2 100755
--- a/audio-drivers/jack/CONFIGURE
+++ b/audio-drivers/jack/CONFIGURE
@@ -28,4 +28,15 @@ config_query_option JACK_OPTIMIZE \
"--enable-optimize" \
"--disable-optimize" &&
-config_query_string JACK_TMPDIR "Input default JACK temp dir:" /tmp
+config_query JACK_TIME \
+ "Apply time patch (required by jackmidi_alsaseq)?" n &&
+
+local _DEFTMP &&
+if [[ $JACK_SHM == "--enable-posix-shm" ]]
+then
+ _DEFTMP=/dev/shm
+else
+ _DEFTMP=/tmp
+fi &&
+
+config_query_string JACK_TMPDIR "Input default JACK temp dir:" $_DEFTMP
diff --git a/audio-drivers/jack/HISTORY b/audio-drivers/jack/HISTORY
index dd5b7a316d..2894ab35a5 100644
--- a/audio-drivers/jack/HISTORY
+++ b/audio-drivers/jack/HISTORY
@@ -1,5 +1,11 @@
2007-03-25 Juuso Alasuutari <iuso@sourcemage.org>
* DETAILS: Updated to 0.103.0.
+ * CONFIGURE: Added query for time patch, made temp dir default to
+ /dev/shm instead of /tmp if JACK_SHM is set.
+ * PRE_BUILD: Added, apply time patch if requested.
+ * jack_time.patch: Added.
+ * PRE_SUB_DEPENDS, SUB_DEPENDS: Added, TIMEPATCH sub-dependency
+ for jackmidi_alsaseq.
2007-03-19 Juuso Alasuutari <iuso@sourcemage.org>
* CONFLICTS: Added conflicts jackdmp.
diff --git a/audio-drivers/jack/PRE_BUILD b/audio-drivers/jack/PRE_BUILD
new file mode 100755
index 0000000000..42bda223b1
--- /dev/null
+++ b/audio-drivers/jack/PRE_BUILD
@@ -0,0 +1,7 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+
+if [[ $JACK_TIME == y ]]
+then
+ patch -p1 < "$SCRIPT_DIRECTORY/jack_time.patch"
+fi
diff --git a/audio-drivers/jack/PRE_SUB_DEPENDS b/audio-drivers/jack/PRE_SUB_DEPENDS
new file mode 100755
index 0000000000..65a4b2a1b4
--- /dev/null
+++ b/audio-drivers/jack/PRE_SUB_DEPENDS
@@ -0,0 +1,4 @@
+case $THIS_SUB_DEPENDS in
+ TIMEPATCH) [[ $JACK_TIME == y ]] && return 0 ;;
+esac
+return 1
diff --git a/audio-drivers/jack/SUB_DEPENDS b/audio-drivers/jack/SUB_DEPENDS
new file mode 100755
index 0000000000..849eff09e5
--- /dev/null
+++ b/audio-drivers/jack/SUB_DEPENDS
@@ -0,0 +1,8 @@
+case $THIS_SUB_DEPENDS in
+ TIMEPATCH) echo "Time patch requested, forcing option JACK_TIME=y." &&
+ JACK_TIME=y && persistent_add JACK_TIME
+ ;;
+ *) echo "Unknown sub-dependency '$THIS_SUB_DEPENDS'"!
+ return 1
+ ;;
+esac
diff --git a/audio-drivers/jack/jack_time.patch b/audio-drivers/jack/jack_time.patch
new file mode 100644
index 0000000000..c70ee25c64
--- /dev/null
+++ b/audio-drivers/jack/jack_time.patch
@@ -0,0 +1,111 @@
+diff -r cd93ab53ed18 jack/jack.h
+--- a/jack/jack.h Wed Dec 13 07:09:13 2006 +0300
++++ b/jack/jack.h Mon Jan 08 22:49:38 2007 +0300
+@@ -730,6 +730,13 @@ int jack_engine_takeover_timebase (jack
+ int jack_engine_takeover_timebase (jack_client_t *);
+
+ /**
++ * @return current system time in microseconds, using jack clock source.
++ *
++ * This function is a client version of jack_get_microseconds().
++ */
++jack_time_t jack_get_time();
++
++/**
+ * @return the time in frames that has passed since the JACK server
+ * began the current process cycle.
+ */
+@@ -750,6 +757,16 @@ jack_nframes_t jack_frame_time (const ja
+ * jack_frame_time() in correlation to the current process cycle.
+ */
+ jack_nframes_t jack_last_frame_time (const jack_client_t *client);
++
++/**
++ * @return estimated time in microseconds of the specified frame time
++ */
++jack_time_t jack_frames_to_time(const jack_client_t *client, jack_nframes_t);
++
++/**
++ * @return estimated time in frames for the specified system time.
++ */
++jack_nframes_t jack_time_to_frames(const jack_client_t *client, jack_time_t);
+
+ /**
+ * @return the current CPU load estimated by JACK. This is a running
+diff -r cd93ab53ed18 libjack/transclient.c
+--- a/libjack/transclient.c Wed Dec 13 07:09:13 2006 +0300
++++ b/libjack/transclient.c Mon Jan 08 22:53:39 2007 +0300
+@@ -231,8 +231,14 @@ jack_frames_since_cycle_start (const jac
+ / 1000000.0f) * usecs);
+ }
+
+-jack_nframes_t
+-jack_frame_time (const jack_client_t *client)
++jack_time_t
++jack_get_time()
++{
++ return jack_get_microseconds();
++}
++
++jack_nframes_t
++jack_time_to_frames(const jack_client_t *client, jack_time_t now)
+ {
+ jack_frame_timer_t time;
+ jack_control_t *ectl = client->engine;
+@@ -240,8 +246,6 @@ jack_frame_time (const jack_client_t *cl
+ jack_read_frame_time (client, &time);
+
+ if (time.initialized) {
+- jack_time_t now = jack_get_microseconds();
+-
+ #if 0
+ fprintf (stderr, "now = %Lu current wakeup = %Lu next = %Lu frames = %lu + %f => %lu\n",
+ now, time.current_wakeup, time.next_wakeup, time.frames,
+@@ -250,14 +254,20 @@ jack_frame_time (const jack_client_t *cl
+ time.frames +
+ (long) rint (((double) (now - time.current_wakeup)/
+ (time.next_wakeup - time.current_wakeup)) * ectl->buffer_size));
+-#endif
++#endif
+
+ return time.frames +
+ (long) rint (((double) ((long long) (now - time.current_wakeup))/
+ ((long long) (time.next_wakeup - time.current_wakeup))) * ectl->buffer_size);
+- }
+-
++ }
+ return 0;
++}
++
++jack_nframes_t
++jack_frame_time (const jack_client_t *client)
++{
++ jack_time_t now = jack_get_microseconds();
++ return jack_time_to_frames(client, now);
+ }
+
+ jack_nframes_t
+@@ -266,6 +276,23 @@ jack_last_frame_time (const jack_client_
+ jack_frame_timer_t current;
+ jack_read_frame_time (client, &current);
+ return current.frames;
++}
++
++jack_time_t
++jack_frames_to_time(const jack_client_t *client, jack_nframes_t frames)
++{
++ jack_frame_timer_t time;
++ jack_control_t *ectl = client->engine;
++
++ jack_read_frame_time (client, &time);
++
++ if (time.initialized) {
++ return time.current_wakeup +
++ (long) rint (((double) ((long long) (frames - time.frames)) *
++ ((long long) (time.next_wakeup - time.current_wakeup)) / ectl->buffer_size) );
++ }
++
++ return 0;
+ }
+
+ jack_nframes_t