-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
iOS: Some phones fail to init AudioUnit when using shared context #804
Comments
The idea of having one The other suspicious thing is If you were to do only playback, or only capture (as in only do one or the other at once), does that work for both sides? |
Thanks for the reply. Yes, I'm using separate ma_devices, I should have specified all of those code sections are in separate classes.
I will give this a try when I get access to one of these iOS devices that reproduce the problem again. I have a feeling this would work though.
This should be 1, right? Could coreaudio be rejecting the format based on this? I will look into this more and see what I can find. |
This turned out to be a problem in my code, and was affected by thread races, so it's not a bug in miniaudio. Thanks for entertaining this though. The details if it helps someone else: |
Hi, first of all thanks for the work on this library. It seems like there may be an issue on some iOS devices.
Background
My use case is VOIP, where I use two
ma_device
s, with two threads, for input and output. After reading this comment, I began sharing an ma_context between the devices in order to play/record at the same time. This works well on my iPhone 13, but on an iPhone SE and iPhone 15, the input fails to initialize. When not sharing the context, there are no errors and the devices "start" but don't work, probably for the reasons in the above comment.Behavior
My output device is initialized first and starts fine. Then, my input device tries to initialize. When it hits line 34287 in
ma_device_init_internal__coreaudio
, it fails with error.This line:
returns
-10868
which corresponds tokAudioUnitErr_FormatNotSupported
. I was able to print some variables at the time of failure:My Code
Context
Output
Input
What I've tried
sampleRate
orperiodSizeInFrames
, but the input still doesn't start properly. It may be failing in a different place, as I didn't step through this scenarioThanks for any guidance.
The text was updated successfully, but these errors were encountered: