changeset 2263:f226f40a731d

report usb stalls
author drewp@bigasterisk.com
date Mon, 29 May 2023 11:46:25 -0700
parents cab292b3ad38
children 74b4acd3dde0
files light9/collector/output.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/light9/collector/output.py	Mon May 29 11:46:04 2023 -0700
+++ b/light9/collector/output.py	Mon May 29 11:46:25 2023 -0700
@@ -223,7 +223,7 @@
                 if logAllDmx.isEnabledFor(logging.DEBUG):
                     # for testing fps, smooth fades, etc
                     logAllDmx.debug('%s: %s...' % (self.shortId(), ' '.join(map(str, buf[:32]))))
-
+                t1 = time.time()
                 sent = self.dev.send_multi_value(1, bytearray(buf))
                 if sent != len(buf):
                     raise ValueError("incomplete send")
@@ -255,6 +255,9 @@
                     return
 
                 raise
+            dt = time.time() - t1
+            if dt > 1/self.rate*1.5:
+                log.warning(f'usb stall- took {(dt*1000):.2f}ms')
 
 
 '''