Oboe is a C++ library that makes it easy to build high-performance audio apps on Android.

Related tags

Audio audio android oboe
Overview

Oboe Build CI

Introduction to Oboe video

Oboe is a C++ library which makes it easy to build high-performance audio apps on Android. It was created primarily to allow developers to target a simplified API that works across multiple API levels back to API level 16 (Jelly Bean).

Features

  • Compatible with API 16 onwards - runs on 99% of Android devices
  • Chooses the audio API (OpenSL ES on API 16+ or AAudio on API 27+) which will give the best audio performance on the target Android device
  • Automatic latency tuning
  • Modern C++ allowing you to write clean, elegant code
  • Workarounds for some known issues
  • Used by popular apps and frameworks

Documentation

Community

Testing

Videos

Sample code and apps

Third party sample code

Contributing

We would love to receive your pull requests. Before we can though, please read the contributing guidelines.

Version history

View the releases page.

License

LICENSE

Comments
  • aaudio crash, assert in releaseBuffer

    aaudio crash, assert in releaseBuffer

    Hi, we've published a beta version app which first uses Oboe, and got reported a lot of crashes look similar to below:

    #00 pc 000000000001a48c /system/lib/libc.so (abort+63) #01 pc 00000000000065c3 /system/lib/liblog.so (__android_log_assert+154) #02 pc 00000000000340f9 /system/lib/libaudioclient.so (android::ClientProxy::releaseBuffer(android::Proxy::Buffer*)+120) #03 pc 0000000000024c3b /system/lib/libaudioclient.so (android::AudioRecord::releaseBuffer(android::AudioRecord::Buffer const*)+66) #04 pc 0000000000024d3d /system/lib/libaudioclient.so (android::AudioRecord::read(void*, unsigned int, bool)+212) #05 pc 000000000001371d /system/lib/libaaudio.so (aaudio::AudioStreamRecord::read(void*, int, long long)+92) oboe::AudioStreamAAudio::read(void*, int, long long) at /android/oboe/src/aaudio/AudioStreamAAudio.cpp:372:26

    Any idea what could cause these crashes ?

    bug P1 
    opened by taemincho 36
  • Crashes on many Android 8.0 devices

    Crashes on many Android 8.0 devices

    I recently tried Oboe in my app for sound output for Android 8.0+ (only). I had to halt rollout because probably the majority of devices with Android 8.0 (none with 8.1) have repeating crashes probably making app unusable. I can't reproduce on API 26 or 27 emulator or a Nexus 5X which I upgraded and tested on both 8.0 and 8.1. When I removed Oboe for 8.0 in new release crashes went away.

    The most common crashes not directly implicate Oboe, but lesser crashes on same devices do. Perhaps relevant information is I am building Oboe with old Android.mk system and with APP_PLATFORM = android-14 (though I think it is using 21 for Arm64 anyway automatically). Clang and c++_shared. NDK latest version in SDK manager. 16.1.4479499

    Thinking about buying one of these devices and trying to get more information.

    1 2 3 4 5 6 7 8

    bug P1 
    opened by svenoaks 33
  • Live streaming over WiFi

    Live streaming over WiFi

    Hello, I am working on a project of live audio streaming over WiFi. In particular, I need to build two apps (a transmitter and a receiver), in order to let a person talk with the transmitter, so that a set of people can listen his voice using the receiver, being connected to the same WiFi network. My current solution is experiencing a small delay, so I was considering to use Oboe on both apps to have better performances. My idea would be to create an AudioStream (with microphone as input source) on transmitter app, send it through network, then reproduce it on the receiver app through speakerphone or headset. Is this technically feasible with Oboe? Can I convert AudioStream objects to/from byte arrays? Or should I look for a different solution? Thanks for any advice.

    question 
    opened by Gaederer 27
  • Input preset Unprocessed results in silence on some devices?

    Input preset Unprocessed results in silence on some devices?

    Android version(s): 10 (API 29) Android device(s): samsung SM-G965F (samsung star2lte) and more? Oboe version: 1.4.2 App: Shruti Carnatic Tuner v7.0.2

    We migrated our app to use oboe and released it recently. This is a tuner app which listens to incoming sound, detects its pitch, and shows the notes. For the input stream, we use Unprocessed as input preset. We know Unprocessed gives weaker volume levels and we handled it in our app. On the devices we tested, this is working perfectly. However, we started seeing users report that the note detection is not working on some devices. Based on the interaction with a user, we suspect the samsung device mentioned above produces silence in the input stream. We also asked the user to switch off Google Assistant to ensure that it is not interfering with the input which didn't address the problem.

    We think that this may be the case with other devices. As a workaround, we asked the user to switch to our old engine which uses OpenSL ES directly without oboe, and it works for this user. No input preset is set while creating this opensl stream, so we assume it uses Generic or whichever is the default.

    Is it wrong to expect Unprocessed to be working on all the devices? Is there anything we could do about this problem? We're particularly interested in getting input signal without any noise suppression which at times alters the pitch of the sound.

    bug P1 requires device quirk input_preset 
    opened by rpattabi 26
  • Possible race on device disconnect, callback after close

    Possible race on device disconnect, callback after close

    Android version(s): 9 Android device(s): Xiaomi Redmi Note 7 Oboe version: 1.4.2

    Hi,

    First of all, sorry if I'm reporting this to a wrong tracker. I'm still not 100% sure if this is Oboe bug, AAudio bug, or bug in my own code.

    My app uses Oboe with BT SCO headset (AirPods) and creates two oboe streams (input and output). It also subscribes AudioManager events (from Java SDK), and when device disappears, it calls stream->stop(), then stream->close(), and then destroys stream; first for one stream, and then for another.

    (I'm using shared stream with data and error callbacks).

    At the same time, concurrently with the second stream close call, onAudioDeviceUpdate() callback is invoked somewhere in background. Then close() returns and I destroy the stream. And then AudioStreamLegacy segfaults in background. Before the segfault, clang UB sanitizer reports integrity check failure.

    It seems to me that close() doesn't wait until onAudioDeviceUpdate() is finished, or onAudioDeviceUpdate() doesn't check that the stream is already closed, or it fails if the stream is being closed during its invocation, or it invokes something (error callback?) that is not being waited by close(), etc.

    Here are the logs:

    07-21 16:49:17.199  19797    19797                              MYAPP  I  stopping stream for device 35
    07-21 16:49:17.199  19797    19797                             AAudio  D  AAudioStream_requestStop(0x6d948d2420)
    07-21 16:49:17.200  20099    20130                       AudioManager  E  updatePortConfig port not found for handle: 31
    07-21 16:49:17.200   2302     2958                       AudioManager  E  updatePortConfig port not found for handle: 31
    07-21 16:49:17.202  19797    20238                        AudioRecord  I  AUDIO_INPUT_FLAG_FAST successful; frameCount 4096 -> 4096
    07-21 16:49:17.212  20099    20130                       AudioManager  E  updatePortConfig port not found for handle: 31
    07-21 16:49:17.212   2302     2958                       AudioManager  E  updatePortConfig port not found for handle: 31
    07-21 16:49:17.228   2302     2958                       AudioManager  E  updatePortConfig port not found for handle: 31
    07-21 16:49:17.228  20099    20130                       AudioManager  E  updatePortConfig port not found for handle: 31
    07-21 16:49:17.229  19797    19822                       AudioManager  E  updatePortConfig port not found for handle: 31
    07-21 16:49:17.437   2302     2958                       AudioManager  E  updatePortConfig port not found for handle: 31
    07-21 16:49:17.437  19797    19822                       AudioManager  E  updatePortConfig port not found for handle: 31
    07-21 16:49:17.438  20099    20130                       AudioManager  E  updatePortConfig port not found for handle: 31
    07-21 16:49:17.439  19797    19797                              MYAPP  I  closing stream for device 35
    07-21 16:49:17.439  19797    19797                             AAudio  D  AAudioStream_close(0x6d948d2420) called ---------------
    07-21 16:49:17.439  19797    19863                  AudioStreamLegacy  D  onAudioDeviceUpdate() deviceId 14
    07-21 16:49:17.439  19797    19797                       AAudioStream  D  destroying 0x6d948d2420, state = AAUDIO_STREAM_STATE_CLOSED
    07-21 16:49:17.439  19797    19863                  AudioStreamLegacy  D  onAudioDeviceUpdate() DISCONNECT the stream now
    07-21 16:49:17.439  19797    19797                             AAudio  D  AAudioStream_close(0x6d948d2420) returned 0 ---------
    07-21 16:49:17.439  19797    19797                              MYAPP  I  stopping stream for device 31
    07-21 16:49:17.439  19797    19797                             AAudio  D  AAudioStream_requestStop(0x6c948d4f80)
    07-21 16:49:17.439  19797    19797                         AudioTrack  D  stop() called with 772032 frames delivered
    07-21 16:49:17.441  19797    19797                              MYAPP  I  closing stream for device 31
    07-21 16:49:17.441  19797    19797                             AAudio  D  AAudioStream_close(0x6c948d4f80) called ---------------
    07-21 16:49:17.442  19792    19792                            wrap.sh  I  frameworks/av/media/libaaudio/src/legacy/AudioStreamLegacy.cpp:216:13: runtime error: control flow integrity check for type 'aaudio::AudioStreamLegacy' failed during non-virtual call (vtable address 0x005e8dbd52f0)
    07-21 16:49:17.442  19792    19792                            wrap.sh  I  0x005e8dbd52f0: note: invalid vtable
    07-21 16:49:17.442  19792    19792                            wrap.sh  I  00 00 00 00  58 de b9 8d 5e 00 00 00  40 cf b9 8d 5e 00 00 00  fc 9d 47 18 7f 00 00 00  34 4c bc 8d
    07-21 16:49:17.442  19792    19792                            wrap.sh  I                ^ 
    07-21 16:49:17.443  19797    19797                         AudioTrack  V  ~AudioTrack, releasing session id 25 from 19797 on behalf of 19797
    07-21 16:49:17.446  19797    19797                       AAudioStream  D  destroying 0x6c948d4f80, state = AAUDIO_STREAM_STATE_CLOSED
    07-21 16:49:17.446  19797    19797                             AAudio  D  AAudioStream_close(0x6c948d4f80) returned 0 ---------
    07-21 16:49:17.446  19797    19797                              MYAPP  D  oboe stream destructor
    07-21 16:49:17.446  19797    19797                              MYAPP  D  oboe stream destructor
    

    Relevant lines are:

    <<<< onAudioDeviceUpdate() is called in background >>>>
    
    07-21 16:49:17.439  19797    19863                  AudioStreamLegacy  D  onAudioDeviceUpdate() DISCONNECT the stream now
    07-21 16:49:17.439  19797    19797                             AAudio  D  AAudioStream_close(0x6d948d2420) returned 0 ---------
    
    <<<< my app calls stop() >>>>
    
    07-21 16:49:17.439  19797    19797                              MYAPP  I  stopping stream for device 31
    07-21 16:49:17.439  19797    19797                             AAudio  D  AAudioStream_requestStop(0x6c948d4f80)
    07-21 16:49:17.439  19797    19797                         AudioTrack  D  stop() called with 772032 frames delivered
    
    <<<< my app calls close() >>>>
    
    07-21 16:49:17.441  19797    19797                              MYAPP  I  closing stream for device 31
    07-21 16:49:17.441  19797    19797                             AAudio  D  AAudioStream_close(0x6c948d4f80) called ---------------
    
    <<<< sanitizer failure >>>>
    
    07-21 16:49:17.442  19792    19792                            wrap.sh  I  frameworks/av/media/libaaudio/src/legacy/AudioStreamLegacy.cpp:216:13: runtime error: control flow integrity check for type 'aaudio::AudioStreamLegacy' failed during non-virtual call (vtable address 0x005e8dbd52f0)
    

    And here is the backtrace:

     wrap.sh  I  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior frameworks/av/media/libaaudio/src/legacy/AudioStreamLegacy.cpp:216:13 in
       DEBUG  F  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
       DEBUG  F  Build fingerprint: 'xiaomi/lavender/lavender:9/PKQ1.180904.001/V11.0.6.0.PFGMIXM:user/release-keys'
       DEBUG  F  Revision: '0'
       DEBUG  F  ABI: 'arm64'
       DEBUG  F  pid: 19797, tid: 19863, name: Binder:19797_4  >>> tech.boring.boringaudio <<<
       DEBUG  F  signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
       DEBUG  F  x0  0000000000000000  x1  0000000000004d97  x2  0000000000000006  x3  0000000000000008
       DEBUG  F  x4  0000000000000000  x5  0000000000000000  x6  0000000000000000  x7  0000000000000000
       DEBUG  F  x8  0000000000000083  x9  727d373c9ee44947  x10 0000000000000000  x11 fffffffc7ffffbdf
       DEBUG  F  x12 0000000000000001  x13 0000005e76454270  x14 0000000000000000  x15 0000007f16a59b5c
       DEBUG  F  x16 0000007f19d942b0  x17 0000007f19cb3cd0  x18 0000000000000001  x19 0000000000004d55
       DEBUG  F  x20 0000000000004d97  x21 0000000820810411  x22 0000005e8dbd52e0  x23 0000005e76455588
       DEBUG  F  x24 0000007094916480  x25 0000007f168772c0  x26 0000007f168fc680  x27 0000007f168ee930
       DEBUG  F  x28 000000000000dd50  x29 0000005e76454ed0
       DEBUG  F  sp  0000005e76454e90  lr  0000007f19ca7144  pc  0000007f19ca716c
       DEBUG  F  backtrace:
       DEBUG  F  #00 pc 000000000002216c  /system/lib64/libc.so (abort+116)
       DEBUG  F  #01 pc 000000000005a6d8  /data/app/tech.boring.boringaudio-jDFB_zBuiZEygtRlTZq43g==/lib/arm64/libclang_rt.asan-aarch64-android.so (offset 0x50000)
       DEBUG  F  #02 pc 0000000000059670  /data/app/tech.boring.boringaudio-jDFB_zBuiZEygtRlTZq43g==/lib/arm64/libclang_rt.asan-aarch64-android.so (offset 0x50000)
       DEBUG  F  #03 pc 00000000000640c4  /data/app/tech.boring.boringaudio-jDFB_zBuiZEygtRlTZq43g==/lib/arm64/libclang_rt.asan-aarch64-android.so (offset 0x50000) (__ubsan_handle_cfi_check_fail_abort+128)
       DEBUG  F  #04 pc 000000000002606c  /system/lib64/libaaudio.so
       DEBUG  F  #05 pc 000000000002a574  /system/lib64/libaaudio.so (__cfi_check+5492)
       DEBUG  F  #06 pc 000000000002ee58  /system/lib64/libaaudio.so (aaudio::AudioStreamLegacy::onAudioDeviceUpdate(int)+856)
       DEBUG  F  #07 pc 000000000005d3e8  /system/lib64/libaudioclient.so (android::AudioRecord::onAudioDeviceUpdate(int, int)+296)
       DEBUG  F  #08 pc 0000000000064ffc  /system/lib64/libaudioclient.so (android::AudioSystem::AudioFlingerClient::ioConfigChanged(android::audio_io_config_event, android::sp<android::AudioIoDescriptor> const&)+3300)
       DEBUG  F  #09 pc 0000000000086140  /system/lib64/libaudioclient.so (android::BnAudioFlingerClient::onTransact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+360)
       DEBUG  F  #10 pc 000000000004fbf4  /system/lib64/libbinder.so (android::BBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+136)
       DEBUG  F  #11 pc 000000000005d2a4  /system/lib64/libbinder.so (android::IPCThreadState::executeCommand(int)+520)
       DEBUG  F  #12 pc 000000000005cfe8  /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+156)
       DEBUG  F  #13 pc 000000000005d6d8  /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+108)
       DEBUG  F  #14 pc 000000000007fc5c  /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24)
       DEBUG  F  #15 pc 00000000000100dc  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+284)
       DEBUG  F  #16 pc 00000000000b5a10  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)
       DEBUG  F  #17 pc 0000000000090328  /system/lib64/libc.so (__pthread_start(void*)+36)
       DEBUG  F  #18 pc 0000000000023a28  /system/lib64/libc.so (__start_thread+68)
     wrap.sh  I  Aborted
     wrap.sh  I  wrap.sh terminated by exit(134)
    

    My own code looks sane to me: I just call close() and expect that it will wait everything that should be waited, and when it returns, I destroy the stream.

    If my code is correct, I'm not sure whether it's related to Oboe or AAudio. Is there a chance that Oboe close() implementation is incomplete and doesn't wait for something?

    Currently the reproducer is a rather large closed-source app. If my expectations to close() are correct and you think I'm using it right, and this may be related to Oboe, I can try to create a stand-alone reproducer. Please let me know if this makes sense.

    bug P1 
    opened by gavv 26
  • Normally-working code crashes with: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR) (AudioRecord)

    Normally-working code crashes with: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR) (AudioRecord)

    Hi, I am new to Oboe but am working on a cross-platform audio app which uses it for the Android version. I just bought a (relatively) new Android phone for testing, and was surprised to see that Oboe seems to have some issue with it. (This app is working fine on a variety of other phones.)

    For reference, the Android-specific code for the app is maintained here. Please let me know if I need to supply more details, thanks!

    Android version(s): 11 -- UPDATE: Actually version 12 Android device(s): Xiaomi Redmi Note 10 Pro Oboe version: 1.6.2 App name used for testing: koord-rt

    Short description When an audio stream is opened for recording, the app exits suddenly with: F libc : Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x7c45df2000 in tid 20486 (AudioRecord), pid 20231 (e.koord.koordrt)

    See below for more debug logs.

    Steps to reproduce

    • connect to a live session, which opens device for recording

    Expected behavior

    • audio stream is opened without problem

    Actual behavior

    • app crashes - exits without message

    Device Xiaomi Redmi Note 10 Pro

    Crash details from Google Play console:

    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    pid: 0, tid: 0 >>> live.koord.koordrt <<<
    
    backtrace:
      #00  pc 000000000008797c  /apex/com.android.runtime/lib64/bionic/libc.so (memset+156)
      #00  pc 00000000001401a4  /data/app/~~3UZEfri9poPsW3XvET5Pxw==/live.koord.koordrt-iFacayaQEnlDg63jR80yDg==/lib/arm64/libKoord-RT_arm64-v8a.so (CSound::onAudioInput(oboe::AudioStream*, void*, int)+108)
      #00  pc 000000000014080c  /data/app/~~3UZEfri9poPsW3XvET5Pxw==/live.koord.koordrt-iFacayaQEnlDg63jR80yDg==/lib/arm64/libKoord-RT_arm64-v8a.so (non-virtual thunk to CSound::onAudioReady(oboe::AudioStream*, void*, int)+152)
      #00  pc 0000000000144fa0  /data/app/~~3UZEfri9poPsW3XvET5Pxw==/live.koord.koordrt-iFacayaQEnlDg63jR80yDg==/lib/arm64/libKoord-RT_arm64-v8a.so (oboe::AudioStream::fireDataCallback(void*, int)+96)
      #00  pc 00000000001434e0  /data/app/~~3UZEfri9poPsW3XvET5Pxw==/live.koord.koordrt-iFacayaQEnlDg63jR80yDg==/lib/arm64/libKoord-RT_arm64-v8a.so (oboe::AudioStreamAAudio::callOnAudioReady(AAudioStreamStruct*, void*, int)+40)
      #00  pc 0000000000022428  /system/lib64/libaaudio_internal.so (aaudio::AudioStream::maybeCallDataCallback(void*, int)+196)
      #00  pc 0000000000024d04  /system/lib64/libaaudio_internal.so (aaudio::AudioStreamLegacy::callDataCallbackFrames(unsigned char*, int)+308)
      #00  pc 000000000002df60  /system/lib64/libaaudio_internal.so (FixedBlockWriter::processVariableBlock(unsigned char*, int)+336)
      #00  pc 0000000000025518  /system/lib64/libaaudio_internal.so (aaudio::AudioStreamLegacy::processCallbackCommon(int, void*)+896)
      #00  pc 000000000005ac3c  /system/lib64/libaudioclient.so (android::AudioRecord::processAudioBuffer()+1308)
      #00  pc 000000000005a428  /system/lib64/libaudioclient.so (android::AudioRecord::AudioRecordThread::threadLoop()+288)
      #00  pc 0000000000013654  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+464)
      #00  pc 00000000000bf4b8  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+148)
      #00  pc 0000000000012de8  /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+408)
      #00  pc 00000000000f0d44  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264)
      #00  pc 000000000008d57c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68)
    

    Further debug from Qt Creator / Android emulator session:

    I OboeAudio: openStream() OUTPUT -------- OboeVersion1.6.2 --------
    I OboeAudio: openStream() OUTPUT -------- OboeVersion1.6.2 --------
    I AAudio  : AAudioStreamBuilder_openStream() called ----------------------------------------
    I AudioStreamBuilder: rate   =      0, channels  = 2, format   = 1, sharing = EX, dir = OUTPUT
    I AudioStreamBuilder: device =      0, sessionId = -1, perfMode = 12, callback: ON with frames = 128
    I AudioStreamBuilder: usage  =      1, contentType = 2, inputPreset = 6, allowedCapturePolicy = 0
    I AudioStreamBuilder: privacy sensitive = false
    I AudioStreamBuilder: opPackageName = (null)
    I AudioStreamBuilder: attributionTag = (null)
    D AudioStreamBuilder: build() EXCLUSIVE sharing mode not supported. Use SHARED.
    D e.koord.koordr: PlayerBase::PlayerBase()
    D AudioStreamTrack: open(), request notificationFrames = -8, frameCount = 0
    I e.koord.koordr: getDeviceIsSupportElevoc() The device is not support elevoc
    I AudioTrack: createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST successful; frameCount 0 -> 1536
    D AudioTrack: setVolume: left = 1.000000 right = 1.000000
    D AAudioStream: setState(s#1) from 0 to 2
    D AudioStreamTrack: open() flags changed from 0x00000104 to 0x00000004
    I AAudio  : AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#1 ----------------
    I libKoord-RT_arm64-v8a.so: Stream details: [sDirection:  "Output" , FramesPerBurst:  "192" , BufferSizeInFrames:  "256" , BytesPerFrame:  "4" , BytesPerSample:  "2" , BufferCapacityInFrames:  "1536" , PerformanceMode:  "LowLatency" , SharingMode:  "Shared" , DeviceID:  "3" , SampleRate:  "48000" , AudioFormat:  "I16" , FramesPerCallback:  "128" ]
    I OboeAudio: openStream() INPUT -------- OboeVersion1.6.2 --------
    I OboeAudio: openStream() INPUT -------- OboeVersion1.6.2 --------
    I AAudio  : AAudioStreamBuilder_openStream() called ----------------------------------------
    I AudioStreamBuilder: rate   =      0, channels  = 2, format   = 1, sharing = EX, dir = INPUT
    I AudioStreamBuilder: device =      0, sessionId = -1, perfMode = 12, callback: ON with frames = 128
    I AudioStreamBuilder: usage  =      1, contentType = 2, inputPreset = 6, allowedCapturePolicy = 0
    I AudioStreamBuilder: privacy sensitive = false
    I AudioStreamBuilder: opPackageName = (null)
    I AudioStreamBuilder: attributionTag = (null)
    D AudioStreamBuilder: build() EXCLUSIVE sharing mode not supported. Use SHARED.
    D e.koord.koordr: PlayerBase::PlayerBase()
    D AudioRecord: set(): inputSource 0, sampleRate 0, format 0x1, channelMask 0xc, frameCount 0, notificationFrames 0, sessionId 0, transferType 1, flags 0x5, attributionSource AttributionSourceState{pid: 20231, uid: 10276, packageName: (null), attributionTag: (null), token: , renouncedPermissions: (null), next: []}uid -1, pid -1,isIsolated:0
    I AudioRecord: createRecord_l(6619216): AUDIO_INPUT_FLAG_FAST successful; frameCount 0 -> 4096
    W AudioStreamRecord: open() flags changed from 0x00000005 to 0x00000001
    D AAudioStream: setState(s#2) from 0 to 2
    I AAudio  : AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#2 ----------------
    I libKoord-RT_arm64-v8a.so: Stream details: [sDirection:  "Input" , FramesPerBurst:  "144" , BufferSizeInFrames:  "4096" , BytesPerFrame:  "4" , BytesPerSample:  "2" , BufferCapacityInFrames:  "4096" , PerformanceMode:  "LowLatency" , SharingMode:  "Shared" , DeviceID:  "22" , SampleRate:  "48000" , AudioFormat:  "I16" , FramesPerCallback:  "128" ]
    I libKoord-RT_arm64-v8a.so: Stream details: [sDirection:  "Output" , FramesPerBurst:  "192" , BufferSizeInFrames:  "256" , BytesPerFrame:  "4" , BytesPerSample:  "2" , BufferCapacityInFrames:  "1536" , PerformanceMode:  "LowLatency" , SharingMode:  "Shared" , DeviceID:  "3" , SampleRate:  "48000" , AudioFormat:  "I16" , FramesPerCallback:  "128" ]
    D AAudio  : AAudioStream_requestStart(s#2) called --------------
    D AAudioStream: setState(s#2) from 2 to 3
    D AAudio  : AAudioStream_requestStart(s#2) returned 0 ---------
    D AAudio  : AAudioStream_requestStart(s#1) called --------------
    D AAudioStream: setState(s#1) from 2 to 3
    D AudioStreamLegacy: onAudioDeviceUpdate(deviceId = 22)
    D AudioStreamLegacy: onAudioDeviceUpdate(deviceId = 22)
    D libKoord-RT_arm64-v8a.so: Stats:  frames_in:  0 ,frames_out:  0 ,frames_filled_out:  0 ,in_callback_calls:  0 ,out_callback_calls:  0 ,ring_overrun:  0
    D AAudio  : AAudioStream_requestStart(s#1) returned 0 ---------
    D AudioStreamLegacy: onAudioDeviceUpdate(deviceId = 3)
    D AAudioStream: setState(s#1) from 3 to 4
    F libc    : Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x7c45df2000 in tid 20486 (AudioRecord), pid 20231 (e.koord.koordrt)
    
    bug P1 
    opened by danryu 25
  • Android 11: ANR when opening stream on some samsung devices

    Android 11: ANR when opening stream on some samsung devices

    Android version(s): 11 Android device(s): Samsung Galaxy M30s, Samsung Galaxy M31, Samsung Galaxy Note10 Lite, Samsung Galaxy M21, Samsung Galaxy A51, Samsung Galaxy F41 (System on chip: Exynos 9611 mostly and Exynos 9810) Oboe version: 1.5-stable (1cc51bbf83bb3b05d436bb9b4a7aea3446aa8e61) App name used for testing: Pocket Shruti Box and Shruti Carnatic Tuner.

    Short description Lots of ANR reports when opening stream. Some users also reported that the app freezes upon opening. For these users the same version of the app used to work. The difference we see is that their devices received Android 11 update recently. All ANR reports in Google Play Console are also only from Android 11. This is the callstack:

      #00  pc 000000000009b124  /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
      #00  pc 0000000000057dd0  /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)
      #00  pc 00000000000529e4  /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+296)
      #00  pc 0000000000053d38  /system/lib64/libbinder.so (android::IPCThreadState::waitForResponse(android::Parcel*, int*)+60)
      #00  pc 0000000000053aa8  /system/lib64/libbinder.so (android::IPCThreadState::transact(int, unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+184)
      #00  pc 000000000004c014  /system/lib64/libbinder.so (android::BpBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+152)
      #00  pc 000000000003d624  /system/lib64/libaaudio_internal.so (android::BpAAudioService::openStream(aaudio::AAudioStreamRequest const&, aaudio::AAudioStreamConfiguration&)+336)
      #00  pc 0000000000039714  /system/lib64/libaaudio_internal.so (aaudio::AAudioBinderClient::openStream(aaudio::AAudioStreamRequest const&, aaudio::AAudioStreamConfiguration&)+172)
      #00  pc 000000000002f180  /system/lib64/libaaudio_internal.so (aaudio::AudioStreamInternal::open(aaudio::AudioStreamBuilder const&)+1576)
      #00  pc 0000000000033fd0  /system/lib64/libaaudio_internal.so (aaudio::AudioStreamInternalPlay::open(aaudio::AudioStreamBuilder const&)+92)
      #00  pc 0000000000022c5c  /system/lib64/libaaudio_internal.so (aaudio::AudioStreamBuilder::build(aaudio::AudioStream**)+860)
      #00  pc 00000000000037a8  /system/lib64/libaaudio.so (AAudioStreamBuilder_openStream.cfi+144)
      #00  pc 0000000000078bb8  /data/app/~~GJ14j16uejuWrNUJmjjvKA==/org.kuyil.shruti-NkXY0fPDmPbz-mBugtmV7w==/lib/arm64/libpdnativeoboe.so (oboe::AudioStreamAAudio::open()+568)
      #00  pc 00000000000714cc  /data/app/~~GJ14j16uejuWrNUJmjjvKA==/org.kuyil.shruti-NkXY0fPDmPbz-mBugtmV7w==/lib/arm64/libpdnativeoboe.so (oboe::AudioStreamBuilder::openStream(oboe::AudioStream**)+636)
      #00  pc 0000000000071388  /data/app/~~GJ14j16uejuWrNUJmjjvKA==/org.kuyil.shruti-NkXY0fPDmPbz-mBugtmV7w==/lib/arm64/libpdnativeoboe.so (oboe::AudioStreamBuilder::openStream(oboe::AudioStream**)+312)
      #00  pc 00000000000719b8  /data/app/~~GJ14j16uejuWrNUJmjjvKA==/org.kuyil.shruti-NkXY0fPDmPbz-mBugtmV7w==/lib/arm64/libpdnativeoboe.so (oboe::AudioStreamBuilder::openStream(std::__ndk1::shared_ptr<oboe::AudioStream>&)+136)
    

    Steps to reproduce We open the stream like this:

            std::shared_ptr<oboe::AudioStream> tmpStream;
            streamBuilder
                    .setSampleRate(params.sampleRate)  // native sample rate AudioManager::PROPERTY_OUTPUT_SAMPLE_RATE
                    ->setSampleRateConversionQuality(oboe::SampleRateConversionQuality::Medium)
                    ->setAudioApi(params.audioApi)  // AAudio for these devices
                    ->setChannelCount(params.numChannels) // channels 2 in case of output stream, 1 in case of input stream
                    ->setChannelConversionAllowed(true)
                    ->setFormat(oboe::AudioFormat::Float)
                    ->setFormatConversionAllowed(true)
                    ->setSharingMode(oboe::SharingMode::Shared)
                    ->setPerformanceMode(oboe::PerformanceMode::LowLatency)
                    ->setDeviceId(params.deviceId) // only applicable for AAudio. This is ignored for OpenSL.
                    ->setCallback(callback);
    
            auto tmpStreamResult = streamBuilder
                        .setDirection(getDirection())
                        ->openStream(tmpStream);
    

    We don't have access to any of these devices. So this is the info we have for now. As and when we get more info based on our investigation, we'll update it here.

    bug waiting for answer P1 Samsung bug_anr 
    opened by rpattabi 22
  • Accessing specific hardware output sample rates?

    Accessing specific hardware output sample rates?

    Are there any ways to encourage Oboe to open a device at a specific sample rate/format via the interfaces provided by Oboe? Even when addressing a device directly by device ID, I don't seem to be able to get more than one fixed low-latency sample rate.

    For example, if I connect a USB DAC to an Android 9.0 device (Samsung Galaxy Tab S5e), I can see via its AudioDeviceInfo that it supports these sample rates: 48kHz, 88.2kHz, 96kHz, 176.4kHz, 192kHz. If I try to open an Exclusive/Low Latency stream though, none of these rates allow for exclusive use (D/AudioStreamBuilder: build() EXCLUSIVE sharing mode not supported. Use SHARED.) and only 48kHz provides a low-latency stream. All other rates are accepted but the device itself remains at 48kHz.

    Is there some secret to getting the audio device to switch sample rates? There are certain audio formats that require bit-perfect transmission at specific sample rates (MQA, DSD over PCM) that just don't work if there's any data-altering mixing or resampling involved.

    Also, I've noticed that all of the USB devices that I've tried don't list 44.1kHz (or rates higher than 192kHz) as an available sample rate via AudioDeviceInfo, even when that is definitely a sample rate that the hardware supports. Is this an Android limitation?

    question 
    opened by strangecargo 22
  • OboeTester - Significant Audio Recording Glitches with Pixel 2

    OboeTester - Significant Audio Recording Glitches with Pixel 2

    When recording audio using the OboeTester Record and Play feature with default settings on the Pixel 2, significant audio glitches are introduced. Speech is unintelligible, see here: https://soundcloud.com/anon-ymous-647326941/sets/pixel-2-glitch

    If you change the sample rate to 8000hZ, there is no issue.

    • Was any code changed? No
    • How to reproduce?
    1. Install OboeTester on a Pixel 2 device.
    2. Hit Record and Play.
    3. Record some audio, at least 5 seconds, with all default settings.
    4. Play Recording, you will hear glitches.
    • Other points of interest
    1. This happens when using any pixel 2 microphone and when using an external microphone on my earbuds. Changing channels or PCM_16 doesn't solve the problem.
    2. There is no audio glitch at any sample rate below 48000 is used. My guess is the Android Resampler fixes this bug somehow.
    3. LiveEffect does not have this audio glitch issue by default, even at 48000hZ. However, if you use blocking reads instead of non-blocking, this audio glitch arises. Git Diff is here: https://pastebin.com/raw/sNeykq7Y
    • Android Version: 9.0
    bug P1 
    opened by ShariqM 19
  • how do I query output latency for echo cancellation

    how do I query output latency for echo cancellation

    I want to know how to get the delay for output(write data until it real rendered),or is there any way to get the delay?Can I use the buffersize as the play delay? I want do echo cancel use the webrtc-apm,but the AudioTrack can't get the right delay(I'm not sure if the delay is too long). So I want to try oboe. Thanks for help!!

    opened by yangwuan55 19
  • Oboe may need handle the case that openStream failed too many times

    Oboe may need handle the case that openStream failed too many times

    Android version(s): Android device(s): Oboe version: latest App name used for testing: (Please try to reproduce the issue using the OboeTester or an Oboe sample.)

    Short description

    Steps to reproduce

    1. disallow cellphone's microphone permission for oboe app
    2. try openStream many times
    3. then give permission for oboe app
    4. openStream maybe failed

    By investigate the oboe source code, I think here may have issue, could you help double check?

    image bug P1 
    opened by xzhan96 16
  • setState cycle when playing from input device and headphone jack connected.

    setState cycle when playing from input device and headphone jack connected.

    Android version(s): 11 Android device(s): Mi 9 T Oboe version: 1.6 and later

    When I plug in jack headphones while playing from usb input device oboe get into some kind of cicle. I cannot detect error anywhere it just cicles in console and audio stops. Then I can restart stream and everything works again.

    W/AudioRecord: restoreRecord_l(2768): dead IAudioRecord, creating a new one from obtainBuffer()
    D/AudioStreamLegacy: onAudioDeviceUpdate() devId 2321 => 2777
    D/AudioStreamLegacy: onAudioDeviceUpdate() DISCONNECT the stream now
    D/AAudioStream: setState(s#3) from 4 to 13
    D/AAudio: AAudioStream_requestStop(s#3) called
    D/AAudioStream: setState(s#3) from 13 to 9
    E/AAudioStream: setState(3) tried to set to 9 but already DISCONNECTED
    D/AudioRecord: stop mSessionID=10121
    D/AudioRecord: stop(2776): mActive:1
    D/truments.fxrac: PlayerBase::stop() from IPlayer
    D/AudioStreamLegacy: onAudioDeviceUpdate() devId 2777 => 2777
    D/AAudio: AAudioStream_requestStop(s#3) called
    D/AAudioStream: setState(s#3) from 13 to 9
    E/AAudioStream: setState(3) tried to set to 9 but already DISCONNECTED
    D/AudioRecord: stop mSessionID=10121
    D/AudioRecord: stop(2776): mActive:0
    D/truments.fxrac: PlayerBase::stop() from IPlayer
    D/AudioStreamLegacy: onAudioDeviceUpdate() devId 2777 => 2777
    D/AAudio: AAudioStream_requestStop(s#3) called
    D/AAudioStream: setState(s#3) from 13 to 9
    E/AAudioStream: setState(3) tried to set to 9 but already DISCONNECTED
    D/AudioRecord: stop mSessionID=10121
    
    bug 
    opened by renetik 2
  • LowLatency causes cracksin audio  after some time on one usb c input audio interface I tested

    LowLatency causes cracksin audio after some time on one usb c input audio interface I tested

    Android version(s): 11

    Android device(s): Mi 9T Oboe version: Main 30.12.2022 App name used for testing: Renetik FX Rack (to be released)

    Short description LowLatency causes cracks in audio on one usb c input audio interface I tested on others works fine. Looks like just that xiaomi device has this issue, but how should I solve it for users , what if more devices has this low latency issue? Shall I not use low latenci on input stream ?

    Steps to reproduce ... Create autput , create input , set oboe::PerformanceMode::LowLatency to input , start engine -> listen to some cracks in sound. Remove oboe::PerformanceMode::LowLatency, restart app -> no issues in sound.

    Expected behavior Should work good with LowLatency on all devices or just be disabled automaticaly or I dont know how can I ship this app wit LowLatency if I know it has problems with some devices, I am not sure what to do actually.

    Actual behavior First it sounds good and then after few second or minute starts crackling, when aj restart stream again first good then crackling, you can listen in audio.

    Device See Android device and that audo interface is Cubilux.

    ro.product.brand = Xiaomi
    ro.product.manufacturer = Xiaomi
    ro.product.model = Mi 9T
    ro.product.device = davinci
    ro.product.cpu.abi = arm64-v8a
    ro.build.description = davinci-user 11 RKQ1.200826.002 V12.1.4.0.RFJMIXM release-keys
    ro.hardware = qcom
    ro.hardware.chipname = 
    ro.arch = 
    | grep aaudio = [aaudio.hw_burst_min_usec]: [2000]
    [aaudio.mmap_exclusive_policy]: [2]
    [aaudio.mmap_policy]: [1]
    

    Here clearly you can hear audio effect and also some wired pause then it comes back to normal and in few second again crackling pause normal:

    FX Rack Recording (2).wav.zip

    bug 
    opened by renetik 0
  • aaudio capture with noice on vivo  x50pro+ (V2011A)

    aaudio capture with noice on vivo x50pro+ (V2011A)

    Android version(s): 10 Android device(s): vivo x50pro+ (V2011A) Oboe version: lastest App name used for testing: OboeTester (Please try to reproduce the issue using the OboeTester or an Oboe sample.)

    Short description capture with noice

    Steps to reproduce

    1. select "Record and play" test
    2. select aaudio + 48k+1channel+Generic(InPreset)
    3. Do "Record"

    Problem and Question: If I set "Input margin" to 2, the capture works well. I see this setting actually call stream->waitForAvailableFrames, my question is if the issue cased by xrun happens? However, I always get 0 value of stream->getXRunCount(), is this because the device does not support the function or other possible reason?

    Thanks a lot.

    https://user-images.githubusercontent.com/13726257/209959288-2f8105ea-9215-427b-93df-0356637d6172.mp4

    bug 
    opened by xzhan96 0
  • Audio streams very slow on Windows 11

    Audio streams very slow on Windows 11

    Android version(s): WSA Android 12 Android device(s): Windows 11 Oboe version: 1.6.1 App name used for testing: Remixlive

    Hi, I am not sure if this should be considered as a "bug" for Oboe (and if not, please close this), but when testing our app on Windows Subsystem for Android, even if I try OpenSL, or AAudio, the opened stream does not appear to have a low latency path at all. The buffer size returned is very high, and when closing & reopening a stream, it can lead to an ANR. Did you experienced the same on your side ? Is it a bug to be reported to Microsoft instead ?

    Thanks in advance and happy holidays !

    bug 
    opened by Nordhal 0
  • OboeTester: add latency test that measures inter-channel sync

    OboeTester: add latency test that measures inter-channel sync

    Test each output channel individually while the stream is held open so that we can compare the latency per-channel. Some wired headset have different output latency for left/right channels!

    enhancement apps 
    opened by philburk 0
  • Can we make multiple resamplers in same AudioPlayer?

    Can we make multiple resamplers in same AudioPlayer?

    I am receiving multiple audio frames with different sample rate. I am using resampler::MultiChannelResampler::make(...) to make resample all audio data to 44100 so I can play it in 1 stream after resampling. how can I create multiple resampleres so I can resample any sample rate I receive?

    question 
    opened by Slahuddin-Ch 1
Releases(1.7.0)
  • 1.7.0(Dec 15, 2022)

    API changes

    • Channel mask support is supported for AAudio in API 32 and above (#1548)
    • Add methods setDelayBeforeCloseMillis and getDelayBeforeCloseMillis to audio streams (#1593)
    • Add OboeExtensions (#1602). These will allow you to query for, enable, and disable MMAP support.
    • Add shared_ptr support for setDataCallback and setErrorCallback (#1626). The equivalent for raw pointers is now deprecated. This helps avoid crashes by preventing the callback from being deleted while the error callback is still active.

    OpenSL ES bug fixes

    • Fixed an issue with OpenSL ES queuing only one callback buffer (#1245, Fixes #1165)
    • Fixed an issue with OpenSL ES volume not working if Usage was Unspecified (#1537, Fixes #1536)
    • Fixed an issue with OpenSL ES where resources were not closed if open failed (#1550, Fixes #1550)
    • Fixed an issue with OpenSL ES not handling processBufferCallback() from multiple threads correctly (#1570, #1621, Fixes #1567)
    • Fixed an issue with OpenSL ES returning 0 from getBufferSizeInFrames() if callbacks are not used (#1582, Fixes #1581)
    • Fixed an issue with OpenSL ES not handling large buffers gracefully (#1601, Fixes #744, #952)
    • Fixed an issue with OpenSL ES input streams not checking buffer depths (#1621, Fixes #1431)
    • Fixed an issue with OpenSL ES returning ErrorInternal for invalid formats (#1634)

    Other bug fixes

    • Fixed an issue with AAudio segfaults if closed while reading or writing (#1497, Fixes #1484)
    • Fixed resampler glitches for some configurations (#1624, Fixes #1622)

    Workarounds

    • Add Quirk to disable MMAP on Exynos SDM8150 (#1381, Fixes #1381)
    • Add Quirks for Vivo devices (#1590, Fixes #201)
    • Check for workaround flag for automatic INT16 to FLOAT conversion when FLOAT is not supported (#1590, Fixes #1589)

    Code samples

    Non core changes

    • Many OboeTester updates
    • API reference docs are automatically updated after API changes
    • Add RISC-V support to StablizedCallback.h (#1586)
    • Updated Oboe to support API 33 (#1618)
    Source code(tar.gz)
    Source code(zip)
    oboe-1.7.0.aar(3.15 MB)
  • 1.6.1(Jul 22, 2021)

    API changes

    • Add methods setPackageName and setAttributionTag (#1332). These methods allow you to pass your package name and/or a tag when creating an audio stream. Android will output these strings in system logs to make it easier to attribute system calls back to your application.

    Bug fixes and workarounds

    • Fixed an issue where an incorrect audio device ID could be used if sample rate conversion is also used (#1310)
    • flowgraph: Start linear ramps at the initial volume set (#1318)
    • fix unused-parameter warnings (#1331)
    • Add workaround for Samsung Galaxy S9 recording silence sometimes. Fixes #1110
    • Improve callback stop handling on pre-R devices (#1351, Fixes #1230)
    • Remove include of ndk-version.h (#1359, #Fixes #1358)

    Binary changes

    • The Oboe libraries are now built with debug information to assist with debugging. This information is stripped automatically by Android Studio in release builds so there's no APK bloat. Fixes #1301.

    Non core changes

    • Many updates to OboeTester
    • Code samples now use Float to Int16 conversion on API <21
    • Github repo default branch renamed from master to main
    Source code(tar.gz)
    Source code(zip)
    oboe-1.6.1.aar(2.95 MB)
  • 1.6.0(May 18, 2021)

    • Add support for 24 and 32 bit sample formats. Support in AAudio will be added to Android 12. This was added to support some codecs that generate 24-bit output. We still recommend using Float format for most high-resolution use cases. (https://github.com/google/oboe/commit/8041b3891ade1a39dc575fb4e740b6d6f7087d0d)
    • Add support for float output streams on pre-L devices (#1267)
    • Fix calculation related to sample rate conversion (#1256, thanks to @flamme and @chrismanchester)
    • Check for nullptr in FilterAudioStream::getTimestamp() (#1171, Fixes #1166)
    • Android TV improvements (https://github.com/google/oboe/commit/a65df53c20e1bd6fa685894534cc07867edfdeb4, thanks to @ftsui)
    • Oboe now requires C++17 to be built from source (binaries available on https://maven.google.com/)
    • Add quirk for S20 input (Fixes #892)
    • Add quirk for Exynos850 devices (https://github.com/google/oboe/commit/2c06e95dc82b390041d32db52e04ae90f1a27e88)
    • Remove call to dlclose, avoids possible segfault (https://github.com/google/oboe/commit/2ca99f6dd20b8116ff4301a90a3924b8fbb1d44d)
    • Fix possible, but very unlikely, race on close (#1200)
    Source code(tar.gz)
    Source code(zip)
    oboe-1.6.0.aar(561.39 KB)
  • 1.5.0(Nov 26, 2020)

    API changes

    New callback classes

    Added new classes AudioStreamDataCallback and AudioStreamErrorCallback. These classes replace AudioStreamCallback which is now deprecated. The new callback classes separate the responsibilities of data handling and error handling.

    Additionally, AudioStreamErrorCallback includes a new onError method. This allows you to override the default error handling and stop/close the audio stream yourself. More details.

    New features

    • Channel count conversion. Oboe now includes a ChannelCountConverter. This is part of the flowgraph library. It can be used directly for performing channel count conversion. Internally this class is used to handle situations where opening a stream with a specific channel count results in suboptimal performance. For example, some devices cannot obtain a low latency mono input stream so Oboe opens the stream in stereo and performs a seamless stereo->mono conversion for the application. [commit, PR]
    • Set a minimum buffer size for LatencyTuner. Added method LatencyTuner::setMinimumBufferSize which allows you to set the minimum buffer size in frames. This stops the LatencyTuner from reducing the buffer size below a user-defined threshold. Note that the value specified for the minimum buffer size should be an integer multiple of the burst size. [PR]

    Bug fixes / workarounds

    • If you attempt to open an AAudio input stream without the relevant permission Oboe will now output a more useful error message. [commit]
    • Fixed a race condition that could cause a crash during close() if a callback was still running. [PR]
    • Fixed an issue with the sample rate converter which could cause input streams using callbacks to stall. [issue, commit]
    • Fixed several crashes associated with using setFramesPerCallback. [commit]
    • Fixed a bug that could cause stop() of an OpenSL ES stream with a non-zero timeout value to spin forever. [original issue]
    • In cases where the VoicePerformance input preset is not supported (OpenSL ES and Android P and below) Oboe will use the VoiceRecognition preset instead. [commit, commit]
    • In Android RQ1A a regression was introduced which meant that when a stream disconnects (e.g. headphones unplugged) a TIMEOUT error code was supplied rather than the expected DISCONNECT. This only affects SHARED AAudio MMAP streams. Oboe works around this by returning a DISCONNECT error code if a TIMEOUT error code is received on RQ1A. [commit]
    • Fixed a potential race condition when closing an OpenSL ES stream. [PR]
    • Fixed a problem where AAudio might accidentally call the flowgraph units in Oboe instead of in AAudio. [PR]
    • Added a workaround for broken mono recording on Samsung S9. [PR]

    Documentation and samples updates

    • [docs] Added the OpenSL ES migration guide.
    • [all samples] Standardise package name to com.google.oboe.samples
    • [hello-oboe] Save user settings, use shared stream, use locks to prevent race conditions [commit]
    • [RhythmGame] Updates to the FFmpeg extractor and decoder [commit, commit]
    • [DrumThumper] Audio is resampled on app load to avoid resampling penalty during playback [commit]
    • [DrumThumper] App is now published on Play Store.
    • [parselib] Fixed a problem with parsing unexpected chunks in a WAV file. [issue]
    • [OboeTester] can now print a device and microphone report.

    All commits since 1.4.3: https://github.com/google/oboe/compare/1.4.3...1.5.0

    How to update existing code

    On previous version of Oboe you implement AudioStreamCallback and override onAudioReady for data handling and the onError* methods for error handling.

    In Oboe 1.5 data callbacks and error callbacks have been split into 2 separate classes. To migrate your code, create an AudioStreamDataCallback and an AudioStreamErrorCallback. Then copy the code from your existing AudioStreamCallback implementation to the new methods, as per the following table:

    Deprecated method New method
    AudioStreamCallback::onAudioReady AudioStreamDataCallback::onAudioReady
    AudioStreamCallback::onErrorBeforeClose AudioStreamErrorCallback::onErrorBeforeClose
    AudioStreamCallback::onErrorAfterClose AudioStreamErrorCallback::onErrorAfterClose

    Corresponding setDataCallback and setErrorCallback methods have been added to AudioStreamBuilder and you must use these in place of setCallback.

    The term "callback" within Oboe is now ambiguous so the following methods have been renamed to refer specifically to the data callback. If you're using any *FramesPerCallback methods, you should use the new methods instead.

    Deprecated method New method
    AudioStreamBuilder::setFramesPerCallback AudioStreamBuilder::setFramesPerDataCallback
    AudioStream::getFramesPerCallback AudioStream::setFramesPerDataCallback

    For further guidance take a look at this PR which updates the Oboe sample code.

    Source code(tar.gz)
    Source code(zip)
    oboe-1.5.0.aar(2.57 MB)
  • 1.4.3(Aug 5, 2020)

  • 1.4.2(Jun 1, 2020)

    We fixed issue #535, which caused an intermittent crash in releaseBuffer() when a headset was plugged in. This mostly affected OpenSL ES. But it could affect AAudio if you called stream->getFramesRead() or stream->getTimeStamp() from an output stream callback. This was a serious crash that affected many apps. So we strongly recommend upgrading to Oboe 1.4.2. Here is a Tech Note that describes the issue in more detail.

    We fixed issue #820, which could cause a stream to get deleted while it was in use by an onError callback. We now use a std::shared_ptr to hold the stream and strongly recommend using the following technique to open a stream:

    std::shared_ptr<oboe::AudioStream> oboeStream; // hold onto this, maybe in an instance variable
    
    Result result = builder.openStream(oboeStream);
    

    Oboe error, warning and information log messages are now enabled in release builds.

    We updated QuirksManager to handle specific device requirements. Some devices, for example, may require a different minimum number of bursts in their buffer. https://github.com/google/oboe/pull/734

    Added “DrumThumper”, an interactive drum pad sample app. It demonstrates how to load drum sounds from WAV files, and how to mix multiple drums to one stream. See samples/DrumThumper.

    For OpenSL ES, we now scale the buffer size by the sample rate so that it will better match the internal buffer sizes. The default is based on a 20 msec period common on Android. This will reduce glitching when using OpenSL ES. https://github.com/google/oboe/pull/762

    The LiveEffect sample app now handles a failure to open the stream. It used to crash. https://github.com/google/oboe/issues/796

    Source code(tar.gz)
    Source code(zip)
    oboe-1.4.2.aar(2.33 MB)
  • 1.3(Nov 15, 2019)

    Oboe now features resampling and format conversion so you can request a stream with a specific sample rate, channel count or format and still receive a low latency stream. Do this using the following methods:

    AudioStreamBuilder builder;
    builder.setSampleRateConversionQuality(SampleRateConversionQuality::Medium);
    builder.setChannelConversionAllowed(true);
    builder.setFormatConversionAllowed(true);`
    

    The new ManagedStream class takes care of a stream lifecycle for you. Open one using the following code:

     ManagedStream myStream;
     AudioStreamBuilder builder;
     b.openManagedStream(myStream);
    

    Many other bug fixes.

    Full list of changes: https://github.com/google/oboe/compare/1.2.0...1.3-stable

    Source code(tar.gz)
    Source code(zip)
    oboe-1.3.0.aar(2.19 MB)
  • 1.2.0(Apr 23, 2019)

    New features

    • When creating a stream with PerformanceMode::LowLatency the buffer size is now set automatically to twice the burst size.

    Behaviour changes

    • AudioStream::waitForStateChange now returns Result::ErrorTimeout if a timeout of zero is specified and the stream's state does not change. Previously it would return Result::OK.
    • AudioStream::getTimestamp now returns Result::ErrorInvalidState if called when the stream is not in the Started state. Previously the timestamp would continue to advance resulting in inaccurate latency measurements.

    Bug fixes/workarounds

    • Fix crash caused caused by error callback running on a blocking read/write stream that does not use a data callback. #364
    • Avoid issue with recursive locking in AudioOutputStreamOpenSLES::requestFlush(). #378
    • Stop the stream when callback returns DataCallbackResult::Stop. Workaround for some AAudio bugs. #323
    • #406 Crash when headset plugs in/out
    • After opening an AAudio stream the stream state would stuck in the Starting state. Oboe now includes a workaround for this.
    • Many other bug fixes (see: https://github.com/google/oboe/issues?q=is%3Aclosed+milestone%3Av1.2)

    Code samples

    • Codebase updated to use floats throughout
    • Added shared folder which contains shared code used by samples (for Oscillator, Mixer objects etc)
    • RhythmGame sample updated with ability to extract compressed audio assets using NDK media codec and FFmpeg

    Plus many improvements in OboeTester.

    Diff with previous release

    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(Dec 18, 2018)

    No API changes.

    New features:

    • Audio streams which specify a Usage and are created using OpenSL ES have that usage mapped to the OpenSL ES stream type (thanks to pbodilis@)
    • The oboe version number is now logged when a stream is opened
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Dec 6, 2018)

    Bug fixes:

    New features:

    Source code(tar.gz)
    Source code(zip)
Owner
Google
Google ❤️ Open Source
Google
A simple and easy-to-use audio library based on miniaudio

raudio A simple and easy-to-use audio library based on miniaudio raudio forks from raylib.audio module to become an standalone library. Actually, it w

Ray 67 Dec 21, 2022
Easy and efficient audio synthesis in C++

Tonic Fast and easy audio synthesis in C++. Prefer coding to patching? Love clean syntax? Care about performance? That's how we feel too, and why we m

null 482 Dec 26, 2022
Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems

Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. Audacity is open source software licensed under GPL, version 2 or later.

Audacity 8.7k Dec 31, 2022
Sneedacity (formerly Audacity) is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems.

Sneedacity (formerly Audacity) is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. Sneedacity is open source software licensed under GPL, version 2 or later.

Sneed's Feed & Seed 874 Dec 30, 2022
Tenacity is an easy-to-use, cross-platform multi-track audio editor/recorder for Windows, MacOS, GNU/Linux

Tenacity is an easy-to-use, cross-platform multi-track audio editor/recorder for Windows, MacOS, GNU/Linux and other operating systems and is developed by a group of volunteers as open source software.

null 59 Jan 1, 2023
Glitch-free high-quality internet audio streaming on the Apple II

A2Stream A2Stream simultaneously receives an .a2stream file from any HTTP server and plays it through the stock Apple II speaker circuit using pulse-w

Oliver Schmidt 22 Oct 4, 2022
Airspy HF+, a high performance software defined radio for the HF and VHF bands.

User mode driver for Airspy HF+ This repository contains host software (Linux/Windows) for Airspy HF+, a high performance software defined radio for t

Dhiru Kholia 2 Nov 23, 2021
A simple C++ library for reading and writing audio files.

AudioFile A simple header-only C++ library for reading and writing audio files. Current supported formats: WAV AIFF Author AudioFile is written and ma

Adam Stark 683 Jan 4, 2023
A C library for reading and writing sound files containing sampled audio data.

libsndfile libsndfile is a C library for reading and writing files containing sampled audio data. Authors The libsndfile project was originally develo

null 1.1k Jan 2, 2023
C library for cross-platform real-time audio input and output

libsoundio C library providing cross-platform audio input and output. The API is suitable for real-time software such as digital audio workstations as

Andrew Kelley 1.6k Jan 6, 2023
C++ Audio and Music DSP Library

_____ _____ ___ __ _ _____ __ __ __ ____ ____ / \\_ \\ \/ / |/ \| | | | \_ \/ \ | Y Y \/ /_ \> <| | Y Y \ | |_|

Mick Grierson 1.4k Jan 7, 2023
Single file audio playback and capture library written in C.

A single file library for audio playback and capture. Example - Documentation - Supported Platforms - Backends - Major Features - Building - Unofficia

David Reid 2.6k Jan 8, 2023
C++17 library for creating macOS Audio Server plugins.

libASPL Synopsis Instructions Versioning API reference Example driver Quick start Object model Types of setters Customization Thread and realtime safe

Victor Gaydov 36 Dec 19, 2022
a library for audio and music analysis

aubio is a library to label music and sounds. It listens to audio signals and attempts to detect events. For instance, when a drum is hit, at which frequency is a note, or at what tempo is a rhythmic melody.

aubio 2.9k Jan 2, 2023
A discord audio playback library in c++ with node bindings

Tokio This project is still WIP. C++ Discord library with node bindings focused on audio playback. The Core parts as networking with discord/audio dec

Liz3 2 Nov 17, 2021
VINE Audio Processing Library Standard Edition

audiolib VINE Audio Processing Library Standard Edition Standard 버전에서는 AGC (Automaic Gain Control)기능을 제공합니다. AGC는 Mic와 화자 간 거리에 따라 자동으로 송신음량을 최적화하는 기능

null 21 Jul 5, 2022
Audio File Library

Audio File Library

michael pruett 140 Dec 30, 2022
C++ library for audio and music analysis, description and synthesis, including Python bindings

Essentia Essentia is an open-source C++ library for audio analysis and audio-based music information retrieval released under the Affero GPL license.

Music Technology Group - Universitat Pompeu Fabra 2.3k Jan 7, 2023