In real-time audio software, any code that blocks the audio processing thread must be avoided at all costs, as it can cause glitches in the signal. This includes system calls on general-purpose operating systems that can lead to blocking interactions with other threads, the thread scheduler and/or the virtual memory paging mechanism. Or heap memory allocations and unconditional locks (mutexes) that have unpredictable execution times. Bencina, R. (2014, July). Interfacing real-time audio and file I/O. In Proc. of the Australasian Computer Music Conference (ACMC) (pp. 21-28).
I wonder if the tensorflow lite c library method for forwarding the input tensor TfLiteInterpreterInvoke(interpreter);
uses any non real-time safe operations like the ones described above, which could have unpredictable execution times and therefore block the audio processing thread on callback at worst-case execution times. The interpreter creation and memory allocation can be done beforehand, so I only refer to the actual inference. Is such a call real-time safe?
Unfortunately, it is quite difficult to check all these non real-time safe operations in the inference method... That's why I hope to find an answer here.