From ee888891d912b88e5e003a40bedd5ee12e893195 Mon Sep 17 00:00:00 2001 From: "J.A. de Jong - Redu-Sone B.V., ASCEE V.O.F" Date: Fri, 7 May 2021 22:50:03 +0200 Subject: [PATCH] Bugfix in lasp_daq.pyx. This was the reason of the initial tick in the audio. The CppSleep was done with the GIL held. Sometimes indentation is what you need in PYthon... --- lasp/device/lasp_daq.pyx | 4 ++-- lasp/device/lasp_daqconfig.pyx | 2 ++ scripts/lasp_record | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lasp/device/lasp_daq.pyx b/lasp/device/lasp_daq.pyx index 5529dee..36170d7 100644 --- a/lasp/device/lasp_daq.pyx +++ b/lasp/device/lasp_daq.pyx @@ -263,8 +263,8 @@ cdef class Daq: self.sd.thread = new CPPThread[void*, void (*)(void*)](audioCallbackPythonThreadFunction, self.sd) - # Allow stream stome time to start - CPPsleep_ms(500) + # Allow stream stome time to start + CPPsleep_ms(300) self.daq_device.start( self.sd.inQueue, diff --git a/lasp/device/lasp_daqconfig.pyx b/lasp/device/lasp_daqconfig.pyx index a3cad81..5ffea08 100644 --- a/lasp/device/lasp_daqconfig.pyx +++ b/lasp/device/lasp_daqconfig.pyx @@ -75,6 +75,8 @@ cdef class DaqConfiguration: """ Initialize a device descriptor """ + def __cinit__(self): + pass def __str__(self): return str(self.to_json()) diff --git a/scripts/lasp_record b/scripts/lasp_record index 7f6f8fc..c2fa06e 100755 --- a/scripts/lasp_record +++ b/scripts/lasp_record @@ -43,8 +43,6 @@ if __name__ == '__main__': choosen_key = config_keys[daqindex] config = configs[choosen_key].input_config - config.__reduce__() - print(f'Choosen configuration: {choosen_key}') try: