I have a board (like IXDP425) with IXP425 and Linux.
I need to use HSS interface to read (and write) a data from it and then send throw Ethernet (UDP).
I use ixp400AccessLibrary-2_4, IPL_IDS_FoundationLibrary_V1_1 and BSD_IDS_HSS_Drv_V1_1.
Driver allows me to read/write in channilized mode from/to “/dev/hssdriver”.
I open and init (as showed in codelets) hssdev with 32 IX_DSP_TS_V64K timeslots
#define IX_DSP_CODELET_NUM_TIMESLOT 32
IX_HSSACC_CLK_SPEED_2048KHZ
TX: IX_HSSACC_SYNC_CLK_DIR_OUTPUT
RX: IX_HSSACC_SYNC_CLK_DIR_INPUT
fdDev = open("/dev/hssdriver", O_RDWR);if(!fdDev)
{ perror("open:"); return 1;
}
//Initialize HSS port
res = ioctl(fdDev, IX_DSR_HSS_INIT, &hss_port_config);
if (res != 0)
{ printf("HssPortInit: Init HSS failed .. \n"); return 1;
}
printf("HssPortInit: Init HSS Ok!\n");
Then i read from HSS dev, sorted data (because circular buffer is PCM buff * 2) and send it to socket.
BYTE pcHssReadBuffRaw[32*80*2];
BYTE pcHssReadBuff[32*80*2];
btCurCycleBuf = 0;
while(1)
{
res = read(fdDev, pcHssReadBuffRaw, sizeof(pcHssReadBuffRaw));
for(int n=0; n<32; n++)
pcHssReadBuff[n*80] = pcHssReadBuffRaw[n*80*2 + btCurCycleBuf*80];
if(btCurCycleBuf==0) btCurCycleBuf=1; else btCurCycleBuf=0;
sendto(...
);
}
And i find, that data readed from hssdev is not right.
I find, that when i insert in while(1) cycle printf("\n"), the situation is more better.Also i find, that there are different situation, when i run this read programm from terminal console or from telnet 127.0.0.1.