I’ve had something similar happen as a bug when I was using a python sound device and calling numpy functions inside its stream callback. Took me a long time to figure out that numpy subroutines that drop the GIL would cause the audio stream to stall.