Technical Helpweb

Dialogic® DM3 and JCT Media Boards

Improving the performance of SCbus routing

Problem Description:

When using the SCbus convenience functions, there may be a significant delay during routing of timeslots.

Solution Summary:

The use of the individual SCbus functions, getxmitslot, unlisten, and listen can greatly improve the performance of programs which perform a significant amount of SCbus routing.

Technical Discussion:

Each time the nr_scroute() function is called, it makes 4 function calls:

xx_getxmitslot() - once for each device

xx_listen() - once for each device.

The call to xx_listen() each time is required in order to connect the channel’s local receive time slot to an SCBus time slot, but it is not necessary to repetitively call xx_getxmitslot() to retrieve the SCbus transmit timeslot for each device. SCbus timeslots are set up each time the Dialogic services are started and don’t change until the services are re-started. Thus, a way to speed up your application is to get the SCbus transmit information in the beginning of the program, store it in arrays, and use the individual instructions to perform the routing.

For example:

nr_scroute(chan1, SC_LSI, chan2, SC_LSI, SC_FULLDUP);

would be replaced with:

// Setup the sc_tsinfo for chan2 to listen to chan1
sc_tsinfo.sc_numts = 1; // timeslot for 1 device
sc_tsinfo.sc_tsarrayp = &scts[0]; // pointer to first timeslot
if (ag_listen(chan2, &sc_tsinfo) == -1)
{
printf("Unable to perform ag_listen on chan #2: %s\n", ATDV_ERRMSGP(chan2));
exit(1);
}

// Setup the sc_tsinfo for chan1 to listen to chan2
sc_tsinfo.sc_numts = 1; // timeslot for 1 device
sc_tsinfo.sc_tsarrayp = &scts[1]; // pointer to second timeslot
if (ag_listen(chan1, &sc_tsinfo) == -1)
{
printf("Unable to perform ag_listen on chan #1: %s\n", ATDV_ERRMSGP(chan1));
exit(1);
}

This code assumes that the timeslots for channels 1 & 2 would have been setup in the beginning of the program as scts[0] and scts[1] respectively. The code below shows how this is done:

// Get the scbus transmit slot assignments for the analog frontends
sc_tsinfo.sc_numts = 1; // get the timeslot for 1 device
sc_tsinfo.sc_tsarrayp = &scts[0]; // pointer to first element of array

if (ag_getxmitslot(chan1, &sc_tsinfo) == -1)
{
printf("error getting transmit slot for chan #1: %s\n", ATDV_ERRMSGP(chan1));
exit(1);
}

sc_tsinfo.sc_numts = 1; // get the timeslot for 1 device
sc_tsinfo.sc_tsarrayp = &scts[1]; // pointer to first element of array

if (ag_getxmitslot(chan2, &sc_tsinfo) == -1)
{
printf("error getting transmit slot for chan #2: %s\n", ATDV_ERRMSGP(chan2));
exit(1);
}

Attachments:

scbusr1.c which shows the routing of 2 analog timeslots using convenience functions under Win NT.

scbusr2.c which shows the same routing performed with individual SCbus routing functions under Win NT.

screcord.zip




Feedback

Please rate the usefulness of this page:  
0 - not useful at all
1 - potentially useful
2 - quite useful
3 - very useful
4 - exactly the information I needed     

Please enter a comment about this page: