Loading apex/ld.config.txt +2 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ namespace.default.links = platform # namespace.default.link.platform.shared_libs = %LLNDK_LIBRARIES% # namespace.default.link.platform.shared_libs += %SANITIZER_RUNTIME_LIBRARIES% namespace.default.link.platform.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libRS.so:libandroid_net.so:libc.so:libclang_rt.asan-aarch64-android.so:libclang_rt.asan-arm-android.so:libclang_rt.hwasan-aarch64-android.so:libclang_rt.asan-i686-android.so:libclang_rt.asan-x86_64-android.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libneuralnetworks.so:libsync.so:libvndksupport.so:libvulkan.so # FIXME: b/129552044 namespace.default.link.platform.shared_libs += libz.so ############################################################################### # "platform" namespace Loading apex/manifest.json +1 −1 Original line number Diff line number Diff line { "name": "com.android.media", "version": 1 "version": 200000000 } apex/manifest_codec.json +1 −1 Original line number Diff line number Diff line { "name": "com.android.media.swcodec", "version": 1 "version": 200000000 } media/libaaudio/examples/loopback/src/loopback.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,8 @@ // V0.4.01 = add -h hang option // fix -n option to set output buffer for -tm // plot first glitch #define APP_VERSION "0.4.01" // V0.4.02 = allow -n0 for minimal buffer size #define APP_VERSION "0.4.02" // Tag for machine readable results as property = value pairs #define RESULT_TAG "RESULT: " Loading Loading @@ -535,7 +536,7 @@ int main(int argc, const char **argv) printf("INPUT stream ----------------------------------------\n"); // Use different parameters for the input. argParser.setDeviceId(requestedInputDeviceId); argParser.setNumberOfBursts(AAUDIO_UNSPECIFIED); argParser.setNumberOfBursts(AAudioParameters::kDefaultNumberOfBursts); argParser.setFormat(requestedInputFormat); argParser.setPerformanceMode(inputPerformanceLevel); argParser.setChannelCount(requestedInputChannelCount); Loading media/libaaudio/examples/utils/AAudioArgsParser.h +77 −6 Original line number Diff line number Diff line Loading @@ -36,11 +36,14 @@ static void (*s_setContentType)(AAudioStreamBuilder* builder, aaudio_content_type_t contentType) = nullptr; static void (*s_setInputPreset)(AAudioStreamBuilder* builder, aaudio_input_preset_t inputPreset) = nullptr; static void (*s_setAllowedCapturePolicy)(AAudioStreamBuilder* builder, aaudio_allowed_capture_policy_t usage) = nullptr; static bool s_loadAttempted = false; static aaudio_usage_t (*s_getUsage)(AAudioStream *stream) = nullptr; static aaudio_content_type_t (*s_getContentType)(AAudioStream *stream) = nullptr; static aaudio_input_preset_t (*s_getInputPreset)(AAudioStream *stream) = nullptr; static aaudio_allowed_capture_policy_t (*s_getAllowedCapturePolicy)(AAudioStream *stream) = nullptr; // Link to test functions in shared library. static void loadFutureFunctions() { Loading @@ -61,6 +64,10 @@ static void loadFutureFunctions() { dlsym(handle, "AAudioStreamBuilder_setInputPreset"); if (s_setInputPreset == nullptr) goto error; s_setAllowedCapturePolicy = (void (*)(AAudioStreamBuilder *, aaudio_input_preset_t)) dlsym(handle, "AAudioStreamBuilder_setAllowedCapturePolicy"); if (s_setAllowedCapturePolicy == nullptr) goto error; s_getUsage = (aaudio_usage_t (*)(AAudioStream *)) dlsym(handle, "AAudioStream_getUsage"); if (s_getUsage == nullptr) goto error; Loading @@ -72,6 +79,10 @@ static void loadFutureFunctions() { s_getInputPreset = (aaudio_input_preset_t (*)(AAudioStream *)) dlsym(handle, "AAudioStream_getInputPreset"); if (s_getInputPreset == nullptr) goto error; s_getAllowedCapturePolicy = (aaudio_input_preset_t (*)(AAudioStream *)) dlsym(handle, "AAudioStream_getAllowedCapturePolicy"); if (s_getAllowedCapturePolicy == nullptr) goto error; } return; Loading Loading @@ -169,6 +180,14 @@ public: mInputPreset = inputPreset; } aaudio_allowed_capture_policy_t getAllowedCapturePolicy() const { return mAllowedCapturePolicy; } void setAllowedCapturePolicy(aaudio_allowed_capture_policy_t policy) { mAllowedCapturePolicy = policy; } int32_t getDeviceId() const { return mDeviceId; } Loading Loading @@ -223,8 +242,17 @@ public: } else if (mUsage != AAUDIO_UNSPECIFIED){ printf("WARNING: setInputPreset not supported"); } // Call Q functions if supported. if (s_setAllowedCapturePolicy != nullptr) { s_setAllowedCapturePolicy(builder, mAllowedCapturePolicy); } else if (mAllowedCapturePolicy != AAUDIO_UNSPECIFIED){ printf("WARNING: setAllowedCapturePolicy not supported"); } } static constexpr int32_t kDefaultNumberOfBursts = 2; private: int32_t mChannelCount = AAUDIO_UNSPECIFIED; aaudio_format_t mFormat = AAUDIO_FORMAT_UNSPECIFIED; Loading @@ -238,8 +266,9 @@ private: aaudio_usage_t mUsage = AAUDIO_UNSPECIFIED; aaudio_content_type_t mContentType = AAUDIO_UNSPECIFIED; aaudio_input_preset_t mInputPreset = AAUDIO_UNSPECIFIED; aaudio_allowed_capture_policy_t mAllowedCapturePolicy = AAUDIO_UNSPECIFIED; int32_t mNumberOfBursts = AAUDIO_UNSPECIFIED; int32_t mNumberOfBursts = kDefaultNumberOfBursts; int32_t mFramesPerCallback = AAUDIO_UNSPECIFIED; }; Loading Loading @@ -267,6 +296,9 @@ public: case 'c': setChannelCount(atoi(&arg[2])); break; case 'C': setAllowedCapturePolicy(parseAllowedCapturePolicy(arg[2])); break; case 'd': setDeviceId(atoi(&arg[2])); break; Loading Loading @@ -341,6 +373,10 @@ public: printf(" Default values are UNSPECIFIED unless otherwise stated.\n"); printf(" -b{bufferCapacity} frames\n"); printf(" -c{channels} for example 2 for stereo\n"); printf(" -C{a|s|n} set playback capture policy\n"); printf(" a = _ALL (default)\n"); printf(" s = _SYSTEM\n"); printf(" n = _NONE\n"); printf(" -d{deviceId} default is %d\n", AAUDIO_UNSPECIFIED); printf(" -f{0|1|2} set format\n"); printf(" 0 = UNSPECIFIED\n"); Loading @@ -352,7 +388,7 @@ public: printf(" 1 = _NEVER, never use MMAP\n"); printf(" 2 = _AUTO, use MMAP if available, default for -m with no number\n"); printf(" 3 = _ALWAYS, use MMAP or fail\n"); printf(" -n{numberOfBursts} for setBufferSize\n"); printf(" -n{numberOfBursts} for setBufferSize, default %d\n", kDefaultNumberOfBursts); printf(" -p{performanceMode} set output AAUDIO_PERFORMANCE_MODE*, default NONE\n"); printf(" n for _NONE\n"); printf(" l for _LATENCY\n"); Loading @@ -365,6 +401,25 @@ public: printf(" -z{callbackSize} or block size, in frames, default = 0\n"); } static aaudio_performance_mode_t parseAllowedCapturePolicy(char c) { aaudio_allowed_capture_policy_t policy = AAUDIO_ALLOW_CAPTURE_BY_ALL; switch (c) { case 'a': policy = AAUDIO_ALLOW_CAPTURE_BY_ALL; break; case 's': policy = AAUDIO_ALLOW_CAPTURE_BY_SYSTEM; break; case 'n': policy = AAUDIO_ALLOW_CAPTURE_BY_NONE; break; default: printf("ERROR: invalid playback capture policy %c\n", c); break; } return policy; } static aaudio_performance_mode_t parsePerformanceMode(char c) { aaudio_performance_mode_t mode = AAUDIO_PERFORMANCE_MODE_NONE; switch (c) { Loading Loading @@ -407,17 +462,28 @@ public: getFormat(), AAudioStream_getFormat(stream)); int32_t framesPerBurst = AAudioStream_getFramesPerBurst(stream); int32_t sizeFrames = AAudioStream_getBufferSizeInFrames(stream); printf(" Buffer: burst = %d\n", framesPerBurst); int32_t sizeFrames = AAudioStream_getBufferSizeInFrames(stream); if (framesPerBurst > 0) { printf(" Buffer: size = %d = (%d * %d) + %d\n", int32_t requestedSize = getNumberOfBursts() * framesPerBurst; printf(" BufferSize: requested = %4d, actual = %4d = (%d * %d) + %d\n", requestedSize, sizeFrames, (sizeFrames / framesPerBurst), framesPerBurst, (sizeFrames % framesPerBurst)); } else { printf(" BufferSize: %d\n", sizeFrames); } printf(" Capacity: requested = %d, actual = %d\n", getBufferCapacity(), AAudioStream_getBufferCapacityInFrames(stream)); int32_t capacityFrames = AAudioStream_getBufferCapacityInFrames(stream); printf(" Capacity: requested = %4d, actual = %4d = (%d * %d) + %d\n", getBufferCapacity(), capacityFrames, (capacityFrames / framesPerBurst), framesPerBurst, (capacityFrames % framesPerBurst)); printf(" CallbackSize: requested = %d, actual = %d\n", getFramesPerCallback(), AAudioStream_getFramesPerDataCallback(stream)); Loading Loading @@ -449,6 +515,11 @@ public: printf(" Is MMAP used? %s\n", AAudioStream_isMMapUsed(stream) ? "yes" : "no"); if (s_getAllowedCapturePolicy != nullptr) { printf(" ContentType: requested = %d, actual = %d\n", getAllowedCapturePolicy(), s_getAllowedCapturePolicy(stream)); } } int32_t getDurationSeconds() const { Loading Loading
apex/ld.config.txt +2 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ namespace.default.links = platform # namespace.default.link.platform.shared_libs = %LLNDK_LIBRARIES% # namespace.default.link.platform.shared_libs += %SANITIZER_RUNTIME_LIBRARIES% namespace.default.link.platform.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libRS.so:libandroid_net.so:libc.so:libclang_rt.asan-aarch64-android.so:libclang_rt.asan-arm-android.so:libclang_rt.hwasan-aarch64-android.so:libclang_rt.asan-i686-android.so:libclang_rt.asan-x86_64-android.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libneuralnetworks.so:libsync.so:libvndksupport.so:libvulkan.so # FIXME: b/129552044 namespace.default.link.platform.shared_libs += libz.so ############################################################################### # "platform" namespace Loading
apex/manifest.json +1 −1 Original line number Diff line number Diff line { "name": "com.android.media", "version": 1 "version": 200000000 }
apex/manifest_codec.json +1 −1 Original line number Diff line number Diff line { "name": "com.android.media.swcodec", "version": 1 "version": 200000000 }
media/libaaudio/examples/loopback/src/loopback.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,8 @@ // V0.4.01 = add -h hang option // fix -n option to set output buffer for -tm // plot first glitch #define APP_VERSION "0.4.01" // V0.4.02 = allow -n0 for minimal buffer size #define APP_VERSION "0.4.02" // Tag for machine readable results as property = value pairs #define RESULT_TAG "RESULT: " Loading Loading @@ -535,7 +536,7 @@ int main(int argc, const char **argv) printf("INPUT stream ----------------------------------------\n"); // Use different parameters for the input. argParser.setDeviceId(requestedInputDeviceId); argParser.setNumberOfBursts(AAUDIO_UNSPECIFIED); argParser.setNumberOfBursts(AAudioParameters::kDefaultNumberOfBursts); argParser.setFormat(requestedInputFormat); argParser.setPerformanceMode(inputPerformanceLevel); argParser.setChannelCount(requestedInputChannelCount); Loading
media/libaaudio/examples/utils/AAudioArgsParser.h +77 −6 Original line number Diff line number Diff line Loading @@ -36,11 +36,14 @@ static void (*s_setContentType)(AAudioStreamBuilder* builder, aaudio_content_type_t contentType) = nullptr; static void (*s_setInputPreset)(AAudioStreamBuilder* builder, aaudio_input_preset_t inputPreset) = nullptr; static void (*s_setAllowedCapturePolicy)(AAudioStreamBuilder* builder, aaudio_allowed_capture_policy_t usage) = nullptr; static bool s_loadAttempted = false; static aaudio_usage_t (*s_getUsage)(AAudioStream *stream) = nullptr; static aaudio_content_type_t (*s_getContentType)(AAudioStream *stream) = nullptr; static aaudio_input_preset_t (*s_getInputPreset)(AAudioStream *stream) = nullptr; static aaudio_allowed_capture_policy_t (*s_getAllowedCapturePolicy)(AAudioStream *stream) = nullptr; // Link to test functions in shared library. static void loadFutureFunctions() { Loading @@ -61,6 +64,10 @@ static void loadFutureFunctions() { dlsym(handle, "AAudioStreamBuilder_setInputPreset"); if (s_setInputPreset == nullptr) goto error; s_setAllowedCapturePolicy = (void (*)(AAudioStreamBuilder *, aaudio_input_preset_t)) dlsym(handle, "AAudioStreamBuilder_setAllowedCapturePolicy"); if (s_setAllowedCapturePolicy == nullptr) goto error; s_getUsage = (aaudio_usage_t (*)(AAudioStream *)) dlsym(handle, "AAudioStream_getUsage"); if (s_getUsage == nullptr) goto error; Loading @@ -72,6 +79,10 @@ static void loadFutureFunctions() { s_getInputPreset = (aaudio_input_preset_t (*)(AAudioStream *)) dlsym(handle, "AAudioStream_getInputPreset"); if (s_getInputPreset == nullptr) goto error; s_getAllowedCapturePolicy = (aaudio_input_preset_t (*)(AAudioStream *)) dlsym(handle, "AAudioStream_getAllowedCapturePolicy"); if (s_getAllowedCapturePolicy == nullptr) goto error; } return; Loading Loading @@ -169,6 +180,14 @@ public: mInputPreset = inputPreset; } aaudio_allowed_capture_policy_t getAllowedCapturePolicy() const { return mAllowedCapturePolicy; } void setAllowedCapturePolicy(aaudio_allowed_capture_policy_t policy) { mAllowedCapturePolicy = policy; } int32_t getDeviceId() const { return mDeviceId; } Loading Loading @@ -223,8 +242,17 @@ public: } else if (mUsage != AAUDIO_UNSPECIFIED){ printf("WARNING: setInputPreset not supported"); } // Call Q functions if supported. if (s_setAllowedCapturePolicy != nullptr) { s_setAllowedCapturePolicy(builder, mAllowedCapturePolicy); } else if (mAllowedCapturePolicy != AAUDIO_UNSPECIFIED){ printf("WARNING: setAllowedCapturePolicy not supported"); } } static constexpr int32_t kDefaultNumberOfBursts = 2; private: int32_t mChannelCount = AAUDIO_UNSPECIFIED; aaudio_format_t mFormat = AAUDIO_FORMAT_UNSPECIFIED; Loading @@ -238,8 +266,9 @@ private: aaudio_usage_t mUsage = AAUDIO_UNSPECIFIED; aaudio_content_type_t mContentType = AAUDIO_UNSPECIFIED; aaudio_input_preset_t mInputPreset = AAUDIO_UNSPECIFIED; aaudio_allowed_capture_policy_t mAllowedCapturePolicy = AAUDIO_UNSPECIFIED; int32_t mNumberOfBursts = AAUDIO_UNSPECIFIED; int32_t mNumberOfBursts = kDefaultNumberOfBursts; int32_t mFramesPerCallback = AAUDIO_UNSPECIFIED; }; Loading Loading @@ -267,6 +296,9 @@ public: case 'c': setChannelCount(atoi(&arg[2])); break; case 'C': setAllowedCapturePolicy(parseAllowedCapturePolicy(arg[2])); break; case 'd': setDeviceId(atoi(&arg[2])); break; Loading Loading @@ -341,6 +373,10 @@ public: printf(" Default values are UNSPECIFIED unless otherwise stated.\n"); printf(" -b{bufferCapacity} frames\n"); printf(" -c{channels} for example 2 for stereo\n"); printf(" -C{a|s|n} set playback capture policy\n"); printf(" a = _ALL (default)\n"); printf(" s = _SYSTEM\n"); printf(" n = _NONE\n"); printf(" -d{deviceId} default is %d\n", AAUDIO_UNSPECIFIED); printf(" -f{0|1|2} set format\n"); printf(" 0 = UNSPECIFIED\n"); Loading @@ -352,7 +388,7 @@ public: printf(" 1 = _NEVER, never use MMAP\n"); printf(" 2 = _AUTO, use MMAP if available, default for -m with no number\n"); printf(" 3 = _ALWAYS, use MMAP or fail\n"); printf(" -n{numberOfBursts} for setBufferSize\n"); printf(" -n{numberOfBursts} for setBufferSize, default %d\n", kDefaultNumberOfBursts); printf(" -p{performanceMode} set output AAUDIO_PERFORMANCE_MODE*, default NONE\n"); printf(" n for _NONE\n"); printf(" l for _LATENCY\n"); Loading @@ -365,6 +401,25 @@ public: printf(" -z{callbackSize} or block size, in frames, default = 0\n"); } static aaudio_performance_mode_t parseAllowedCapturePolicy(char c) { aaudio_allowed_capture_policy_t policy = AAUDIO_ALLOW_CAPTURE_BY_ALL; switch (c) { case 'a': policy = AAUDIO_ALLOW_CAPTURE_BY_ALL; break; case 's': policy = AAUDIO_ALLOW_CAPTURE_BY_SYSTEM; break; case 'n': policy = AAUDIO_ALLOW_CAPTURE_BY_NONE; break; default: printf("ERROR: invalid playback capture policy %c\n", c); break; } return policy; } static aaudio_performance_mode_t parsePerformanceMode(char c) { aaudio_performance_mode_t mode = AAUDIO_PERFORMANCE_MODE_NONE; switch (c) { Loading Loading @@ -407,17 +462,28 @@ public: getFormat(), AAudioStream_getFormat(stream)); int32_t framesPerBurst = AAudioStream_getFramesPerBurst(stream); int32_t sizeFrames = AAudioStream_getBufferSizeInFrames(stream); printf(" Buffer: burst = %d\n", framesPerBurst); int32_t sizeFrames = AAudioStream_getBufferSizeInFrames(stream); if (framesPerBurst > 0) { printf(" Buffer: size = %d = (%d * %d) + %d\n", int32_t requestedSize = getNumberOfBursts() * framesPerBurst; printf(" BufferSize: requested = %4d, actual = %4d = (%d * %d) + %d\n", requestedSize, sizeFrames, (sizeFrames / framesPerBurst), framesPerBurst, (sizeFrames % framesPerBurst)); } else { printf(" BufferSize: %d\n", sizeFrames); } printf(" Capacity: requested = %d, actual = %d\n", getBufferCapacity(), AAudioStream_getBufferCapacityInFrames(stream)); int32_t capacityFrames = AAudioStream_getBufferCapacityInFrames(stream); printf(" Capacity: requested = %4d, actual = %4d = (%d * %d) + %d\n", getBufferCapacity(), capacityFrames, (capacityFrames / framesPerBurst), framesPerBurst, (capacityFrames % framesPerBurst)); printf(" CallbackSize: requested = %d, actual = %d\n", getFramesPerCallback(), AAudioStream_getFramesPerDataCallback(stream)); Loading Loading @@ -449,6 +515,11 @@ public: printf(" Is MMAP used? %s\n", AAudioStream_isMMapUsed(stream) ? "yes" : "no"); if (s_getAllowedCapturePolicy != nullptr) { printf(" ContentType: requested = %d, actual = %d\n", getAllowedCapturePolicy(), s_getAllowedCapturePolicy(stream)); } } int32_t getDurationSeconds() const { Loading