roc-droid icon indicating copy to clipboard operation
roc-droid copied to clipboard

[Q] Regarding using high performance audio library.

Open barolo opened this issue 10 months ago • 1 comments

Would be using a high performance android audio lib like oboe be helpful at lowering latency? https://github.com/google/oboe?tab=readme-ov-file

barolo avatar Apr 17 '24 14:04 barolo

Potentially yes, however it's far from trivial.

We have an issue for adding oboe to roc-toolkit: https://github.com/roc-streaming/roc-toolkit/issues/232

But just adding oboe wouldn't be enough, we'll also need to extend C API to provide access to it. Currently roc-toolkit C API doesn't expose sources & sinks functionality, instead it expects that user will implement I/O outside. However, there are plans to add such API too, which can be especially useful for language bindings like Go and Java, to keep real-time path entirely inside C++.

However, in case of android there is one more problem. Android audio stack uses java, and oboe is a low-level C++ library. It works great, but since it works on a lower level, it does not perform many housekeeping calls to various java APIs to initialize and configure audio device. So to make it work properly, especially with bluetooth, you'll need to implement this housekeeping on top of roc-toolkit, either in roc-java or in roc-droid.

So it would be quite a long journey :)

gavv avatar Apr 30 '24 17:04 gavv