Phil Maddaloni
Phil Maddaloni

Reputation: 81

AudioUnit Programming iOS iPhone 6s error 50 in audiounitrender after playing back audio

I have an application that had previously been working fine (using iOS 9, iPhone 6 and lower). It uses Audio Unit APIs to process audio using an AudioUnitRender callback (calculating audio frequencies). This code also worked fine on iPhone 6s until I attempt to play back audio after which I get an Error 50 (very generic error) when calling AudioUnitRender.

The same code works fine before using audio playback APIs (any including playing video) and works fine before or after using an iPhone 6, iPhone 5, 5s, etc.

There is a ton of code involved so I am not posting it but any thoughts on what might be causing this or what I might be able to try to help diagnose the issue would be greatly appreciated.

Upvotes: 1

Views: 188

Answers (1)

hotpaw2
hotpaw2

Reputation: 70693

Error 50 may be an indication of an unsupported audio mode, such as sample rate.

In some configurations, the RemoteIO Audio Unit on an iPhone 6s will only support a sample rate of 48000 (not 44100 as with all older iOS devices, other than the obsolete 2G and 3G iPhones). This may apply to other iOS device models which use the Apple A9 processor as well.

See: https://forums.developer.apple.com/message/72961#72961 for more details.

IIRC, either plugging in or unplugging (forgot which) a headset will allow the 6s to temporarily support 44.1k.

Upvotes: 1

Related Questions