Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when call oboe::AudioStreamBuilder openStream function,the system will be stuck #1202

Open
myj420 opened this issue Feb 25, 2021 · 5 comments
Assignees
Labels

Comments

@myj420
Copy link

myj420 commented Feb 25, 2021

Android version(s): android 11
Android device(s):Samsung galaxy s10+ SM-G9750
Oboe version:1.5 stable
App name used for testing:
(Please try to reproduce the issue using the OboeTester or an Oboe sample.)

Short description
(Please only report one bug per Issue. Do not combine multiple bugs.)
we are using the oboe 1.5-stable on the android 11, and when we open a stream with the API AAudio, the thread is stuck, but it not stuck when we use the API OpenSLES. We tried all samples of oboe, and they are in the same situation. After we reboot the device, it works correctly again. we print the stack information when stuck:

  • thread Add code to handle disconnects #1, name = 'highras.rtc.sdk', stop reason = signal SIGSTOP
    • frame #0: 0x000000734ccf4b84 libc.so__ioctl + 4 frame #1: 0x000000734ccae14c libc.soioctl + 160
      frame Add support for INPUT streams for OpenSL ES #2: 0x000000734c7d7424 libbinder.soandroid::IPCThreadState::talkWithDriver(bool) + 252 frame #3: 0x000000734c7d879c libbinder.soandroid::IPCThreadState::waitForResponse(android::Parcel*, int*) + 64
      frame Add Oboe version number #4: 0x000000734c7d8514 libbinder.soandroid::IPCThreadState::transact(int, unsigned int, android::Parcel const&, android::Parcel*, unsigned int) + 188 frame #5: 0x000000734c7d0048 libbinder.soandroid::BpBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int) + 156
      frame dlsym links for getFramesWritten and getFramesRead were reversed #6: 0x00000070b1795c90 libaaudio_internal.so___lldb_unnamed_symbol140$$libaaudio_internal.so + 348 frame #7: 0x00000070b1791b38 libaaudio_internal.soaaudio::AAudioBinderClient::openStream(aaudio::AAudioStreamRequest const&, aaudio::AAudioStreamConfiguration&) + 172
      frame oboe callback: remove onExit() #8: 0x00000070b1786058 libaaudio_internal.soaaudio::AudioStreamInternal::open(aaudio::AudioStreamBuilder const&) + 1268 frame #9: 0x00000070b178b8e0 libaaudio_internal.soaaudio::AudioStreamInternalPlay::open(aaudio::AudioStreamBuilder const&) + 92
      frame Build instructions need improvement #10: 0x00000070b1777f88 libaaudio_internal.soaaudio::AudioStreamBuilder::build(aaudio::AudioStream**) + 904 frame #11: 0x00000070b17f6754 libaaudio.so___lldb_unnamed_symbol25$$libaaudio.so + 148
      frame Update FifoBuffer.cpp #12: 0x000000703b725ac0 librtcEngineNative.sooboe::AudioStreamAAudio::open(this=0xb40000715b09af30) at AudioStreamAAudio.cpp:262 frame #13: 0x000000703b71ced8 librtcEngineNative.sooboe::AudioStreamBuilder::openStream(this=0x0000007fd4ff6538, streamPP=0x0000007fd4ff64d0) at AudioStreamBuilder.cpp:159
      frame When overriding onAudioReady the return type should be oboe_data_callback_result_t #14: 0x000000703b71cd94 librtcEngineNative.sooboe::AudioStreamBuilder::openStream(this=0x0000007fd4ff66d8, streamPP=0x0000007fd4ff65e0) at AudioStreamBuilder.cpp:113 frame #15: 0x000000703b71d3c4 librtcEngineNative.sooboe::AudioStreamBuilder::openStream(this=0x0000007fd4ff66d8, sharedStream=nullptr) at AudioStreamBuilder.cpp:208
      frame oboe: automatically stop and close a stream when disconnected #16: 0x000000703b70cd68 librtcEngineNative.soRTCEngineNative::openStreams(this=0xb40000719b083530) at RTCEngineNative.cpp:120 frame #17: 0x000000703b70cb4c librtcEngineNative.soRTCEngineNative::setEffectOn(this=0xb40000719b083530, isOn=true) at RTCEngineNative.cpp:87
      frame New namespace, constexprs and scoped enums #18: 0x000000703b71c124 librtcEngineNative.so`::Java_com_livedata_rtc_RTCEngine_setEffectOn(env=0xb40000717b055d90, (null)=0x0000007fd4ff68c4, isEffectOn=1 true) at jni_bridge.cpp:84
@myj420 myj420 added the bug label Feb 25, 2021
@philburk
Copy link
Collaborator

From the stack trace, it appears that the AAudio MMAP server is not responding to a Binder request to open a stream. The service is probably stuck in a deadlock. It is very important that we fix this. Thank you for reporting this.

Has the service gotten stuck like this more than once? Can you reproduce it?

It would be a very big help if you could capture a bugreport the next time it gets stuck. Hopefully very soon after the problem occurs before the logs get flushed. A bugreport file will have tombstones that we can use to identify the stuck service threads.

@myj420 - Please file a new bug here and attach the bugreport:

https://issuetracker.google.com/issues/new?component=898361&template=1458029

Then let me know the bug number. Do not attach a bugreport file to a public GitHub issue.

@philburk philburk self-assigned this Feb 26, 2021
@myj420
Copy link
Author

myj420 commented Feb 26, 2021

thanks for your reply, it often sticks on this phone, but I couldn't find a way to reproduce it. I will capture a bugreport when it appears again

@xzhan96
Copy link

xzhan96 commented May 16, 2023

@philburk I also met this issue in our product, using oboe latest release version.
The stuck happens when calling oboe::AudioStreamBuilder.openStream(stream_), but I can't reproduce it, I often suggest our user restart the App, all things works well again.

Do you know how we can provide more information about the issue? such as some android log? we can request use export android log, but can't request user try special debug version.

@xzhan96
Copy link

xzhan96 commented May 17, 2023

may the root cause is I am using SharingMode::Exclusive mode?

@philburk
Copy link
Collaborator

may the root cause is I am using SharingMode::Exclusive mode?

That should not cause a hang.
There is not much we can do without a bugreport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants