Comments (14)
What thread are you calling mal_device_uninit() from? What version of Android? Hardware or emulator?
EDIT: Is it happening consistently, or randomly?
from miniaudio.
both the last version of master and dev, Android 7.0 , Hardware , Xiaomi redmi , consistently.
last master line.18239
last dev line.18250
the log pthread 0x7f6a27a450 is the caller thread, a object locked by self ? or the mutexlock need a PTHREAD_MUTEX_RECURSIVE lock ?
or need call some functions to release the object
i found a android issue there:
https://grokbase.com/t/gg/android-ndk/156tayqf1c/opensl-deadlock-issue
https://groups.google.com/forum/#!searchin/android-ndk/deadlock/android-ndk/G7dLKAGGL28/xwlmjpdv2ssJ
from miniaudio.
I'm not sure what's going on. This is the first report I've had with this. I'm wondering if it's something to do with the callback being running at the same time as Destroy() is called. Not 100% sure, though... Are you calling mal_device_uninit() from the same thread as the call to mal_device_init()? Also, make sure you're not calling it from the callback thread.
from miniaudio.
Is it happening on any other devices or emulators?
from miniaudio.
i have found lots of this issue of opensl, it's not mini_al issue , i create and destroy the device by same thread , and not call it from callback .
i test it only one device, let me test it from other device
from miniaudio.
I test it in huawei 7x / android 8.0, same as xiaomi redmi4x, playback success, but when uninit device , it crash on libwilhelm.so(OpenSLES) pthread_mutex_trylock, error : SIGSEGV (signal SIGSEGV: invalid address (fault address: 0x55555555555591))
xiaomi redmi note4x : deadlock screenshot
from miniaudio.
Test in Xiaomi mi6 / Android 8.0, same as Xiaomi redmi note4x, deadlok.
seems ,it's not the random occue event and in less class of device , is there a solution to avoid openSLES issue?
from miniaudio.
OpenSL|ES is the only supported backend for Android. An AAudio backend is planned, but this is only supported on later versions of Android.
This feels like a bug in mini_al somewhere. I will need to do a few experiments and get back to you.
from miniaudio.
and i test in android emulator 7.0 (X86_64 without google api) ,it would deadlock too.
from miniaudio.
OK something I just saw in your screenshot is that the variable g_malOpenSLInitCounter
is set to 0. That means the mal_context
object has either been uninitialized before uninitializing the device (you must uninitialize all devices before attempting to uninitialize the context) or you have not initialized the context at all. Can you please check that the context is not getting uninitialized before the device.
Some basic things to consider:
- If you are using the onStop callback, make sure you're not uninitializing the context in onStop and then again outside of it.
- Your tear down should look something like this:
mal_device_uninit(device); // <-- Must do this _before_ mal_context_uninit()
mal_context_uninit(context);
Meanwhile, I have pushed an update to the dev branch which checks for this and throws an assert. Can you please let me know what the outcome of that is?
from miniaudio.
Yes, it's my fault, i init mal_context before init mal_device , should be uninit mal_context after uninit mal_device , but before that , thank you point out the error .i changed that it's work. :) :) :)
from miniaudio.
That's good to hear! So everything is working now?
from miniaudio.
all ok, please close the thread.
from miniaudio.
Great! Closing.
from miniaudio.
Related Issues (20)
- WASM duplicate symbol HOT 3
- Emscripten WASM Thread Problem HOT 2
- Question about Attenuation in Miniaudio. HOT 1
- Javascript error after uninitializing miniaudio HOT 4
- "Error: Invalid argument" due to ma_channel_map_is_valid HOT 6
- Does miniaudio support encoding PCM sample data into ADPCM sample data? HOT 1
- Uncaught RuntimeError: memory access out of bounds after starting playing the sound. HOT 8
- DELETED HOT 1
- Miniaudio waiting infinitely when calling ma_engine_uninit HOT 1
- Is there a way to gracefully shut down all threads created by miniaudio when the application exits? HOT 1
- Channel Convert Init Access Violation going from 2 channels to >2 channels HOT 2
- Sound system lags when playing sounds quickly and using delay or reverb HOT 1
- ma_device_uninit crash on Android <= 10 HOT 2
- error when compiling on android HOT 1
- "[ALSA] poll() failed" Bug. HOT 1
- Consider ditching ReadFile() in favor of FILE* fread() HOT 2
- Compile error with gcc: `error: invalid conversion from 'UInt32*' {aka 'long unsigned int*'} to 'ma_uint32*' {aka 'unsigned int*'} [-fpermissive]` HOT 8
- [i386] `miniaudio.h:83477:no such instruction: `lzcntl %eax, %ecx'` HOT 2
- How can I Cache ma_sound's into memory? HOT 1
- HELP , create a virtual microfone device for windows. 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 miniaudio.