Technical Q&A QA1467

CoreAudio Overload Warnings

Q:  CoreAudio is sending me occasional overload warnings when processing audio. What do these warnings mean, and what should I do to help eliminate these problems?

A: CoreAudio is sending me occasional overload warnings when processing audio. What do these warnings mean, and what should I do to help eliminate these problems?

The HAL IOProc is a time-limited, high-priority thread. CoreAudio will generate an overload warning in order to indicate that a recent I/O cycle took too long to complete. This happens when the time allocated, by the HAL, expires before the IOProc returns. These types of warnings can be commonplace under high cpu load and/or low memory conditions. Some kernel-level tasks may also be causing your IOProc to be preempted, VM paging being a big one, especially when memory is sparse.

Optimize! Optimize! Optimize!

If you have Apple's CHUD tools installed you can use Shark and/or Saturn to profile your IOProc. These tools will allow you to determine any bottlenecks or IOProc preemptions caused by your code. Tools and documentation are available online under Performance & Debugging.

Apple also provides the HALLab utility (/Developer/Examples/CoreAudio/HAL/HALLab). You can use this application to monitor the statistics of your I/O cycle to get a better idea of where in the cycle the overload is occurring. This information can found in the IO Telemetry window (File->New:).

Process audio outside the HAL thread

If applicable to your situation, it is recommended that you create a separate thread for preparing audio data for the IOProc. For example, file or network I/O, codec decompression, or other tasks that may induce a high-level of latency can be done from a lower priority thread. The resultant data can then be fed to the IOProc.

Some simple tips:

References



Document Revision History


DateNotes
2006-03-29

New document that describes CoreAudio overload warnings what they mean and how to avoid them.