(Page 6 of 11 in this chapter) Version
trauLoad
Description
- Loads an AG TRAU program to an NMS board DSP and binds the program to a CT Access context.
Prototype
- DWORD trauLoad ( CTAHD loadhd,
unsigned board,
char *file_name,
TRAUDSPID *dspid,
void *start_parms,
unsigned size )
- loadhd A CT Access context handle used to open an AG TRAU service.
- board AG board number on which to load AG TRAU programs. Set to ANY_FUSION_BOARD to load programs to DSPs on any available NMS board.
- file_name Pointer to the file name of the AG TRAU program file to load.
- dspid Pointer to a location to receive an AG TRAU DSP ID associated with the AG TRAU program.
- start_parms Pointer to an optional data structure that specifies program-specific initialization values for the AG TRAU program. Set to NULL if not used. This is reserved.
- size Size of the start_parms structure in bytes (when start_parms is not NULL). If start_parms is NULL, set to zero.
Return Values
Events
Details
- This function loads a specified AG TRAU program to an available
NMS board DSP. If the board value is set to ANY_FUSION_BOARD, the AG TRAU load AG TRAU programs to available DSPs on any NMS board on the system.
Note: ANY_FUSION_BOARD can be used only in systems that use a single type of DSP resource board. A system that uses more than one type of DSP resource board (for example an AG 4000 and an
AG 2000 board), cannot use this option.
- The load operation is complete when the TRAUEVN_LOAD_DONE event is returned. If the operation completes successfully, the TRAUEVN_LOAD_DONE points to a buffer that holds information about the loaded AG TRAU program and its associated channels. Applications should call trauReleaseBuffer after retrieving data from this buffer.
- Applications can use dspids to match returned events with their associated AG TRAU programs (loadhds).
Note: CTA_REASON_FINISHED always tries to return a buffer containing LOAD_DONE_DATA. If size is set to 0 and buffer is set to NULL, the application failed to return buffer resources to the AG TRAU service with trauReleaseBuffer.
- Refer to the Fusion readme.txt for a list of available AG TRAU program file names.
- For Fusion host-based applications, you may specify the optimization parameter startdata[0] with the start_parms argument. Although this parameter increases signal latency it tends to reduce the number of packets the host processor drops under heavy host processing conditions.
- startdata[0] uses the specified value to set the depth of an internal jitter buffer between the HBF service and host processor. The specified value sets the jitter depth in number of frames (valid entries range from 1 to 5). A jitter depth of 1 frame (the minimum) is set when you specify NULL and 0 for the start_parms and size arguments. NMS recommends a value of 2 frames (as set by the gSJThresh argument in the example code that follows).
Example
int gSJThresh = 2;
...
case 's':
gSJThresh = atoi(&argv[i][2]);
break;
...
DWORD loadDSP(char* vocoder, unsigned *dspNum, unsigned *channels, unsigned *trauType)
{
DWORD ret;
TRAU_LOAD_DONE_DATA* pLoadDoneData;
unsigned dspId;
CTA_EVENT Event;
WORD startdata[4];
startdata[0] = gSJThresh; startdata[1] = 18; startdata[2] = 19;
startdata[3] = 20; // Only 0 is used
#if 1
if(( ret = trauLoad(ghTrauLd, gBoardNumber, vocoder,
&dspId, startdata, 8 )) != SUCCESS)
// last two parameters were NULL, 0 (ptr,siz)
{
dprintf("loadDSP(): trauLoad() failed...0x%x\n", ret);
return E_FAIL;
}
#else
if(( ret = trauLoad(ghTrauLd, gBoardNumber, vocoder,
&dspId, NULL, 0 )) != SUCCESS) // last two parameters were NULL, 0 (ptr,siz)
{
dprintf("loadDSP(): trauLoad() failed...0x%x\n", ret);
return E_FAIL;
}
#endif
See Also
- trauAttach
, trauEnable, trauReleaseBuffer, trauUnload
(Page 6 of 11 in this chapter) Version
Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights
reserved.