Loading 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 +19 −6 Original line number Diff line number Diff line Loading @@ -251,6 +251,8 @@ public: } } static constexpr int32_t kDefaultNumberOfBursts = 2; private: int32_t mChannelCount = AAUDIO_UNSPECIFIED; aaudio_format_t mFormat = AAUDIO_FORMAT_UNSPECIFIED; Loading @@ -266,7 +268,7 @@ private: 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 @@ -386,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 Loading @@ -460,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 media/libaaudio/examples/utils/AAudioSimplePlayer.h +3 −4 Original line number Diff line number Diff line Loading @@ -120,10 +120,9 @@ public: if (result == AAUDIO_OK) { int32_t sizeInBursts = parameters.getNumberOfBursts(); if (sizeInBursts > 0) { int32_t framesPerBurst = AAudioStream_getFramesPerBurst(mStream); AAudioStream_setBufferSizeInFrames(mStream, sizeInBursts * framesPerBurst); } int32_t bufferSizeFrames = sizeInBursts * framesPerBurst; AAudioStream_setBufferSizeInFrames(mStream, bufferSizeFrames); } AAudioStreamBuilder_delete(builder); Loading media/libaaudio/examples/write_sine/src/write_sine_callback.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ #include "AAudioSimplePlayer.h" #include "AAudioArgsParser.h" #define APP_VERSION "0.1.6" #define APP_VERSION "0.1.7" constexpr int32_t kDefaultHangTimeMSec = 10; Loading Loading
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 +19 −6 Original line number Diff line number Diff line Loading @@ -251,6 +251,8 @@ public: } } static constexpr int32_t kDefaultNumberOfBursts = 2; private: int32_t mChannelCount = AAUDIO_UNSPECIFIED; aaudio_format_t mFormat = AAUDIO_FORMAT_UNSPECIFIED; Loading @@ -266,7 +268,7 @@ private: 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 @@ -386,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 Loading @@ -460,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
media/libaaudio/examples/utils/AAudioSimplePlayer.h +3 −4 Original line number Diff line number Diff line Loading @@ -120,10 +120,9 @@ public: if (result == AAUDIO_OK) { int32_t sizeInBursts = parameters.getNumberOfBursts(); if (sizeInBursts > 0) { int32_t framesPerBurst = AAudioStream_getFramesPerBurst(mStream); AAudioStream_setBufferSizeInFrames(mStream, sizeInBursts * framesPerBurst); } int32_t bufferSizeFrames = sizeInBursts * framesPerBurst; AAudioStream_setBufferSizeInFrames(mStream, bufferSizeFrames); } AAudioStreamBuilder_delete(builder); Loading
media/libaaudio/examples/write_sine/src/write_sine_callback.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ #include "AAudioSimplePlayer.h" #include "AAudioArgsParser.h" #define APP_VERSION "0.1.6" #define APP_VERSION "0.1.7" constexpr int32_t kDefaultHangTimeMSec = 10; Loading