Browse Source

fix rolling frame count handling, and expand author list

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@810 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
pbd 20 years ago
parent
commit
df6021a3fa
4 changed files with 48 additions and 12 deletions
  1. +1
    -1
      configure.ac
  2. +2
    -1
      jackd/engine.c
  3. +8
    -1
      jackd/jackd.1.in
  4. +37
    -9
      libjack/transclient.c

+ 1
- 1
configure.ac View File

@@ -15,7 +15,7 @@ dnl changes are made
dnl --- dnl ---
JACK_MAJOR_VERSION=0 JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=99 JACK_MINOR_VERSION=99
JACK_MICRO_VERSION=15
JACK_MICRO_VERSION=16


dnl --- dnl ---
dnl HOWTO: updating the jack protocol version dnl HOWTO: updating the jack protocol version


+ 2
- 1
jackd/engine.c View File

@@ -1969,6 +1969,8 @@ jack_run_one_cycle (jack_engine_t *engine, jack_nframes_t nframes,
consecutive_excessive_delays = 0; consecutive_excessive_delays = 0;
} }


jack_inc_frame_time (engine, nframes);

if (jack_try_lock_graph (engine)) { if (jack_try_lock_graph (engine)) {
/* engine can't run. just throw away an entire cycle */ /* engine can't run. just throw away an entire cycle */
driver->null_cycle (driver, nframes); driver->null_cycle (driver, nframes);
@@ -2021,7 +2023,6 @@ jack_run_one_cycle (jack_engine_t *engine, jack_nframes_t nframes,
} }


jack_engine_post_process (engine); jack_engine_post_process (engine);
jack_inc_frame_time (engine, nframes);
ret = 0; ret = 0;


unlock: unlock:


+ 8
- 1
jackd/jackd.1.in View File

@@ -409,7 +409,14 @@ Please report bugs to
.br .br
.I http://jackit.sourceforge.net/mantis/main_page.php .I http://jackit.sourceforge.net/mantis/main_page.php
.SH "AUTHORS" .SH "AUTHORS"
Paul Davis and others.
Architect and original implementor: Paul Davis
.PP
Original design Group: Paul Davis, David Olofson, Kai Vehmanen, Benno Sennoner,
Richard Guenther, and other members of the Linux Audio Developers group.
.PP
Programming: Paul Davis, Jack O'Quin, Taybin Rutkin, Stephane Letz, Fernando
Pablo Lopez-Lezcano, Steve Harris, Jeremy Hall, Andy Wingo, Kai
Vehmanen, Melanie Thielker, Jussi Laako, Tilman Linneweh, Johnny Petrantoni.
.PP .PP
Manpage written by Stefan Schwandter, Jack O'Quin and Alexandre Manpage written by Stefan Schwandter, Jack O'Quin and Alexandre
Prokoudine. Prokoudine.

+ 37
- 9
libjack/transclient.c View File

@@ -43,15 +43,29 @@ static inline void
jack_read_frame_time (const jack_client_t *client, jack_frame_timer_t *copy) jack_read_frame_time (const jack_client_t *client, jack_frame_timer_t *copy)
{ {
int tries = 0; int tries = 0;
long timeout = 1000;


do { do {
/* throttle the busy wait if we don't get /* throttle the busy wait if we don't get
the answer very quickly. the answer very quickly.

XXX This is disgusting. on a UP
system, it needs to sleep
if the first try didn't work. on an SMP
system, it should wait for half of
the context switch time before
sleeping.
*/ */


if (tries > 10) { if (tries > 10) {
usleep (20); usleep (20);
tries = 0; tries = 0;

/* debug code to avoid system hangs... */
if (--timeout == 0) {
jack_error ("hung in loop copying position A");
abort();
}
} }


*copy = client->engine->frame_timer; *copy = client->engine->frame_timer;
@@ -70,14 +84,16 @@ jack_transport_copy_position (jack_position_t *from, jack_position_t *to)


do { do {
/* throttle the busy wait if we don't get the answer /* throttle the busy wait if we don't get the answer
* very quickly. */
* very quickly. See comment above about this
* design.
*/
if (tries > 10) { if (tries > 10) {
usleep (20); usleep (20);
tries = 0; tries = 0;


/* debug code to avoid system hangs... */ /* debug code to avoid system hangs... */
if (--timeout == 0) { if (--timeout == 0) {
jack_error("hung in loop copying position");
jack_error ("hung in loop copying position B");
abort(); abort();
} }
} }
@@ -219,19 +235,31 @@ jack_nframes_t
jack_frame_time (const jack_client_t *client) jack_frame_time (const jack_client_t *client)
{ {
jack_frame_timer_t current; jack_frame_timer_t current;
float usecs;
jack_nframes_t elapsed;
float elapsed_usecs;
jack_nframes_t elapsed_frames;
jack_control_t *ectl = client->engine; jack_control_t *ectl = client->engine;
jack_time_t now;


jack_read_frame_time (client, &current); jack_read_frame_time (client, &current);
usecs = jack_get_microseconds() - current.stamp;
now = jack_get_microseconds ();


elapsed = (jack_nframes_t)
floor ((((float) ectl->current_time.frame_rate)
/ 1000000.0f) * usecs);
elapsed_usecs = now - current.stamp;
return current.frames + elapsed;
elapsed_frames = (jack_nframes_t)
floor ((((float) ectl->current_time.frame_rate)
/ 1000000.0f) * elapsed_usecs);

/* clamp to prevent race conditions when other threads
call this in the window between the driver wakeup
and the frame timer being updated.
*/

if (elapsed_frames > ectl->buffer_size) {
elapsed_frames = ectl->buffer_size;
}

return current.frames + elapsed_frames;
} }


jack_nframes_t jack_nframes_t


Loading…
Cancel
Save