[PD-cvs] pd/src s_audio_jack.c,1.5.4.6,1.5.4.7
Tim Blechmann
timblech at users.sourceforge.net
Sun Apr 17 12:23:58 CEST 2005
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21575
Modified Files:
Tag: devel_0_38
s_audio_jack.c
Log Message:
sys_lock during dsp callback
Index: s_audio_jack.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio_jack.c,v
retrieving revision 1.5.4.6
retrieving revision 1.5.4.7
diff -C2 -d -r1.5.4.6 -r1.5.4.7
*** s_audio_jack.c 9 Apr 2005 19:53:29 -0000 1.5.4.6
--- s_audio_jack.c 17 Apr 2005 10:23:56 -0000 1.5.4.7
***************
*** 86,93 ****
{
int i,j;
-
- /* rethink: should we lock the sys_lock? */
-
for (i = 0; i != dspticks_per_jacktick; ++i)
{
--- 86,95 ----
{
int i,j;
+ int timeout = (float)nframes / (float) sys_dacsr * 1e6;
+
+ if (sys_timedlock(timeout) == ETIMEDOUT)
+ /* we're late ... lets hope that jack doesn't kick us out */
+ return 0;
for (i = 0; i != dspticks_per_jacktick; ++i)
{
***************
*** 120,123 ****
--- 122,127 ----
zerovec_simd(sys_soundout, j * sys_dacblocksize);
}
+
+ sys_unlock();
return 0;
***************
*** 457,461 ****
}
! if ((timenow = sys_getrealtime()) - timeref > 0.002)
{
rtnval = SENDDACS_SLEPT;
--- 461,465 ----
}
! if ((timenow = sys_getrealtime()) - timeref > sys_sleepgrain * 1e-6)
{
rtnval = SENDDACS_SLEPT;
More information about the Pd-cvs
mailing list