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

CantStartAudioEngine #69

Open
mranhtu opened this issue Jun 2, 2020 · 6 comments
Open

CantStartAudioEngine #69

mranhtu opened this issue Jun 2, 2020 · 6 comments

Comments

@mranhtu
Copy link

mranhtu commented Jun 2, 2020

Hello, I got this error when running on swift 5. Please help me.

Error Domain=Runtime Error Code=500 "Start decoding speech failed with error: CantStartAudioEngine(Error Domain=com.apple.coreaudio.avfaudio Code=-10868 "(null)" UserInfo={failed call=err = AUGraphParser::InitializeActiveNodesInInputChain(ThisGraph, *GetInputNode())})" UserInfo={NSLocalizedDescription=Start decoding speech failed with error: CantStartAudioEngine(Error Domain=com.apple.coreaudio.avfaudio Code=-10868 "(null)" UserInfo={failed call=err = AUGraphParser::InitializeActiveNodesInInputChain(ThisGraph, *GetInputNode())})}

@luciilucii
Copy link

I'm having the same issue, any updates on this?

@BrunoBerisso
Copy link
Contributor

Maybe it will be more useful if you guys could add more info to the issue? Is hard to track it down to something useful just by looking at the error.

A quick search for the error code here https://www.osstatus.com/search/results?platform=all&framework=all&search=-10868 points to a more clear kAudioUnitErr_FormatNotSupported

Is there anything else you guys could add?

@luciilucii
Copy link

sure, for me it's happening randomly when the engine is being started. Tested it with AirPods, headphones, and built-in mic still seems to be random.

@hcsaaron
Copy link

hcsaaron commented Nov 6, 2020

I got the same error. How to resolve it?

terminal log:
2020-11-06 17:29:47.760997+0800 TLSphinxExample[16307:1568311] [avae] AVAEInternal.h:109 [AVAudioEngineGraph.mm:1397:Initialize: (err = AUGraphParser::InitializeActiveNodesInInputChain(ThisGraph, *GetInputNode())): error -10868
Can't start AVAudioEngine: Error Domain=com.apple.coreaudio.avfaudio Code=-10868 "(null)" UserInfo={failed call=err = AUGraphParser::InitializeActiveNodesInInputChain(ThisGraph, *GetInputNode())}
error: TLSphinx.DecodeErrors.CantStartAudioEngine(Error Domain=com.apple.coreaudio.avfaudio Code=-10868 "(null)" UserInfo={failed call=err = AUGraphParser::InitializeActiveNodesInInputChain(ThisGraph, *GetInputNode())})

@randydalrymple
Copy link

I've been fighting the same problem. However, it appeared only when I upgraded my iPhone from iOS 13 to iOS 14 (TLSphinx still built in Swift 4). I get the exact error hcsaaron shows. To date, I haven't found any guidance in the Apple Developer forums, etc.

@randydalrymple
Copy link

(1) Can't Start AudioEngine:
I'm still working this issue, since my app requires TLSphinx. I found some guidance in a StackOverflow post regarding AudioKit, another 3rd-party product:

https://stackoverflow.com/questions/58193040/avaudiorecorder-audiokit-issues-ios-13-1-2

It seems that Apple changed the default behavior in iOS 13+, and now we must explicitly set parameters and behaviors.

Here is the change I made to fix that problem. It does not harm TLSphinx running on previous versions of iOS:
(add to Decoder.startDecodingSpeech()):
//------------------------------
let output = engine.outputNode
engine.connect(mixer, to: output, format: input.outputFormat(forBus: 0))
//------------------------------

Apparently, the initial failure (can't start audioengine) is caused by a lack of an output node on the graph. Once I added the output node, audioengine started correctly.

(2) Can't Read Valid Data:
However, now I'm receiving silence for the data generated by the tap. Somehow, the problem seems to be related to the format passed to mixer.installTap(). If I pass 'formatIn', then the generated data are all '0'. As an experiment, if I pass 'mixer.outputFormat(forBus: 0)', then the tap generates data, but incorrectly formatted (as expected).

If anyone can make more progress on this, please post.

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

No branches or pull requests

5 participants