From 578f91f3b8d8ebef9f518b220a6a17f11f0e3c44 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Thu, 28 May 2009 04:42:48 +0000 Subject: reformat svn path=/trunk/; revision=11541 --- desiredata/src/s_audio_jack.c | 59 +++++++++++-------------------------------- 1 file changed, 15 insertions(+), 44 deletions(-) (limited to 'desiredata') diff --git a/desiredata/src/s_audio_jack.c b/desiredata/src/s_audio_jack.c index 9dbaa8a0..2f290d06 100644 --- a/desiredata/src/s_audio_jack.c +++ b/desiredata/src/s_audio_jack.c @@ -51,8 +51,7 @@ static int process (jack_nframes_t nframes, void *arg) { memset(jack_outbuf,0,sizeof(jack_outbuf)); jack_filled = 0; } - /* tb: wait in the scheduler */ - /* pthread_cond_broadcast(&jack_sem); */ + /* tb: wait in the scheduler: pthread_cond_broadcast(&jack_sem); */ return 0; } @@ -75,15 +74,8 @@ static int cb_process (jack_nframes_t nframes, void *arg) { } int status = sys_timedlock(timeout); if (status) { - if (status == ETIMEDOUT) { - /* we're late ... lets hope that jack doesn't kick us out */ - error("timeout %d", (timeout)); - sys_log_error(ERR_SYSLOCK); - return 0; - } else { - post("sys_timedlock returned %d", status); - return 0; - } + if (status == ETIMEDOUT) {error("timeout %d", (timeout)); sys_log_error(ERR_SYSLOCK); return 0;} + else {post("sys_timedlock returned %d", status); return 0;} } for (int i = 0; i != dspticks_per_jacktick; ++i) { for (int j=0; j NUM_JACK_PORTS) {post("%d output ports not supported, setting to %d",outchans, NUM_JACK_PORTS); outchans = NUM_JACK_PORTS;} if ( inchans > NUM_JACK_PORTS) {post( "%d input ports not supported, setting to %d", inchans, NUM_JACK_PORTS); inchans = NUM_JACK_PORTS;} - if (jack_client && scheduler != sys_getscheduler()) { - jack_client_close(jack_client); - jack_client = 0; - } + if (jack_client && scheduler != sys_getscheduler()) {jack_client_close(jack_client); jack_client = 0;} sys_setscheduler(scheduler); jack_scheduler = scheduler; /* set block copy/zero functions */ @@ -245,10 +232,7 @@ int jack_open_audio_2(int inchans, int outchans, int rate, int scheduler) { /* tell the JACK server to call `jack_shutdown()' if it ever shuts down, either entirely, or if it just decides to stop calling us. */ jack_on_shutdown (jack_client, jack_shutdown, 0); - for (int j=0;j= jack_out_max) return SENDDACS_NO; - /* tb: wait in the scheduler */ -/* pthread_cond_wait(&jack_sem,&jack_mutex); */ + /* tb: wait in the scheduler: pthread_cond_wait(&jack_sem,&jack_mutex); */ jack_started = 1; float *fp = sys_soundout; - for (int j=0; j sys_sleepgrain*1e-6) rtnval = SENDDACS_SLEPT; memset(sys_soundout,0,sys_dacblocksize*sizeof(float)*sys_outchannels); @@ -324,8 +297,8 @@ void jack_getdevs(char *indevlist, int *nindevs, char *outdevlist, int *noutdevs *canmulti = 0; /* supports multiple devices */ int ndev = 1; for (int i=0; i %s", port, jack_port_name (input_port[i])); + if (status) error("cannot connect input ports %s -> %s", port, jack_port_name(input_port[i])); } } /* restoring the output connections */ -- cgit v1.2.1