added sampling state check to prevent hardware timeouts from improper library use