2.3 Audio

UP


2.3.1 Alignment Issues

The audio system shares several data structures between the N64 CPU and the RCP. In order to avoid alignment problems, any buffer used by both the N64 CPU and the RCP should be allocated using the alHeapAlloc() routine. This will generate buffers with 16 byte alignment, avoiding all alignment issues as well as cache tearing issues.

UP


2.3.2 Size and Number of Buffers

A common error is to run out of buffers, particularly DMA buffers. Because the number of buffers needed is largely dependent on the music and sound effects used, it is not possible to provide guidelines. As music and sound effect complexity increases, the number of buffers needed will increase.

UP


2.3.3 Audio Pops and Clicks

To avoid audio pops and clicks, all samples should start with at least one value of zero. Upon receiving a pre-nmi message it is important that the audio fade to zero output, or on consecutive boot ups, there is a potential for a pop. If audio does not run at a high enough priority, the audio may not be generated before the previous buffer has completed. If this occurs there will be a period where no samples are played. This will usually generate a clear pop.

UP