Rich Adamson
2005-May-03 08:48 UTC
[Asterisk-Users] TDM users: modified zttest.c for testing
TDM & X100P card users: Attached is a modified zaptel/zttest.c app called "attest-mod.c". It has been modified to report the "delay" in receiving 8,192 bytes from the TDM card (instead of reporting a percentage). It works with the digium x100p cards as well. Drop the attachment in your zaptel directory and compile it with: gcc zttest-mod.c -o zttest-mod.o Then run the executable like this: ./zttest-mod.o -v and report the results. The output should look like: 8192 bytes in 1.023843 seconds 8192 bytes in 1.023866 seconds 8192 bytes in 1.023853 seconds 8192 bytes in 1.023876 seconds 8192 bytes in 1.023841 secondsr --- Results after 5 passes --- Best: 1.023876 -- Worst: 1.023841 -- Average: 1.023856 The design objective of the TDM (and x100p) cards was to transfer 8,192 bytes of data from the card in exactly 1.00000 seconds. The above sample indicates my system required 1.023856 seconds to accomplish this, or 23856 microseconds too late. Since the data transfer is to late, it implies that one frame of data (or 1,024 bytes) will be dropped every 5.2 seconds on average (or, one frame dropped for every 42 received). I'm about 90% sure that's why spandsp does not function correctly and probably impacts how well the echo canceller works in some cases as well. It would be very interesting to see everyone's results in running this, and even more interesting to report the results with the OS distro in use, mobo in use (if known), etc. If anyone actually get's a result that is very close to 1.000 seconds, I'd really like to know more about those systems. (email off list is fine if you want.) Rich -------------- next part -------------- #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <fcntl.h> #include <sys/time.h> #include <sys/signal.h> #include <math.h> #define SIZE 8000 static int pass = 0; static float best = 0.0; static float worst = 100.0; static float total = 0.0; void hup_handler(int sig) { printf("\n--- Results after %d passes ---\n", pass); printf("Best: %f -- Worst: %f -- Average: %f\n", best, worst, pass ? total/pass : 100.00); exit(0); } int main(int argc, char *argv[]) { int fd; int res; int count=0; float ms; int sec; int curarg = 1; int verbose=0; char buf[8192]; float score; struct timeval start, now; fd = open("/dev/zap/pseudo", O_RDWR); if (fd < 0) { fprintf(stderr, "Unable to open zap interface: %s\n", strerror(errno)); exit(1); } while(curarg < argc) { if (!strcasecmp(argv[curarg], "-v")) verbose++; curarg++; } printf("Objective: to read 8192 bytes from TDM card in 1.000000 seconds.\n"); printf("Opened pseudo zap interface, measuring accuracy...\n"); signal(SIGHUP, hup_handler); signal(SIGINT, hup_handler); /* Flush input buffer */ for (count = 0;count < 4; count++) res = read(fd, buf, sizeof(buf)); count = 0; gettimeofday(&start, NULL); for(;;) { /* res contains the number of bytes read in */ res = read(fd, buf, sizeof(buf)); if (res < 0) { fprintf(stderr, "Failed to read from pseudo interface: %s\n", strerror(errno)); exit(1); } count += res; /* count = total number of bytes read */ if (count >= SIZE) { gettimeofday(&now, NULL); sec = (now.tv_sec - start.tv_sec); ms = sec + ((float)(now.tv_usec - start.tv_usec) / 1000000 ); start = now; score = ms; if (verbose) printf("\n%d bytes in %f seconds", count, ms); else { printf("%f ", score); if ((pass % 8) == 7) printf("\n"); } if (score > best) best = score; if (score < worst) worst = score; /* printf("%f ", score); */ total += score; fflush(stdout); count = 0; pass++; } } }
Josiah Bryan
2005-May-03 09:20 UTC
[Asterisk-Users] TDM users: modified zttest.c for testing
On Tuesday 03 May 2005 11:48 am, Rich Adamson wrote:> The design objective of the TDM (and x100p) cards was to transfer > 8,192 bytes of data from the card in exactly 1.00000 seconds. > The above sample indicates my system required 1.023856 seconds to > accomplish this, or 23856 microseconds too late. >...> > It would be very interesting to see everyone's results in running > this, and even more interesting to report the results with the OS > distro in use, mobo in use (if known), etc. If anyone actually > get's a result that is very close to 1.000 seconds, I'd really > like to know more about those systems. (email off list is fine > if you want.) >Results summary: Best: 1.024028 -- Worst: 1.023796 -- Average: 1.023886 Distro: FC3 [root@asterisk zaptel]# ./zttest-mod -v Objective: to read 8192 bytes from TDM card in 1.000000 seconds. Opened pseudo zap interface, measuring accuracy... 8192 bytes in 1.023861 seconds 8192 bytes in 1.023878 seconds 8192 bytes in 1.023878 seconds 8192 bytes in 1.023894 seconds 8192 bytes in 1.023861 seconds 8192 bytes in 1.023878 seconds 8192 bytes in 1.023879 seconds 8192 bytes in 1.023878 seconds 8192 bytes in 1.023877 seconds 8192 bytes in 1.023912 seconds 8192 bytes in 1.023845 seconds 8192 bytes in 1.023879 seconds 8192 bytes in 1.023911 seconds 8192 bytes in 1.023898 seconds 8192 bytes in 1.024028 seconds 8192 bytes in 1.023796 seconds 8192 bytes in 1.023916 seconds 8192 bytes in 1.023887 seconds --- Results after 18 passes --- Best: 1.024028 -- Worst: 1.023796 -- Average: 1.023886 # uname -a Linux asterisk.productiveconcepts.com 2.6.9-1.667 #1 Tue Nov 2 14:41:25 EST 2004 i686 i686 i386 GNU/Linux # cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 1 model name : Intel(R) Pentium(R) 4 CPU 1.50GHz stepping : 2 cpu MHz : 1483.665 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm bogomips : 2924.54 -- Josiah Bryan IT Coordinator Productive Concepts, Inc. jbryan@productiveconcepts.com (765) 964-6009, ext. 224
Roger Gulbranson
2005-May-03 09:27 UTC
[Asterisk-Users] TDM users: modified zttest.c for testing
On Tue, 2005-05-03 at 09:48 -0600, Rich Adamson wrote:> TDM & X100P card users: > > Attached is a modified zaptel/zttest.c app called "attest-mod.c". It > has been modified to report the "delay" in receiving 8,192 bytes > from the TDM card (instead of reporting a percentage). It works with > the digium x100p cards as well. > > Drop the attachment in your zaptel directory and compile it with: > gcc zttest-mod.c -o zttest-mod.o > Then run the executable like this: > ./zttest-mod.o -v > and report the results. > > The output should look like: > 8192 bytes in 1.023843 seconds > 8192 bytes in 1.023866 seconds > 8192 bytes in 1.023853 seconds > 8192 bytes in 1.023876 seconds > 8192 bytes in 1.023841 secondsr > --- Results after 5 passes --- > Best: 1.023876 -- Worst: 1.023841 -- Average: 1.023856 > > The design objective of the TDM (and x100p) cards was to transfer > 8,192 bytes of data from the card in exactly 1.00000 seconds. > The above sample indicates my system required 1.023856 seconds to > accomplish this, or 23856 microseconds too late.Isn't the design objective to read 8000 bytes in one second? The reported (roughly) 1.024 second time frame is correct for 8192 bytes. I get average numbers very close to 1.024 (especially if I take some rounding error into account).> Since the data transfer is to late, it implies that one frame of > data (or 1,024 bytes) will be dropped every 5.2 seconds on average > (or, one frame dropped for every 42 received). > > I'm about 90% sure that's why spandsp does not function correctly > and probably impacts how well the echo canceller works in some > cases as well. > > It would be very interesting to see everyone's results in running > this, and even more interesting to report the results with the OS > distro in use, mobo in use (if known), etc. If anyone actually > get's a result that is very close to 1.000 seconds, I'd really > like to know more about those systems. (email off list is fine > if you want.)
Dave Cotton
2005-May-03 10:00 UTC
[Asterisk-Users] TDM users: modified zttest.c for testing
On Tue, 2005-05-03 at 09:48 -0600, Rich Adamson wrote:> TDM & X100P card users: >Again much the same result:- On Mandriva Cooker but with vanilla kernel. [root@Sheriff zaptel]# ./zttest-mod -v Objective: to read 8192 bytes from TDM card in 1.000000 seconds. Opened pseudo zap interface, measuring accuracy... 8192 bytes in 1.023969 seconds 8192 bytes in 1.024003 seconds 8192 bytes in 1.023982 seconds 8192 bytes in 1.023993 seconds 8192 bytes in 1.023989 seconds 8192 bytes in 1.023994 seconds 8192 bytes in 1.024002 seconds --- Results after 7 passes --- Best: 1.024003 -- Worst: 1.023969 -- Average: 1.023990 Linux Sheriff 2.6.11 #2 Mon Mar 7 14:45:42 CET 2005 i686 AMD Duron(tm) unknown GNU/Linux processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 7 model name : AMD Duron(tm) stepping : 1 cpu MHz : 1300.286 cache size : 64 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse pni syscall mmxext 3dnowext 3dnow bogomips : 2555.90 Interestingly faxes inwards work for me. -- Dave Cotton <dcotton@linuxautrement.com>
Tony Mountifield
2005-May-03 10:21 UTC
[Asterisk-Users] Re: TDM users: modified zttest.c for testing
In article <Chameleon.1115133799.adar0@vegas>, Rich Adamson <radamson@routers.com> wrote:> > It would be very interesting to see everyone's results in running > this, and even more interesting to report the results with the OS > distro in use, mobo in use (if known), etc. If anyone actually > get's a result that is very close to 1.000 seconds, I'd really > like to know more about those systems. (email off list is fine > if you want.)Details below; Fedora Core 1. I also tried using "nice" to raise the process priority, but it made no difference. [root@softins zaptel]# ./zttest-mod -v Objective: to read 8192 bytes from TDM card in 1.000000 seconds. Opened pseudo zap interface, measuring accuracy... 8192 bytes in 1.023981 seconds 8192 bytes in 1.023995 seconds 8192 bytes in 1.023992 seconds 8192 bytes in 1.023996 seconds 8192 bytes in 1.023991 seconds 8192 bytes in 1.023994 seconds 8192 bytes in 1.023992 seconds 8192 bytes in 1.023994 seconds 8192 bytes in 1.024003 seconds 8192 bytes in 1.023986 seconds 8192 bytes in 1.023992 seconds 8192 bytes in 1.023993 seconds 8192 bytes in 1.023994 seconds 8192 bytes in 1.023993 seconds 8192 bytes in 1.023993 seconds 8192 bytes in 1.023995 seconds 8192 bytes in 1.023992 seconds 8192 bytes in 1.023995 seconds 8192 bytes in 1.023992 seconds 8192 bytes in 1.023993 seconds --- Results after 20 passes --- Best: 1.024003 -- Worst: 1.023981 -- Average: 1.023993 This looks very close to 1024ms instead of 1000ms. That got me thinking: I believe your premise is wrong. The sample rate of telephony audio is 8kHz. With 8-bit samples (uLaw or aLaw), that means 8000 bytes should be supplied in 1 second, not 8192. At a rate of 8000 bytes/sec, 8192 bytes will arrive in 1.024 seconds. Cheers Tony -- Tony Mountifield Work: tony@softins.co.uk - http://www.softins.co.uk Play: tony@mountifield.org - http://tony.mountifield.org
Andrew Kohlsmith
2005-May-03 10:34 UTC
[Asterisk-Users] TDM users: modified zttest.c for testing
On May 3, 2005 11:48 am, Rich Adamson wrote:> TDM & X100P card users:TDM400P on a practically unkillable system (P3/700) -- this is the one with shared IRQs and heavy network traffic on that shared IRQ without any appreciable loss in audio quality: --- Results after 192 passes --- Best: 1.024003 -- Worst: 1.023921 -- Average: 1.023960 T100P on an MSI cheapo P4 mainboard (getting EAGAIN problems from time to time): --- Results after 181 passes --- Best: 1.024127 -- Worst: 1.023902 -- Average: 1.024012 TE405P in a pretty average P4 system: --- Results after 144 passes --- Best: 1.024305 -- Worst: 1.024078 -- Average: 1.024201 -A.
Alexander Lopez
2005-May-03 12:02 UTC
[Asterisk-Users] TDM users: modified zttest.c for testing
Funny thing is that Faxes over IP (SIP ATA186) and Fax Over Public Internet (FOPI) have worked fine since day one. I even have faxes on DSL lines at my house working glitch free. I have been scared to 'retire' the old OS as it has worked so well. # ./zttest-mod -v Objective: to read 8192 bytes from TDM card in 1.000000 seconds. Opened pseudo zap interface, measuring accuracy... 8192 bytes in 1.023890 seconds 8192 bytes in 1.023900 seconds 8192 bytes in 1.023900 seconds 8192 bytes in 1.023899 seconds 8192 bytes in 1.023900 seconds 8192 bytes in 1.023900 seconds 8192 bytes in 1.023901 seconds 8192 bytes in 1.023900 seconds 8192 bytes in 1.023898 seconds 8192 bytes in 1.023901 seconds 8192 bytes in 1.023900 seconds 8192 bytes in 1.023900 seconds --- Results after 12 passes --- Best: 1.023901 -- Worst: 1.023890 -- Average: 1.023899 # P3/700 Compaq ML330 w/ IDE HD and Stock Mandrake 9.1 Kernel 2.4.21 328MB Ram Single CPU processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 8 model name : Pentium III (Coppermine) stepping : 6 cpu MHz : 794.721 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse bogomips : 1585.97
Alexander Lopez
2005-May-03 12:09 UTC
[Asterisk-Users] TDM users: modified zttest.c for testing
I ran this test on a machine with P3/700 an got same results. See provious post. Is anyone keeping track of this??? Alex # ./zttest-mod -v Objective: to read 8192 bytes from TDM card in 1.000000 seconds. Opened pseudo zap interface, measuring accuracy... 8192 bytes in 1.023984 seconds 8192 bytes in 1.023999 seconds 8192 bytes in 1.023999 seconds 8192 bytes in 1.024000 seconds 8192 bytes in 1.024002 seconds 8192 bytes in 1.024000 seconds 8192 bytes in 1.024000 seconds 8192 bytes in 1.023998 seconds 8192 bytes in 1.024002 seconds 8192 bytes in 1.024001 seconds --- Results after 10 passes --- Best: 1.024002 -- Worst: 1.023984 -- Average: 1.023999 Compaq ML350 G3 512 MB Ram SCSI Hard Drive # more /proc/cpu* processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 2 model name : Intel(R) Xeon(TM) CPU 2.80GHz stepping : 9 cpu MHz : 2799.439 cache size : 512 KB physical id : 0 siblings : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid bogomips : 5537.79
Andrew Kohlsmith
2005-May-03 12:34 UTC
[Asterisk-Users] TDM users: modified zttest.c for testing
On May 3, 2005 01:34 pm, Andrew Kohlsmith wrote:> T100P on an MSI cheapo P4 mainboard (getting EAGAIN problems from time to > time): > --- Results after 181 passes --- > Best: 1.024127 -- Worst: 1.023902 -- Average: 1.024012And the TE405P in the exact same motherboard (swapped it out trying to get rid of EAGAIN): --- Results after 264 passes --- Best: 1.024143 -- Worst: 1.023924 -- Average: 1.024013 -A.
Doug Coker
2005-May-03 13:55 UTC
[Asterisk-Users] TDM users: modified zttest.c for testing
This was on a DELL 750 P4, 3.2Ghz, with Digi 4 port FXO voip-gw1:/usr/src/zaptel# ./zttest-mod.o -v Objective: to read 8192 bytes from TDM card in 1.000000 seconds. Opened pseudo zap interface, measuring accuracy... 8192 bytes in 1.023973 seconds 8192 bytes in 1.023972 seconds 8192 bytes in 1.023974 seconds 8192 bytes in 1.023976 seconds 8192 bytes in 1.023973 seconds 8192 bytes in 1.023986 seconds 8192 bytes in 1.023962 seconds 8192 bytes in 1.023975 seconds 8192 bytes in 1.023973 seconds 8192 bytes in 1.023976 seconds 8192 bytes in 1.023973 seconds --- Results after 11 passes --- Best: 1.023986 -- Worst: 1.023962 -- Average: 1.023974 Alexander Lopez wrote:>I ran this test on a machine with P3/700 an got same results. See >provious post. Is anyone keeping track of this??? > >Alex > > > ># ./zttest-mod -v >Objective: to read 8192 bytes from TDM card in 1.000000 seconds. >Opened pseudo zap interface, measuring accuracy... > >8192 bytes in 1.023984 seconds >8192 bytes in 1.023999 seconds >8192 bytes in 1.023999 seconds >8192 bytes in 1.024000 seconds >8192 bytes in 1.024002 seconds >8192 bytes in 1.024000 seconds >8192 bytes in 1.024000 seconds >8192 bytes in 1.023998 seconds >8192 bytes in 1.024002 seconds >8192 bytes in 1.024001 seconds >--- Results after 10 passes --- >Best: 1.024002 -- Worst: 1.023984 -- Average: 1.023999 > >Compaq ML350 G3 >512 MB Ram > >SCSI Hard Drive ># more /proc/cpu* >processor : 0 >vendor_id : GenuineIntel >cpu family : 15 >model : 2 >model name : Intel(R) Xeon(TM) CPU 2.80GHz >stepping : 9 >cpu MHz : 2799.439 >cache size : 512 KB >physical id : 0 >siblings : 2 >fdiv_bug : no >hlt_bug : no >f00f_bug : no >coma_bug : no >fpu : yes >fpu_exception : yes >cpuid level : 2 >wp : yes >flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca >cmov pat >pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid >bogomips : 5537.79 > >_______________________________________________ >Asterisk-Users mailing list >Asterisk-Users@lists.digium.com >http://lists.digium.com/mailman/listinfo/asterisk-users >To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > > > >-- Doug Coker dcoker@dataflo.net http://www.dataflo.net DataFlo Communications LLC 311 N Walnut St, Suite 210 Wood Dale, IL 60191 phone: (630)860-4578 Fax: (630)860-5463
Greg Boehnlein
2005-May-05 18:19 UTC
[Asterisk-Users] TDM users: modified zttest.c for testing
P3 1Ghz under Tao Linux 1.0 (2.4 Kenrnel) cvs-stable w/ X101P --- Results after 66 passes --- Best: 1.024461 -- Worst: 1.024420 -- Average: 1.024447 And on our new gateway box... P4 3.0 Ghz under Tao Linux 4.0 (2.6 Kernel) cvs-stable w/ TE405P --- Results after 106 passes --- Best: 1.023967 -- Worst: 1.023953 -- Average: 1.023960 -- Vice President of N2Net, a New Age Consulting Service, Inc. Company http://www.n2net.net Where everything clicks into place! KP-216-121-ST
Rich Adamson
2005-May-05 20:22 UTC
[Asterisk-Users] TDM users: modified zttest.c for testing
> P3 1Ghz under Tao Linux 1.0 (2.4 Kenrnel) cvs-stable w/ X101P > > --- Results after 66 passes --- > Best: 1.024461 -- Worst: 1.024420 -- Average: 1.024447 > > And on our new gateway box... > > P4 3.0 Ghz under Tao Linux 4.0 (2.6 Kernel) cvs-stable w/ TE405P > > --- Results after 106 passes --- > Best: 1.023967 -- Worst: 1.023953 -- Average: 1.023960Have you tried to use spandsp at all? It would appear the P3 would fail, but the P4 would like function correctly.
Mike Mueller
2005-May-06 07:11 UTC
[Asterisk-Users] TDM users: modified zttest.c for testing
On Thu, May 05, 2005 at 09:22:24PM -0600, Rich Adamson wrote:> > > P3 1Ghz under Tao Linux 1.0 (2.4 Kenrnel) cvs-stable w/ X101P > > > > --- Results after 66 passes --- > > Best: 1.024461 -- Worst: 1.024420 -- Average: 1.024447 > > > > And on our new gateway box... > > > > P4 3.0 Ghz under Tao Linux 4.0 (2.6 Kernel) cvs-stable w/ TE405P > > > > --- Results after 106 passes --- > > Best: 1.023967 -- Worst: 1.023953 -- Average: 1.023960 > > Have you tried to use spandsp at all?How about trying a fax or modem on lines on the two machines? -- Mike