atsushieno / aap-core

an Audio Plugin Format/Framework for Android
MIT License
92 stars 3 forks source link

implement UMP request-response correlator for non-RT-safe async operations #176

Closed atsushieno closed 1 year ago

atsushieno commented 1 year ago

It is possible that an AAP plugin receives non-RT-safe operations via AAPXS SysEx8.

It should not be expected that such operations are performed in realtime manner, but it is valid if such requests were intended to be asynchronous operations. extension() operation via Binder could prevent realtime process() calls on its RT thread (extension() on non-RT thread could block RT audio processing thread), so at realtime ACTIVE state everything should be on a process() call.

Some extension functions need a response to the request. Since it may not be completed within one realtime request-reply process() call, such non-RT request should be performed asynchronously at the aap::LocalPluginInstance, which sends the reply back to the client only when it is ready. Then the client aap::RemotePluginInstance also needs to waited for the result until it is returned by the service.

We need such a correlator implementation down to somewhere like cmidi2 layer.

atsushieno commented 1 year ago

This needs to be worked on in the context of https://github.com/atsushieno/aap-core/issues/171 which means it will be post-0.7.8 work...

atsushieno commented 1 year ago

At ^ there is a migration implementation in StandardExtensions helper facade for asynchronous extension function, wrapped in synchronous API.

To make everything fully async, we will have to revamp the entire AAPXS stack (in both API and implementation) and that's going to be a further milestone.

atsushieno commented 1 year ago

It's done in aapxs-v080 branch. Once we merge aapxs-v080 branch, we can close this issue.

atsushieno commented 1 year ago

It is merged into main.