Comments (8)
I notice from the crash dump that the output callback is using Legacy mode and the input read() is using MMAP.
That situation may be more common on the MT6833.
There could also be timing differences that cause race conditions.
Are you using a shared_ptr for your stream variables?
Line 190 in 89427ed
That can help prevent some use-after-free bugs.
from oboe.
Do you think this could be happening when the user plugs in or unplugs a headset?
from oboe.
It is hard to tell if there is any headset connection change just with the stack trace. We used to have an old bug b/220061515 reporting a similar crash with sound amplifier on android S. It is closed due to no longer reproduced. That may be the same root cause while the issue is not really fixed. I will take a look.
from oboe.
Looking more into the code, it looks like this could be caused by the audio stream is freed when the data callback is fired. In aaudio, the audio stream is held by the clients. @sonicdebris, could you please share if you are using a shared pointer for your stream variables as Phil mentioned above? It will also be good to know if you will free the stream immediately when receiving disconnect error.
from oboe.
Hello, sorry for the delay in the response.
We are using shared pointers for the streams, and using AudioStreamBuilder::openStream
to set them up.
We handle stream errors by implementing AudioStreamErrorCallback::onError()
, where we stop and close the stream (and reset the pointer).
We protect all accesses to the stream with a mutex, and in the audio callback we do a try-lock, followed by a null-check on the stream pointer, so the audio callback will just do nothing in case some other function is messing with the stream or has reset the pointer.
I might add that we have the same issue reported on crashlytics, where we log when onError
is called and also when audio route changes happen (we listen to such events on the jvm side by using AudioManager.registerAudioDeviceCallback
), but in the logs associated to the crashes we don't see any such events related to stream errors or route changes.
from oboe.
@sonicdebris - you wrote:
We handle stream errors by implementing AudioStreamErrorCallback::onError(), where we stop and close the stream (and reset the pointer).
Do you return true from your onError() call? If you return false then Oboe might close the stream again!
from oboe.
Yes, we do return true
from oboe.
The reason you see more crashes on MTK6833 may be because Mediatek may have set compiler options that are detecting numeric overflows. Or there may be lower memory on those devices.
from oboe.
Related Issues (20)
- oneplus 6 uses opensles through oboe, there will be no voice with mono channel capture HOT 6
- OboeTester crash when running disconnect test
- Can oboe support custom log printing?
- System screen recorder doesn't capture audio in Oboe sample apps
- Help to resolve crash [libc++_shared.so] abort_message.cpp - abort_message HOT 5
- Phone volume buttons can't control the bluetooth with VoiceComm HOT 3
- Help to resolve Samsung devices support 3.5 mm headphones and Type C headphones. HOT 1
- How to set the microphone direction in Oboe similar to audioRecord.setPreferredMicrophoneDirection() HOT 1
- OboeTester: add DataPaths test to catch b/270535408, ch=3 and Effects HOT 1
- Normalized correlation should handle when both sides are zero HOT 1
- Flowgraph call count needs cleanup
- OboeTester automation buffer_bursts not updating BufferSize UI properly
- SampleRateConverter in flowgrap was reading out of bounds on first call
- Unit tests are using deprecated raw pointer, should use shared_ptr
- Will oboe use raw error callback when the client release shared pointer? HOT 4
- Unit tests failing in VerifyFullDuplexStream, callback count off
- OboeTester analyzer crashes with assertion "numSamples <= mMaxSamples" failed HOT 1
- FifoBuffer.getFullFramesAvailable() can be const
- AppCompat and other changes needed for google3 build HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oboe.