From f9d042735ed294183a1f75db7f6fed5c0d440ccf Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 9 May 2021 11:54:54 +0200 Subject: Start OLA scanout automatically --- guile/starlet/scanout.scm | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'guile') 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) -- cgit v1.2.3