What's the best way to look up the meaning of OSStatus errors ( i.e. -43 ) in Core Audio? Is there a way to process them in your iOS code so they can be formatted to show up with a brief explanation in the console?
Asked
Active
Viewed 2,843 times
5
-
possible duplicate: http://stackoverflow.com/questions/10218257/ios-playback-of-recorded-audio-fails-with-osstatus-error-43-file-not-found – Jakub Dec 14 '12 at 19:58
-
2Saw that - lots of stuff about what to do after you know it's a file not found error, not so clear on how to look it up. – OverToasty Dec 14 '12 at 20:12
-
3This question is not a duplicate of the other one, finding the error codes is a bit of a constant pain for core audio develeopers. – Aran Mulholland Jan 03 '13 at 05:09
3 Answers
5
After a quick look around, the best way so far seems to be to use the Unix command line tool - macerror - and type in the error code as an argument: not sure if it's possible to call & get the results of a macerror query from my Obj-C code in iOS into a console print out.

OverToasty
- 749
- 7
- 15
-
1hmm, while it's interesting to know about ´macerror´, most of the AudioUnit related errors I get show up as "unknown error", which isn't super helpful. Eg. -10877, -10861, -10860, 2755. – auco Mar 02 '15 at 14:01
-
Crap, I can't find the original page that used to list this stuff ... I'll break it apart and list 'em below. – OverToasty Mar 03 '15 at 15:17
-
CORE MIDI ERRORS kMIDIInvalidClient = -10830, kMIDIInvalidPort = -10831, kMIDIWrongEndpointType = -10832, kMIDINoConnection = -10833, kMIDIUnknownEndpoint = -10834, kMIDIUnknownProperty = -10835, kMIDIWrongPropertyType = -10836, kMIDINoCurrentSetup = -10837, kMIDIMessageSendErr = -10838, kMIDIServerStartErr = -10839, kMIDISetupFormatErr = -10840, kMIDIWrongThread = -10841, kMIDIObjectNotFound = -10842, kMIDIIDNotUnique = -10843 – OverToasty Mar 03 '15 at 15:17
-
1TOOLBOX kAudioToolboxErr_InvalidSequenceType = -10846, kAudioToolboxErr_TrackIndexError = -10859, kAudioToolboxErr_TrackNotFound = -10858, kAudioToolboxErr_EndOfTrack = -10857, kAudioToolboxErr_StartOfTrack = -10856, kAudioToolboxErr_IllegalTrackDestination = -10855, kAudioToolboxErr_NoSequence = -10854, kAudioToolboxErr_InvalidEventType = -10853, kAudioToolboxErr_InvalidPlayerState = -10852, these are dupes kAudioToolboxErr_CannotDoInCurrentContext = -10863 kAudioUnitErr_CannotDoInCurrentContext = -10863, – OverToasty Mar 03 '15 at 15:18
-
2AUDIO UNIT 1 kAudioUnitErr_InvalidProperty = -10879, kAudioUnitErr_InvalidParameter = -10878, kAudioUnitErr_InvalidElement = -10877, kAudioUnitErr_NoConnection = -10876, kAudioUnitErr_FailedInitialization = -10875, kAudioUnitErr_TooManyFramesToProcess = -10874, kAudioUnitErr_InvalidFile = -10871, kAudioUnitErr_FormatNotSupported = -10868, kAudioUnitErr_Uninitialized = -10867, kAudioUnitErr_InvalidScope = -10866, – OverToasty Mar 03 '15 at 15:20
-
Audio Unit 2 kAudioUnitErr_PropertyNotWritable = -10865, kAudioUnitErr_CannotDoInCurrentContext = -10863, kAudioUnitErr_InvalidPropertyValue = -10851, kAudioUnitErr_PropertyNotInUse = -10850, kAudioUnitErr_Initialized = -10849, kAudioUnitErr_InvalidOfflineRender = -10848, kAudioUnitErr_Unauthorized = -10847 – OverToasty Mar 03 '15 at 15:20
-
There's more, but those are the main ones - this page claims to have found the answer, but I couldn't find 'em using his instructions:http://stackoverflow.com/questions/16906111/ios-where-to-find-the-full-list-of-osstatus-codes-for-ios – OverToasty Mar 03 '15 at 15:22
-
Wow :-) I usually look them up in the corresponding header files: in Xcode you can just cmd+click on the kXxxErr_xxx. The AudioUnit related errors can be found in AUComponent.h – auco Mar 03 '15 at 18:03
3
A recent article in IOS Dev Weekly linked to a great webpage that allows you to search for all OSStatus codes. Definitely worth bookmarking.

manderson
- 666
- 6
- 15
1
A bit late to the party, but I just noticed that at least one error code (560226676) is actual a four-letter code; it can be represented as '!dat' in big-endian. Searching for that gives kAudioDeviceUnsupportedFormatError.
IOW, it can't hurt to print error codes with a little function like this:
char *OSTStr( OSType type )
{
static union OSTStr {
uint32_t four;
char str[5];
} ltype;
ltype.four = EndianU32_BtoN(type);
ltype.str[4] = '\0';
return ltype.str;
}

RJVB
- 698
- 8
- 18
-
1And how you resolved this error? I get the same code when I convert m4a to lpcm with AudioConverterFillComplexBuffer. – Harman Nov 23 '18 at 13:05
-
2This error means you're trying to convert an unsupported format. Quick guess: only two solutions: find other data to convert or find a converter that supports your data... – RJVB Nov 24 '18 at 14:29