aboutsummaryrefslogtreecommitdiff
path: root/guile
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-05-09 11:54:54 +0200
committerThomas White <taw@physics.org>2021-05-10 20:56:02 +0200
commitf9d042735ed294183a1f75db7f6fed5c0d440ccf (patch)
treec187ca4f4bb9cf9beb6c670849c337d77e587f7a /guile
parent25542a091718cf78a474c7bc8bcf1bc8472cb521 (diff)
Start OLA scanout automatically
Diffstat (limited to 'guile')
-rw-r--r--guile/starlet/scanout.scm38
1 files changed, 20 insertions, 18 deletions
diff --git a/guile/starlet/scanout.scm b/guile/starlet/scanout.scm
index 3c9562a..7833076 100644
--- a/guile/starlet/scanout.scm
+++ b/guile/starlet/scanout.scm
@@ -29,8 +29,7 @@
#:use-module (ice-9 atomic)
#:use-module (ice-9 exceptions)
#:use-module (srfi srfi-1)
- #:export (start-ola-output
- patch-fixture!
+ #:export (patch-fixture!
scanout-freq
register-state!
current-value))
@@ -240,19 +239,22 @@
(define (start-ola-output)
- (unless ola-thread
- (let* ((ola-client (make-ola-streaming-client))
- (start-time (hirestime)))
-
- (set! ola-thread
- (begin-thread
- (with-exception-handler
- (lambda (exn)
- (display "Error in OLA output thread:\n")
- (set! ola-thread #f)
- (backtrace)
- (raise-exception exn))
- (lambda ()
- (scanout-loop ola-client start-time 0 '()))
- #:unwind? #f))))))
-
+ (if ola-thread
+ (format #t "OLA output already running\n")
+ (let* ((ola-client (make-ola-streaming-client))
+ (start-time (hirestime)))
+
+ (set! ola-thread
+ (begin-thread
+ (with-exception-handler
+ (lambda (exn)
+ (display "Error in OLA output thread:\n")
+ (set! ola-thread #f)
+ (backtrace)
+ (raise-exception exn))
+ (lambda ()
+ (scanout-loop ola-client start-time 0 '()))
+ #:unwind? #f))))))
+
+
+(start-ola-output)