[Asterisk-Users] Re: TDM users: modified zttest.c for testing

Dave Cotton dcotton at linuxautrement.com
Wed May 4 01:33:47 MST 2005


On Tue, 2005-05-03 at 21:28 +0000, Tony Mountifield wrote:

> I've done a few more tests and think I may have uncovered a problem in
> the pseudo-driver. Whether it's relevant to Rich's problem I don't know,
> but it might have something to do with MeetMe drift on SIP channels.
> 
> I modified Rich's program as follows:
> 
> a) Changed "char buf[8192];" to "char buf[SIZE];" (SIZE is 8000).
> 
> b) Changed the objective line to:
> 
> printf("Objective: to read %d bytes from TDM card in 1.000000 seconds.\n", sizeof(buf));
> 
> On running it again I was surprised to find it STILL showing times for
> 8192 bytes instead of 8000.
> 
> I added the following line just after the read() in the main loop:
> 
> printf("\nread(fd, buf, %d) returns %d", sizeof(buf), res);
> 
> That showed me that read(fd,buf,8000) was returning 1024 bytes.
> 
> Aha, so by the time count >= SIZE, it had read 8 blocks totalling 8192.
> 
> I changed the read to res=read(fd,buf,sizeof(buf)-count) so it would stop
> at 8000 bytes, and got the following results:
> 

Funny I tried much the same thing this morning before reading your
results, and was amazed to find the same.

Whether you used 8192 or 8000 the time was the same.

But as I've posted earlier faxes do work perfectly for me, though the
traffic is negligible.
 
-- 
Dave Cotton <dcotton at linuxautrement.com>




More information about the asterisk-users mailing list