Technical Q&A QA1749

AVAudioSession - General recommendations for handling AVAudioSessionMediaServicesWereResetNotification

Q:  Should my application register for AVAudioSessionMediaServicesWereResetNotification and if so, how do I recover once media services were reset?

A: While this is a very rare occurrence, it is good practice to monitor for the AVAudioSessionMediaServicesWereResetNotification notification and if it does occur, take the appropriate steps to re-initialize any audio objects used by your application.

Re-initializing generally requires disposing all of an application's now orphaned audio objects (for example AudioQueue, AURemoteIO, AudioConverter and so on since none of them will function as expected), and re-creating them as if the application was starting up for the first time. Any errors returned during disposing can safely be ignored.

General recommendations for handling a media services reset (AVAudioSessionMediaServicesWereResetNotification):

Upon receiving the AVAudioSessionMediaServicesWereResetNotification notification, applications should:

Figure 1  
Figure 1 Art/qa1749_settings.jpg

Document Revision History


Adding note regarding how to test resetting the media server.


Updated for AVAudioSession


New document that discusses some steps audio applications may take to recover if media services were reset.