// loopFlag
#define AXPBADDR_LOOP_OFF 0 // one shot
#define AXPBADDR_LOOP_ON 1 // looped
// format
#define AX_PB_FORMAT_PCM16 0x000A // signed 16 bit PCM (mono)
#define AX_PB_FORMAT_PCM8 0x0019 // signed 8 bit PCM (mono)
#define AX_PB_FORMAT_ADPCM 0x0000 // ADPCM encoded (mono)
typedef struct _AXPBADDR
{
u16 loopFlag; // one shot or looped sample? (See above)
u16 format; // sample format used (see above)
u16 loopAddressHi; // Loop start
u16 loopAddressLo;
u16 endAddressHi; // Loop/sample end, including last sample played
u16 endAddressLo;
u16 currentAddressHi; // Current playback position
u16 currentAddressLo;
} AXPBADDR;
The AXPBADDR structure specifies the address and other information about the sampling data.
The loopFlag parameter specifies whether to loop the sampling data or play it only once.
The format parameter specifies the classification of the sampling data. This in turn dictates the addressing mode of the DSP streaming cache.
Specify AX_PB_FORMAT_PCM16 for format if the sampling data are encoded as 16-bit PCM. With this setting, the streaming cache accesses main memory in units of WORDs (16 bits), so the addresses mentioned below also need to be specified in units of WORDs (16 bits).
Specify AX_PB_FORMAT_PCM8 for format if the sampling data are encoded as 8-bit PCM. With this setting, the streaming cache accesses main memory in bytes, so the addresses mentioned below also need to be specified in bytes.
Finally, specify AX_PB_FORMAT_ADPCM for format if the sampling data is encoded as DSP ADPCM. With this setting, the streaming cache accesses main memory in units of nibbles (4 bits), so the addresses mentioned below also need to be specified in units of nibbles (4 bits).
The addresses are specified as physical addresses in main memory.
The loopAddressHi and loopAddressLo values specify the loop starting address for the sampling data. The loopAddressHi value defines the upper 16 bits of the 32-bit loop starting address, and loopAddressLo defines the lower 16 bits. If the sampling data is played only once, specify the same values for loopAddressHi/Lo and for currentAddressHi/Lo (described below).
The endAddressHi and endAddressLo values specify the loop ending address for the sampling data (i.e., the address of the sample at the end of the loop). If the sampling data is played only once, specify the address of the last sample in the data.
The currentAddressHi and currentAddressLo values specify the current playback address in the sampling data. Normally, currentAddressHi/Lo specifies the starting address for playback of the sampling data when voices are initialized, and after that the DSP updates the value automatically.
Each frame of DSP ADPCM data is 8 bytes long. The first byte is the frame header and contains the predictor and scale values needed to decode the samples in the given frame. The following seven bytes contain a payload of 14 samples.
The DSP hardware ADPCM decoder assumes that the frame header of every frame of DSP ADPCM data is set to an 8-byte boundary. However, DSP ADPCM data does not need to end on an 8-byte boundary.
When specifying the addresses for sampling data that is encoded in DSP ADPCM in the AXPBADDR structure, the addresses (loopAddress, endAddress, and currentAddress) must not specify a frame header in main memory. A simple formula for calculating the appropriate nibble address for a given sample offset (starting from zero) is given below:
nibble_address = ((sample / 14) * 16) + (sample % 14) + 2);
If the loopFlag parameter has changed, assert the AX_SYNC_USER_LOOP bit in the axvpb.sync member.
If a loopAddress* parameter has changed, assert the AX_SYNC_USER_LOOPADDR bit in the axvpb.sync member.
If a currentAddress* parameter has changed, assert the AX_SYNC_USER_CURRADDR bit in the axvpb.sync member.
If an endAddress* parameter has changed, assert the AX_SYNC_USER_ENDADDR bit in the axvpb.sync member.
To force synchronization of the entire structure, assert the AX_SYNC_USER_ADDR bit.
2006/11/21 Changed the A memory to main memory. Deleted the zero buffer explanation because it is no longer necessary.
2006/03/01 Initial version.
CONFIDENTIAL