From owner-freebsd-isdn@FreeBSD.ORG Sun May 14 13:18:39 2006 Return-Path: X-Original-To: freebsd-isdn@freebsd.org Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21A5D16A401 for ; Sun, 14 May 2006 13:18:39 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from mail47.e.nsc.no (mail47.e.nsc.no [193.213.115.47]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8ACF343D58 for ; Sun, 14 May 2006 13:18:38 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from acer-a6444i28v1.lan (ti131310a080-7087.bb.online.no [85.165.219.175]) by mail47.nsc.no (8.13.6/8.13.5) with ESMTP id k4EDIW1F024210; Sun, 14 May 2006 15:18:33 +0200 (CEST) From: Hans Petter Selasky To: freebsd-isdn@freebsd.org Date: Sun, 14 May 2006 15:18:33 +0200 User-Agent: KMail/1.7 References: <0CDCE7F4-A7D2-4379-9560-516FFF3350C6@dtinnovations.com> In-Reply-To: <0CDCE7F4-A7D2-4379-9560-516FFF3350C6@dtinnovations.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200605141518.33634.hselasky@c2i.net> Cc: Dirk =?iso-8859-1?q?Thannh=E4user?= Subject: Re: Sound delay in i4b X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 May 2006 13:18:39 -0000 Hi, On Sunday 14 May 2006 14:28, Dirk Thannh=E4user wrote: > Hello Folks, > > i compiled successfully the new isdn4bsd and chan_capi on FreeBSD 6. > chan_capi also works fine with asterisk. As already mentiones > somebody before there is a huge delay on the channel when > transferring sound. (256ms?) > I experienced this using the echo test application in Asterisk. > As a result I began diving into the i4b source to check out the > problem. Soon I got stuck as I couldn't find any source for the delay > in the driver itself. (it was the first look into the source, and i > am currently learing how things work an fit together) Maybe that the > delay is _only_ an issue while processing sound an that i am seeking > for the problem at the wrong place. > Is there anybody who has some advice? It is due to a buffering bug in I4B, which I discovered not so long ago. Wh= en=20 "chan_capi" registers its CAPI application, it sets the buffer to 7 frames = of=20 160/8ms =3D 20ms. The bug is that my I4B implementation did not check that= =20 value and instead, by default, buffered up to 50 frames, which is equal to= =20 near one second of data. Due to packet loss on IP connections, this value i= s=20 always kept low. But if you run the echo test, the buffer can grow. I have fixed this in the SVN version of "i4b + "chan_capi". Upgrading=20 "chan_capi" should do the trick. Maybe you want to try out that first. Do you have SVN installed?=20 The round trip delay for I4B + HFC-S PCI A, should be close to 5*160/8ms = =3D=20 100ms. It is possible to get the delay down, and the HFC-E1/HFC-4S/8S drive= r=20 has a round trip delay of 50ms. =46or IP-telephony the extra buffering is ideal to handle jitter and other= =20 problems. From my experience, if the buffer delay is less than 25ms, the=20 transmission will get prone to clicks due to buffer underruns, when the CPU= =20 load is high or when you loose IP-packets. For ISDN to ISDN bridging it is= =20 not so good, and I would recommend that you buy a HFC-4S/8S card, that will= =20 have a buffer delay of around 1ms, when line interconnect is used. =2D-HPS