Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11810
Modified Files: Tag: devel_0_38 s_audio_jack.c Log Message: workaround: reconnect if jack kicked us out
Index: s_audio_jack.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio_jack.c,v retrieving revision 1.5.4.5 retrieving revision 1.5.4.6 diff -C2 -d -r1.5.4.5 -r1.5.4.6 *** s_audio_jack.c 9 Apr 2005 06:52:00 -0000 1.5.4.5 --- s_audio_jack.c 9 Apr 2005 19:53:29 -0000 1.5.4.6 *************** *** 87,96 **** int i,j; ! if (sys_timedlock(sys_schedadvance) == EBUSY) ! /* this is bad ... we're blocking a realtime thread */ ! { ! return 1; ! } ! for (i = 0; i != dspticks_per_jacktick; ++i) { --- 87,93 ---- int i,j; ! ! /* rethink: should we lock the sys_lock? */ ! for (i = 0; i != dspticks_per_jacktick; ++i) { *************** *** 123,127 **** zerovec_simd(sys_soundout, j * sys_dacblocksize); } - sys_unlock();
return 0; --- 120,123 ---- *************** *** 137,145 **** }
static void jack_shutdown (void *arg) { ! /* Ignore for now */ ! // exit (1); }
--- 133,152 ---- }
+ + static t_int jack_shutdown_handler(t_int* none) + { + jack_close_audio(); + post("jack most likely kicked us out ... trying to reconnect"); + /* try to reconnect to jack server */ + jack_open_audio(sys_inchannels, sys_outchannels,\ + sys_dacsr, sys_callbackscheduler); + return 0; + } + static void jack_shutdown (void *arg) { ! /* register idle callback in scheduler */ ! sys_callback(jack_shutdown_handler, NULL, 0); }