Make microphone polling interval configurable#877
Make microphone polling interval configurable#877watsaig wants to merge 1 commit intoRustAudio:masterfrom
Conversation
|
Thanks. If memory serves me well, then in #799 we even moved to a |
|
Regarding this PR: as far as I know there are two big latency sources for a VoIP like application:
Switching to the condvar should remove the polling latency entirely. I would also be open to other implementations. The reason we have the polling interval is to convert from OS callbacks pushing samples to OS callbacks pulling samples: Microphone
----- Analog cable -----> DAC
----- Kernel polling/interrupts -----> OS audio buffer
----- Kernel calling on "non empty" buffer ----> Rodio microphone callback (via CPAL)
Rodio callback <----- kernel calling on "non full" buffer ----
OS audio buffer <----- kernel pollling/interrupst ------------
ADC <--------------------analog cable-------------------------
SpeakerSo we have a thread to "reverse the flow" at the microphone side, to go from the I did the initial microphone design mostly to get the feature landed. It might For example maybe we could do without the thread. If you want to feel free to |
|
Thanks for the feedback! I'll take a deeper dive and see if the condvar approach works best or if we can do without the thread as you mentioned |
The microphone functionality added recently is very useful but for some use cases, the hard-coded 5ms poll interval is a limitation.
This makes the interval configurable, as suggested by @roderickvd in the original PR.