[asterisk-dev] zaptel device timing accuracy

spied spied at yandex.ru
Sun May 14 13:24:41 MST 2006


first sorry - my english is bad.

every zaptel device provide timing source by calling zt_receive/zt_transmit functions every millisecond. how accurate must this timing be?

i write driver for usb device, every millisecond i get urb complete callback. typically i get 8 sound samples per urb, but sometimes i can get 7 (or may be 9) samples per urb. for my computer i get ~79981 samples per 10000 urbs (internal device timer is not synchronized with usb bus).

for simpicity - let i get 7 samples per every 10-th urb (79 samples per 10ms).

i can:
 - duplicate every 79-th sample and call zt_receive/zt_transmit functions for every urb;
 - call zt_receive/zt_transmit only 79 times per 80 urbs (do not call zt_receive/zt_transmit while we don't get full chunk from device).

which behavior is right?

with first we get accurate timing (zt_receive/zt_transmit functions called every millisecond), but with small sound distortions.
with second we don't touch sound, but sometimes (rarely) we get 2ms delay between zt_receive/zt_transmit calls.



More information about the asterisk-dev mailing list