diff options
author | olipet <olpc@localhost.localdomain> | 2007-01-10 05:43:10 (GMT) |
---|---|---|
committer | olipet <olpc@localhost.localdomain> | 2007-01-10 05:43:10 (GMT) |
commit | 31ad623c32205fce5def219e7de5e048c038a29f (patch) | |
tree | 391c2f94f45fdcbdcccc53ff15cb8173ff5004b6 | |
parent | 66582e798557285494cda9e85fa0bcdd60629c8f (diff) | |
parent | ce450c25e2dba1594316c66142730a3708e1da52 (diff) |
Merge branch 'master' of git+ssh://olipet@dev.laptop.org/git/projects/tamtam
-rw-r--r-- | Player/StandalonePlayer.py | 27 | ||||
-rwxr-xr-x | TamTam.py | 2 | ||||
-rw-r--r-- | Util/CSoundClient.py | 13 | ||||
-rw-r--r-- | Util/Clooper/Makefile (renamed from Util/notelooper/Makefile) | 0 | ||||
-rwxr-xr-x | Util/Clooper/_ttest.so | bin | 0 -> 39840 bytes | |||
-rw-r--r-- | Util/Clooper/ttest.c (renamed from Util/notelooper/ttest.c) | 15 | ||||
-rw-r--r-- | Util/Clooper/ttest.h (renamed from Util/notelooper/ttest.h) | 5 | ||||
-rw-r--r-- | Util/Clooper/ttest.i (renamed from Util/notelooper/ttest.i) | 0 | ||||
-rw-r--r-- | Util/Clooper/ttest.py (renamed from Util/notelooper/ttest.py) | 0 | ||||
-rw-r--r-- | Util/Clooper/ttest_wrap.c (renamed from Util/notelooper/ttest_wrap.c) | 0 | ||||
-rw-r--r-- | Util/notelooper/.ttest.c.swp | bin | 12288 -> 0 bytes | |||
-rwxr-xr-x | Util/notelooper/_ttest.so | bin | 40624 -> 0 bytes | |||
-rw-r--r-- | Util/notelooper/ttest.o | bin | 5240 -> 0 bytes | |||
-rw-r--r-- | Util/notelooper/ttest_wrap.o | bin | 30688 -> 0 bytes | |||
-rw-r--r-- | scripts/olpc_get_stuff.sh | 2 |
15 files changed, 47 insertions, 17 deletions
diff --git a/Player/StandalonePlayer.py b/Player/StandalonePlayer.py index feef8d2..b4c341a 100644 --- a/Player/StandalonePlayer.py +++ b/Player/StandalonePlayer.py @@ -22,14 +22,27 @@ Tooltips = Config.Tooltips import thread import time +import gobject +import Util.Clooper.ttest as ttest + +asdf_t0 = time.time() +def asdf(): + global asdf_t0 + sleeptime = 0.02 + t1 = time.time() + if t1 - asdf_t0 > 1.2 * sleeptime : + print 'critical lagginess: ', t1 - asdf_t0 + asdf_t0 = t1 + return True def testtimer(arg): m = 0.0 + sleeptime = 0.10 # seconds while True: t0 = time.time() - time.sleep(0.05) + time.sleep(sleeptime) t1 = time.time() - if t1 - t0 > 0.75 : + if t1 - t0 > 2.0 * sleeptime : print 'critical lagginess: ', t1 - t0 if m < t1 - t0: m = t1 - t0 @@ -38,7 +51,15 @@ def testtimer(arg): class StandAlonePlayer( gtk.EventBox ): def __init__(self, client): - thread.start_new_thread( testtimer, (0,) ) + if False: + gobject.threads_init() + gtk.gdk.threads_init() + thread.start_new_thread( testtimer, (0,) ) + if False: + ttest.testtimer(20) + if False: + gobject.timeout_add( 20, asdf ) + gtk.EventBox.__init__( self) self.set_border_width(Config.MAIN_WINDOW_PADDING) @@ -71,6 +71,8 @@ if __name__ == "__main__": sys.exit(0) else: run_sugar_mode() + csnd.initialize(False) + print 'GOT BACK FROM UNINIT' sys.exit(0) diff --git a/Util/CSoundClient.py b/Util/CSoundClient.py index fe940da..e8ba4c7 100644 --- a/Util/CSoundClient.py +++ b/Util/CSoundClient.py @@ -104,13 +104,14 @@ class CSoundClientPerf( CSoundClientBase ): #time.sleep(1) print 'JOIN' #time.sleep(1) - self.perf.Join() - del self.perf - #print 'RESET' + rval = self.perf.Join() + print 'Join returned ', rval + #del self.perf #time.sleep(1) - print 'STOP' - self.csound.Stop() - #self.csound.Reset() + #print 'STOP' + #self.csound.Stop() + print 'RESET' + self.csound.Reset() #careful how much cleaning up we do... don't cause a segault! # better to leave a segfault for the automatic cleanning at the end of the prog diff --git a/Util/notelooper/Makefile b/Util/Clooper/Makefile index 22e78c9..22e78c9 100644 --- a/Util/notelooper/Makefile +++ b/Util/Clooper/Makefile diff --git a/Util/Clooper/_ttest.so b/Util/Clooper/_ttest.so Binary files differnew file mode 100755 index 0000000..6b14ebe --- /dev/null +++ b/Util/Clooper/_ttest.so diff --git a/Util/notelooper/ttest.c b/Util/Clooper/ttest.c index d18cace..9ff3d85 100644 --- a/Util/notelooper/ttest.c +++ b/Util/Clooper/ttest.c @@ -5,6 +5,7 @@ #include <unistd.h> #include <sys/time.h> +double sleeptime = 0.0; int usleep(int); static void * threadfn(void * _arg) { @@ -14,7 +15,8 @@ static void * threadfn(void * _arg) } struct timeval tv0, tv1; double m = 0.0; - double sleeptime = 0.05; + + int loops = 0; while (1) { @@ -23,7 +25,7 @@ static void * threadfn(void * _arg) gettimeofday(&tv1, 0); double t0 = pytime(&tv0); double t1 = pytime(&tv1); - if (t1 - t0 > 2.0 * sleeptime) + if (t1 - t0 > 1.2 * sleeptime) { fprintf(stderr, "critical lagginess %lf\n", t1 - t0); } @@ -32,12 +34,19 @@ static void * threadfn(void * _arg) m = t1 - t0; fprintf(stderr, "maximum lag %lf\n", m); } + + if ( ( loops % 100 ) == 0 ) + { + fprintf(stderr, "loop (%lf)\n", t0); + } + ++loops; } return NULL; } -void testtimer() +void testtimer(double st) { pthread_t pth; + sleeptime = st; pthread_create( &pth, NULL, &threadfn, NULL ); } diff --git a/Util/notelooper/ttest.h b/Util/Clooper/ttest.h index a4ea56d..111f10c 100644 --- a/Util/notelooper/ttest.h +++ b/Util/Clooper/ttest.h @@ -1,14 +1,11 @@ #ifndef _MSL_MATH_H #define _MSL_MATH_H -#include <gsl/gsl_complex.h> -typedef gsl_complex msl_complex_t; - #ifdef __cplusplus extern "C" { #endif -void testtimer(); +void testtimer(double); #ifdef __cplusplus } diff --git a/Util/notelooper/ttest.i b/Util/Clooper/ttest.i index 0c88add..0c88add 100644 --- a/Util/notelooper/ttest.i +++ b/Util/Clooper/ttest.i diff --git a/Util/notelooper/ttest.py b/Util/Clooper/ttest.py index 302c8f3..302c8f3 100644 --- a/Util/notelooper/ttest.py +++ b/Util/Clooper/ttest.py diff --git a/Util/notelooper/ttest_wrap.c b/Util/Clooper/ttest_wrap.c index a073e99..a073e99 100644 --- a/Util/notelooper/ttest_wrap.c +++ b/Util/Clooper/ttest_wrap.c diff --git a/Util/notelooper/.ttest.c.swp b/Util/notelooper/.ttest.c.swp Binary files differdeleted file mode 100644 index 487b09c..0000000 --- a/Util/notelooper/.ttest.c.swp +++ /dev/null diff --git a/Util/notelooper/_ttest.so b/Util/notelooper/_ttest.so Binary files differdeleted file mode 100755 index 1e44d39..0000000 --- a/Util/notelooper/_ttest.so +++ /dev/null diff --git a/Util/notelooper/ttest.o b/Util/notelooper/ttest.o Binary files differdeleted file mode 100644 index e10c7f8..0000000 --- a/Util/notelooper/ttest.o +++ /dev/null diff --git a/Util/notelooper/ttest_wrap.o b/Util/notelooper/ttest_wrap.o Binary files differdeleted file mode 100644 index 1f339f6..0000000 --- a/Util/notelooper/ttest_wrap.o +++ /dev/null diff --git a/scripts/olpc_get_stuff.sh b/scripts/olpc_get_stuff.sh index e2fb272..ebbd292 100644 --- a/scripts/olpc_get_stuff.sh +++ b/scripts/olpc_get_stuff.sh @@ -1,5 +1,5 @@ -yum install vim-common vim-enhanced screen git-core xterm fluxbox ctags irssi +yum install vim-common vim-enhanced screen git-core xterm fluxbox ctags irssi gcc make python-devel if [ ! -f ~/.Xdefaults ] ; then #use a legible xterm font |