[asterisk-dev] Re: TDMoE protocol

Paul Cadach paul at odt.east.telecom.kz
Fri Feb 24 04:38:07 MST 2006


Hi,

Tony Mountifield wrote:
[skipped]
> As the one who added 2.6 RTC support to ztdummy, I'm qualified to comment!
> The primary reason for ztdummy is to support SIP, IAX and MeetMe in a
> system with no Zaptel cards. It is quite adequate for that, although
> there is a patch on the bugtracker that aims to address a perceived
> weakness in it.

The main reason for presense of ztdummy is to provide TIMING source for zaptel,
NO MORE.

> However, I don't think ztdummy as it stands is quite accurate enough
> for governing TDMoE, because it doesn't maintain a 1ms spacing. Since
> the RTC can only do power-of-2 subdivisions of a second, it is set to
> 1/1024 sec (0.9765625ms), but then 3 interrupts out of every 128 are
> skipped (evenly spaced) to give an average of 1000 per second. This
> is ok for VoIP with a 20ms or 30ms frame size, but not for TDMoE with
> a packet every 1ms. I would probably try making ztdummy use 4096 RTC
> interrupts per second and skip 3096 of them. This would make the
> interval between two consecutive packets either 0.9765625ms or
> 1.220703125ms.

Timing source is not required to be so accurate, it should take minimum jitter.
So, skip 3 interrupts makes pause in timing of 3/1024 sec (3 ms), while skip of
3096 interrupts makes timing pause for more than 755 ms.

Better is to provide some sort of PLL - just to collect interrupt count with
fractional part (i.e. 4096 RTC interrupts per second generates 4.096 interrupts
per ms, so you skip 3.096 irqs and passes one to zaptel). The calculations
should be looks like as (we take every 4th PLL count out to zaptel, marked with
'+' sign)
RTC int PLL count
ticks: 0, ints: 0
+0        4.096 (0.000000 ms) - 4096
1         1.000 (0.000244 ms)
2         2.000 (0.000488 ms)
3         3.000 (0.000732 ms)
4         4.000 (0.000977 ms)
+5        5.000 (0.001221 ms) - 4096
6         1.904 (0.001465 ms)
7         2.904 (0.001709 ms)
8         3.904 (0.001953 ms)
+9        4.904 (0.002197 ms) - 4096
10        1.808 (0.002441 ms)
11        2.808 (0.002686 ms)
12        3.808 (0.002930 ms)
+13       4.808 (0.003174 ms) - 4096
14        1.712 (0.003418 ms)
15        2.712 (0.003662 ms)
16        3.712 (0.003906 ms)
+17       4.712 (0.004150 ms) - 4096
18        1.616 (0.004395 ms)
19        2.616 (0.004639 ms)
20        3.616 (0.004883 ms)
+21       4.616 (0.005127 ms) - 4096
22        1.520 (0.005371 ms)
23        2.520 (0.005615 ms)
24        3.520 (0.005859 ms)
+25       4.520 (0.006104 ms) - 4096
26        1.424 (0.006348 ms)
27        2.424 (0.006592 ms)
28        3.424 (0.006836 ms)
+29       4.424 (0.007080 ms) - 4096
30        1.328 (0.007324 ms)
31        2.328 (0.007568 ms)
32        3.328 (0.007812 ms)
+33       4.328 (0.008057 ms) - 4096
34        1.232 (0.008301 ms)
35        2.232 (0.008545 ms)
36        3.232 (0.008789 ms)
+37       4.232 (0.009033 ms) - 4096
38        1.136 (0.009277 ms)
39        2.136 (0.009521 ms)
40        3.136 (0.009766 ms)
+41       4.136 (0.010010 ms) - 4096
42        1.040 (0.010254 ms)
43        2.040 (0.010498 ms)
44        3.040 (0.010742 ms)
45        4.040 (0.010986 ms)
+46       5.040 (0.011230 ms) - 4096
47        1.944 (0.011475 ms)
48        2.944 (0.011719 ms)
49        3.944 (0.011963 ms)
+50       4.944 (0.012207 ms) - 4096
51        1.848 (0.012451 ms)
52        2.848 (0.012695 ms)
53        3.848 (0.012939 ms)
+54       4.848 (0.013184 ms) - 4096
55        1.752 (0.013428 ms)
56        2.752 (0.013672 ms)
57        3.752 (0.013916 ms)
+58       4.752 (0.014160 ms) - 4096
59        1.656 (0.014404 ms)
60        2.656 (0.014648 ms)
61        3.656 (0.014893 ms)
+62       4.656 (0.015137 ms) - 4096
63        1.560 (0.015381 ms)
64        2.560 (0.015625 ms)
65        3.560 (0.015869 ms)
+66       4.560 (0.016113 ms) - 4096
...
+245715   4.152 (59.989014 ms) - 4096
245716    1.056 (59.989258 ms)
245717    2.056 (59.989502 ms)
245718    3.056 (59.989746 ms)
245719    4.056 (59.989990 ms)
+245720   5.056 (59.990234 ms) - 4096
245721    1.960 (59.990479 ms)
245722    2.960 (59.990723 ms)
245723    3.960 (59.990967 ms)
+245724   4.960 (59.991211 ms) - 4096
245725    1.864 (59.991455 ms)
245726    2.864 (59.991699 ms)
245727    3.864 (59.991943 ms)
+245728   4.864 (59.992188 ms) - 4096
245729    1.768 (59.992432 ms)
245730    2.768 (59.992676 ms)
245731    3.768 (59.992920 ms)
+245732   4.768 (59.993164 ms) - 4096
245733    1.672 (59.993408 ms)
245734    2.672 (59.993652 ms)
245735    3.672 (59.993896 ms)
+245736   4.672 (59.994141 ms) - 4096
245737    1.576 (59.994385 ms)
245738    2.576 (59.994629 ms)
245739    3.576 (59.994873 ms)
+245740   4.576 (59.995117 ms) - 4096
245741    1.480 (59.995361 ms)
245742    2.480 (59.995605 ms)
245743    3.480 (59.995850 ms)
+245744   4.480 (59.996094 ms) - 4096
245745    1.384 (59.996338 ms)
245746    2.384 (59.996582 ms)
245747    3.384 (59.996826 ms)
+245748   4.384 (59.997070 ms) - 4096
245749    1.288 (59.997314 ms)
245750    2.288 (59.997559 ms)
245751    3.288 (59.997803 ms)
+245752   4.288 (59.998047 ms) - 4096
245753    1.192 (59.998291 ms)
245754    2.192 (59.998535 ms)
245755    3.192 (59.998779 ms)
+245756   4.192 (59.999023 ms) - 4096
245757    1.096 (59.999268 ms)
245758    2.096 (59.999512 ms)
245759    3.096 (59.999756 ms)
ticks: 245760, ints: 60000

As you can see, zaptel's interrupt jitter is just ONE RTP interrupt interval,
i.e. 1/4096 sec (about 0.24 ms).


WBR,
Paul.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtc_jitter.c
Type: application/octet-stream
Size: 650 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20060224/80864545/rtc_jitter.obj


More information about the asterisk-dev mailing list