google / oboe

Oboe is a C++ library that makes it easy to build high-performance audio apps on Android.
Apache License 2.0
3.72k stars 573 forks source link

System properties like "aaudio.mmap_policy" going away, need fallback solution #2025

Open philburk opened 6 months ago

philburk commented 6 months ago

Oboe looks at those system properties to determine whether MMAP is supported:

https://github.com/google/oboe/blob/854e0d4ecb1f49cb84af41820182a6ef267e71f4/src/aaudio/AAudioExtensions.h#L46

Those system properties are going away as we transition to AIDL. So we need a fallback solution.

Note that the "media.aaudio" service is only launched if MMAP is supported. So Oboe and CTS could use the availability of that service instead of reading the property "aaudio.mmap_policy". This is a bit of a hack so it might not be appropriate.

See https://cs.android.com/android/platform/superproject/main/+/main:frameworks/av/media/audioserver/main_audioserver.cpp

We could do something like: sp sm = defaultServiceManager(); sp binder = sm->waitForService(String16(AAUDIO_SERVICE_NAME));

If binder is != null then MMAP is supported.