cpal 0.12 macOS stream callback isn't executed when winit event loop is running
In 0.12 the stream callback is only executed if I call thread::sleep() or loop {} after stream.play(), it doesn't get called if I spawn a winit window after. I had no problem with 0.11 when I spawn my own audio thread.
Minimal example (modified from beep example): https://gist.github.com/slmjkdbtl/61aab267bae59907ada0d6296682a40d Currently can't test on other platforms so not sure if I'm just doing it wrong
Your gist isn't accessible to me. FWIW I'm on MacOS and found this issue when searching because I was seeing something similar, but then I realised that because stream.play() is non-blocking, my thread was terminating. I think that's expected though.
@curlywurlycraig Sorry I accidentally deleted the code yesterday. In my case application / windowing main loop is blocking the main thread after I call stream.play(). I remember it's something like
stream.play();
while (true) {} // this blocks and works
stream.play();
start_winit_main_loop(); // this blocks but doesn't work
I'm afraid I can't help then. My issue was just that I wasn't blocking the main thread.
@curlywurlycraig NP. Thanks for replying. (I'm not even sure if this problem still exists, haven't tried in some time and there're updates to both libs)