Revision: 9921 http://pure-data.svn.sourceforge.net/pure-data/?rev=9921&view=rev Author: zmoelnig Date: 2008-05-26 04:16:30 -0700 (Mon, 26 May 2008)
Log Message: ----------- do not start jack-server automatically but hook into an already running server...does this fix things?
Modified Paths: -------------- branches/pd-extended/v0-40/pd/src/s_audio_jack.c
Modified: branches/pd-extended/v0-40/pd/src/s_audio_jack.c =================================================================== --- branches/pd-extended/v0-40/pd/src/s_audio_jack.c 2008-05-26 07:33:25 UTC (rev 9920) +++ branches/pd-extended/v0-40/pd/src/s_audio_jack.c 2008-05-26 11:16:30 UTC (rev 9921) @@ -80,12 +80,13 @@ static void jack_shutdown (void *arg) { - fprintf(stderr, "jack: JACK server shut down\n"); + verbose(1, "JACK-server shut down"); sys_close_audio(); jack_client = NULL; }
static int jack_xrun(void* arg) { + verbose(1, "JACK-server xrun"); jack_dio_error = 1; return 0; } @@ -177,7 +178,7 @@ if (jack_ports) for (i=0;jack_ports[i] != NULL && i < sys_inchannels;i++) if (jack_connect (jack_client, jack_ports[i], jack_port_name (input_port[i]))) - fprintf (stderr, "cannot connect input ports %s -> %s\n", jack_ports[i],jack_port_name (input_port[i])); + error("JACK: cannot connect input ports %s -> %s", jack_ports[i],jack_port_name (input_port[i]));
@@ -186,7 +187,7 @@ if (jack_ports) for (i=0;jack_ports[i] != NULL && i < sys_outchannels;i++) if (jack_connect (jack_client, jack_port_name (output_port[i]), jack_ports[i])) - fprintf (stderr, "cannot connect output ports %s -> %s\n", jack_port_name (output_port[i]),jack_ports[i]); + error("JACK: cannot connect output ports %s -> %s", jack_port_name (output_port[i]),jack_ports[i]);
@@ -196,6 +197,7 @@
void jack_error(const char *desc) { + error("JACK error: %s", desc); return; }
@@ -216,12 +218,12 @@ if ((inchans == 0) && (outchans == 0)) return 0;
if (outchans > NUM_JACK_PORTS) { - fprintf(stderr,"%d output ports not supported, setting to %d\n",outchans, NUM_JACK_PORTS); + error("JACK: %d output ports not supported, setting to %d",outchans, NUM_JACK_PORTS); outchans = NUM_JACK_PORTS; }
if (inchans > NUM_JACK_PORTS) { - fprintf(stderr,"%d input ports not supported, setting to %d\n",inchans, NUM_JACK_PORTS); + error("JACK: %d input ports not supported, setting to %d",inchans, NUM_JACK_PORTS); inchans = NUM_JACK_PORTS; }
@@ -231,10 +233,10 @@ do { sprintf(port_name,"pure_data_%d",client_iterator); client_iterator++; - - jack_client = jack_client_open (port_name, JackNullOption, &status, NULL); + /* do not try to start the jack-server...seems to make problems... */ + jack_client = jack_client_open (port_name, JackNoStartServer, &status, NULL); if (status & JackServerFailed) { - fprintf(stderr,"unable to connect to JACK server\n"); + error("JACK: unable to connect to JACK server"); jack_client=NULL; break; } @@ -242,9 +244,9 @@
if(status) { if (status & JackServerStarted) { - fprintf(stderr, "started JACK server\n"); + post("JACK: started JACK server?"); } else { - fprintf(stderr, "jack returned status %d\n", status); + post("JACK: jack returned status %d", status); } }
@@ -261,7 +263,7 @@
jack_set_process_callback (jack_client, process, 0);
- jack_set_error_function (jack_error); + // jack_set_error_function (jack_error);
#ifdef JACK_XRUN jack_set_xrun_callback (jack_client, jack_xrun, NULL); @@ -303,7 +305,7 @@ sprintf(port_name, "input%d", j); if (!input_port[j]) input_port[j] = jack_port_register (jack_client, port_name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); if (!input_port[j]) { - fprintf (stderr, "jack: can only register %d input ports (instead of requested %d)\n", j, inchans); + error("JACK: can only register %d input ports (instead of requested %d)", j, inchans); sys_inchannels = inchans = j; break; } @@ -313,7 +315,7 @@ sprintf(port_name, "output%d", j); if (!output_port[j]) output_port[j] = jack_port_register (jack_client, port_name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); if (!output_port[j]) { - fprintf (stderr, "jack: can only register %d output ports (instead of requested %d)\n", j, outchans); + error("JACK: can only register %d output ports (instead of requested %d)", j, outchans); sys_outchannels = outchans = j; break; } @@ -324,7 +326,7 @@
if (new_jack) { if (jack_activate (jack_client)) { - fprintf (stderr, "cannot activate client\n"); + error("JACK: cannot activate client"); sys_inchannels = sys_outchannels = 0; return 1; } @@ -406,7 +408,7 @@
void jack_listdevs( void) { - post("device listing not implemented for jack yet\n"); + error("device listing not implemented for jack yet"); }
#endif /* JACK */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.