TLSphinx icon indicating copy to clipboard operation
TLSphinx copied to clipboard

CantStartAudioEngine

Open mranhtu opened this issue 5 years ago • 6 comments

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())})}

mranhtu avatar Jun 02 '20 08:06 mranhtu

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

luciilucii avatar Jul 24 '20 12:07 luciilucii

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?

BrunoBerisso avatar Jul 24 '20 13:07 BrunoBerisso

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.

luciilucii avatar Jul 24 '20 14:07 luciilucii

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())})

hcsaaron avatar Nov 06 '20 09:11 hcsaaron

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 avatar Dec 30 '20 18:12 randydalrymple

(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.

randydalrymple avatar Jan 26 '21 17:01 randydalrymple