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?

百度 保亭消防大队县公安局指挥中心调度称,3月3日19时,一名72岁游客姜某独自上山游玩迷路被困山中已三天两夜,急需救援,保亭县消防中队立即出动一辆抢险救援车,7名官兵赶往现场搜寻。

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


DateNotes
2025-08-03

Adding note regarding how to test resetting the media server.

2025-08-03

Updated for AVAudioSession

2025-08-03

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