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

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

Owner
Google
Google ❤️ Open Source
Google
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 ?

  • 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

  • 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.

  • 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.

  • 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.

  • 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)
    
  • 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.

  • 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?

  • 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
  • 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!!

  • 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
  • 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
    
  • 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

  • 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

  • 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 !

  • 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!

  • 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?

Related tags
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

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

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 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.

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 (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.

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.

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

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

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

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

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

Jan 6, 2023
C++ Audio and Music DSP Library

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

Jan 7, 2023
Single file audio playback and capture library written in C.
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

Jan 8, 2023
C++17 library for creating macOS Audio Server plugins.
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

Dec 19, 2022
a library for audio and music analysis
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.

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

Nov 17, 2021
VINE Audio Processing Library Standard Edition

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

Jul 5, 2022
Audio File Library

Audio File Library

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.

Jan 7, 2023