On Mon, Jan 11, 2021 at 12:37 PM Jonah Fox <[email protected]> wrote: > > Hi I'm trying to capture audio (using portaudio) and send and receive UDP > packets. > > I'm trying to work out how to integrate with the libuv loop from the > soundcard callback. > > *If I send using libuv directly from the loop - it occasionally crashes > (perhaps expected) > * I could write into a buffer and have a libuv timer process this - but I'd > get wasted latency. > * perhaps I can write into a buffer and direct libuv to wake up. I did try > using uv_async, but it seemed to be too slow. > > What is the correct thing to do here? > > J
Is your soundcard callback called on the same thread as libuv or a different one? I assume it's a different one and in that case uv_async_send() is the right thing to use. You say it's too slow. What kind of latency do you see? How and when do you call uv_run()? Do you have callbacks that take a while to complete? A uv_async_t callback won't run until libuv gets the opportunity to poll for new events. -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/libuv/CAHQurc-bJKTDOA_FTPmNf%3DNr1v_Yk__vUa434HyMgKU3Ta6NhA%40mail.gmail.com.
