re-wrote delay timing loop in the capture thread as it wasn't actually working