Re: Calling dll function causes program to end
- Posted by ghaberek (admin) Jan 05, 2014
- 1487 views
ryanj said...
Now it runs. I still don't hear audio, though. Another interesting thing i discovered: if i call task_yield() while the audio stream is running, it dies with no error. I'm curious what task_yield() does that would cause problems with a callback.
I believe task_yield() moves the internal stack pointer, which is probably affecting a threaded asynchronous call to your callback function. Matt or Jim can probably shed more light on this. It sound obvious when I say it, but it's been my experience that multitasking is generally not thread-safe. And the thread safety of PortAudio is currently unspecified, with the note that "calls to open and close streams are definitely not thread safe on any platform."
-Greg