Miles Sound System SDK 7.2a

RAD_IOPStartUp

The function RAD_IOPStartUp opens the RAD_IOP API for use.

S32 RAD_IOPStartUp(
  U32 num_file_buffers,
  S32 command_handler_index,
  VOID_PTR IOP_memory,
  SOUND_CORE_FLAGS sound_flags
);

In Parameters

num_file_buffers
Specifies the number of file buffers to use. This should be the maximum files that you expect to be reading from at once. Each file buffer is 4096 bytes of EE memory.
command_handler_index
Specifies the index of the command handler to use. If you don't currently use command handlers, use -1 for the flag and we will set one up.
IOP_memory
Specifies an IOP address that is used for IOP side buffering. Use the RAD_IOPMemoryAmount function to query how large this buffer should be. You will usually use the sceSifAllocIopHeap function to allocate this memory.
sound_flags
Specifies the sound core to use.

Returns

Returns non-zero for success, and zero for failure.

Discussion

This function starts up the RAD IOP API layer. It also starts up an internal IOP IRX to receive the calls you make. The RAD IOP layer is designed to do three things:

1) Asynchronous file I/O on the EE. You can request async file reads to execute in the background, and RAD_IOP will tell the IOP to go off and do them for you. You can then get a callback, or just check a status field to determine when the read completes. This is the API that we use to do its file I/O, but you can use it for your own I/O too.

2) PCM sound streaming. You can request that RAD_IOP start a streaming buffer, and it will call you back on an interrupt to fill the buffer. You simply copy your sound into the buffer in each interrupt. This is the API that we use to play sound, but like the I/O API, you can use it to play your own sound as well.

3) Drift-free timer services. You can request that RAD_IOP start calling a function callback at a certain timer frequency. They are drift-free in the sense that we monitor how long between each callback and will call you less and more often to maintain the exact callback frequency you requested.

You can use these features with or without Bink or Miles, and you can use all of these features, or just some of them.

Normally, when using this API just for Bink or Miles, you will simply call it with one file buffer, and one sound core flag, and then tell us which core you requested.

You can call this startup routine multiple times, but only the first call configures the library. You need to call RAD_IOPShutDown a matching number of times to shut the library down.


Group: The RAD_IOP API for the Sony PS2
Related Sections: Miles DTS Provider for the Sony PS2
Related Functions: RAD_IOPMemoryAmount, RAD_IOPShutDown
Related Basic Types: S32, SOUND_CORE_FLAGS, U32, VOID_PTR
Related Structures: RAD_IOP_SOUND_DATA

For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.